示例#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
$topic->Parse();
$topic->GetReplies();
Output::Assign('topic', $topic);
update_activity('topic', $_GET['id']);
$page_title = 'Topic: ' . htmlspecialchars($topic->Headline);
// Increment visit count.
if (!isset($_SESSION['visited_topics'][$_GET['id']]) && isset($_COOKIE['SID'])) {
    $_SESSION['visited_topics'][$_GET['id']] = 1;
    DB::Execute('UPDATE {P}Topics SET visits = visits + 1 WHERE id = ' . $_GET['id']);
}
// Set visited cookie...
$last_read_post = $User->Visited[$_GET['id']];
if ($last_read_post !== $topic->Replies) {
    // Build cookie.
    // Add the current topic:
    $User->Visited = array($_GET['id'] => $topic_replies) + $User->Visited;
    // Readd old topics.
    foreach ($User->Visited as $cur_topic_id => $num_replies) {
        // If the cookie is getting too long (4kb), stop.
        if (strlen($cookie_string) > 3900) {
            break;
        }
        $cookie_string .= 't' . $cur_topic_id . 'n' . $num_replies;
    }
    CreateCookie('topic_visits', $cookie_string);
}
Output::Assign('LastReadPost', $last_read_post);
// Output dummy form. (This is for JavaScript submissions to action.php.)
dummy_form();
echo Output::$tpl->Fetch('topic.tpl.php');
require 'includes/footer.php';
示例#3
0
<?php

require 'includes/header.php';
force_id();
Output::Assign('sidebar', $sidebar);
Output::$tpl->display('dashhead.tpl.php');
$page_title = 'Your trash can';
if ($_POST['empty_trash']) {
    $delete_topic = $link->prepare('DELETE FROM trash WHERE uid = ?');
    $delete_topic->bind_param('s', $_SESSION['UID']);
    $delete_topic->execute();
    $delete_topic->close();
    $_SESSION['notice'] = 'Trash emptied.';
}
echo '<p>Your deleted topics and replies are archived here.</p>';
if ($trash = show_trash($_SESSION['UID'])) {
    echo $trash;
    ?>

	<form action="" method="post">
		<div class="row">
			<input type="submit" name="empty_trash" value="Empty trash can" onclick="return confirm('Really?');" />
		</div>
	</form>

	<?php 
}
Output::$tpl->display('dashfooter.tpl.php');
require 'includes/footer.php';
示例#4
0
					$puntxt='<b>Ban user for '.calculate_age($expiry+time(),time()).'.</b>';
					break;
				case PUNISH_ERROR:
					$puntxt='<b>Display a 403 and stop posting.</b>';
					break;
				default:
					$puntxt="<b>Unknown: \$punish=$punish; \$expiry=$expiry; \$replacement=$replacement;</b>";
					break;
			}
			$r = array('<input type="checkbox" name="del_filter[]" value="'.$id.'" />',$id,"<code>$txt</code",$reason,$puntxt);
			$tbl->Row($r);
		}
		Output::Assign('tbl',$tbl);
		Output::Assign('Options',array(
				PUNISH_REPLACE	=> 'Replace',
				PUNISH_BAN	=> 'Ban',
				PUNISH_ERROR	=> 'Display Error')
		);
		Output::$tpl->display('controlpanel/list_filters.tpl.php');

		break;
	case 'add_filters':
		$page_title="Process Filters";

/*		
			filter[]	Text to filter
			type[]		filter_type
			replace[]	Replace with
			duration[]	Ban Duration
			reason[]	Ban Reason
			del_filter[]	Delete Filter
示例#5
0
* 
* Copyright (c) 2009-2010 ATBBS Contributors
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
$buffered_content = ob_get_contents();
ob_end_clean();
// require 'template.php';
Output::Assign('title', $page_title);
Output::Assign('onload', $onload_javascript);
Output::Assign('body', $buffered_content);
Output::Assign('head', $header);
Output::Assign('menu', $main_menu);
Output::Assign('User', $User);
Output::Flush();