Exemplo n.º 1
0
function hook_new_logs(&$db, &$tpl, &$player, $args = 0)
{
    if (LOGGED_IN == true) {
        $tpl->assign('new_logs', checkLog($player->id, $db));
    }
    return $args;
}
Exemplo n.º 2
0
function EmailErrorHandler($FXErrorObj)
{
    //if error not written to log
    if (checkLog() == false) {
        //send email to admins
        EmailError($FXErrorObj->message);
    }
    //write it
    writeLog($FXErrorObj->message);
    if (DISPLAY_ERROR_MESSAGES) {
        echo $FXErrorObj->message;
    }
    return true;
}
Exemplo n.º 3
0
    if (!empty($_msg)) {
        $tpl->assign('GET_MSG', $_msg);
    }
}
$player = 0;
//Check if user logged in
$session_check = sha1($_SESSION['userid'] . $_SERVER['REMOTE_ADDR'] . SECRET_KEY);
if ($_SESSION['hash'] == $session_check) {
    //Select player details
    $player = $db->fetchRow("SELECT * FROM <ezrpg>players WHERE id=?", array($_SESSION['userid']));
    $tpl->assign('player', $player);
    //Set logged in flag
    define('LOGGED_IN', true);
    $tpl->assign('LOGGED_IN', 'TRUE');
    //Update last_active value for the player
    $query = $db->execute("UPDATE <ezrpg>players SET last_active=? WHERE id=?", array(time(), $player->id));
    //Check for new log messages and send to template
    $tpl->assign('new_logs', checkLog($player->id, $db));
} else {
    if (isset($_SESSION['hash'])) {
        unset($_SESSION['hash']);
    }
    if (isset($_SESSION['userid'])) {
        unset($_SESSION['userid']);
    }
    define('LOGGED_IN', false);
}
//Online players
$query = $db->fetchRow("SELECT COUNT(id) AS count FROM <ezrpg>players WHERE last_active>?", array(time() - 60 * 5));
$online = $query->count;
$tpl->assign('ONLINE', $online);
<?php

// Output message boxes for not user-only areas or empty carts/inventory.
if (isset($boxMsg)) {
    foreach ($boxMsg as $m) {
        echo "<table class = 'boxMsg'><td><p class='logMsg'>" . $m . "</p></td></table>";
    }
}
if (isset($errMsg)) {
    foreach ($errMsg as $m) {
        echo "<table class = 'boxMsg'><td><p class='errMsg'>" . $m . "</p></td></table>";
    }
}
checkLog();
ob_end_flush();
Exemplo n.º 5
0
header("Content-type: text/html; charset={$charset}");
///////////////////////////////////////////////////////////
// load active installed blades ///////////////////////////
foreach ($razorArray['active-bladepack'] as $bladePack) {
    if (file_exists(getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BLADEPACK_DIR . $bladePack . '.php')) {
        include_once getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BLADEPACK_DIR . $bladePack . '.php';
    }
}
///////////////////////////////////////////////////////////
// edit razor array ///////////////////////////////////////
BsocketB('admin-edit-razorarray', array(&$razorArray));
///////////////////////////////////////////////////////////
//  login  //
if (!isset($_SESSION['adminLogIn'])) {
    if (isset($_POST['user']) && $_POST['user'] != '' && isset($_POST['pass']) && $_POST['pass'] != '') {
        if (!checkLog()) {
            if ($_POST['user'] == RAZOR_SADMIN_USER and createHash($_POST['pass'], substr(RAZOR_SADMIN_PASS, 0, strlen(RAZOR_SADMIN_PASS) / 2), 'sha1') == RAZOR_SADMIN_PASS) {
                $_SESSION['loginTimeStamp'] = $ts = time();
                $_SESSION['adminLogIn'] = sha1($_SERVER['REMOTE_ADDR'] . RAZOR_SADMIN_USER . $ts . $_SERVER['HTTP_USER_AGENT']);
                $_SESSION['adminType'] = 'sadmin';
            } elseif ($_POST['user'] == RAZOR_ADMIN_USER and createHash($_POST['pass'], substr(RAZOR_ADMIN_PASS, 0, strlen(RAZOR_ADMIN_PASS) / 2), 'sha1') == RAZOR_ADMIN_PASS) {
                $_SESSION['loginTimeStamp'] = $ts = time();
                $_SESSION['adminLogIn'] = sha1($_SERVER['REMOTE_ADDR'] . RAZOR_ADMIN_USER . $ts . $_SERVER['HTTP_USER_AGENT']);
                $_SESSION['adminType'] = 'admin';
            } elseif ($_POST['user'] == RAZOR_USER_USER and createHash($_POST['pass'], substr(RAZOR_USER_PASS, 0, strlen(RAZOR_USER_PASS) / 2), 'sha1') == RAZOR_USER_PASS) {
                $_SESSION['loginTimeStamp'] = $ts = time();
                $_SESSION['adminLogIn'] = sha1($_SERVER['REMOTE_ADDR'] . RAZOR_USER_USER . $ts . $_SERVER['HTTP_USER_AGENT']);
                $_SESSION['adminType'] = 'user';
            } else {
                loginLog();
            }