[Mediawiki-l] UserLogin hook

Ingmar Heinrich ingmar.heinrich at gmail.com
Fri Oct 13 08:37:11 UTC 2006

Hi there!

In the documentation I found an example for user login via LDAP:

$wgHooks['UserLogin'][] = array('ldapLogin', $ldapServer);

$ldap['port'] = 636;
$ldap['base'] = ",ou=Staff,dc=company,dc=com";

function ldapLogin($username, $password) {
 global $ldap;
      if($bind=@ldap_bind($connect, $auth_user, $password)){
      }//if bound to ldap
      else {
         echo "Error on ldap_bind";
  }//if connected to ldap
  else {
     echo "Error on ldap_connect";

First of all, the example doesn't make sense to me because it calls
the function ldapLogin with one parameter, which is the LDAP server
name, but the function itself demands two parameters - login and
password. Secondly, I don't find the Hook UserLogin in the list of
available hooks.

What is this?


More information about the MediaWiki-l mailing list