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

I have the extension working with auto-authentication, but I'm having trouble with the SetUsernameAttributeFromLDAP hook. When a new user visits, they get an account created (and logged on) using their sAMAccountName instead of the specified attribute. Here are the details:

Active Directory, IIS6, MediaWiki 1.16.5, Extension 1.2e

require_once ('extensions/LdapAuthentication/LdapAutoAuthentication.php'); require_once ('extensions/LdapAuthentication/LdapAuthentication.php'); $wgAuth = new LdapAuthenticationPlugin; $wgLDAPDebug = 1; $wgDebugLogGroups["ldap"] = "debug.log" ; $wgLDAPDomainNames             = array('example.com'); $wgLDAPAutoAuthDomain          = 'example.com'; $wgLDAPServerNames             = array('example.com' => 'globalcatalog.example.com'); $wgLDAPEncryptionType          = array('example.com' => 'clear'); $wgLDAPProxyAgent              = array('example.com' => 'CN=proxyagent,OU=Users,DC=example,DC=com'); $wgLDAPProxyAgentPassword      = array('example.com' => 'password'); $wgLDAPSearchAttributes        = array('example.com' => 'sAMAccountName'); $wgLDAPBaseDNs                 = array('example.com' => 'DC=example,DC=com'); $wgLDAPUserBaseDNs             = array('example.com' => 'OU=Users,DC=example,DC=com'); if (isset($_SERVER["REMOTE_USER"])) $wgLDAPAutoAuthUsername = preg_replace( '#^.*\\\#',, $_SERVER["REMOTE_USER"]); $wgHooks['SetUsernameAttributeFromLDAP'][] = 'SetUsernameAttribute'; function SetUsernameAttribute(&$LDAPUsername, $info) { $LDAPUsername = $info[0]['displayName'][0]; return true; } AutoAuthSetup; My debug log looks clean except for this: 1.2e Fetched username is not a string (check your hook code...). This message can be safely ignored if you do not have the SetUsernameAttributeFromLDAP hook defined. The "displayname" attribute is of "DirectoryString" type (same as sAMAccountName). I even changed it to sAMAccountName to test and got the same error.
 * 1) LDAP Authentication Extension

Any advice? Did I miss something?