diff options
author | Gerry Weißbach <gerry.w@gammaproduction.de> | 2014-12-22 10:31:30 +0100 |
---|---|---|
committer | Gerry Weißbach <gerry.w@gammaproduction.de> | 2014-12-22 10:31:30 +0100 |
commit | 8da2ebf4f4261eb8f54df5704b5d9af283b5402d (patch) | |
tree | 9c63975e3898c949e1784e30e81a5ed3da7fca93 /lib/plugins/authpgsql/auth.php | |
parent | 5e7f4d50cbbc788c9c0483a0a2ff1b536e4ffe8c (diff) | |
parent | 1bf4abb07f65e28578bae98aad457cb768d8b44f (diff) | |
download | rpg-8da2ebf4f4261eb8f54df5704b5d9af283b5402d.tar.gz rpg-8da2ebf4f4261eb8f54df5704b5d9af283b5402d.tar.bz2 |
Merge remote-tracking branch 'splitbrain/master'
Diffstat (limited to 'lib/plugins/authpgsql/auth.php')
-rw-r--r-- | lib/plugins/authpgsql/auth.php | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/plugins/authpgsql/auth.php b/lib/plugins/authpgsql/auth.php index e51b39858..4cb280aae 100644 --- a/lib/plugins/authpgsql/auth.php +++ b/lib/plugins/authpgsql/auth.php @@ -104,7 +104,7 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { * * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net> * - * @param array $keys + * @param string[] $keys * @param bool $wop * @return bool */ @@ -159,9 +159,11 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { if($first) $sql .= " OFFSET $first"; $result = $this->_queryDB($sql); - foreach($result as $user) - if(($info = $this->_getUserInfo($user['user']))) + foreach($result as $user) { + if(($info = $this->_getUserInfo($user['user']))) { $out[$user['user']] = $info; + } + } $this->_unlockTables(); $this->_closeDB(); @@ -212,7 +214,10 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { $sql = str_replace('%{user}', addslashes($user), $sql); $sql = str_replace('%{gid}', addslashes($gid), $sql); $sql = str_replace('%{group}', addslashes($group), $sql); - if($this->_modifyDB($sql) !== false) return true; + if($this->_modifyDB($sql) !== false) { + $this->_flushUserInfoCache($user); + return true; + } if($newgroup) { // remove previously created group on error $sql = str_replace('%{gid}', addslashes($gid), $this->conf['delGroup']); @@ -262,11 +267,12 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { if($uid) { foreach($grps as $group) { - $gid = $this->_addUserToGroup($user, $group, 1); + $gid = $this->_addUserToGroup($user, $group, true); if($gid === false) break; } if($gid !== false){ + $this->_flushUserInfoCache($user); return true; } else { /* remove the new user and all group relations if a group can't @@ -336,7 +342,7 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net> * * @param string $query SQL string that contains the query - * @return array the result table + * @return array|false the result table */ protected function _queryDB($query) { $resultarray = array(); @@ -359,6 +365,9 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { * MySQL one because it does NOT return the last insertID * * @author Andreas Gohr <andi@splitbrain.org> + * + * @param string $query + * @return bool */ protected function _modifyDB($query) { if($this->dbcon) { @@ -392,6 +401,8 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql { * Commit a transaction * * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net> + * + * @return bool */ protected function _unlockTables() { if($this->dbcon) { |