public function start() { requireLogin(); if (isset($_GET['act'])) { if ($_GET['act'] == 'withdraw') { $this->withdraw(); } else { if ($_GET['act'] == 'deposit') { $this->deposit(); } else { if ($_GET['act'] == 'install') { $this->install(); } else { if ($_GET['act'] == 'uninstall') { $this->uninstall(); } else { $this->tpl->display('bank.tpl'); } } } } } else { $this->tpl->display('bank.tpl'); } }
function force_login() { $realm = defined('AUTH_REALM') ? AUTH_REALM : null; $validUser = defined('AUTH_USER') ? AUTH_USER : null; $validPass = defined('AUTH_PASS') ? AUTH_PASS : null; if (empty($realm)) { return; } if (empty($validUser)) { return; } if (empty($validPass)) { return; } // Just a random id $nonce = uniqid(); // Get the digest from the http header $digest = getDigest(); // If there was no digest, show login if (is_null($digest)) { requireLogin($realm, $nonce); } $digestParts = digestParse($digest); // Based on all the info we gathered we can figure out what the response should be $A1 = md5("{$validUser}:{$realm}:{$validPass}"); $A2 = md5("{$_SERVER['REQUEST_METHOD']}:{$digestParts['uri']}"); $validResponse = md5("{$A1}:{$digestParts['nonce']}:{$digestParts['nc']}:{$digestParts['cnonce']}:{$digestParts['qop']}:{$A2}"); if ($digestParts['response'] != $validResponse) { requireLogin($realm, $nonce); } }
public function start() { requireLogin(); if (isset($_GET['act'])) { switch ($_GET['act']) { case 'license': $this->buyLicense(); break; case 'buy': $this->buyMines(); break; case 'market': $this->sell(); break; case 'mine': $this->mine(); break; case 'install': $this->install(); break; case 'uninstall': $this->uninstall(); break; default: $this->home(); break; } } else { $this->home(); } }
function probeAdmin() { // prevents unauthorised access to the CMS pages...called on the controllers for these pages... requireLogin(); if ($_SESSION['role'] != 'admin') { header('Location: ?page=stream'); } }
function requireOwnership() { if (doesHaveOwnership()) { return true; } requireLogin(); return false; }
function requireDomainAdmin() { $userId = requireLogin(); if (!isDomainAdmin()) { header('HTTP/1.1 403 Forbidden: Not a domain administrator'); exit; } return $userId; }
public function start() { requireLogin(); if ($_GET['act'] == '1') { $this->play(); } else { $this->tpl->display('fiftyfifty/5050.tpl'); } }
public function __construct(&$db, &$tpl, &$player = 0) { //If your module does not need the player to be logged in, you can remove this requireLogin() function call. requireLogin(); //Save the variables to the class so they can be used in other class methods. $this->db = $db; $this->tpl = $tpl; $this->player = $player; }
public function start() { //Require login requireLogin(); if (isset($_POST['change_password'])) { $this->changePassword(); } else { $this->tpl->display('account_settings.tpl'); } }
public function start() { //Require login requireLogin(); if (isset($_POST['change_password'])) { $this->changePassword(); } elseif (isset($_POST['change_language'])) { $this->changeLanguage(); } else { $query = $this->db->execute('SELECT * FROM `<ezrpg>settings` WHERE `optionscode` =?', array("language")); $language = $this->db->fetchAll($query); $this->tpl->assign('language', $language); $this->tpl->display('account_settings.tpl'); } }
public function start() { //Require login requireLogin(); //If the form was submitted, process it in register(). if (isset($_POST['stat']) && $this->player->stat_points > 0) { $this->spend(); } else { if ($this->player->stat_points > 0) { $this->tpl->display('statpoints.tpl'); } else { $msg = 'You don\'t have any stat points left!'; header('Location: index.php?msg=' . urlencode($msg)); } } }
public function start() { //Require the user to be logged in requireLogin(); if (isset($_GET['act']) && $_GET['act'] == 'clear') { $this->clear(); } else { //Retrieve all log messages $query = $this->db->execute('SELECT `time`, `message`, `status` FROM `<ezrpg>player_log` WHERE `player`=? ORDER BY `time` DESC LIMIT 10', array($this->player->id)); $logs = $this->db->fetchAll($query); //Update log message statuses to old/read (status value: 1) $this->db->execute('UPDATE `<ezrpg>player_log` SET `status`=1 WHERE `player`=?', array($this->player->id)); $this->tpl->assign('logs', $logs); $this->tpl->display('log.tpl'); } }
public function start() { requireLogin(); if ($_GET['act'] == 'sell') { if ($_GET['move'] == 'dosell') { $this->dosell(); } else { $this->tpl->display('market/sell.tpl'); } } elseif ($_GET['act'] == 'buy') { $this->buy(); } elseif ($_GET['act'] == 'remove') { $this->del(); } else { $this->marketlist(); } }
public function start() { //Require login requireLogin(); if (isset($_GET['page'])) { $page = intval($_GET['page']) > 0 ? intval($_GET['page']) : 0; } else { $page = 0; } $query = $this->db->execute('SELECT `username`, `level` FROM `<ezrpg>players` ORDER BY `id` ASC LIMIT ?,50', array($page * 50)); $members = $this->db->fetchAll($query); $prevpage = $page - 1 >= 0 ? $page - 1 : 0; $this->tpl->assign('nextpage', ++$page); $this->tpl->assign('prevpage', $prevpage); $this->tpl->assign('members', $members); $this->tpl->display('members.tpl'); }
public function start() { requireLogin(); if (isset($_GET['act'])) { if ($_GET['act'] == 'heal') { $this->heal(); } else { if ($_GET['act'] == 'adrenaline') { $this->adrenaline(); } else { $this->tpl->display('healer.tpl'); } } } else { $this->tpl->display('hospital.tpl'); } }
public function start() { requireLogin(); if ($this->player->ban_forum == 1) { $msg = 'Du wurdest aus den Forum verbant!'; header('Location: index.php?msg=' . urlencode($msg)); exit; } if (isset($_GET['act'])) { switch ($_GET['act']) { case 'cat': $this->cat(); break; case 'topic': $this->topic(); break; case 'createTopic': $this->createTopic(); break; case 'addTopic': $this->addTopic(); break; case 'read': $this->read(); break; case 'addReply': $this->addReply(); break; case 'deltopic': $this->deltopic(); break; case 'topicon': $this->topicon(); break; case 'topicoff': $this->topicoff(); break; default: $this->home(); break; } } else { $this->home(); } }
public function start() { requireLogin(); //Name of the different jobs $work_strength = 'Warehouse Worker'; $work_vitality = 'Fitness Specialist'; $work_agility = 'Athlete'; $work_dexterity = 'Thief'; if (isset($_GET['work'])) { $this->work(); } else { $this->tpl->assign('work_strength', $work_strength); $this->tpl->assign('work_vitality', $work_vitality); $this->tpl->assign('work_agility', $work_agility); $this->tpl->assign('work_dexterity', $work_dexterity); $this->tpl->display('job.tpl'); } }
public function __construct(&$db, &$tpl, &$player = 0) { //Require login requireLogin(); //If the form was submitted, process it in register(). if ($_POST['stat'] && $player->stat_points > 0) { $this->db = $db; //$this->tpl = $tpl; #Not used in spend() $this->player = $player; $this->spend(); } else { if ($player->stat_points > 0) { $tpl->display('statpoints.tpl'); } else { $msg = 'You don\'t have any stat points left!'; header('Location: index.php?msg=' . urlencode($msg)); } } }
public function start() { requireLogin(); if (isset($_GET['act'])) { if ($_GET['act'] == 'go') { $this->attackuser(); } else { if ($_GET['act'] == 'install') { $this->install(); } else { if ($_GET['act'] == 'uninstall') { $this->uninstall(); } else { $this->listOpponent(); } } } } else { $this->listOpponent(); } }
public function start() { requireLogin(); if (isset($_GET['act'])) { if ($_GET['act'] == 'battle') { $this->battle(); } else { if ($_GET['act'] == 'install') { $this->install(); } else { if ($_GET['act'] == 'uninstall') { $this->uninstall(); } else { $this->listBots(); } } } } else { $this->listBots(); } }
public function start() { //Require login requireLogin(); switch ($_GET['order']) { case 'money': $order = 'money'; break; case 'bank': $order = 'bank'; break; case 'level': // falls through // falls through default: $order = 'level'; } $query = $this->db->execute('SELECT `username`, `level`, `money`, `bank` FROM `<ezrpg>players` ORDER BY ' . $order . ' DESC LIMIT 10'); $members = $this->db->fetchAll($query); $this->tpl->assign('members', $members); $this->tpl->display('topplayers.tpl'); }
public function start() { //Require login requireLogin(); if (isset($_GET['act'])) { switch ($_GET['act']) { case 'use': $this->useItem(); break; case 'install': $this->install(); break; case 'uninstall': $this->uninstall(); break; default: $this->home(); break; } } else { $this->home(); } }
public function start() { requireLogin(); if (isset($_GET['act'])) { switch ($_GET['act']) { case 'read': $this->readmail(); break; case 'compose': $this->compose(); break; case 'delete': $this->delete(); break; case 'showmail': $this->showmail(); break; case 'install': $this->install(); break; case 'send': $this->send(); break; case 'outbox': $this->outbox(); break; case 'deleteall': $this->deleteall(); break; default: $this->showmail(); break; } } else { $this->showmail(); } }
public function __construct(&$db, &$tpl, &$player = 0) { //Require the user to be logged in requireLogin(); if ($_GET['act'] == 'clear') { $this->db = $db; //$this->tpl = $tpl; #Not used in clear() $this->player = $player; $this->clear(); } else { //Retrieve all log messages $query = $db->execute('SELECT time, message, status FROM <ezrpg>player_log WHERE player=? ORDER BY time DESC LIMIT 10', array($player->id)); $logs = array(); if ($db->numRows($query) > 0) { while ($l = $db->fetch($query)) { $logs[] = $l; } } //Update log message statuses to old/read (status value: 1) $db->execute('UPDATE <ezrpg>player_log SET status=1 WHERE player=?', array($player->id)); $tpl->assign('logs', $logs); $tpl->display('log.tpl'); } }
<?php define('COOKIE_SESSION', true); require_once "db.php"; session_start(); requireLogin(); userMenu(); flashMessages(); if (!isset($_GET['id'])) { $_SESSION['err'] = 'Missing value for id'; header('Location: error.php'); return; } $sql = sprintf("SELECT name,lkey,id FROM LTI_Courses WHERE id=%s AND key_id=%s", $db->quote($_GET['id']), $CFG->localkeyid); $q = $db->query($sql); $course = $q->fetch(); if (!$course) { $_SESSION['error'] = 'Bad value for id'; header('Location: error.php'); return; } ?> <iframe name="basicltiLaunchFrame" id="basicltiLaunchFrame" src="launch.php?id=<?php echo $_GET['id']; ?> " width="100%" height="600" scrolling="auto" frameborder="1" transparency> <p>frames_required</p> </iframe>
public function start() { //Require login requireLogin(); $this->tpl->display('game_statistics.tpl'); }
public function requireLogin() { requireLogin(); }
function requireMembership() { global $session; if (!isLoggedIn()) requireLogin(); if (!empty($session['id']) && isSessionAuthorized(session_id())) { return true; } return false; }
* Steps to perform: * 1. Require elements from the elements folder * 2. Unserialize posted gridelement * 3. Create update array if validator is ok * 4. Create update statements for each row * 5. execute update statements */ $root = $_SERVER['DOCUMENT_ROOT']; /* * Imports trough SmartLibs */ $debug = 1; require_once '../../JPFLibs.php'; libadd("lib.JPF.Data.MySQL"); libadd("lib.JPF"); requireLogin(0); if ($handle = opendir('Elements')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && $file != ".svn") { require_once "Elements/{$file}/{$file}.php"; } } } if (isset($_POST["printbutton"])) { } // Find out how many updates should be performed (one per value) //$updateCount = $_POST["toUpdateCount"]; // Find out the type for the update (datatable) $varchar = isset($_POST["varcharID"]); $UpdateArr = array(); $i = 0;
public function __construct(&$db, &$tpl, &$player = 0) { //Require the user to be logged in requireLogin(); $tpl->display('city.tpl'); }