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

📄 masterentrance.java~1~

📁 源码/软件简介: 云网论坛1.1RC国际版是采用JSP开发的集论坛、CMS(网站内容管理系统)、博客、聊天室、商城、交友、语音灌水等于一体的门户式社区。拥有CWBBS ( Cloud Web BBS
💻 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 + -