function show()
 {
     global $CONF, $LNG;
     if (filter_var(Config::get('forum_url'), FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED)) {
         HTTP::sendHeader('Location', Config::get('forum_url'));
     } else {
         $this->printMessage($LNG['bad_forum_url']);
     }
 }
Esempio n. 2
0
 function show()
 {
     global $LNG;
     $boardUrl = Config::get()->forum_url;
     if (filter_var($boardUrl, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED)) {
         HTTP::sendHeader('Location', $boardUrl);
     } else {
         $this->printMessage($LNG['bad_forum_url']);
     }
 }
Esempio n. 3
0
 function BannerError($Message)
 {
     HTTP::sendHeader('Content-type', 'image/jpg');
     $im = imagecreate(450, 80);
     $text_color = imagecolorallocate($im, 233, 14, 91);
     imagestring($im, 3, 5, 5, $Message, $text_color);
     imagejpeg($im);
     imagedestroy($im);
     exit;
 }
Esempio n. 4
0
 public function isValid()
 {
     if ($this->getAccount() != 0) {
         return $this->getAccount();
     }
     if (!empty($_GET['error_reason'])) {
         HTTP::redirectTo('index.php');
     }
     HTTP::sendHeader('Location', $this->fbObj->getLoginUrl(array('scope' => 'publish_stream,publish_actions,user_games_activity', 'redirect_uri' => HTTP_PATH . 'index.php?page=externalAuth&method=facebook')));
     exit;
 }
Esempio n. 5
0
 function BannerError($Message)
 {
     HTTP::sendHeader('Content-type', 'image/jpg');
     $im = ImageCreate(450, 80);
     $background_color = ImageColorAllocate($im, 255, 255, 255);
     $text_color = ImageColorAllocate($im, 233, 14, 91);
     ImageString($im, 3, 5, 5, $Message, $text_color);
     ImageJPEG($im);
     imagedestroy($im);
     exit;
 }
Esempio n. 6
0
 public function __construct()
 {
     $this->oidObj = new LightOpenID(PROTOCOL . HTTP_HOST);
     if (!$this->oidObj->mode) {
         if (isset($_REQUEST['openid_identifier'])) {
             $this->oidObj->identity = $_REQUEST['openid_identifier'];
             $this->oidObj->required = array('namePerson/friendly', 'contact/email', 'pref/language');
             $this->oidObj->optional = array('namePerson');
             HTTP::sendHeader('Location', $this->oidObj->authUrl());
             exit;
         } else {
             HTTP::redirectTo('index.php?code=4');
         }
     }
 }
