(optional) limit creation of weblogs to sysAdmins or trusted users.

needs property "limitNewWeblogs" in app.properties (thanks to kris!)
This commit is contained in:
Robert Gaggl 2002-04-12 11:34:46 +00:00
parent d07dba571d
commit 82f06be359

View file

@ -1,5 +1,14 @@
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) {
@ -9,7 +18,6 @@ else if (req.data.submit == "create" || req.data.create) {
res.redirect(result.weblog.href());
}
res.skin = "root.page";
res.data.title = "Antville";