RoxyFile文件浏览器中基于ID的特定文件夹

时间:2017-02-24 13:40:30

标签: php roxy-fileman

是否可以根据客户ID设置上传文件夹?

示例:客户获得了ID:2543(存储在会话中)

配置:

{
"FILES_ROOT":          "fileman/uploads/2543 ", // "fileman/uploads/CUSTOMERID "
"RETURN_URL_PREFIX":   "http://localhost/",
"SESSION_PATH_KEY":    "",
"THUMBS_VIEW_WIDTH":   "140",
"THUMBS_VIEW_HEIGHT":  "120",
"PREVIEW_THUMB_WIDTH": "100",
"PREVIEW_THUMB_HEIGHT":"100",
"MAX_IMAGE_WIDTH":     "1000",
"MAX_IMAGE_HEIGHT":    "1000",
"INTEGRATION":         "tinymce4",
"DIRLIST":             "php/dirtree.php",
"CREATEDIR":           "",
"DELETEDIR":           "",
"MOVEDIR":             "php/movedir.php",
"COPYDIR":             "php/copydir.php",
"RENAMEDIR":           "",
"FILESLIST":           "php/fileslist.php",
"UPLOAD":              "php/upload.php",
"DOWNLOAD":            "php/download.php",
"DOWNLOADDIR":         "php/downloaddir.php",
"DELETEFILE":          "php/deletefile.php",
"MOVEFILE":            "php/movefile.php",
"COPYFILE":            "php/copyfile.php",
"RENAMEFILE":          "php/renamefile.php",
"GENERATETHUMB":       "php/thumb.php",
"DEFAULTVIEW":         "list",
"FORBIDDEN_UPLOADS":   "zip js jsp jsb mhtml mht xhtml xht php phtml php3 php4 php5 phps shtml jhtml pl sh py cgi exe application gadget hta cpl msc jar vb jse ws wsf wsc wsh ps1 ps2 psc1 psc2 msh msh1 msh2 inf reg scf msp scr dll msi vbs bat com pif cmd vxd cpl htpasswd htaccess csv json php css html exe",
"ALLOWED_UPLOADS":     "",
"FILEPERMISSIONS":     "0644",
"DIRPERMISSIONS":      "0755",
"LANG":                "auto",
"DATEFORMAT":          "dd/MM/yyyy HH:mm",
"OPEN_LAST_DIR":       "yes"
}

只有拥有正确customerID的客户才能看到他的文件夹。所以没有人可以触摸其他成员文件夹。

我在网上搜索了它,找不到任何解决方案。

1 个答案:

答案 0 :(得分:1)

您需要修改配置文件并更改以下行:

"SESSION_PATH_KEY": "roxyFilePath"

然后你需要在调用Roxy filemanager之前设置这个会话变量。使用PHP,可以使用

的用户ID将其设置为正确的值
$_SESSION["roxyFilePath"] = "Uploads/user/2543"

您也可能会发现阅读此SO问题也很有用PHP- RoxyFileMan set FILES_ROOT path dynamically