Esempio n. 7
0
set_error_handler('errorHandler');
require 'includes/classes/ArrayUtil.class.php';
require 'includes/classes/Cache.class.php';
require 'includes/classes/Database.class.php';
require 'includes/classes/Config.class.php';
require 'includes/classes/class.FleetFunctions.php';
require 'includes/classes/HTTP.class.php';
require 'includes/classes/Language.class.php';
require 'includes/classes/PlayerUtil.class.php';
require 'includes/classes/Session.class.php';
require 'includes/classes/Universe.class.php';
require 'includes/classes/class.theme.php';
require 'includes/classes/class.template.php';
require 'includes/vars.php';
// Say Browsers to Allow ThirdParty Cookies (Thanks to morktadela)
HTTP::sendHeader('P3P', 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
define('AJAX_REQUEST', HTTP::_GP('ajax', 0));
$THEME = new Theme();
if (MODE === 'INSTALL') {
    return;
}
if (!file_exists('includes/config.php')) {
    HTTP::redirectTo('install/index.php');
}
if (defined('DATABASE_VERSION') && DATABASE_VERSION === 'OLD') {
    /* For our old Admin panel */
    require 'includes/classes/Database_BC.class.php';
    $DATABASE = new Database_BC();
    $dbTableNames = Database::get()->getDbTableNames();
    $dbTableNames = array_combine($dbTableNames['keys'], $dbTableNames['names']);
    foreach ($dbTableNames as $dbAlias => $dbName) {
Esempio n. 8
0
<?php

define('MODE', 'CRON');
define('ROOT_PATH', str_replace('\\', '/', dirname(__FILE__)) . '/');
set_include_path(ROOT_PATH);
require 'includes/common.php';
// Output transparent gif
HTTP::sendHeader('Cache-Control', 'no-cache');
HTTP::sendHeader('Content-Type', 'image/gif');
HTTP::sendHeader('Expires', '0');
$isSessionActive = $SESSION->isActiveSession();
echo "GIF89a€!ù,D;";
if (!$isSessionActive) {
    exit;
}
$cronjobID = HTTP::_GP('cronjobID', 0);
if (empty($cronjobID)) {
    exit;
}
require 'includes/classes/Cronjob.class.php';
$cronjobsTodo = Cronjob::getNeedTodoExecutedJobs();
if (!in_array($cronjobID, $cronjobsTodo)) {
    exit;
}
Cronjob::execute($cronjobID);
function exceptionHandler($exception)
{
    global $CONF;
    if (!headers_sent()) {
        if (!class_exists('HTTP', false)) {
            require_once 'includes/classes/HTTP.class.php';
        }
        HTTP::sendHeader('HTTP/1.1 503 Service Unavailable');
    }
    if (method_exists($exception, 'getSeverity')) {
        $errno = $exception->getSeverity();
    } else {
        $errno = E_USER_ERROR;
    }
    $errorType = array(E_ERROR => 'ERROR', E_WARNING => 'WARNING', E_PARSE => 'PARSING ERROR', E_NOTICE => 'NOTICE', E_CORE_ERROR => 'CORE ERROR', E_CORE_WARNING => 'CORE WARNING', E_COMPILE_ERROR => 'COMPILE ERROR', E_COMPILE_WARNING => 'COMPILE WARNING', E_USER_ERROR => 'USER ERROR', E_USER_WARNING => 'USER WARNING', E_USER_NOTICE => 'USER NOTICE', E_STRICT => 'STRICT NOTICE', E_RECOVERABLE_ERROR => 'RECOVERABLE ERROR');
    try {
        if (!class_exists('Config', false)) {
            throw new Exception("No config class");
        }
        $VERSION = Config::get('VERSION');
    } catch (Exception $e) {
        if (file_exists(ROOT_PATH . 'install/VERSION')) {
            $VERSION = file_get_contents(ROOT_PATH . 'install/VERSION') . ' (FILE)';
        } else {
            $VERSION = 'UNKNOWN';
        }
    }
    try {
        if (!class_exists('Config', false)) {
            throw new Exception("No config class");
        }
        $gameName = Config::get('game_name');
    } catch (Exception $e) {
        $gameName = '-';
    }
    $DIR = MODE == 'INSTALL' ? '..' : '.';
    ob_start();
    echo '<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="de" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="de" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="de" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="de" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="de" class="no-js"> <!--<![endif]-->
<head>
	<title>' . $errorType[$errno] . '</title>
	<meta name="generator" content="2Moons ' . $VERSION . '">
	<!-- 
		This website is powered by 2Moons ' . $VERSION . '
		2Moons is a free Space Browsergame initially created by Jan Kr�pke and licensed under GNU/GPL.
		2Moons is copyright 2009-2013 of Jan Kröpke. Extensions are copyright of their respective owners.
		Information and contribution at http://2moons.cc/
	-->
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body id="overview" class="full">
<style>
body {
    background:#0F0F3D;
    color:#ffffff;
    font-family:courier;
    font-size:12pt;
    text-align:center;
    margin:100px;
}

blink {
    color:yellow;
}

.neg {
    background:#fff;
    color:#0F0F3D;
    padding:2px 8px;
    font-weight:bold;
}

p {
    margin:30px 100px;
    text-align:left;
}

a,a:hover {
    color:inherit;
    font:inherit;
}

.menu {
    text-align:center;
    margin-top:50px;
}
</style>

<span class="neg">' . $errorType[$errno] . '</span>
<p>Seems something went wrong! Copy paste this error and send via Support Ticket, so we can fix this issue.</p>

		<p class="left">
			<b>Issue: </b>' . $exception->getMessage() . '<br>
			<b>File: </b>' . $exception->getFile() . ' (Line ' . $exception->getLine() . ')<br>
			<b>URL: </b>' . PROTOCOL . HTTP_HOST . $_SERVER['REQUEST_URI'] . '<br>
			<b>PHP: Version </b>' . PHP_VERSION . ' [ ' . php_sapi_name() . ' ]<br>
			<b>MySQL: </b>' . mysqli_get_client_info() . '<br><br>
			<b>Debug Track:</b><br>' . makebr(htmlspecialchars($exception->getTraceAsString())) . '
		</p>

		<div class="menu">
<a href="' . $DIR . '/game.php">Return to Game</a> | 
<a href="' . $DIR . '/game.php?page=ticket">Contact Support Ticket</a> 
</div>

</body>
</html>';
    echo str_replace(array('\\', ROOT_PATH, substr(ROOT_PATH, 0, 15)), array('/', '/', 'FILEPATH '), ob_get_clean());
    $errorText = date("[d-M-Y H:i:s]", TIMESTAMP) . ' ' . $errorType[$errno] . ': "' . strip_tags($exception->getMessage()) . "\"\r\n";
    $errorText .= 'File: ' . $exception->getFile() . ' | Line: ' . $exception->getLine() . "\r\n";
    $errorText .= 'URL: ' . PROTOCOL . HTTP_HOST . $_SERVER['REQUEST_URI'] . ' | Version: ' . $VERSION . "\r\n";
    $errorText .= "Stack trace:\r\n";
    $errorText .= str_replace(ROOT_PATH, '/', htmlspecialchars(str_replace('\\', '/', $exception->getTraceAsString()))) . "\r\n";
    if (is_writable('includes/error.log')) {
        file_put_contents('includes/error.log', $errorText, FILE_APPEND);
    }
}
Esempio n. 10
0
 * @version 1.7.3 (2013-05-19)
 * @info $Id: userpic.php 2643 2013-03-26 17:13:31Z slaver7 $
 * @link http://2moons.cc/
 */
define('MODE', 'BANNER');
define('ROOT_PATH', str_replace('\\', '/', dirname(__FILE__)) . '/');
set_include_path(ROOT_PATH);
if (!extension_loaded('gd')) {
    clearGIF();
}
require 'includes/common.php';
$id = HTTP::_GP('id', 0);
if (!isModulAvalible(MODULE_BANNER) || $id == 0) {
    clearGIF();
}
$LNG = new Language();
$LNG->getUserAgentLanguage();
$LNG->includeData(array('L18N', 'BANNER', 'CUSTOM'));
require 'includes/classes/class.StatBanner.php';
$banner = new StatBanner();
$Data = $banner->GetData($id);
if (!isset($Data) || !is_array($Data)) {
    clearGIF();
}
$ETag = md5(implode('', $Data));
header('ETag: ' . $ETag);
if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $ETag) {
    HTTP::sendHeader('HTTP/1.0 304 Not Modified');
    exit;
}
$banner->CreateUTF8Banner($Data);
Esempio n. 11
0
function exceptionHandler($exception)
{
    /** @var $exception ErrorException|Exception */
    if (!headers_sent()) {
        if (!class_exists('HTTP', false)) {
            require_once 'includes/classes/HTTP.class.php';
        }
        HTTP::sendHeader('HTTP/1.1 503 Service Unavailable');
    }
    if (method_exists($exception, 'getSeverity')) {
        $errno = $exception->getSeverity();
    } else {
        $errno = E_USER_ERROR;
    }
    $errorType = array(E_ERROR => 'ERROR', E_WARNING => 'WARNING', E_PARSE => 'PARSING ERROR', E_NOTICE => 'NOTICE', E_CORE_ERROR => 'CORE ERROR', E_CORE_WARNING => 'CORE WARNING', E_COMPILE_ERROR => 'COMPILE ERROR', E_COMPILE_WARNING => 'COMPILE WARNING', E_USER_ERROR => 'USER ERROR', E_USER_WARNING => 'USER WARNING', E_USER_NOTICE => 'USER NOTICE', E_STRICT => 'STRICT NOTICE', E_RECOVERABLE_ERROR => 'RECOVERABLE ERROR');
    if (file_exists(ROOT_PATH . 'install/VERSION')) {
        $VERSION = file_get_contents(ROOT_PATH . 'install/VERSION') . ' (FILE)';
    } else {
        $VERSION = 'UNKNOWN';
    }
    $gameName = '-';
    if (MODE !== 'INSTALL') {
        try {
            $config = Config::get();
            $gameName = $config->game_name;
            $VERSION = $config->VERSION;
        } catch (ErrorException $e) {
        }
    }
    $DIR = MODE == 'INSTALL' ? '..' : '.';
    ob_start();
    echo '<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="de" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="de" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="de" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="de" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="de" class="no-js"> <!--<![endif]-->
<head>
	<title>' . $gameName . ' - ' . $errorType[$errno] . '</title>
	<meta name="generator" content="2Moons ' . $VERSION . '">
	<!-- 
		This website is powered by 2Moons ' . $VERSION . '
		2Moons is a free Space Browsergame initially created by Jan Kröpke and licensed under GNU/GPL.
		2Moons is copyright 2009-2013 of Jan Kröpke. Extensions are copyright of their respective owners.
		Information and contribution at http://2moons.cc/
	-->
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="' . $DIR . '/styles/resource/css/base/boilerplate.css?v=' . $VERSION . '">
	<link rel="stylesheet" type="text/css" href="' . $DIR . '/styles/resource/css/ingame/main.css?v=' . $VERSION . '">
	<link rel="stylesheet" type="text/css" href="' . $DIR . '/styles/resource/css/base/jquery.css?v=' . $VERSION . '">
	<link rel="stylesheet" type="text/css" href="' . $DIR . '/styles/theme/gow/formate.css?v=' . $VERSION . '">
	<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
	<script type="text/javascript">
	var ServerTimezoneOffset = -3600;
	var serverTime 	= new Date(2012, 2, 12, 14, 43, 36);
	var startTime	= serverTime.getTime();
	var localTime 	= serverTime;
	var localTS 	= startTime;
	var Gamename	= document.title;
	var Ready		= "Fertig";
	var Skin		= "' . $DIR . '/styles/theme/gow/";
	var Lang		= "de";
	var head_info	= "Information";
	var auth		= 3;
	var days 		= ["So","Mo","Di","Mi","Do","Fr","Sa"] 
	var months 		= ["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"] ;
	var tdformat	= "[M] [D] [d] [H]:[i]:[s]";
	var queryString	= "";

	setInterval(function() {
		serverTime.setSeconds(serverTime.getSeconds()+1);
	}, 1000);
	</script>
	<script type="text/javascript" src="' . $DIR . '/scripts/base/jquery.js?v=2123"></script>
	<script type="text/javascript" src="' . $DIR . '/scripts/base/jquery.ui.js?v=2123"></script>
	<script type="text/javascript" src="' . $DIR . '/scripts/base/jquery.cookie.js?v=2123"></script>
	<script type="text/javascript" src="' . $DIR . '/scripts/base/jquery.fancybox.js?v=2123"></script>
	<script type="text/javascript" src="' . $DIR . '/scripts/base/jquery.validationEngine.js?v=2123"></script>
	<script type="text/javascript" src="' . $DIR . '/scripts/base/tooltip.js?v=2123"></script>
	<script type="text/javascript" src="' . $DIR . '/scripts/game/base.js?v=2123"></script>
</head>
<body id="overview" class="full">
<table width="960">
	<tr>
		<th>' . $errorType[$errno] . '</th>
	</tr>
	<tr>
		<td class="left">
			<b>Message: </b>' . $exception->getMessage() . '<br>
			<b>File: </b>' . $exception->getFile() . '<br>
			<b>Line: </b>' . $exception->getLine() . '<br>
			<b>URL: </b>' . PROTOCOL . HTTP_HOST . $_SERVER['REQUEST_URI'] . '<br>
			<b>PHP-Version: </b>' . PHP_VERSION . '<br>
			<b>PHP-API: </b>' . php_sapi_name() . '<br>
			<b>MySQL-Cleint-Version: </b>' . mysqli_get_client_info() . '<br>
			<b>2Moons Version: </b>' . $VERSION . '<br>
			<b>Debug Backtrace:</b><br>' . makebr(htmlspecialchars($exception->getTraceAsString())) . '
		</td>
	</tr>
</table>
</body>
</html>';
    echo str_replace(array('\\', ROOT_PATH, substr(ROOT_PATH, 0, 15)), array('/', '/', 'FILEPATH '), ob_get_clean());
    $errorText = date("[d-M-Y H:i:s]", TIMESTAMP) . ' ' . $errorType[$errno] . ': "' . strip_tags($exception->getMessage()) . "\"\r\n";
    $errorText .= 'File: ' . $exception->getFile() . ' | Line: ' . $exception->getLine() . "\r\n";
    $errorText .= 'URL: ' . PROTOCOL . HTTP_HOST . $_SERVER['REQUEST_URI'] . ' | Version: ' . $VERSION . "\r\n";
    $errorText .= "Stack trace:\r\n";
    $errorText .= str_replace(ROOT_PATH, '/', htmlspecialchars(str_replace('\\', '/', $exception->getTraceAsString()))) . "\r\n";
    if (is_writable('includes/error.log')) {
        file_put_contents('includes/error.log', $errorText, FILE_APPEND);
    }
}