Set Different Root for Users (ResponsiveFilemanager)

The key is

$_SESSION['RF']["subfolder"]

https://www.responsivefilemanager.com/#documentation-section

But in Laravel , you can’t use $_SESSION, so need to change dialog.php of responsivefilemanager

//根據登入的user是哪個site, 決定filemanager的root folder
if(isset($_GET['site_root']) && $_GET['site_root'] != false){
    $_SESSION['RF']["subfolder"] = $_GET['site_root'];
}

if (!isset($_SESSION['RF']["subfolder"])) {
    $_SESSION['RF']["subfolder"] = '';
}
$rfm_subfolder = '';

Bug

If users have different permission (root folder), change account could cause error.
Line #150~ shoud be modified.

/*
如果$rfm_subfolder = 'TW/', $subdir = 'TW/', 
會造成下面的判斷成立$ftp == false, file_exists() == false
這樣就造成$cur_dir會是根目錄,但其實應該顯示的目錄是/TW, 畫面會無法點擊
*/
$ftp_path = $config['ftp_base_folder'] . $config['upload_dir'] . $rfm_subfolder . $subdir;
$current_path = $config['current_path'] . $rfm_subfolder . $subdir;
//logg($current_path);
if (($ftp && !$ftp->isDir($ftp_path)) || (!$ftp && !file_exists($current_path))){
    $subdir = '';

    //如果目前的路徑不是file, 就表示路徑發生錯誤,只把subdir清掉
    //直接顯示正確的根目錄
    //$rfm_subfolder = "";
}
//logg($subdir);