antville/code/Site/edit.hac

24 lines
No EOL
649 B
Text

checkIfLoggedIn(this.href(req.action));
var deny = this.isEditDenied(session.user,req.data.memberlevel);
if (deny) {
res.message = getMessage("error",deny);
res.redirect(this.href());
}
if (req.data.submit == "cancel" || req.data.cancel)
res.redirect(this.href());
else if (req.data.submit == "save" || req.data.save) {
var result = this.evalPreferences(req.data,session.user);
res.message = result.message;
if (!result.error)
res.redirect(this.href());
}
res.data.action = this.href(req.action);
res.data.title = "Preferences of " + this.title;
res.data.body = this.renderSkinAsString("edit");
this.renderSkin("page");