Thread:Extension talk:LDAP Authentication/$wgLDAPUseLocal and the template's 'useemail' property

Using LDAPAuthentication on our wiki but also allowing local users and logins (thus having set $wgLDAPUseLocal to true), we noticed that the email field was missing on the UserCreateForm. The email address being required to create a user, the form wouldn't submit successfully, thus preventing new users from signing up.

It took me a while to find that the modifyUITemplate method was changing the template's properties. I thus suggest the following patch to LdapAuthentication.php in order to allow new uses to sign up locally:

454  if ( $wgLDAPUseLocal ) { 455     // don't touch the useemail setting 456  } else { 457     $template->set( 'useemail', isset( $wgLDAPMailPassword[$_SESSION['wsDomain']] ) && $wgLDAPMailPassword[$_SESSION['wsDomain']] ); 458  }

However, experimenting with this and another dirty workaround, such as setting $wgLDAPMailPassword in LocalSettings.php, I noticed that the value of $_SESSION['wsDomain'] in our case is 'invaliddomain'. (Thus requiring $wgLDAPMailPassword = array( 'invaliddomain' => true ); to achieve the same result as above.)

I did have "get_class($template) == 'UsercreateTemplate'" in the if statement above in the beginning until I realized that there's no email field at all at the login screen. Which brings me to the conclusion that this testing of $wgLDAPMailPassword[$_SESSION['wsDomain']] in modifyUITemplate makes no sense at all, or does it?