<?php
session_start();
include '../inc/config.php';
require_once ('../language/'.$row['language'].'.php');

$_GET = security::escape($_GET);
$_POST = security::escape($_POST);

$text = '<title>Admin Panel- Session error</title>
'.$styleSettings.'
         <table class="defaultUpdate" style="width:470px; margin-left: -250px;margin-top: -100px;position: absolute;left: 50%;top: 50%;" border="0" cellspacing="0" cellpadding="4"><td>
'.LANG_LOGOUT_LOGOUT1.'
</td></table>';


if(!empty($_SESSION['username'])) {
$username = $_SESSION['username'];


$abfrage = "SELECT username, passwort FROM ".DBPrefix."login WHERE username LIKE '$username' LIMIT 1";
$ergebnis = mysql_query($abfrage);
$row = mysql_fetch_assoc($ergebnis);

if($username == $row['username']) {
	session_destroy();
?>
<title>Admin Panel- Logout</title>
<?php echo $styleSettings; ?>
         <table class="defaultUpdate" style="width:470px; margin-left: -250px;margin-top: -100px;position: absolute;left: 50%;top: 50%;" border="0" cellspacing="0" cellpadding="4"><td>
<?php echo LANG_LOGOUT_LOGOUT; ?>
</td></table>
<?php
 }
else{
echo $text;
 }
}
else{
	echo $text;
}