32 lines
No EOL
868 B
Text
32 lines
No EOL
868 B
Text
if (!session.user && (req.data.submit == "save" || req.data.save))
|
|
rescueText(req.data);
|
|
|
|
checkIfLoggedIn(this.href(req.action));
|
|
|
|
if (session.data.rescuedText)
|
|
restoreRescuedText();
|
|
|
|
var deny = this.isEditDenied(session.user,req.data.memberlevel);
|
|
if (deny) {
|
|
res.message = getMessage("error",deny);
|
|
res.redirect(this.story.href());
|
|
}
|
|
|
|
res.data.action = this.href(req.action);
|
|
|
|
res.data.title = this.site.title;
|
|
if (this.story.title)
|
|
res.data.title += " - " + encode(this.story.title);
|
|
|
|
if (req.data.submit == "cancel" || req.data.cancel)
|
|
res.redirect(this.story.href());
|
|
else if (req.data.submit == "save" || req.data.save) {
|
|
var result = this.updateComment(req.data);
|
|
res.message = result.message;
|
|
if (!result.error)
|
|
res.redirect(path.story.href());
|
|
}
|
|
|
|
res.data.body = this.renderSkinAsString("edit");
|
|
|
|
path.site.renderSkin("page"); |