diff options
author | andi <andi@splitbrain.org> | 2005-01-29 17:51:40 +0100 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-01-29 17:51:40 +0100 |
commit | 306a7581aba6e75359485ea915efa8c248db3556 (patch) | |
tree | be536ad71c37673b1754d6490446ef5912eecbf8 | |
parent | a3a400668708bee16f14a779aa276a94be425350 (diff) | |
download | rpg-306a7581aba6e75359485ea915efa8c248db3556.tar.gz rpg-306a7581aba6e75359485ea915efa8c248db3556.tar.bz2 |
groupfilter for LDAP added
darcs-hash:20050129165140-9977f-f3138e26169b9da972af009727422b6a8f95c037.gz
-rw-r--r-- | inc/auth_ldap.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/inc/auth_ldap.php b/inc/auth_ldap.php index d8302e1fc..1376f883e 100644 --- a/inc/auth_ldap.php +++ b/inc/auth_ldap.php @@ -87,6 +87,7 @@ function auth_checkPass($user,$pass){ * * @author Andreas Gohr <andi@splitbrain.org> * @author Trouble + * @author Dan Allen <dan.j.allen@gmail.com> */ function auth_getUserData($user){ global $conf; @@ -116,13 +117,15 @@ function auth_getUserData($user){ $info['mail']= $result[0]['mail'][0]; $info['name']= $result[0]['cn'][0]; $info['uid'] = $result[0]['uid'][0]; - + //primary group id $gid = $result[0]['gidnumber'][0]; //get groups for given user if grouptree is given if ($cnf['grouptree'] != '') { - $filter = "(&(objectClass=posixGroup)(|(gidNumber=$gid)(memberUID=".$info['uid'].")))"; + $filter = str_replace('%i', $info['uid'], $cnf['groupfilter']); + $filter = str_replace('%u', $info['name'], $filter); + $filter = str_replace('%g', $gid, $filter); $sr = @ldap_search($conn, $cnf['grouptree'], $filter); if(!$sr){ msg("LDAP: Reading group memberships failed",-1); |