diff options
author | Andreas Gohr <andi@splitbrain.org> | 2006-02-03 16:03:02 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2006-02-03 16:03:02 +0100 |
commit | 82fd59b6cf8cda9b2c419fb08bbc40a571b36fe8 (patch) | |
tree | cddf8d28de73822bb0932f005f4056d925cc7025 /inc/auth.php | |
parent | ce070a9f83cfdd14001e835635ff4e1a3f43f41c (diff) | |
download | rpg-82fd59b6cf8cda9b2c419fb08bbc40a571b36fe8.tar.gz rpg-82fd59b6cf8cda9b2c419fb08bbc40a571b36fe8.tar.bz2 |
new way of auth module capability checking
This changes the way of how the capabilities of the used auth module are
checked as suggested as first option in
http://www.freelists.org/archives/dokuwiki/01-2006/msg00267.html
The MySQL backend WAS NOT TESTED and probably needs some work.
darcs-hash:20060203150302-7ad00-c524cafe20499f32e76ad42b4e68d7c635f6a9e9.gz
Diffstat (limited to 'inc/auth.php')
-rw-r--r-- | inc/auth.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/inc/auth.php b/inc/auth.php index 7ae0da1a4..69ff930be 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -51,7 +51,7 @@ // do the login either by cookie or provided credentials if($conf['useacl']){ // external trust mechanism in place? - if(!is_null($auth) && $auth->canDo('trustExternal')){ + if(!is_null($auth) && $auth->canDo('external')){ $auth->trustExternal($_REQUEST['u'],$_REQUEST['p'],$_REQUEST['r']); }else{ auth_login($_REQUEST['u'],$_REQUEST['p'],$_REQUEST['r']); @@ -413,7 +413,7 @@ function register(){ global $auth; if(!$_POST['save']) return false; - if(!$auth->canDo('createUser')) return false; + if(!$auth->canDo('addUser')) return false; //clean username $_POST['login'] = preg_replace('/.*:/','',$_POST['login']); @@ -483,8 +483,8 @@ function updateprofile() { if(!$_POST['save']) return false; - // should not be able to get here without modifyUser being possible... - if(!$auth->canDo('modifyUser')) { + // should not be able to get here without Profile being possible... + if(!$auth->canDo('Profile')) { msg($lang['profna'],-1); return false; } @@ -543,11 +543,11 @@ function act_resendpwd(){ if(!$_POST['save']) return false; if(!$conf['resendpasswd']) return false; - // should not be able to get here without modifyUser being possible... - if(!$auth->canDo('modifyUser')) { + // should not be able to get here without modPass being possible... + if(!$auth->canDo('modPass')) { msg($lang['resendna'],-1); return false; - } + } if (empty($_POST['login'])) { msg($lang['resendpwdmissing'], -1); |