Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php |
— | — | @@ -674,7 +674,11 @@ |
675 | 675 | $aa = $this->getConf( 'AuthAttribute' ); |
676 | 676 | if ( $aa ) { |
677 | 677 | $this->printDebug( "Checking for auth attributes: $aa", NONSENSITIVE ); |
678 | | - if ( !isset( $this->userInfo ) || !isset( $this->userInfo[0][$aa] ) ) { |
| 678 | + $filter = "(" . $aa . ")"; |
| 679 | + $attributes = array( "dn" ); |
| 680 | + $entry = LdapAuthenticationPlugin::ldap_read( $this->ldapconn, $this->userdn, $filter, $attributes ); |
| 681 | + $info = LdapAuthenticationPlugin::ldap_get_entries( $this->ldapconn, $entry ); |
| 682 | + if ( $info["count"] < 1 ) { |
679 | 683 | $this->printDebug( "Failed auth attribute check", NONSENSITIVE ); |
680 | 684 | LdapAuthenticationPlugin::ldap_unbind( $this->ldapconn ); |
681 | 685 | $this->markAuthFailed(); |
— | — | @@ -995,11 +999,6 @@ |
996 | 1000 | return false; |
997 | 1001 | } |
998 | 1002 | |
999 | | - $aa = $this->getConf( 'AuthAttribute' ); |
1000 | | - if ( $aa ) { |
1001 | | - $values[$aa] = "true"; |
1002 | | - } |
1003 | | - |
1004 | 1003 | $this->printDebug( "Adding user", NONSENSITIVE ); |
1005 | 1004 | if ( LdapAuthenticationPlugin::ldap_add( $this->ldapconn, $this->userdn, $values ) ) { |
1006 | 1005 | $this->printDebug( "Successfully added user", NONSENSITIVE ); |