• Resolved FelixSima

    (@felixsima)


    Hey. First of all, thank you for this great plugin, it’s a masterpiece.

    I’m having a problem regarding the users abilities to create folders.
    I am using this shortcode:

    [fileaway type=”table” fadein=”opacity” makedir=”true” fadetime=”500″ theme=”silk” bulkdownload=”on” manager=”on” name=”files” sub=”/fa-userrole/fa-username” password=”pass” user_override=”fa-userid”]

    Everything works well, the users are able to create directories and everything, with one exception. If the username contains a period ( . ), then the creation of directories becomes a problem. It seems that it creates another folder without the period in its name. So, for example, let’s take the user test.test . The files can be found in the “test.test” folder, but when the user creates a new sub directory, a new folder is created on the base folder with the same name as the user but the period is replaced by space (test test), and that’s where it creates the new subdirectory, while all the files are on the ‘test.test’ folder. Any ideas? Thank you!

    https://ww.wp.xz.cn/plugins/file-away/

Viewing 9 replies - 16 through 24 (of 24 total)
  • Plugin Author thomstark

    (@thomstark)

    To make that change, change this line:

    $atts['sub'] = 'fa-userrole/'.$login;

    to this:

    $atts['sub'] = 'fa-userrole/fa-userid/'.$login;

    Note that this line occurs twice, once in each function sc and up, so you’ll have to replace it in both places

    Thread Starter FelixSima

    (@felixsima)

    I would rather have the manager use the user full username (dot included) if it’s possible and not a big security risk. I also have thought about adding the id to the path, but I am affraid that would be a bit confusing for some of the admins that will manage the files (they will need to download the files users upload, make some changes and then upload it back to the users folder).

    Thread Starter FelixSima

    (@felixsima)

    $login = $u->user_login;
    instead of :
    $login = str_replace(array(‘.’,”‘”,'”‘), ”, $u->user_login);

    Would this pose a security risk?

    Plugin Author thomstark

    (@thomstark)

    $login = $u->user_login is the same as just using fa-username in the original shortcode.

    Plugin Author thomstark

    (@thomstark)

    All right, it looks like the only place it’s relevant to you is in the directory creation function.

    You can open up wp-content/plugins/file-away/lib/cls/class.fileaway_management.php

    Go down to lines 325-236, and replace these two lines:

    $parents = stripslashes(trim(str_replace('.', '', $_POST['parents']), '/'));
    $newsub = stripslashes(trim(str_replace('.', '', $_POST['newsub']), '/'));

    with these two lines:

    $parents = stripslashes(trim(str_replace('..', '', $_POST['parents']), '/'));
    $newsub = stripslashes(trim(str_replace('..', '', $_POST['newsub']), '/'));

    Then just go back to your original shortcodes and ditch the custom extension plugin we spent the last few hours on.

    Thread Starter FelixSima

    (@felixsima)

    You’re a generous god!
    One question though. Should I avoid updating the plugin or will you inlcude this in the next update?

    Plugin Author thomstark

    (@thomstark)

    Twill be in the next update.

    Plugin Author thomstark

    (@thomstark)

    Sorry we went the long way round.

    Thread Starter FelixSima

    (@felixsima)

    No worries man. I appreciate your help and dedication!
    PS: I added your movies on my watchlist 😀

Viewing 9 replies - 16 through 24 (of 24 total)

The topic ‘Username dynamic path bug’ is closed to new replies.