Fixed generic permission model to redirect to login page if anonymous user was not granted access

This commit is contained in:
Tobi Schäfer 2008-05-08 17:05:51 +00:00
parent b3a85c5998
commit 3e32e976db
3 changed files with 10 additions and 5 deletions

View file

@ -83,6 +83,10 @@ HopObject.prototype.onRequest = function() {
}
if (!this.getPermission(req.action)) {
if (!session.user) {
res.message = gettext("Please login first.");
res.redirect(res.handlers.site.members.href("login"));
}
res.status = 401;
res.write(gettext("Sorry, you are not allowed to access this part of the site."));
res.stop();