$WPRO_SESS->doSave = true; return $response; } if (isset($WPRO_SESS->data['move-copy'][$moveCopyID]['overwrite'])) { if (count($WPRO_SESS->data['move-copy'][$moveCopyID]['overwrite']) && count($overwrite)) { if (!$destDir->overwrite) { $response->addAlert($DIALOG->langEngine->get('wproCore_fileBrowser', 'JSOverwritePermissionsError')); $this->displayFolderList($folderID, $folderPath, $page, $sortBy, $sortDir, $view, array(), $history, $response); $response->addScriptCall("dialog.hideLoadMessage", ''); unset($WPRO_SESS->data['move-copy'][$moveCopyID]); $WPRO_SESS->doSave = true; return $response; } else { foreach ($overwrite as $file) { if (in_array($file, $WPRO_SESS->data['move-copy'][$moveCopyID]['overwrite'])) { if (!$fs->fileNameOK($file)) { array_push($failed, $file); continue; } $isFile = is_file($srcDirectory . $file); $exists = file_exists($srcDirectory . $file); if (!$exists) { array_push($failed, $file); continue; } // check user can move the files and folders in the src dir if ($isFile && !$srcDir->moveFiles && $action == 'move') { array_push($failed, $file); continue; } else { if ($isFile && !$srcDir->copyFiles && $action == 'copy') {
return $response; } $fs = new wproFilesystem(); $name = trim($name); if ($arr = $this->getFolder($folderId, $folderPath, $response)) { $directory = $arr['directory']; $URL = $arr['URL']; $dir = $arr['dir']; if (!$dir->createFolders) { $this->displayFolderList($folderId, $folderPath, $page, $sortBy, $sortDir, $view, array(), $history, $response); $response->addAlert($DIALOG->langEngine->get('wproCore_fileBrowser', 'JSNewFolderPermissionsError')); $response->addScriptCall("dialog.hideLoadMessage", ''); $response->addScriptCall("hideMessageBox", ''); return $response; } if (!$fs->fileNameOK($name)) { $this->displayFolderList($folderId, $folderPath, $page, $sortBy, $sortDir, $view, array(), $history, $response); $response->addAlert($DIALOG->langEngine->get('wproCore_fileBrowser', 'JSFileNameError')); $response->addScriptCall("document.dialogForm.newFolderName.focus", ''); $response->addScriptCall("dialog.hideLoadMessage", ''); return $response; } // filter check if ($fs->filterMatch($name, $dir->filters)) { $this->displayFolderList($folderId, $folderPath, $page, $sortBy, $sortDir, $view, array(), $history, $response); $response->addAlert($DIALOG->langEngine->get('wproCore_fileBrowser', 'JSReservedNameError')); $response->addScriptCall("document.dialogForm.newFolderName.focus", ''); $response->addScriptCall("dialog.hideLoadMessage", ''); return $response; } $exists = file_exists($directory . $name);