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

📄 vipuserentrance.java~2~

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

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

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class VIPUserEntrance implements IPluginEntrance {
    public static String CODE = "vipuser";

    public VIPUserEntrance() {
    }

    public boolean canEnter(HttpServletRequest request, String boardCode) throws ErrMsgException{
        Privilege pvg = new Privilege();

        // 查询用户是否为VIP用户
        VIPUserDb vud = new VIPUserDb();
        vud = vud.getVIPUserDb(pvg.getUser(request));
        boolean isValid = false;
        // System.out.println("VIPUserEntrance.java " + vud.getBoards() + " " + boardCode);
        if (vud!=null && vud.isLoaded()) {
            if ((vud.getBoards()+",").indexOf(boardCode + ",")!=-1)
                isValid = true;
        }
        if (!isValid)
            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 + -