r113879 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113878‎ | r113879 | r113880 >
Date:00:04, 15 March 2012
Author:laner
Status:deferred
Tags:
Comment:
Reverting AuthAttribute back to former implementation. I really need to read my own documentation before I make stupid changes like this.
Modified paths:
  • /trunk/extensions/LdapAuthentication/LdapAuthentication.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php
@@ -674,7 +674,11 @@
675675 $aa = $this->getConf( 'AuthAttribute' );
676676 if ( $aa ) {
677677 $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 ) {
679683 $this->printDebug( "Failed auth attribute check", NONSENSITIVE );
680684 LdapAuthenticationPlugin::ldap_unbind( $this->ldapconn );
681685 $this->markAuthFailed();
@@ -995,11 +999,6 @@
9961000 return false;
9971001 }
9981002
999 - $aa = $this->getConf( 'AuthAttribute' );
1000 - if ( $aa ) {
1001 - $values[$aa] = "true";
1002 - }
1003 -
10041003 $this->printDebug( "Adding user", NONSENSITIVE );
10051004 if ( LdapAuthenticationPlugin::ldap_add( $this->ldapconn, $this->userdn, $values ) ) {
10061005 $this->printDebug( "Successfully added user", NONSENSITIVE );

Status & tagging log