<?php
session_start();
include_once('sessionhelpers.inc.php');
$connection = connect();
$ufro = 'SELECT status from '.$usertabell.' WHERE Session = \'' . session_id() . '\'';
$result = mysql_query ($ufro, $connection);
$ausgabe = mysql_fetch_object ($result);
if ( isset($_POST['login']) ) {
$userid = check_user($_POST['username'], $_POST['userpass']);
if ( $userid ) {
login($userid);
} else {
echo '<p>Deng Daten waren falsch!</p>';
}
}
if ( !logged_in() ) { ?>
<form method="post" action="<?php $PHP_SELF ?>">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><label>Usernumm:</label></td>
</tr>
<tr>
<td><input name="username" type="text" /></td>
</tr>
<tr>
<td><label>Passwuerd:</label></td>
</tr>
<tr>
<td><input name="userpass" type="password" id="userpass" /></td>
</tr>
<tr>
<td><input name="login" type="submit" id="login" value="Einloggen" /></td>
</tr>
</table>
</form>
<?php
} elseif ($ausgabe->status == 'admin') { ?>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="index.php?section=user&art=main">Internen Bereich </a></td>
</tr>
<tr>
<td>Memberen</td>
</tr>
<tr>
<td><a href="index.php?section=admin&art=main">Adminpanel</a></td>
</tr>
<tr>
<td><a href="index.php?section=user&art=logout">Logout</a></td>
</tr>
</table>
<?php } else { ?>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="index.php?section=user&art=main">Internen Bereich </a></td>
</tr>
<tr>
<td>Memberen</td>
</tr>
<tr>
<td><a href="index.php?section=user&art=logout">Logout</a></td>
</tr>
</table>
<?php } ?>