diff options
-rw-r--r-- | inc/auth.php | 6 | ||||
-rw-r--r-- | inc/common.php | 2 | ||||
-rw-r--r-- | lib/plugins/auth.php | 5 | ||||
-rw-r--r-- | lib/plugins/authmysql/auth.php | 10 |
4 files changed, 10 insertions, 13 deletions
diff --git a/inc/auth.php b/inc/auth.php index cbdd7163b..5e0d13417 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -922,7 +922,7 @@ function auth_sendPassword($user, $password) { if(!$auth) return false; $user = $auth->cleanUser($user); - $userinfo = $auth->getUserData($user, DokuWiki_Auth_Plugin::IGNORE_GROUPS); + $userinfo = $auth->getUserData($user, $requireGroups = false); if(!$userinfo['mail']) return false; @@ -1184,7 +1184,7 @@ function act_resendpwd() { } $user = io_readfile($tfile); - $userinfo = $auth->getUserData($user, DokuWiki_Auth_Plugin::IGNORE_GROUPS); + $userinfo = $auth->getUserData($user, $requireGroups = false); if(!$userinfo['mail']) { msg($lang['resendpwdnouser'], -1); return false; @@ -1236,7 +1236,7 @@ function act_resendpwd() { $user = trim($auth->cleanUser($INPUT->post->str('login'))); } - $userinfo = $auth->getUserData($user, DokuWiki_Auth_Plugin::IGNORE_GROUPS); + $userinfo = $auth->getUserData($user, $requireGroups = false); if(!$userinfo['mail']) { msg($lang['resendpwdnouser'], -1); return false; diff --git a/inc/common.php b/inc/common.php index 9ed9e84d4..9b3c59e6e 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1468,7 +1468,7 @@ function editorinfo($username) { case 'username': case 'email': case 'email_link': - if($auth) $info = $auth->getUserData($username, DokuWiki_Auth_Plugin::IGNORE_GROUPS); + if($auth) $info = $auth->getUserData($username, $requireGroups = false); break; default: return hsc($username); diff --git a/lib/plugins/auth.php b/lib/plugins/auth.php index 9275611be..b38b591a3 100644 --- a/lib/plugins/auth.php +++ b/lib/plugins/auth.php @@ -15,9 +15,6 @@ if(!defined('DOKU_INC')) die(); class DokuWiki_Auth_Plugin extends DokuWiki_Plugin { public $success = true; - const IGNORE_GROUPS = false; - const REQUIRE_GROUPS = true; - /** * Possible things an auth backend module may be able to * do. The things a backend can do need to be set to true @@ -240,7 +237,7 @@ class DokuWiki_Auth_Plugin extends DokuWiki_Plugin { * @param bool $requireGroups whether or not the returned data must include groups * @return array containing user data or false */ - public function getUserData($user, $requireGroups=self::REQUIRE_GROUPS) { + public function getUserData($user, $requireGroups=true) { if(!$this->cando['external']) msg("no valid authorisation system in use", -1); return false; } diff --git a/lib/plugins/authmysql/auth.php b/lib/plugins/authmysql/auth.php index d3906759b..95c62f636 100644 --- a/lib/plugins/authmysql/auth.php +++ b/lib/plugins/authmysql/auth.php @@ -182,7 +182,7 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin { * when false, it maybe included, but is not required by the caller * @return array|bool */ - public function getUserData($user, $requireGroups=DokuWiki_Auth_Plugin::REQUIRE_GROUPS) { + public function getUserData($user, $requireGroups=true) { if($this->_cacheExists($user, $requireGroups)) { return $this->cacheUserInfo[$user]; } @@ -690,13 +690,13 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin { * * @return bool existence of required user information in the cache */ - protected function _cacheExists($user, $requireGroups=DokuWiki_Auth_Plugin::REQUIRE_GROUPS) { + protected function _cacheExists($user, $requireGroups=true) { if (isset($this->cacheUserInfo[$user])) { if (!is_array($this->cacheUserInfo[$user])) { return true; // user doesn't exist } - if ($requireGroups == DokuWiki_Auth_Plugin::IGNORE_GROUPS || isset($this->cacheUserInfo[$user]['grps'])) { + if (!$requireGroups || isset($this->cacheUserInfo[$user]['grps'])) { return true; } } @@ -718,7 +718,7 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin { * @return mixed false|array false if the user doesn't exist * array containing user information if user does exist */ - protected function _getUserInfo($user, $requireGroups=DokuWiki_Auth_Plugin::REQUIRE_GROUPS, $useCache=true) { + protected function _getUserInfo($user, $requireGroups=true, $useCache=true) { $info = null; if ($useCache && isset($this->cacheUserInfo[$user])) { @@ -729,7 +729,7 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin { $info = $this->_retrieveUserInfo($user); } - if (($requireGroups == DokuWiki_Auth_Plugin::REQUIRE_GROUPS) && $info && !isset($info['grps'])) { + if (($requireGroups == true) && $info && !isset($info['grps'])) { $info['grps'] = $this->_getGroups($user); } |