From cf1d86d50ea928ae459abcae6d09f8bf2014738f Mon Sep 17 00:00:00 2001 From: thomascube Date: Sat, 6 Sep 2008 16:50:22 +0000 Subject: Don't import contacts without an e-mail address (does not make sense) --- program/steps/addressbook/import.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'program/steps/addressbook/import.inc') diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc index 22913493b..a0786e214 100644 --- a/program/steps/addressbook/import.inc +++ b/program/steps/addressbook/import.inc @@ -116,7 +116,7 @@ if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name' $IMPORT_STATS = new stdClass; $IMPORT_STATS->names = array(); $IMPORT_STATS->count = count($vcards); - $IMPORT_STATS->inserted = $IMPORT_STATS->skipped = $IMPORT_STATS->errors = 0; + $IMPORT_STATS->inserted = $IMPORT_STATS->skipped = $IMPORT_STATS->nomail = $IMPORT_STATS->errors = 0; if ($replace) $CONTACTS->delete_all(); @@ -135,6 +135,11 @@ if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name' continue; } } + // skip entries without an e-mail address + if (empty($email)) { + $IMPORT_STATS->nomail++; + continue; + } $success = $CONTACTS->insert(array( 'name' => $vcard->displayname, -- cgit v1.2.3