Source

Selador / brain / admin.php

<?php
/* admin.php - Front-end code for the admin page
 *
 * Copyright (C) 2006, 2007, 2008 Kevin Read, Simone Schaefer
 *
 * This file is part of Selador, a browser-based fantasy strategy game
 *
 * This program is distributed under the terms of the GNU Affero General Public License.
 *
 *
 *   Selador is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU Affero General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   any later version.
 *
 *   Selador is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU Affero General Public License for more details.
 *
 *   You should have received a copy of the GNU Affero General Public License
 *   along with Selador.  If not, see <http://www.gnu.org/licenses/>.
 **/

header ("Content-Type: text/html; charset=UTF-8");

$cwd = getcwd ()."/..";
ini_set("include_path", $cwd."/php:".$cwd."/php/base:".$cwd."/var/php:.");
require_once ("privileges.php");
require_once ("GameDB.inc.php");
require_once ("../php/base/config.inc.php");
?>

<html>
<head>
<?php
echo '<title>'.WORLDTITLE.'-Verwaltungswerkzeuge</title>'
?>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<!-- html2xhtml.js written by Jacob Lee <letsgolee@lycos.co.kr> //-->
<script language="JavaScript" type="text/javascript" src="../cbrte/html2xhtml.js"></script>
<script language="JavaScript" type="text/javascript" src="../cbrte/richtext_compressed.js"></script>
<noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
<link type="text/css" href="../styles/sun.css" rel="stylesheet"/>
<style type="text/css">
#error {color:red;font-weight:bold}
</style>
</head>
<body>
<?php
echo '<h2>Selador '.WORLDTITLE.'-Verwaltungsbereich</h2>'
?>
<br/>
<table width="900px">
<tr>

<?php
if (isManagement())
{
	if (IS_PORTAL)
	{
		echo '<td><a href="admin.php?module=portal">Weltübergreifendes</a></td>';
    	echo '<td><a href="admin.php?module=portalusers">Accounts</a></td>';
	}
}

if (!IS_PORTAL)
{
	if (isManagement())
		echo '<td><a href="admin.php?module=overview">&Uuml;bersicht</a></td>';

	if (isWorldAdmin() || isBalancing())
	{
		echo '<td><a href="admin.php?module=users">Spieler</a></td>';
	}

	if (isBalancing())
  	{
		echo '<td><a href="admin.php?module=buildings">Geb&auml;ude</a></td>';
    	echo '<td><a href="admin.php?module=research">Forschungen</a></td>';
    	echo '<td><a href="admin.php?module=units">Einheiten</a></td>';
  	}
}
?>

</tr>
</table>

<div style="height:3px; background-color: black; width:900px;">
</div>

<?php
// DB-Initialisierung
//$dblink = mysql_pconnect (DB_HOST, DB_USER, DB_PASS);
//mysql_select_db (DB_NAME);
$db = GameDB::instance();

if (isset ($_REQUEST['module']))
	$module=$_REQUEST['module'];
else
{
	if (isWorldAdmin())
		$module = "users";
	if (isManagement())
		$module="overview";
	if (isBalancing())
		$module = "buildings";
	if (!$module)
	{
		if (IS_PORTAL || MASTERURL == "")
			$module = "portaladmin";
		else
			$module = "overview";
	}
}

switch ($module)
{
  case 'portal':
  	require_once ("portaladmin.php");
    break;
  case 'portalusers':
  	require_once ("portalusers.php");
    break;
  case 'overview':
  	require_once ("overview.php");
    break;
  case 'buildings':
  case 'research':
  case 'units':
    require_once ("buildings.php");
    break;
  case 'users':
    require_once ("users.php");
    break;
  case 'help':
    require_once ("hilfe-edit.php");
    break;
   case 'locations':
    require_once ("locations.php");
    break;
}

?>

</body>
</html>