コード例 #1
0
ファイル: post.php プロジェクト: hitoy/domai-ims
    require_once MSGROOT . "include/acl.class.php";
    $ip_contrl = new Acl();
    if ($ip_contrl->is_forbid($ip_add)) {
        //如果当前用户IP被管理员禁止,则错误代码为1;
        $errorcode = 1;
        //goto view;
        showui($errorcode);
        exit;
    }
}
//加载信息类并实例化,可能存在IP被禁止的情况,所以放到后面加载
require_once MSGROOT . "include/message.class.php";
$msg_ins = new Msg($team, $ip_add, $http_referer, $user_agent);
//管理员启用IP提交控制的情况(限制相同IP多次提交)
if ($sysconf->subctl_byip > 0) {
    if ($msg_ins->getsubcount() > $sysconf->subctl_byip) {
        //如果当前提交IP超过系统限制,则错误代码为2;
        $errorcode = 2;
        showui($errorcode);
        //goto view;
        exit;
    }
}
//管理员启动根据Cookie判定指定时间内不能重复提交
if ($sysconf->subctl_bycookie > 0) {
    if ($msg_ins->getsubinterval() < $sysconf->subctl_bycookie) {
        //如果两次提交间隔小于系统设置,则错误代码为3;
        $errorcode = 3;
        showui($errorcode);
        //goto view;
        exit;