summaryrefslogtreecommitdiff
path: root/lib/plugins/authpgsql
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-09-26 11:31:13 +0200
committerAndreas Gohr <andi@splitbrain.org>2014-09-26 11:31:13 +0200
commit7b950f2d59050052c1d9251b0bd9bd40c7441040 (patch)
tree98a14f7a197ed87059aab12b3c2a424000962a43 /lib/plugins/authpgsql
parent9d209ab87700c872fa85dcbee8623ad386190847 (diff)
parent2dc9e90007f12ac996b0e74479137a9dc6243c3c (diff)
downloadrpg-7b950f2d59050052c1d9251b0bd9bd40c7441040.tar.gz
rpg-7b950f2d59050052c1d9251b0bd9bd40c7441040.tar.bz2
Merge remote-tracking branch 'origin/auth_getUserData_improvements'
* origin/auth_getUserData_improvements: KISS - remove class constants for REQUIRE_GROUPS & IGNORE_GROUPS and replace with boolean values use $requireGroups constants in auth classes; comments; code improvements fix comment errors, sp. & grammar code styling - add missing braces Allow user info to be retrieved without groups Restore correct public interface of getUserData() for authldap plugin Conflicts: inc/common.php
Diffstat (limited to 'lib/plugins/authpgsql')
-rw-r--r--lib/plugins/authpgsql/auth.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/plugins/authpgsql/auth.php b/lib/plugins/authpgsql/auth.php
index e51b39858..99f3ed443 100644
--- a/lib/plugins/authpgsql/auth.php
+++ b/lib/plugins/authpgsql/auth.php
@@ -160,7 +160,7 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql {
$result = $this->_queryDB($sql);
foreach($result as $user)
- if(($info = $this->_getUserInfo($user['user'])))
+ if(($info = $this->_getCachedUserInfo($user['user'])))
$out[$user['user']] = $info;
$this->_unlockTables();
@@ -212,7 +212,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']);
@@ -267,6 +270,7 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql {
}
if($gid !== false){
+ $this->_flushUserInfoCache($user);
return true;
} else {
/* remove the new user and all group relations if a group can't