gcc484ntopperl-5.22
Last change
on this file since 0105685 was
c5c522c,
checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago
|
initial commit, transferred from cleaned syn3 svn tree
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[c5c522c] | 1 | --- LDAPAuthenticateUser.php 2007-08-30 04:20:00.000000000 +0200 |
---|
| 2 | +++ a 2007-09-20 14:52:36.000000000 +0200 |
---|
| 3 | @@ -96,8 +96,22 @@ |
---|
| 4 | // Authentication succeeded, get info from LDAP directory
|
---|
| 5 | $attrs = array_keys($GLOBALS['ldapConfig']['users']['fields']);
|
---|
| 6 | $base_dn = $GLOBALS['ldap_config']->settings['ldap_base_dn'];
|
---|
| 7 | - $name_filter = "(" . $GLOBALS['ldap_config']->settings['ldap_login_attr']. "=" . $name . ")";
|
---|
| 8 | +
|
---|
| 9 | + //check group membership |
---|
| 10 | + $result = @ldap_search($ldapconn, "cn=SugarCRM,ou=Groups,$base_dn", "(memberUid=$name)", $attrs);
|
---|
| 11 | + $info=@ldap_get_entries($ldapconn, $result); |
---|
| 12 | + if (strtolower($name)=="administrator" || $info[0])
|
---|
| 13 | + { |
---|
| 14 | + $GLOBALS['log']->debug("ldapauth: Group membership OK");
|
---|
| 15 | + } |
---|
| 16 | + else |
---|
| 17 | + { |
---|
| 18 | + $GLOBALS['log']->debug("ldapauth: FAILED, $name not member of SugarCRM group!");
|
---|
| 19 | + return ''; |
---|
| 20 | + } |
---|
| 21 | + |
---|
| 22 |
|
---|
| 23 | + $name_filter = "(" . $GLOBALS['ldap_config']->settings['ldap_login_attr']. "=" . $name . ")";
|
---|
| 24 | $GLOBALS['log']->debug("ldapauth: Fetching user info from Directory.");
|
---|
| 25 | $result = @ldap_search($ldapconn, $base_dn, $name_filter, $attrs);
|
---|
| 26 | if($this->loginError($error)){
|
---|
Note: See
TracBrowser
for help on using the repository browser.