moved security-checks into this file

This commit is contained in:
Robert Gaggl 2001-06-28 16:51:22 +00:00
parent ed0c1c3703
commit c5ffe969e5

View file

@ -0,0 +1,18 @@
/**
* check if user is allowed to create a new weblog
*/
function isAddAllowed() {
if (!user.uid) {
res.message = "Please login first!";
user.cache.referer = root.href("new");
res.redirect(root.members.href("login"));
} else if (user.isBlocked()) {
res.message = "Sorry, your account was disabled!";
return false;
} else if (user.getWeblog()) {
res.message = "You already own a Weblog! You'll need a new account to create another one.";
res.redirect(root.members.href("register"));
}
return true;
}