try {
    // Initialization.
    kotoba_session_start();
    if (Config::LANGUAGE != $_SESSION['language']) {
        require Config::ABS_PATH . "/locale/{$_SESSION['language']}/messages.php";
        require Config::ABS_PATH . "/locale/{$_SESSION['language']}/logging.php";
    }
    locale_setup();
    $smarty = new SmartyKotobaSetup();
    // Check if client banned.
    if (($ban = bans_check(get_remote_addr())) !== FALSE) {
        // Cleanup.
        DataExchange::releaseResources();
        $smarty->assign('ip', $_SERVER['REMOTE_ADDR']);
        $smarty->assign('reason', $ban['reason']);
        $smarty->display('banned.tpl');
        session_destroy();
        exit(1);
    }
    // Check permission and write message to log file.
    if (!is_admin()) {
        // Cleanup.
        DataExchange::releaseResources();
        display_error_page($smarty, new NotAdminError());
        exit(1);
    }
    call_user_func(Logging::$f['EDIT_USER_GROUPS_USE']);
    $groups = groups_get_all();
    $users = users_get_all();
    $user_groups = user_groups_get_all();
    $reload_user_groups = false;
示例#2
0
require_once Config::ABS_PATH . '/lib/exceptions.php';
try {
    // Initialization.
    kotoba_session_start();
    if (Config::LANGUAGE != $_SESSION['language']) {
        require Config::ABS_PATH . "/locale/{$_SESSION['language']}/messages.php";
    }
    locale_setup();
    $smarty = new SmartyKotobaSetup();
    // Check if client banned.
    if (($ban = bans_check(get_remote_addr())) !== FALSE) {
        // Cleanup.
        DataExchange::releaseResources();
        $smarty->assign('ip', $_SERVER['REMOTE_ADDR']);
        $smarty->assign('reason', $ban['reason']);
        $smarty->display('banned.tpl');
        session_destroy();
        exit(1);
    }
    // Get boards and categories and make tree for navbar.
    $categories = categories_get_all();
    $boards = boards_get_visible($_SESSION['user']);
    make_category_boards_tree($categories, $boards);
    // Конгломерат. Разкомментируйте и отредактируйте.
    //array_push(
    //    $categories,
    //    array('id' => 'Conglomerate',
    //          'name' => 'Conglomerate',
    //          'boards' => array(array('url' => 'http://wakachan.org/unyl/',
    //                                  'title' => 'Унылчан',
    //                                  'name' => 'unyl'),
示例#3
0
require_once Config::ABS_PATH . '/lib/exceptions.php';
try {
    // Initialization.
    kotoba_session_start();
    if (Config::LANGUAGE != $_SESSION['language']) {
        require Config::ABS_PATH . "/locale/{$_SESSION['language']}/messages.php";
    }
    locale_setup();
    $smarty = new SmartyKotobaSetup();
    // Check if client banned.
    if (($ban = bans_check(get_remote_addr())) !== FALSE) {
        // Cleanup.
        DataExchange::releaseResources();
        $smarty->assign('ip', $_SERVER['REMOTE_ADDR']);
        $smarty->assign('reason', $ban['reason']);
        $smarty->display('banned.tpl');
        session_destroy();
        exit(1);
    }
    // Generate main page html-code and display it.
    $smarty->assign('ib_name', Config::IB_NAME);
    $smarty->display('index.tpl');
    // Cleanup.
    DataExchange::releaseResources();
    exit(0);
} catch (KotobaException $e) {
    // Cleanup.
    DataExchange::releaseResources();
    if (!isset($smarty)) {
        $smarty = new SmartyKotobaSetup();
    }
示例#4
0
require_once Config::ABS_PATH . '/lib/exceptions.php';
try {
    // Initialization.
    kotoba_session_start();
    if (Config::LANGUAGE != $_SESSION['language']) {
        require Config::ABS_PATH . "/locale/{$_SESSION['language']}/messages.php";
    }
    locale_setup();
    $smarty = new SmartyKotobaSetup();
    // Check if client banned.
    if (($ban = bans_check(get_remote_addr())) !== FALSE) {
        // Cleanup.
        DataExchange::releaseResources();
        $smarty->assign('ip', $_SERVER['REMOTE_ADDR']);
        $smarty->assign('reason', $ban['reason']);
        $smarty->display('banned.tpl');
        session_destroy();
        exit(1);
    }
    // Generate my id page html-code and display it.
    $smarty->assign('show_control', is_admin() || is_mod());
    $smarty->assign('boards', boards_get_visible($_SESSION['user']));
    $smarty->assign('id', $_SESSION['user']);
    $smarty->assign('groups', $_SESSION['groups']);
    $smarty->display('my_id.tpl');
    if (isset($_REQUEST['kuga'])) {
        echo take_it_easy();
    }
    // Cleanup.
    DataExchange::releaseResources();
    exit(0);