<?php
include_once 'Auth_simple/Auth_Simple.php';
include_once 'Auth_simple/Session.php';
if($_GET['reset']== 'yes'){
Auth_Simple::__resetAuth();
}
if(Auth_Simple::__chkForFirstEntery() == false){
header('Location: register.php');
}
$sessionOBJ = new Session();
if($sessionOBJ->__isLoggedIn() == false){
if($_POST['go'] == "true"){
if( Auth_Simple::__authenticate($_POST['username'], $_POST['password']) == true){
$sessionOBJ->__login(true);
header('location: index.php');
}
}
}
$theme = "default";
?>
<html>
<head>
<title>Login</title>
<link href="theme/<?php echo $theme;?>/css/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<br/><br/>
<center>
<table cellspacing="5" cellpadding="0" border="0" align="center" id="tbl_global">
<tr>
<td>
<h3>Login: </h3>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
<table cellpadding="2" cellspacing="0" border="0" class="default">
<tr>
<td id="borders">Username: </td><td id="borders"><input type="text" name="username" /></td>
</tr>
<tr>
<td id="borders">Password: </td><td id="borders"><input type="password" name="password" /></td>
</tr>
<tr>
<td id="borders" colspan="2"><input type="submit" value="Log in"><input type="hidden" name="go" value="true"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</center>
</body>
</html>