summaryrefslogtreecommitdiffstats
path: root/apps/contacts/import.php
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-07-15 17:34:30 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-07-15 17:34:30 +0200
commitdd95149238ae8792e2ca322d404f6ab6cb09c926 (patch)
treee75fd2a5534c1cb3d960733fe6ef0cfe37026712 /apps/contacts/import.php
parent160e701fbf4d87e9673114f0dd51c6705e180475 (diff)
downloadnextcloud-server-dd95149238ae8792e2ca322d404f6ab6cb09c926.tar.gz
nextcloud-server-dd95149238ae8792e2ca322d404f6ab6cb09c926.zip
Also unlink unsuccessful imports.
Diffstat (limited to 'apps/contacts/import.php')
-rw-r--r--apps/contacts/import.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/contacts/import.php b/apps/contacts/import.php
index ed1b80e132a..7d3acf86cf8 100644
--- a/apps/contacts/import.php
+++ b/apps/contacts/import.php
@@ -80,6 +80,11 @@ $imported = 0;
$failed = 0;
if(!count($parts) > 0) {
OCP\JSON::error(array('data' => array('message' => 'No contacts to import in '.$_POST['file'].'. Please check if the file is corrupted.', 'file'=>$_POST['file'])));
+ if(isset($_POST['fstype']) && $_POST['fstype'] == 'OC_FilesystemView') {
+ if(!$view->unlink('/imports/' . $_POST['file'])) {
+ OCP\Util::writeLog('contacts','Import: Error unlinking OC_FilesystemView ' . '/' . $_POST['file'], OCP\Util::ERROR);
+ }
+ }
exit();
}
foreach($parts as $part){