Skip to content
Snippets Groups Projects
Commit dd951492 authored by Thomas Tanghus's avatar Thomas Tanghus
Browse files

Also unlink unsuccessful imports.

parent 160e701f
No related branches found
No related tags found
No related merge requests found
...@@ -80,6 +80,11 @@ $imported = 0; ...@@ -80,6 +80,11 @@ $imported = 0;
$failed = 0; $failed = 0;
if(!count($parts) > 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']))); 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(); exit();
} }
foreach($parts as $part){ foreach($parts as $part){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment