https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113879

Revision: 113879
Author:   laner
Date:     2012-03-15 00:04:49 +0000 (Thu, 15 Mar 2012)
Log Message:
-----------
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: trunk/extensions/LdapAuthentication/LdapAuthentication.php
===================================================================
--- trunk/extensions/LdapAuthentication/LdapAuthentication.php  2012-03-14 
23:47:55 UTC (rev 113878)
+++ trunk/extensions/LdapAuthentication/LdapAuthentication.php  2012-03-15 
00:04:49 UTC (rev 113879)
@@ -674,7 +674,11 @@
                        $aa = $this->getConf( 'AuthAttribute' ); 
                        if ( $aa ) {
                                $this->printDebug( "Checking for auth 
attributes: $aa", NONSENSITIVE );
-                               if ( !isset( $this->userInfo ) || !isset( 
$this->userInfo[0][$aa] ) ) {
+                               $filter = "(" . $aa . ")";
+                               $attributes = array( "dn" );
+                               $entry = LdapAuthenticationPlugin::ldap_read( 
$this->ldapconn, $this->userdn, $filter, $attributes );
+                               $info = 
LdapAuthenticationPlugin::ldap_get_entries( $this->ldapconn, $entry );
+                               if ( $info["count"] < 1 ) {
                                        $this->printDebug( "Failed auth 
attribute check", NONSENSITIVE );
                                        LdapAuthenticationPlugin::ldap_unbind( 
$this->ldapconn );
                                        $this->markAuthFailed();
@@ -995,11 +999,6 @@
                                return false;
                        }
 
-                       $aa = $this->getConf( 'AuthAttribute' );
-                       if ( $aa ) {
-                               $values[$aa] = "true";
-                       }
-
                        $this->printDebug( "Adding user", NONSENSITIVE );
                        if ( LdapAuthenticationPlugin::ldap_add( 
$this->ldapconn, $this->userdn, $values ) ) {
                                $this->printDebug( "Successfully added user", 
NONSENSITIVE );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to