Пример #1
0
            RewritePageTitle("View Players");
        } elseif ($_GET['o'] == 'view') {
            $modTabMenu = new CTabsMenu();
            $modTabMenu->addMenuItem("Back", 0, "", "javascript:history.go(-1);", true);
            $modTabMenu->outputMenu();
            $player_id = (int) $_GET['id'];
            $player = $GLOBALS['db']->GetRow("SELECT id, steamid FROM `" . DB_PREFIX . "_player_ids` WHERE id={$player_id}");
            $player_names = $GLOBALS['db']->GetAll("SELECT name, last_seen FROM `" . DB_PREFIX . "_player_names` WHERE playerid={$player_id} ORDER BY last_seen DESC");
            $player_ips = $GLOBALS['db']->GetAll("SELECT ip, last_seen FROM `" . DB_PREFIX . "_player_ips` WHERE playerid={$player_id} ORDER BY last_seen DESC");
            $player_alts = $GLOBALS['db']->GetAll("\r\n\t\t\t\tSELECT id, steamid, ip, names\r\n\t\t\t\tFROM (\r\n\t\t\t\t\tSELECT *\r\n\t\t\t\t\tFROM `" . DB_PREFIX . "_player_ips`\r\n\t\t\t\t\tWHERE \r\n\t\t\t\t\t\tip IN (\r\n\t\t\t\t\t\t\tSELECT ip\r\n\t\t\t\t\t\t\tFROM `" . DB_PREFIX . "_player_ips`\r\n\t\t\t\t\t\t\tWHERE playerid={$player_id}\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\tAND playerid<>{$player_id}\r\n\t\t\t\t) AS ips\r\n\t\t\t\tNATURAL JOIN (\r\n\t\t\t\t\tSELECT playerid, GROUP_CONCAT(name ORDER BY name ASC SEPARATOR ', ') AS names\r\n\t\t\t\t\tFROM (\r\n\t\t\t\t\t\tSELECT playerid, name\r\n\t\t\t\t\t\tFROM `" . DB_PREFIX . "_player_names`\r\n\t\t\t\t\t\tGROUP BY playerid, name\r\n\t\t\t\t\t) AS names\r\n\t\t\t\t\tGROUP BY playerid\r\n\t\t\t\t) AS grouped_names\r\n\t\t\t\tLEFT JOIN `" . DB_PREFIX . "_player_ids` ON id=playerid\r\n\t\t\t\tORDER BY ip ASC");
            include TEMPLATES_PATH . "/admin.view.player.php";
            RewritePageTitle("View Player Info");
        }
    } elseif ($_GET['c'] == "settings") {
        CheckAdminAccess(ADMIN_OWNER | ADMIN_WEB_SETTINGS);
        // ====================[ ADMIN SIDE MENU START ] ===================
        $settingsTabMenu = new CTabsMenu();
        if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_WEB_SETTINGS)) {
            $settingsTabMenu->addMenuItem("Main Settings", 0);
            $settingsTabMenu->addMenuItem("Features", 3);
        }
        $settingsTabMenu->addMenuItem("Themes", 1);
        if ($userbank->HasAccess(ADMIN_OWNER)) {
            $settingsTabMenu->addMenuItem("System Log", 2);
        }
        $settingsTabMenu->outputMenu();
        // ====================[ ADMIN SIDE MENU END ] ===================
        include TEMPLATES_PATH . "/admin.settings.php";
        RewritePageTitle("SourceBans Settings");
    }
}
Пример #2
0
/**
 * Displays the pagetabs
 *
 * @return noreturn
 */
