73 lines
1.9 KiB
PHP
73 lines
1.9 KiB
PHP
<?php
|
|
/*
|
|
Author: Riccardo Di Dato
|
|
Creation Date: 13/gen/2016
|
|
*/
|
|
|
|
|
|
require_once(dirname(__FILE__)."/../load.php");
|
|
|
|
GUIHandler::generateHtmlHeaders(array(),true);
|
|
|
|
if (AdminLoginManager::isLogged()) {
|
|
GUIHandler::redirect("admin/index.php");
|
|
}
|
|
|
|
$action = PostHandler::get("action");
|
|
|
|
$errMsg = "";
|
|
if (!is_null($action) && strcmp($action,"login")==0){
|
|
$username = PostHandler::get("username");
|
|
$pass = PostHandler::get("pass");
|
|
|
|
if (!is_null($username) && strcmp($username,"")!=0 && !is_null($pass) && strcmp($pass,"")!=0){
|
|
if (!AdminLoginManager::login($username, $pass)){
|
|
$errMsg = "Invalid Data";
|
|
}
|
|
else {
|
|
|
|
GUIHandler::redirect("admin/index.php");
|
|
}
|
|
}
|
|
}
|
|
echo '<body class="white">';
|
|
// GUIHandler::generateLoadingOverlay();
|
|
|
|
?>
|
|
<div id="login_page">
|
|
<div class="pageHead">
|
|
<img class="scritta" src="../images/admin/header.png" />
|
|
</div>
|
|
<div class="loginArea">
|
|
<div style="text-align:center;">
|
|
<table style="margin-left:auto;margin-right:auto;"><tr><td>
|
|
<div id="loginformdiv">
|
|
<div style="color:red;"><?php echo $errMsg;?></div>
|
|
<form action="" target="_self" method="POST">
|
|
<input type="hidden" name="action" value="login"/>
|
|
<div class="formRow">
|
|
<input type="text" name="username" value="" placeholder="Username"></input>
|
|
</div>
|
|
<div class="formRow">
|
|
<input id="pass_fld" type="password" name="pass" value="" placeholder="Password"></input>
|
|
</div>
|
|
<div class="formBtns">
|
|
<a href="#" onClick="javascript:$('#loginformdiv form').submit();return false;" class="btn">Login</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</td></tr></table>
|
|
</div>
|
|
</div>
|
|
<div class="pageClosure"></div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(document).ready(function () {
|
|
$('#pass_fld').keypress(function(event) {
|
|
if (event.which==13){
|
|
$('#loginformdiv form').submit();
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
</script>
|