From b3a2de359d116781315e276ea2a81e0e2fd21d8d Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 20 Sep 2012 11:56:44 +0200 Subject: [PATCH] =?UTF-8?q?Recherche=20sur=20l'adresse=20mail=20si=20l'uid?= =?UTF-8?q?=20ne=20donne=20aucun=20r=C3=A9sultat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- root/usr/share/mozilla-mcd/firefox.php | 9 +++++++-- root/usr/share/mozilla-mcd/thunderbird.php | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/root/usr/share/mozilla-mcd/firefox.php b/root/usr/share/mozilla-mcd/firefox.php index 93aad45..16e568b 100644 --- a/root/usr/share/mozilla-mcd/firefox.php +++ b/root/usr/share/mozilla-mcd/firefox.php @@ -17,8 +17,13 @@ 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 - exit; + // 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 diff --git a/root/usr/share/mozilla-mcd/thunderbird.php b/root/usr/share/mozilla-mcd/thunderbird.php index 3b15086..1bb6276 100644 --- a/root/usr/share/mozilla-mcd/thunderbird.php +++ b/root/usr/share/mozilla-mcd/thunderbird.php @@ -16,8 +16,13 @@ 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 - exit; + // 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