function BuildPageTabs()
{
    global $userbank;
    AddTab("Dashboard", "index.php?p=home", "This page shows an overview of your bans and servers.");
    AddTab("Ban List", "index.php?p=banlist", "All of the bans in the database can be viewed from here.");
    AddTab("Servers", "index.php?p=servers", "All of your servers and their status can be viewed here");
    if ($GLOBALS['config']['config.enablesubmit'] == "1") {
        AddTab("Submit a ban", "index.php?p=submit", "You can submit a demo or screenshot of a suspected cheater here. It will then be up for review by one of the admins");
    }
    if ($GLOBALS['config']['config.enableprotest'] == "1") {
        AddTab("Protest a ban", "index.php?p=protest", "Here you can protest your ban. And prove your case as to why you should be unbanned.");
    }
    if ($userbank->is_admin()) {
        AddTab(" Admin Panel ", "index.php?p=admin", "This is the control panel for SourceBans where you can setup new admins, add new server, etc.");
    }
    include INCLUDES_PATH . "/CTabsMenu.php";
    // BUILD THE SUB-MENU's FOR ADMIN PAGES
    $submenu = new CTabsMenu();
    if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_LIST_ADMINS | ADMIN_ADD_ADMINS | ADMIN_EDIT_ADMINS | ADMIN_DELETE_ADMINS)) {
        $submenu->addMenuItem("Admins", 0, "", "index.php?p=admin&amp;c=admins", true);
    }
    if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_LIST_SERVERS | ADMIN_ADD_SERVER | ADMIN_EDIT_SERVERS | ADMIN_DELETE_SERVERS)) {
        $submenu->addMenuItem("Servers", 0, "", "index.php?p=admin&amp;c=servers", true);
    }
    if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_ADD_BAN | ADMIN_EDIT_OWN_BANS | ADMIN_EDIT_GROUP_BANS | ADMIN_EDIT_ALL_BANS | ADMIN_BAN_PROTESTS | ADMIN_BAN_SUBMISSIONS)) {
        $submenu->addMenuItem("Bans", 0, "", "index.php?p=admin&amp;c=bans", true);
    }
    if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_LIST_GROUPS | ADMIN_ADD_GROUP | ADMIN_EDIT_GROUPS | ADMIN_DELETE_GROUPS)) {
        $submenu->addMenuItem("Groups", 0, "", "index.php?p=admin&amp;c=groups", true);
    }
    if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_WEB_SETTINGS)) {
        $submenu->addMenuItem("Settings", 0, "", "index.php?p=admin&amp;c=settings", true);
    }
    if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_LIST_MODS | ADMIN_ADD_MODS | ADMIN_EDIT_MODS | ADMIN_DELETE_MODS)) {
        $submenu->addMenuItem("Mods", 0, "", "?p=admin&amp;c=mods", true);
    }
    SubMenu($submenu->getMenuArray());
}
/**
 * Displays the pagetabs
 *
 * @return noreturn
 */
function BuildPageTabs()
{
    global $userbank;
    AddTab("Главная", "index.php?p=home", "Главная страница.");
    AddTab("Банлист", "index.php?p=banlist", "Список всех банов.");
    AddTab("Серверы", "index.php?p=servers", "Список всех серверов");
    if ($GLOBALS['config']['config.enablesubmit'] == "1") {
        AddTab("Запрос бан", "index.php?p=submit", "На этой странице Вы можете предложить демо или скриншот предполагаемого читера. Админы рассмотрят заявку.");
    }
    if ($GLOBALS['config']['config.enableprotest'] == "1") {
        AddTab("Протест бана", "index.php?p=protest", "На этой странице Вы можете опротестовать бан, и доказать свою невиновность.");
    }
    if ($userbank->is_admin()) {
        AddTab(" Админцентр ", "index.php?p=admin", "Административный центр SourceBans. Тут Вы можете управлять админами, группами, серверами, банами и т.д.");
    }
    include INCLUDES_PATH . "/CTabsMenu.php";
    // BUILD THE SUB-MENU's FOR ADMIN PAGES
    $submenu = new CTabsMenu();
    if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_LIST_ADMINS | ADMIN_ADD_ADMINS | ADMIN_EDIT_ADMINS | ADMIN_DELETE_ADMINS)) {
        $submenu->addMenuItem("Админы", 0, "", "index.php?p=admin&amp;c=admins", true);
    }
    if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_LIST_SERVERS | ADMIN_ADD_SERVER | ADMIN_EDIT_SERVERS | ADMIN_DELETE_SERVERS)) {
        $submenu->addMenuItem("Серверы", 0, "", "index.php?p=admin&amp;c=servers", true);
    }
    if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_ADD_BAN | ADMIN_EDIT_OWN_BANS | ADMIN_EDIT_GROUP_BANS | ADMIN_EDIT_ALL_BANS | ADMIN_BAN_PROTESTS | ADMIN_BAN_SUBMISSIONS)) {
        $submenu->addMenuItem("Баны", 0, "", "index.php?p=admin&amp;c=bans", true);
    }
    if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_LIST_GROUPS | ADMIN_ADD_GROUP | ADMIN_EDIT_GROUPS | ADMIN_DELETE_GROUPS)) {
        $submenu->addMenuItem("Группы", 0, "", "index.php?p=admin&amp;c=groups", true);
    }
    if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_WEB_SETTINGS)) {
        $submenu->addMenuItem("Настройки", 0, "", "index.php?p=admin&amp;c=settings", true);
    }
    if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_LIST_MODS | ADMIN_ADD_MODS | ADMIN_EDIT_MODS | ADMIN_DELETE_MODS)) {
        $submenu->addMenuItem("МОДы", 0, "", "?p=admin&amp;c=mods", true);
    }
    SubMenu($submenu->getMenuArray());
}
            }
            $modTabMenu->outputMenu();
            // ====================[ ADMIN SIDE MENU END ] ===================
            $mod_list = $GLOBALS['db']->GetAll("SELECT * FROM `" . DB_PREFIX . "_mods` WHERE mid > 0 ORDER BY name ASC");
            $query = $GLOBALS['db']->GetRow("SELECT COUNT(mid) AS cnt FROM `" . DB_PREFIX . "_mods`");
            $mod_count = $query['cnt'];
            include TEMPLATES_PATH . "/admin.mods.php";
            RewritePageTitle("Управление МОДами");
        } elseif ($_GET['o'] == 'edit') {
            $modTabMenu = new CTabsMenu();
            $modTabMenu->addMenuItem("Назад", 0, "", "javascript:history.go(-1);", true);
            $modTabMenu->outputMenu();
            include TEMPLATES_PATH . "/admin.edit.mod.php";
            RewritePageTitle("Редактировать детали МОДа");
        }
    } elseif ($_GET['c'] == "settings") {
        CheckAdminAccess(ADMIN_OWNER | ADMIN_WEB_SETTINGS);
        // ====================[ ADMIN SIDE MENU START ] ===================
        $settingsTabMenu = new CTabsMenu();
        if ($userbank->HasAccess(ADMIN_OWNER | ADMIN_WEB_SETTINGS)) {
            $settingsTabMenu->addMenuItem("Главные настройки", 0);
            $settingsTabMenu->addMenuItem("Опции", 3);
        }
        $settingsTabMenu->addMenuItem("Шаблоны", 1);
        $settingsTabMenu->addMenuItem("Системный лог", 2);
        $settingsTabMenu->outputMenu();
        // ====================[ ADMIN SIDE MENU END ] ===================
        include TEMPLATES_PATH . "/admin.settings.php";
        RewritePageTitle("Настройки SourceBans");
    }
}
 * @link http://www.sourcebans.net
 * 
 * @version $Id: page.youraccount.php 200 2008-12-31 12:33:17Z peace-maker $
 * =============================================================================
 */
