antville/code/HopObject/securityFunctions.js

19 lines
563 B
JavaScript

/**
* function checks if there's a weblog in path
* if true it checks if the weblog or the user is blocked
*/
function onRequest() {
autoLogin();
// defining skinpath
if (path.weblog)
res.skinpath = new Array(path.weblog.skins);
if (path.weblog && path.weblog.isBlocked())
res.redirect(root.href("blocked"));
if (isUserBlocked()) {
// user was blocked recently, so log out
session.logout();
res.message = getMsg("error","accountBlocked");
res.redirect(path.weblog ? path.weblog.href() : root.href());
}
}