26 lines
886 B
Text
26 lines
886 B
Text
checkIfLoggedIn(this.href(req.action));
|
|
|
|
var limit = getProperty("limitNewWeblogs").toLowerCase();
|
|
if (limit == "sysadmin" && !user.isSysAdmin ()) {
|
|
res.message = "Sorry! Only administrators are allowed to create new Weblogs."
|
|
res.redirect(root.href());
|
|
} else if (limit == "trusted" && !(user.isSysAdmin () || user.isTrusted ())) {
|
|
res.message = "Sorry! You are not allowed to create new Weblogs."
|
|
res.redirect(root.href());
|
|
}
|
|
|
|
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";
|
|
|
|
var newLog = new weblog();
|
|
res.data.body = newLog.renderSkinAsString("new");
|