Пример #1
0
 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');
     }
 }
Пример #2
0
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);
    }
}
Пример #3
0
 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();
     }
 }
Пример #4
0
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');
    }
}
Пример #5
0
function requireOwnership()
{
    if (doesHaveOwnership()) {
        return true;
    }
    requireLogin();
    return false;
}
Пример #6
0
function requireDomainAdmin()
{
    $userId = requireLogin();
    if (!isDomainAdmin()) {
        header('HTTP/1.1 403 Forbidden: Not a domain administrator');
        exit;
    }
    return $userId;
}
Пример #7
0
 public function start()
 {
     requireLogin();
     if ($_GET['act'] == '1') {
         $this->play();
     } else {
         $this->tpl->display('fiftyfifty/5050.tpl');
     }
 }
Пример #8
0
 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;
 }
Пример #9
0
 public function start()
 {
     //Require login
     requireLogin();
     if (isset($_POST['change_password'])) {
         $this->changePassword();
     } else {
         $this->tpl->display('account_settings.tpl');
     }
 }
Пример #10
0
 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');
     }
 }
Пример #11
0
 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));
         }
     }
 }
Пример #12
0
 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');
     }
 }
Пример #13
0
 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();
     }
 }
Пример #14
0
 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');
 }
Пример #15
0
 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');
     }
 }
Пример #16
0
 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();
     }
 }
Пример #17
0
 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');
     }
 }
Пример #18
0
 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));
         }
     }
 }
Пример #19
0
 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();
     }
 }
Пример #20
0
 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();
     }
 }
Пример #21
0
 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');
 }
Пример #22
0
 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();
     }
 }
Пример #23
0
 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();
     }
 }
Пример #24
0
 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');
     }
 }
Пример #25
0
<?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>

Пример #26
0
 public function start()
 {
     //Require login
     requireLogin();
     $this->tpl->display('game_statistics.tpl');
 }
Пример #27
0
 public function requireLogin()
 {
     requireLogin();
 }
Пример #28
0
function requireMembership() {
	global $session;
	if (!isLoggedIn()) requireLogin();
	if (!empty($session['id']) && isSessionAuthorized(session_id())) {
		return true;
	}
	return false;
}
Пример #29
0
 * 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;
Пример #30
0
 public function __construct(&$db, &$tpl, &$player = 0)
 {
     //Require the user to be logged in
     requireLogin();
     $tpl->display('city.tpl');
 }