0

要在我的网站上列出文件,我使用:Encode-Explorer

有一些上传、创建目录和删除的功能。要访问上传文件,您必须先登录。

我有自己的用户系统,只希望可以进入此页面的每个人都能够上传文件。无需额外登录。

这是整个脚本:
https ://github.com/marekrei/encode-explorer/blob/master/index.php

我试图设置return true;一些选项:

public static function isAccessAllowed()
{
    if(!GateKeeper::isLoginRequired() || GateKeeper::isUserLoggedIn())
        return true;
    return false; //THIS I CHANGED TO TRUE
}

public static function isUploadAllowed(){
    if(EncodeExplorer::getConfig("upload_enable") == true && GateKeeper::isUserLoggedIn() == true && GateKeeper::getUserStatus() == "admin")
        return true;
    return false; //THIS I CHANGED TO TRUE
}

当我改变这个..我能够看到要上传的 HTML,但该功能不会上传任何东西。我还需要改变什么?

4

1 回答 1

0

这成功了!

public static function isUserLoggedIn()
{
    if(isset($_SESSION['ee_user_name'], $_SESSION['ee_user_pass']))
    {
        if(GateKeeper::isUser($_SESSION['ee_user_name'], $_SESSION['ee_user_pass']))
            return true;
    }
    return true; //DEFAULT FALSE
}

public static function isAccessAllowed()
{
    if(!GateKeeper::isLoginRequired() || GateKeeper::isUserLoggedIn())
        return true;
    return true; //DEFAULT FALSE
}

public static function isUploadAllowed(){
    if(EncodeExplorer::getConfig("upload_enable") == true && GateKeeper::isUserLoggedIn() == true && GateKeeper::getUserStatus() == "admin")
        return true;
    return true; //DEFAULT FALSE
}

public static function isNewdirAllowed(){
    if(EncodeExplorer::getConfig("newdir_enable") == true && GateKeeper::isUserLoggedIn() == true && GateKeeper::getUserStatus() == "admin")
        return true;
    return true; //DEFAULT FALSE
}

public static function isDeleteAllowed(){
    if(EncodeExplorer::getConfig("delete_enable") == true && GateKeeper::isUserLoggedIn() == true && GateKeeper::getUserStatus() == "admin")
        return true;
    return true; //DEFAULT FALSE
}
于 2019-01-29T09:59:35.033 回答