Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php |
— | — | @@ -708,7 +708,7 @@ |
709 | 709 | |
710 | 710 | $this->email = $user->getEmail(); |
711 | 711 | $this->realname = $user->getRealName(); |
712 | | - $username = $user->getName(); |
| 712 | + $username = strtolower( $user->getName() ); |
713 | 713 | |
714 | 714 | $pass = $this->getPasswordHash( $password ); |
715 | 715 | |
— | — | @@ -722,7 +722,7 @@ |
723 | 723 | if ( isset( $wgLDAPWriteLocation[$_SESSION['wsDomain']] ) ) { |
724 | 724 | $this->printDebug( "wgLDAPWriteLocation is set, using that", NONSENSITIVE ); |
725 | 725 | $this->userdn = $wgLDAPSearchAttributes[$_SESSION['wsDomain']] . "=" . |
726 | | - strtolower( $username ) . "," . $wgLDAPWriteLocation[$_SESSION['wsDomain']]; |
| 726 | + $username . "," . $wgLDAPWriteLocation[$_SESSION['wsDomain']]; |
727 | 727 | } else { |
728 | 728 | $this->printDebug( "wgLDAPWriteLocation is not set, failing", NONSENSITIVE ); |
729 | 729 | // getSearchString will bind, but will not unbind |
— | — | @@ -750,7 +750,12 @@ |
751 | 751 | $values["objectclass"] = array( "inetorgperson" ); |
752 | 752 | |
753 | 753 | # Let other extensions modify the user object before creation |
754 | | - wfRunHooks( 'LDAPSetCreationValues', array( $this, &$values ) ); |
| 754 | + wfRunHooks( 'LDAPSetCreationValues', array( $this, &$values, &$result ) ); |
| 755 | + if ( ! $result ) { |
| 756 | + $this->printDebug( "Failed to add user because LDAPSetCreationValues returned false", NONSENSITIVE ); |
| 757 | + @ldap_unbind(); |
| 758 | + return false; |
| 759 | + } |
755 | 760 | |
756 | 761 | if ( isset ( $wgLDAPAuthAttribute[$_SESSION['wsDomain']] ) ) { |
757 | 762 | $values[$wgLDAPAuthAttribute[$_SESSION['wsDomain']]] = "true"; |