fix upload delete
Dieser Commit ist enthalten in:
Ursprung
4d65fba9dc
Commit
92181aba97
|
@ -116,10 +116,10 @@ if ($action == "upl_delete") {
|
||||||
if (is_dbfs($path)) {
|
if (is_dbfs($path)) {
|
||||||
$dbfs->remove($path . "/.");
|
$dbfs->remove($path . "/.");
|
||||||
} else {
|
} else {
|
||||||
|
$failedFiles = [];
|
||||||
|
|
||||||
/* Check for files */
|
/* Check for files */
|
||||||
if (uplHasFiles($path)) {
|
if (uplHasFiles($path)) {
|
||||||
$failedFiles = array();
|
|
||||||
|
|
||||||
$directory = opendir($cfgClient[$client]["upl"]["path"] . $path);
|
$directory = opendir($cfgClient[$client]["upl"]["path"] . $path);
|
||||||
while (false !== ($dir_entry = readdir($directory))) {
|
while (false !== ($dir_entry = readdir($directory))) {
|
||||||
if ($dir_entry != "." && $dir_entry != "..") {
|
if ($dir_entry != "." && $dir_entry != "..") {
|
||||||
|
@ -132,11 +132,11 @@ if ($action == "upl_delete") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($failedFiles) > 0) {
|
if ($failedFiles !== []) {
|
||||||
$notification->displayNotification("warning", i18n("Failed to delete the following files:") . "<br><br>" . implode("<br>", $failedFiles));
|
$notification->displayNotification("warning", i18n("Failed to delete the following files:") . "<br><br>" . implode("<br>", $failedFiles));
|
||||||
} else {
|
} else {
|
||||||
$res = @ rmdir($cfgClient[$client]['upl']['path'] . $path);
|
$res = @rmdir($cfgClient[$client]['upl']['path'] . $path);
|
||||||
if ($res == false) {
|
if (!$res) {
|
||||||
$notification->displayNotification("warning", sprintf(i18n("Failed to remove directory %s"), $path));
|
$notification->displayNotification("warning", sprintf(i18n("Failed to remove directory %s"), $path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Laden…
In neuem Issue referenzieren