Authentication::suspendUser($_POST['user']); $successAlert = 1; } // Deal with unban form if ($_GET['action'] == 'unban' && isset($_POST['unbanID'])) { Authentication::reinstateUser($_POST['unbanID']); $successAlert = 1; } if ($_GET['action'] == 'deactivate' && isset($_POST['uid'])) { Authentication::deactivateUser($_POST['uid']); $successAlert = 1; } } $sqlSuspend = "SELECT * FROM `users` WHERE `suspended` = '0'"; $resultSuspend = openRailwayCore::dbQuery($sqlSuspend); $sqlReinstate = "SELECT * FROM `users` WHERE `suspended` = '1'"; $resultReinstate = openRailwayCore::dbQuery($sqlReinstate); $main = new Template(); $main->set_custom_template("includes/", 'default'); $main->assign_var('ROOT', ROOT); while ($accountSuspend = mysql_fetch_assoc($resultSuspend)) { $main->assign_block_vars('user_loop', array('UID' => $accountSuspend['user_id'], 'NAME' => $accountSuspend['username'], 'SID' => $accountSuspend['staff_id'])); } while ($accountReinstate = mysql_fetch_assoc($resultReinstate)) { $main->assign_block_vars('user_sus_loop', array('UID' => $accountReinstate['user_id'], 'NAME' => $accountReinstate['username'], 'SID' => $accountReinstate['staff_id'])); } if (mysql_num_rows($resultReinstate) == 0) { $main->assign_block_vars('if_no_results', array()); } $main->set_filenames(array('main' => "usr_ban.html")); $main->display('main');
<?php include "config.php"; session_start(); openRailwayCore::initialisation(); openRailwayCore::dbConnect(); Authentication::blockPageToVisitors(); // Process login info section $ipAddr = $_SESSION['user_ip']; $loginTime = date('l jS F Y H:i:s T', $_SESSION['log_in_time']); use phpbrowscap\Browscap; $bc = new Browscap(FROOT . "cache"); // $browser = $bc->getBrowser(); COMMENTED OUT AS XAMPP DOES NOT SUPPORT openRailwayCore::pageHeader("Your dashboard"); $template = new Template(); $template->set_custom_template("theme/" . STYLE, 'default'); $template->assign_var('IP_ADDR', $ipAddr); $template->assign_var('LOGTIME', $loginTime); if (isset($browser['parent']) && isset($browser['platform'])) { $template->assign_var('BRWSR', $browser['parent'] . " on " . $browser['platform']); } $template->set_filenames(array('body' => 'home.html')); $template->display('body'); openRailwayCore::pageFooter();
/** * Activates a user * @param string $token The user activation token */ public static function activateUser($token) { $query = "SELECT * FROM " . USERS_TABLE . " WHERE `activation_key` = '" . $token . "'"; $result = openRailwayCore::dbQuery($query); $row = mysql_fetch_assoc($result); if (mysql_num_rows($result) == 0) { header("Location: " . ROOT . "user.php?mode=activate&l=fail"); } elseif (isset($row['user_id'])) { // Activate user $query = "UPDATE " . USERS_TABLE . " SET `activated` = '1' WHERE `user_id` = '" . $row['user_id'] . "'"; $result = openRailwayCore::dbQuery($query); header("Location: " . ROOT . "index.php?l=reauth"); openRailwayCore::logEvent(time(), openRailwayCore::createInteractionIdentifier(), null, 4, 1, "User (UID:" . $row['user_id'] . ") account activated"); // Get Staff Member details $query = "SELECT * FROM " . STAFF_MASTER_TABLE . " WHERE `staff_id` = '" . $row['staff_id'] . "'"; $result = openRailwayCore::dbQuery($query); $staff = mysql_fetch_assoc($result); // Get Access Level Desc $query = "SELECT * FROM " . ACCESS_TABLE . " WHERE `access_level` = '" . $row['access_level'] . "'"; $result = openRailwayCore::dbQuery($query); $access = mysql_fetch_assoc($result); // Alert user of activation $template = new Template(); $template->set_custom_template("lib/emails", 'default'); $template->assign_var('URL', ROOT); $template->assign_var('NAME', $staff['first_name'] . " " . $staff['surname']); $template->assign_var('USERNAME', $row['username']); $template->assign_var('ACCESS_LEVEL', $access['level_description']); $template->assign_var('LEVEL', $row['access_level']); $template->set_filenames(array('email' => 'after-activation.txt')); echo mail($staff['email'], "openRailway Account Activated", $template->display('email'), "From: no-reply@openrailway"); } else { header("Location: " . ROOT . "user.php?mode=activate&l=fail"); } }
/** * Displays the page footer */ public static function pageFooter() { global $railway_name; $template = new Template(); $template->set_custom_template(FROOT . 'theme/' . STYLE, 'default'); $template->assign_var('RAILWAY_NAME', $railway_name); $template->assign_var('CURRENT_YEAR', gmdate("Y")); $template->assign_var('ROOT', ROOT); $template->set_filenames(array('foot' => 'footer.html')); $template->display('foot'); }
} // And finally, load the relevant language files include $phpbb_root_path . 'language/' . $language . '/common.' . $phpEx; include $phpbb_root_path . 'language/' . $language . '/acp/common.' . $phpEx; include $phpbb_root_path . 'language/' . $language . '/acp/board.' . $phpEx; include $phpbb_root_path . 'language/' . $language . '/install.' . $phpEx; include $phpbb_root_path . 'language/' . $language . '/posting.' . $phpEx; $mode = request_var('mode', 'overview'); $sub = request_var('sub', ''); // Set PHP error handler to ours set_error_handler('msg_handler'); $user = new user(); $auth = new auth(); $cache = new cache(); $template = new Template(); $template->set_custom_template('../adm/style', 'admin'); $template->assign_var('T_TEMPLATE_PATH', '../adm/style'); $install = new module(); $install->create('install', "index.{$phpEx}", $mode, $sub); $install->load(); // Generate the page $install->page_header(); $install->generate_navigation(); $template->set_filenames(array('body' => $install->get_tpl_name())); $install->page_footer(); /** * @package install */ class module { var $id = 0;