예제 #1
0
파일: admin.php 프로젝트: Bossgod/3ch
<?php

require 'config.php';
require_once CORE_DIR . "/mysql/mysql.php";
$mysql = new SaguaroMySQL();
$mysql->init();
require_once CORE_DIR . "/admin/login.php";
$login = new Login();
$login->auth();
//Load and initialize Log.
require_once CORE_DIR . "/log/log.php";
$my_log = new Log();
//Load post table
require_once CORE_DIR . "/admin/tables.php";
$table = new Table();
//Load report queue
require_once CORE_DIR . "/admin/report.php";
$getReport = new Report();
extract($_POST, EXTR_SKIP);
//Display head.
function head($noHead)
{
    require_once CORE_DIR . "/page/head.php";
    $head = new Head();
    $head->info['page']['title'] = "/" . BOARD_DIR . "/ - Management Panel";
    echo $head->generateAdmin($noHead);
}
//Admin form
function aform(&$post, $resno, $admin = "")
{
    require_once CORE_DIR . "/postform.php";
예제 #2
0
*       d'    ,"""""""".      (, )
*      b     :        :     ,  /
*     .-"b    :        ;   .d..`.
*    <::::Y._  `._____/  ,;"`::::\
*    /::::' `""=..__..,="'    \:.|"
*    "|:'        )"" (         \|`
* 
* team-ru4chan, 2015
* 
*/
require "config.php";
session_start();
require_once CORE_DIR . "/log/log.php";
$my_log = new Log();
require_once CORE_DIR . "/mysql/mysql.php";
$mysql = new SaguaroMySQL();
$mysql->init();
extract($_POST, EXTR_SKIP);
extract($_GET, EXTR_SKIP);
extract($_COOKIE, EXTR_SKIP);
$path = realpath("./") . '/' . IMG_DIR;
ignore_user_abort(TRUE);
// check whether the current user can perform $action (on $no, for some actions)
// board-level access is cached in $valid_cache.
function valid($action = 'moderator', $no = 0)
{
    require_once CORE_DIR . "/admin/validate.php";
    $validate = new Validation();
    return $validate->verify($action);
}
function error($mes, $dest, $fancy = 0)
예제 #3
0
<?php

include "config.php";
require_once CORE_DIR . "/mysql/mysql.php";
$mysql = new SaguaroMySQL();
$mysql->init();
$host = $_SERVER['REMOTE_ADDR'];
require_once CORE_DIR . "/admin/banish.php";
$dis = new Banish();
$deny = $dis->checkBan($host) ? 0 : 1;
//no ban : is banned
$status = "are not banned";
if ($deny) {
    $row = $mysql->fetch_assoc("SELECT * FROM " . SQLBANLOG . " WHERE ip='" . $host . "' AND active <> 0 LIMIT 1");
    $length = ($row['expires'] - $row['placedon']) / 60 / 60 / 24;
    //MATH SON
    switch ($row['type']) {
        case '1':
            $status = 'have been warned on: <b>/' . $row['board'] . '/ - ' . TITLE . '</b>';
            $mysql->query("UPDATE " . SQLBANLOG . " SET active='0' WHERE ip='{$host}' AND active='1' LIMIT 1");
            break;
        case '2':
            $status = 'have been banned from: <b>/' . $row['board'] . '/ - ' . TITLE . '</b>';
            if (time() > $row['expires']) {
                $mysql->query("UPDATE " . SQLBANLOG . " SET active='0' WHERE ip='{$host}' AND active='1' LIMIT 1");
            }
            $row['expires'] = date('F d, Y H:i', $row['expires']) . " days";
            break;
        case '3':
            $status = 'have been banned from <b>all boards</b>';
            if (time() > $row['expires']) {