diff options
author | Adrian Lang <lang@cosmocode.de> | 2009-11-24 16:24:19 +0100 |
---|---|---|
committer | Adrian Lang <lang@cosmocode.de> | 2009-11-24 16:24:19 +0100 |
commit | beca106a3366b1fefe827205475e6ff754fb20c5 (patch) | |
tree | e60499e712822cee7787c1a6561dd8cdcf4ec600 | |
parent | b1f92db2fcd7fd8636de6d7801609a9a0e4e58dc (diff) | |
download | rpg-beca106a3366b1fefe827205475e6ff754fb20c5.tar.gz rpg-beca106a3366b1fefe827205475e6ff754fb20c5.tar.bz2 |
Check whether $auth is set
darcs-hash:20091124152419-e4919-b4d55158c15d637a453b082eae6a80a828818934.gz
-rw-r--r-- | inc/auth.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/inc/auth.php b/inc/auth.php index 6483caff4..d52adb1ef 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -150,6 +150,8 @@ function auth_login($user,$pass,$sticky=false,$silent=false){ global $auth; $sticky ? $sticky = true : $sticky = false; //sanity check + if (!$auth) return false; + if(!empty($user)){ //usual login if ($auth->checkPass($user,$pass)){ @@ -337,7 +339,7 @@ function auth_ismanager($user=null,$groups=null,$adminonly=false){ global $USERINFO; global $auth; - if(!$conf['useacl']) return false; + if (!$auth) return false; if(is_null($user)) { if (!isset($_SERVER['REMOTE_USER'])) { return false; @@ -453,6 +455,7 @@ function auth_aclcheck($id,$user,$groups){ // if no ACL is used always return upload rights if(!$conf['useacl']) return AUTH_UPLOAD; + if (!$auth) return AUTH_NONE; //make sure groups is an array if(!is_array($groups)) $groups = array(); @@ -613,6 +616,7 @@ function auth_sendPassword($user,$password){ global $conf; global $lang; global $auth; + if (!$auth) return false; $hdrs = ''; $user = $auth->cleanUser($user); @@ -647,6 +651,7 @@ function register(){ global $conf; global $auth; + if (!$auth) return false; if(!$_POST['save']) return false; if(!$auth->canDo('addUser')) return false; @@ -724,6 +729,7 @@ function updateprofile() { global $lang; global $auth; + if (!$auth) return false; if(empty($_POST['save'])) return false; if(!checkSecurityToken()) return false; @@ -799,6 +805,7 @@ function act_resendpwd(){ global $auth; if(!actionOK('resendpwd')) return false; + if (!$auth) return false; // should not be able to get here without modPass being possible... if(!$auth->canDo('modPass')) { @@ -1044,6 +1051,7 @@ function auth_setCookie($user,$pass,$sticky) { global $auth; global $USERINFO; + if (!$auth) return false; $USERINFO = $auth->getUserData($user); // set cookie |