diff --git a/admin/donors.php b/admin/donors.php
index cc5b608..68f0d50 100644
--- a/admin/donors.php
+++ b/admin/donors.php
@@ -125,29 +125,54 @@ switch($_GET['action']) {
break;
case 'newcontactsearch':
- $searchstr="1 ";
- if($_POST['firstname'])
- $searchstr.=" AND firstname LIKE '%".$_POST['firstname']."%'";
- if($_POST['lastname'])
- $searchstr.=" AND lastname LIKE '%".$_POST['lastname']."%'";
- if($_POST['email'])
- $searchstr.=" AND email LIKE '%".$_POST['email']."%'";
- $q=mysql_query("SELECT *,MAX(year) FROM users WHERE $searchstr GROUP BY uid HAVING deleted='no'");
- $num=mysql_num_rows($q);
- if($num==0) {
- echo i18n("No existing users match, will create a new user");
- }
- else if($num<15) {
- echo i18n("Did you mean one of these existing users? (click to choose one)")." ";
- echo "
";
- while($r=mysql_fetch_object($q)) {
+ if($_POST['email'])
+ $q=mysql_query("SELECT *,MAX(year) FROM users WHERE email='".trim($_POST['email'])."' GROUP BY uid HAVING deleted='no'");
+
+ if($r=mysql_fetch_object($q)) {
+ echo i18n("There is an exact email address match for %1",array($_POST['email']));
+ echo "
";
+
+ ?>
+
+
+
}
else {
- echo i18n("There are %1 existing users that match, please enter more details",array($num));
+ ?>
+
+
+
+ $searchstr="1 ";
+ if($_POST['firstname'])
+ $searchstr.=" AND firstname LIKE '%".$_POST['firstname']."%'";
+ if($_POST['lastname'])
+ $searchstr.=" AND lastname LIKE '%".$_POST['lastname']."%'";
+ if($_POST['email'])
+ $searchstr.=" AND email LIKE '%".$_POST['email']."%'";
+
+ $q=mysql_query("SELECT *,MAX(year) FROM users WHERE $searchstr GROUP BY uid HAVING deleted='no'");
+ $num=mysql_num_rows($q);
+ if($num==0) {
+ echo i18n("No existing users match, will create a new user");
+ }
+ else if($num<15) {
+ echo i18n("Did you mean one of these existing users? (click to choose one)")." ";
+ echo "