diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2014-03-14 17:58:53 +0000 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2014-03-14 17:58:53 +0000 |
commit | 06e3e0c7b506a637df1ea27c6a8a439756e7139d (patch) | |
tree | 99accf2efb7e3868a6d3356e612052ef24267fb9 /lib/plugins/authmysql/auth.php | |
parent | 792883c4aaba64146ea38cd62287c96cb8121c1f (diff) | |
download | rpg-06e3e0c7b506a637df1ea27c6a8a439756e7139d.tar.gz rpg-06e3e0c7b506a637df1ea27c6a8a439756e7139d.tar.bz2 |
use $requireGroups constants in auth classes; comments; code improvements
Diffstat (limited to 'lib/plugins/authmysql/auth.php')
-rw-r--r-- | lib/plugins/authmysql/auth.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/plugins/authmysql/auth.php b/lib/plugins/authmysql/auth.php index 0ddbff99b..d3906759b 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=true) { + public function getUserData($user, $requireGroups=DokuWiki_Auth_Plugin::REQUIRE_GROUPS) { 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=true) { + protected function _cacheExists($user, $requireGroups=DokuWiki_Auth_Plugin::REQUIRE_GROUPS) { if (isset($this->cacheUserInfo[$user])) { if (!is_array($this->cacheUserInfo[$user])) { return true; // user doesn't exist } - if (!$requireGroups || isset($this->cacheUserInfo[$user]['grps'])) { + if ($requireGroups == DokuWiki_Auth_Plugin::IGNORE_GROUPS || 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=true, $useCache=true) { + protected function _getUserInfo($user, $requireGroups=DokuWiki_Auth_Plugin::REQUIRE_GROUPS, $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 && $info && !isset($info['grps'])) { + if (($requireGroups == DokuWiki_Auth_Plugin::REQUIRE_GROUPS) && $info && !isset($info['grps'])) { $info['grps'] = $this->_getGroups($user); } |