Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php |
— | — | @@ -718,11 +718,11 @@ |
719 | 719 | |
720 | 720 | $this->userdn = $this->getSearchString( $username ); |
721 | 721 | if ( '' == $this->userdn ) { |
722 | | - $this->printDebug( "$this->userdn is blank, attempting to use wgLDAPWriteLocation", NONSENSITIVE ); |
| 722 | + $this->printDebug( "userdn is blank, attempting to use wgLDAPWriteLocation", NONSENSITIVE ); |
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 | | - $username . "," . $wgLDAPWriteLocation[$_SESSION['wsDomain']]; |
| 726 | + strtolower( $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 |
— | — | @@ -747,8 +747,11 @@ |
748 | 748 | if ( '' != $this->realname ) { $values["cn"] = $this->realname; } |
749 | 749 | else { $values["cn"] = $username; } |
750 | 750 | $values["userpassword"] = $pass; |
751 | | - $values["objectclass"] = "inetorgperson"; |
| 751 | + $values["objectclass"] = array( "inetorgperson" ); |
752 | 752 | |
| 753 | + # Let other extensions modify the user object before creation |
| 754 | + wfRunHooks( 'LDAPSetCreationValues', array( $this, &$values ) ); |
| 755 | + |
753 | 756 | if ( isset ( $wgLDAPAuthAttribute[$_SESSION['wsDomain']] ) ) { |
754 | 757 | $values[$wgLDAPAuthAttribute[$_SESSION['wsDomain']]] = "true"; |
755 | 758 | } |
— | — | @@ -1752,7 +1755,7 @@ |
1753 | 1756 | * @return string |
1754 | 1757 | * @access private |
1755 | 1758 | */ |
1756 | | - function getLdapEscapedString ( $string ) { |
| 1759 | + function getLdapEscapedString( $string ) { |
1757 | 1760 | // Make the string LDAP compliant by escaping *, (, ) , \ & NUL |
1758 | 1761 | return str_replace( |
1759 | 1762 | array( "*", "(", ")", "\\", "\x00" ), // replace this |
— | — | @@ -1768,7 +1771,7 @@ |
1769 | 1772 | * @return string |
1770 | 1773 | * @access private |
1771 | 1774 | */ |
1772 | | - function getBaseDN ( $type ) { |
| 1775 | + function getBaseDN( $type ) { |
1773 | 1776 | global $wgLDAPBaseDNs, $wgLDAPGroupBaseDNs, $wgLDAPUserBaseDNs; |
1774 | 1777 | |
1775 | 1778 | $this->printDebug( "Entering getBaseDN", NONSENSITIVE ); |