global $userbank, $theme;
if (!defined("IN_SB")) {
    echo "You should not be here. Only follow links!";
    die;
}
if ($userbank->GetAid() == -1) {
    echo "You shoudnt be here. looks like we messed up ><";
    die;
}
$groupsTabMenu = new CTabsMenu();
$groupsTabMenu->addMenuItem("Просмотр прав", 0);
$groupsTabMenu->addMenuItem("Сменить пароль", 1);
$groupsTabMenu->addMenuItem("Пароль сервера", 2);
$groupsTabMenu->addMenuItem("Сменить e-mail", 3);
$groupsTabMenu->outputMenu();
$res = $GLOBALS['db']->Execute("SELECT `srv_password`, `email` FROM `" . DB_PREFIX . "_admins` WHERE `aid` = '" . $userbank->GetAid() . "'");
$srvpwset = !empty($res->fields['srv_password']) ? true : false;
$theme->assign('srvpwset', $srvpwset);
$theme->assign('email', $res->fields['email']);
$theme->assign('user_aid', $userbank->GetAid());
$theme->assign('web_permissions', BitToString($userbank->GetProperty("extraflags")));
$theme->assign('server_permissions', SmFlagsToSb($userbank->GetProperty("srv_flags")));
$theme->assign('min_pass_len', MIN_PASS_LENGTH);
$theme->left_delimiter = "-{";
$theme->right_delimiter = "}-";
$theme->display('page_youraccount.tpl');
Пример #6
0
 * @link http://www.sourcebans.net
 * 
 * @version $Id: page.youraccount.php 200 2008-12-31 12:33:17Z peace-maker $
 * =============================================================================
 */
global $userbank, $theme;
if (!defined("IN_SB")) {
    echo "You should not be here. Only follow links!";
    die;
}
if ($userbank->GetAid() == -1) {
    echo "You shoudnt be here. looks like we messed up ><";
    die;
}
$groupsTabMenu = new CTabsMenu();
$groupsTabMenu->addMenuItem("View Permissions", 0);
$groupsTabMenu->addMenuItem("Change Password", 1);
$groupsTabMenu->addMenuItem("Server Password", 2);
$groupsTabMenu->addMenuItem("Change Email", 3);
$groupsTabMenu->outputMenu();
$res = $GLOBALS['db']->Execute("SELECT `srv_password`, `email` FROM `" . DB_PREFIX . "_admins` WHERE `aid` = '" . $userbank->GetAid() . "'");
$srvpwset = !empty($res->fields['srv_password']) ? true : false;
$theme->assign('srvpwset', $srvpwset);
$theme->assign('email', $res->fields['email']);
$theme->assign('user_aid', $userbank->GetAid());
$theme->assign('web_permissions', BitToString($userbank->GetProperty("extraflags")));
$theme->assign('server_permissions', SmFlagsToSb($userbank->GetProperty("srv_flags")));
$theme->assign('min_pass_len', MIN_PASS_LENGTH);
$theme->left_delimiter = "-{";
$theme->right_delimiter = "}-";
$theme->display('page_youraccount.tpl');