コード例 #1
0
ファイル: manage_page.php プロジェクト: nan0desu/xyntach
 * @package kusaba
 */
session_set_cookie_params(60 * 60 * 24 * 100);
/* 100 Days */
session_start();
require 'config.php';
require KU_ROOTDIR . 'lib/dwoo.php';
require KU_ROOTDIR . 'inc/functions.php';
require KU_ROOTDIR . 'inc/classes/manage.class.php';
require KU_ROOTDIR . 'inc/classes/board-post.class.php';
require KU_ROOTDIR . 'inc/classes/bans.class.php';
$dwoo_data->assign('styles', explode(':', KU_MENUSTYLES));
$manage_class = new Manage();
$bans_class = new Bans();
if (isset($_GET['graph'])) {
    $manage_class->ValidateSession();
    require KU_ROOTDIR . 'lib/graph/phpgraphlib.php';
    if (isset($_GET['type'])) {
        if ($_GET['type'] == 'day' || $_GET['type'] == 'week' || $_GET['type'] == 'postnum' || $_GET['type'] == 'unique' || $_GET['type'] == 'posttime') {
            $graph = new PHPGraphLib(600, 600);
            if ($_GET['type'] == 'day') {
                $setTitle = 'Posts per board in past 24hrs';
                $graph->setTitle($setTitle);
                $results = $tc_db->GetAll("SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "boards` ORDER BY `name` ASC");
                if (count($results) > 0) {
                    $data = array();
                    foreach ($results as $line) {
                        $posts = $tc_db->GetOne("SELECT HIGH_PRIORITY COUNT(*) FROM `" . KU_DBPREFIX . "posts` WHERE `boardid` = " . $line['id'] . " AND `timestamp` > " . (time() - 86400) . "");
                        $data = array_merge($data, array($line['name'] => $posts));
                    }
                }
コード例 #2
0
ファイル: manage_menu.php プロジェクト: nan0desu/xyntach
/**
 * Manage menu
 *
 * Loaded when a user visits manage.php
 *
 * @package kusaba
 */
session_start();
require 'config.php';
require KU_ROOTDIR . 'lib/dwoo.php';
require KU_ROOTDIR . 'inc/functions.php';
require KU_ROOTDIR . 'inc/classes/manage.class.php';
$manage_class = new Manage();
$dwoo_data->assign('styles', explode(':', KU_MENUSTYLES));
$tpl_links = '';
if (!$manage_class->ValidateSession(true)) {
    $tpl_links .= '<li><a href="' . KU_WEBFOLDER . '" target="_top">' . _gettext('Home') . '</a></li>' . "\n";
    $tpl_links .= '<li><a href="manage_page.php">' . ucfirst(_gettext('log in')) . '</a></li>';
} else {
    $manage_postpassword = md5_encrypt($_SESSION['manageusername'], KU_RANDOMSEED);
    $tpl_links .= _gettext('Welcome') . ', <strong>' . $_SESSION['manageusername'] . '</strong>';
    if ($_SESSION['manageusername'] == 'admin') {
        $salt = $tc_db->GetOne("SELECT `salt` FROM " . KU_DBPREFIX . "staff WHERE `username` = " . $tc_db->qstr($_SESSION['manageusername']));
        if ($_SESSION['managepassword'] == md5('admin' . $salt)) {
            $tpl_links .= '<br /><strong><font color="red">' . _gettext('NOTICE: You are using the default administrator account. Anyone can log in to this account, so a second administrator account needs to be created. Create another, log in to it, and delete this one.') . '</font></strong>';
        }
    }
    $tpl_links .= '<br />' . _gettext('Staff rights') . ': <strong>';
    if ($manage_class->CurrentUserIsAdministrator()) {
        $tpl_links .= _gettext('Administrator');
    } elseif ($manage_class->CurrentUserIsModerator()) {