antville/code/Root/new.hac

19 lines
522 B
Text

autoLogin();
checkIfLoggedIn(this.href(req.action));
if (req.data.submit == "cancel" || req.data.cancel)
res.redirect(root.href());
else if (req.data.submit == "create" || req.data.create) {
var result = this.evalWeblog(req.data.title,req.data.alias,user);
res.message = result.message;
if (!result.error)
res.redirect(result.weblog.href());
}
res.skin = "root.page";
res.data.title = "Antville - Create a new weblog";
var newLog = new weblog();
res.data.body = newLog.renderSkinAsString("new");