2012-10-24, 02:07:26
Has anyone used this to block their entire website ?
I am thinking I will have a hook check for logged in session and redirect to login and then somehow get login to redirect back to the referrer.
Without using page checkboxes at all.
Has anyone figured either of those out.
EDIT:
This is what I am using so far, it seems to be working ok.
probably needs some work, like preserving query strings etc.
Was done using my hook component plugin
I am thinking I will have a hook check for logged in session and redirect to login and then somehow get login to redirect back to the referrer.
Without using page checkboxes at all.
Has anyone figured either of those out.
EDIT:
This is what I am using so far, it seems to be working ok.
probably needs some work, like preserving query strings etc.
Was done using my hook component plugin
Code:
// called from index-pretemplate hook
GLOBAL $id;
$login_slug = 'login';
user_login_check();
// not logged in redirect to login form save redirect
if(empty($_SESSION['LoggedIn']) and $id!=$login_slug) {
redirect($SITEURL.$login_slug.'?redirect='.$id);
}
else if(!empty($_SESSION['LoggedIn'])){
if(isset($_GET['redirect'])){
redirect($SITEURL.$_GET['redirect']);
}
}