示例#1
0
/**
 * "You are banned" page
 *
 * Users will be redirected to this page when they are banned from posting to or
 * viewing the boards.
 *
 * @package kusaba
 */
/**
 * Require the configuration file, functions file, and bans class
 */
require 'config.php';
require KU_ROOTDIR . 'inc/functions.php';
require KU_ROOTDIR . 'inc/classes/bans.class.php';
$bans_class = new Bans();
if (isset($_POST['appealmessage']) && KU_APPEAL != '') {
    $results = $tc_db->GetAll("SELECT * FROM `" . KU_DBPREFIX . "banlist` WHERE `type` = '0' AND `ipmd5` = '" . md5($_SERVER['REMOTE_ADDR']) . "' AND `id` = " . $tc_db->qstr($_POST['banid']) . "LIMIT 1");
    if (count($results) > 0) {
        foreach ($results as $line) {
            if ($line['appealat'] > 0 && $line['appealat'] < time()) {
                $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "banlist` SET `appealat` = '-1' , appeal = " . $tc_db->qstr($_POST['appealmessage']) . " WHERE `id` = '" . $line['id'] . "'");
                echo 'Your appeal has been sent and is pending review.';
            } else {
                echo 'You may not appeal that ban at this time.';
            }
            die;
        }
    }
}
$bans_class->BanCheck($_SERVER['REMOTE_ADDR'], '', true);
示例#2
0
if (isset($_POST['board'])) {
    $board_name = $tc_db->GetOne("SELECT `name` FROM `" . KU_DBPREFIX . "boards` WHERE `name` = " . $tc_db->qstr($_POST['board']) . "");
    if (!empty($board_name)) {
        $board_class = new Board($board_name);
        if (!empty($board_class->board['locale'])) {
            changeLocale($board_class->board['locale']);
        }
    } else {
        do_redirect(KU_WEBPATH);
    }
} else {
    // A board being supplied is required for this script to function
    do_redirect(KU_WEBPATH);
}
// {{{ Expired ban removal, and then existing ban check on the current user
$bans_class->BanCheck($_SERVER['REMOTE_ADDR'], $board_class->board['name']);
// }}}
$oekaki = $posting_class->CheckOekaki();
$is_oekaki = empty($oekaki) ? false : true;
/* Ensure that UTF-8 is used on some of the post variables */
$posting_class->UTF8Strings();
/* Check if the user sent a valid post (image for thread, image/message for reply, etc) */
if ($posting_class->CheckValidPost($is_oekaki)) {
    $tc_db->Execute("START TRANSACTION");
    $posting_class->CheckReplyTime();
    $posting_class->CheckNewThreadTime();
    $posting_class->CheckMessageLength();
    $posting_class->CheckCaptcha();
    $posting_class->CheckBannedHash();
    $posting_class->CheckBlacklistedText();
    $post_isreply = $posting_class->CheckIsReply();