Change order of check in global hook
First, check if the requested controller is public. If it is, we do not care if the user is logged in, so don't even make the "logged in"-checks at this moment.
This commit is contained in:
@@ -34,7 +34,7 @@ function check_login() {
|
||||
$public_controllers = array('auth', 'xmlrpc');
|
||||
|
||||
$CI = & get_instance();
|
||||
if (!$CI->input->is_ajax_request() && !$CI->access->isLoggedIn() && !in_array($CI->router->class, $public_controllers)) {
|
||||
if (!in_array($CI->router->class, $public_controllers) && !$CI->input->is_ajax_request() && !$CI->access->isLoggedIn()) {
|
||||
redirect('auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user