(optional) limit creation of weblogs to sysAdmins or trusted users.
needs property "limitNewWeblogs" in app.properties (thanks to kris!)
This commit is contained in:
parent
d07dba571d
commit
82f06be359
1 changed files with 9 additions and 1 deletions
|
@ -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";
|
||||
|
|
Loading…
Add table
Reference in a new issue