Source

Selador / login.php

<?php

/* index.php - Front-end code for the main Selador start 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/>.
 **/


// You definitely want to fit this to your needs.

// Don't forget that the AGPL forces you to make the sources of _your_
// version of Selador available to your users. So if you have changed
// the code, don't just link back to the project web page (unless of
// course you have checked your changes back in :)

$cwd = getcwd ();
ini_set("include_path", $cwd."/php:".$cwd."/php/base:".$cwd."/var/php:.");

require_once ("config.inc.php");

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

if (isset ($_POST['username']))
{
	require_once ("php/auth.php");
	ShowAuth();
}

$webtitle = "Startseite";

if (isset ($_SESSION['world_entered']))
{
	require_once ("land.php");
	die ();
}

if (isset ($_SESSION['authed_user']))
{
	require_once ("portal.php");
	die ();
}

if (!IS_PORTAL && strcmp (MASTERURL, ""))
	header ("Location: ".MASTERURL);
require_once("header_extern.php");

echo '</head>';
require_once("menue.php");
?>
<div id="contentbox" style="text-align:center">
<table class="border">
	<tr>
		<th class="bold" colspan="2">
			Einloggen
		</th>
	</tr>
	<tr>
		<td colspan="2">
		<?php
		if (isset ($login_message))
			echo "<span class=\"error\">".$login_message."</span>";

		if ((strstr ($_SERVER['PHP_SELF'], "index.php")) || (strstr ($_SERVER['PHP_SELF'], "logout.php")))
			$submit_page = "land.php";
		else
			$submit_page = $_SERVER['PHP_SELF'];

		echo "<form action=\"".$submit_page."\" method=\"POST\">\n";
		?>
		</td>
	</tr>
	<tr>
		<td>
			Name
		</td>
		<td>
			<input type ="textarea" class="eingabe" name="username" size="12">
		</td>
	</tr>
	<tr class="iterate">
		<td>
			Kennwort
		</td>
		<td>
			<input type ="password" class="eingabe" name="password" size="12">
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<input  type="submit" name="submit" value="Einloggen!" onclick="">
		</td>
	</tr>
	<tr class="iterate">
		<td colspan="2">
			<a href="lostpw.php" >Passwort vergessen?</a><br>
			<a href="newuser.php" >Neu anmelden</a><br>
		</td>
</table>

		</form><br>

		</td>
	</tr>
</table>
</div>
<?php
require_once("footer_outer.php");
?>