From 030e9fa3051389704a8a6a7f37ed3618634d0a64 Mon Sep 17 00:00:00 2001 From: Karsten Heiken Date: Sun, 4 Dec 2011 17:16:57 +0100 Subject: [PATCH] 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. --- application/hooks/global.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/hooks/global.php b/application/hooks/global.php index ba5dce4..69df3fc 100644 --- a/application/hooks/global.php +++ b/application/hooks/global.php @@ -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'); } }