Пример #1
0
function Check4Ban($posting = false)
{
    global $User;
    $uid = Input::ToString($User->ID);
    $ip = $_SERVER['REMOTE_ADDR'];
    $res = DB::Execute("SELECT flags,reason,expiry,appeal FROM {P}Bans WHERE ip='{$ip}' OR uid='{$uid}'");
    if ($res->RecordCount() == 0) {
        return;
    }
    // NO BAN
    list($flags, $reason, $expiry, $appeal) = $res->FetchRow();
    $td = $expiry - $_SERVER['REQUEST_TIME'];
    //	echo "TD: $td";
    if ($td < 0) {
        remove_id_ban($uid);
        remove_ip_ban($ip);
        return;
    }
    if (!empty($_POST['A_PEEL']) && !($flags & BANF_APPEAL_DENIED)) {
        $appeal = $_POST['A_PEEL'];
        DB::Execute("UPDATE {P}Bans SET appeal=" . DB::Q($appeal) . " WHERE uid='{$id}' OR ip='{$ip}'");
        redirect('Appeal updated.', '/');
    }
    if ($flags & BANF_NO_READ || $posting) {
        if ($flags & BANF_STEALTH) {
            die('');
        }
        // WSoD
        Output::Assign('flags', $flags);
        Output::Assign('reason', $reason);
        Output::Assign('expiry', $expiry);
        Output::Assign('appeal', $appeal);
        Output::$tpl->display('banned.tpl.php');
        exit;
        $derp = 1 / 0;
        // Just in case.
    }
}
Пример #2
0
 static function GetEString($index, $allownull = false)
 {
     $r = GET::FetchIndex($index);
     if (!$r && !$allownull) {
         Output::HardError(sprintf('Index %s unavailable.', $index));
     }
     Output::CheckBuffer();
     return Input::ToString($r);
 }