show error if anon-images directory could not be created

This commit is contained in:
Ralf Becker 2021-03-15 09:45:34 +02:00
parent fa0e7715c1
commit 0b91532bf6

View File

@ -31,9 +31,9 @@ class admin_config
$path = $GLOBALS['egw_info']['server']['files_dir'].'/anon-images'; $path = $GLOBALS['egw_info']['server']['files_dir'].'/anon-images';
$success = false; $success = false;
$response = Api\Json\Response::get(); $response = Api\Json\Response::get();
if (is_array($file) && is_writable(dirname($path))) if (is_array($file) && is_writable(dirname($path)) &&
(is_dir($path) || mkdir($path)))
{ {
if (!is_dir($path)) mkdir ($path);
$tmp_file = array_keys($file); $tmp_file = array_keys($file);
$destination = $path.'/'.$file[$tmp_file[0]]['name']; $destination = $path.'/'.$file[$tmp_file[0]]['name'];
$success = rename($GLOBALS['egw_info']['server']['temp_dir'].'/'.$tmp_file[0],$destination); $success = rename($GLOBALS['egw_info']['server']['temp_dir'].'/'.$tmp_file[0],$destination);