Menu

#7 moving a sub-folder (not a file) to same folder deletes it!

open
nobody
None
5
2005-08-04
2005-07-14
Mike
No

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!

Discussion

  • Mike

    Mike - 2005-08-04
    • summary: moving files/folders to same folder deletes file! --> moving folders (not files) to same folder deletes file!
     
  • Mike

    Mike - 2005-08-04

    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 :-(

     
  • Mike

    Mike - 2005-08-04
    • summary: moving folders (not files) to same folder deletes file! --> moving a sub-folder (not a file) to same folder deletes it!
     
  • johnnemo

    johnnemo - 2005-10-12

    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;
    }

     

Log in to post a comment.

MongoDB Logo MongoDB