summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-09-06 16:50:22 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-09-06 16:50:22 +0000
commita8d099868d722718c94974255c8d91a1fd9af44b (patch)
treedb45d4da73069dbe7dcc4b6ec5525e13e5dc5a78
parent1c8899f918d18ae9c67035cbb65f995320ee11fb (diff)
Don't import contacts without an e-mail address (does not make sense)
git-svn-id: https://svn.roundcube.net/trunk@1752 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/program/steps/addressbook/import.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/roundcubemail/program/steps/addressbook/import.inc b/roundcubemail/program/steps/addressbook/import.inc
index 22913493b..a0786e214 100644
--- a/roundcubemail/program/steps/addressbook/import.inc
+++ b/roundcubemail/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,