Thread:Extension talk:LDAP Authentication/User-name mapping hook does not work

Hi,

I have installed the extension successfully. As far everything works well. Now I would like to use the SetUsernameAttributeFromLDAP hook to change the username. But this hook seems not to work. The function is called but the user in the wiki is still created with his login name.

Does it require the AutoAuthentication to work or is there something wrong with my options?

$wgLDAPDomain            = '***'; $wgLDAPDomainNames       = array( $wgLDAPDomain ); $wgLDAPServerNames       = array( $wgLDAPDomain => '***' ); $wgLDAPSearchStrings     = array( $wgLDAPDomain => 'USER-NAME@***' ); $wgLDAPSearchAttributes  = array( $wgLDAPDomain => 'sAMAccountName' ); $wgLDAPBaseDNs           = array( $wgLDAPDomain => 'OU=Users,OU=***,DC=hks,DC=local' ); $wgLDAPPreferences       = array( $wgLDAPDomain => array( "email" => "mail", "realname" => "cn", "nickname" => "sAMAccountName" ) ); $wgLDAPEncryptionType    = array( $wgLDAPDomain => 'clear' ); $wgLDAPDisableAutoCreate = array( $wgLDAPDomain => false ); $wgLDAPUseSSL            = false; $wgLDAPUseLocal          = true; $wgLDAPDebug             = 4; $wgDebugLogGroups["ldap"] = '/var/log/mediawiki_ldap.log'; $wgMinimalPasswordLength = 1; $wgHooks['SetUsernameAttributeFromLDAP'][] = 'SetUsernameAttribute'; function SetUsernameAttribute(&$LDAPUsername, $info) { $LDAPUsername = $info[0]['displayname'][0]; return true; }

I am using a clean 1.16.0 installation and the current snapshot of this extension.