⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 masterentrance.java~1~

📁 云网论坛CWBBS 源码,内容丰富,学习,参考,教学的好资料,具体见内说明,
💻 JAVA~1~
字号:
package com.redmoon.forum.plugin.entrance;

import com.redmoon.forum.plugin.base.IPluginEntrance;
import com.redmoon.forum.Privilege;
import javax.servlet.http.HttpServletRequest;
import cn.js.fan.util.ErrMsgException;
import com.redmoon.forum.person.MasterDb;
import com.redmoon.forum.BoardEntranceDb;

public class MasterEntrance implements IPluginEntrance {
    public static String CODE = "master";

    public MasterEntrance() {
    }

    public boolean canEnter(HttpServletRequest request, String boardCode) throws ErrMsgException{
        Privilege pvg = new Privilege();
        if (pvg.isMasterLogin(request)) // 这样从后台登录的就可以进入
            return true;

        // 验证用户
        if (!pvg.Authenticate(pvg.getUser(request), pvg.getPwd(request))) {
            throw new ErrMsgException("对不起,只有总版主才能进入");
        }

        // 查询用户是否为管理员
        MasterDb md = new MasterDb();
        md = md.getMasterDb(pvg.getUser(request));
        if (!md.isLoaded()) {
            throw new ErrMsgException("对不起,只有总版主才能进入");
        }
        return true;
    }

    public boolean isPluginBoard(String boardCode) {
        BoardEntranceDb be = new BoardEntranceDb();
        be = be.getBoardEntranceDb(boardCode, CODE);
        if (be.isLoaded())
            return true;
        else
            return false;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -