managerentrance.java~1~
来自「云网论坛CWBBS 源码,内容丰富,学习,参考,教学的好资料,具体见内说明,」· JAVA~1~ 代码 · 共 40 行
JAVA~1~
40 行
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.BoardManagerDb;
import com.redmoon.forum.BoardEntranceDb;
public class ManagerEntrance implements IPluginEntrance {
public static String CODE = "manager";
public ManagerEntrance() {
}
public boolean canEnter(HttpServletRequest request, String boardCode) throws ErrMsgException{
Privilege pvg = new Privilege();
if (!pvg.isUserLogin(request)) // 这样从后台登录的就可以进入
throw new ErrMsgException("对不起,只有版主才能进入!");
BoardManagerDb bm = new BoardManagerDb();
boolean re = bm.isUserManager(pvg.getUser(request));
if (!re) {
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 + =
减小字号Ctrl + -
显示快捷键?