If the two panels show the same folder and you select
some files/folders and click on "MOVE", you get an
error message and the files/folders are deleted!
Solution is simple (2 steps):
1)
add variable STR_ACCESS_MOVEFROM_SAME to your
language file (lang_en.inc.php per default)
line to add:
define('STR_ACCESS_MOVEFROM_SAME', 'the source
and target directory are identical');
2)
modify actions.inc.php as follow:
function execute_action($action) {
global $dirleft, $dirright, $message;
Logged In: YES
user_id=1312617
Ahem, this happens when moving FOLDERS, not files.
So here is the situation:
- two panels show the same folder
- you select one sub-folder in one panel
- you click on move
-> it is deleted :-(
Logged In: YES
user_id=1360417
Solution is simple (2 steps):
1)
add variable STR_ACCESS_MOVEFROM_SAME to your
language file (lang_en.inc.php per default)
line to add:
define('STR_ACCESS_MOVEFROM_SAME', 'the source
and target directory are identical');
2)
modify actions.inc.php as follow:
function execute_action($action) {
global $dirleft, $dirright, $message;
$filelist = filelist();
foreach($filelist as $sideflag => $sidefiles) {
$sourceDir = $sideflag ? $dirright : $dirleft;
$destinationDir = $sideflag ? $dirleft : $dirright;
foreach($sidefiles as $f) {
switch ($action) {
case 'copy':
if ( !userhasrights( getcurrentuser(), trailing_slash(
$destinationDir ), 'COPY' ) ) {
$message .=
STR_ACCESS_COPY_DENIED . ':<BR>' .
trailing_slash( $destinationDir )
;
return;
}
$passAction = 0;
break;
case 'move':
// add next 6 lines to original file
if ($sourceDir == $destinationDir) {
$message .=
STR_ACCESS_MOVEFROM_SAME . ' <I>' .
trailing_slash( $sourceDir ) . '</I>'
;
return;
}
// End of adding
if ( !userhasrights( getcurrentuser(), trailing_slash(
$sourceDir ), 'MOVEFROM' ) ) {
$message .=
STR_ACCESS_MOVEFROM_DENIED . ':<BR>' .
trailing_slash( $sourceDir )
;
return;
}