From 82fd59b6cf8cda9b2c419fb08bbc40a571b36fe8 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 3 Feb 2006 16:03:02 +0100 Subject: 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 --- inc/auth.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'inc/auth.php') 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); -- cgit v1.2.3