Recherche sur l'adresse mail si l'uid ne donne aucun résultat

tags/0.2.18
Daniel Berteaud 12 years ago
parent 02a2f7de90
commit b3a2de359d
  1. 7
      root/usr/share/mozilla-mcd/firefox.php
  2. 7
      root/usr/share/mozilla-mcd/thunderbird.php

@ -17,9 +17,14 @@ if(isset($_SERVER['QUERY_STRING']) && preg_match('/^.+@' . DOMAIN . '$/', $_SERV
$result = ldap_search($link, USER_BASE, "uid=" . $uid);
$user = ldap_get_entries($link, $result);
if($user['count'] == 0) {
// user not found
// Search for the mail address
$result = ldap_search($link, USER_BASE, "mail=" . $_SERVER['QUERY_STRING']);
$user = ldap_get_entries($link, $result);
if($user['count'] != 1) {
// user not found or multiple result found
exit;
}
}
$pref = FF_PREF;
// Don't lock pref if the user is member of some special groups
// regardless of the setting

@ -16,9 +16,14 @@ if(isset($_SERVER['QUERY_STRING']) && preg_match('/^.+@' . DOMAIN . '$/', $_SERV
$result = ldap_search($link, USER_BASE, "uid=" . $uid);
$user = ldap_get_entries($link, $result);
if($user['count'] == 0) {
// user not found
// Search for the mail address
$result = ldap_search($link, USER_BASE, "mail=" . $_SERVER['QUERY_STRING']);
$user = ldap_get_entries($link, $result);
if($user['count'] != 1) {
// user not found or multiple result found
exit;
}
}
$pref = TB_PREF;
// Don't lock pref if the user is member of some special groups
// regardless of the setting

Loading…
Cancel
Save