summaryrefslogtreecommitdiff
path: root/program/steps/addressbook
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2008-09-06 16:50:22 +0000
committerthomascube <thomas@roundcube.net>2008-09-06 16:50:22 +0000
commitcf1d86d50ea928ae459abcae6d09f8bf2014738f (patch)
tree1235c7e31a3d2215dca82e303c9ec45e2ac2ff61 /program/steps/addressbook
parentccd63c5591d56e9dcb43ddc5171b4b54dda08c42 (diff)
Don't import contacts without an e-mail address (does not make sense)
Diffstat (limited to 'program/steps/addressbook')
-rw-r--r--program/steps/addressbook/import.inc7
1 files changed, 6 insertions, 1 deletions
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,