prep login script

This commit is contained in:
Ulf Gebhardt 2013-11-12 17:26:42 +01:00
parent b9ca8585ea
commit fcf8d96acb
3 changed files with 50 additions and 8 deletions

View File

@ -11,11 +11,11 @@ class default_page extends SYSTEM\PAGE\Page {
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PPAGE(),'wizard_details/js/wizard_details.js').'"></script>';
}
private function css (){
return '<link href="lib/bootstrap/css/bootstrap.css" rel="stylesheet">'.
'<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/css/default_page.css').'" rel="stylesheet">'.
'<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/css/font.css').'" rel="stylesheet">';
}
private function css (){
return '<link href="lib/bootstrap/css/bootstrap.css" rel="stylesheet">'.
'<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/css/default_page.css').'" rel="stylesheet">'.
'<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/css/font.css').'" rel="stylesheet">';
}
public function html(){
$vars = array();

View File

@ -37,9 +37,35 @@
</div>
<div class="lifecraft" style="float: right; padding-right: 10px;">
<h3>Login</h3>
<input type="text" class="form-control input-lg" id="username" placeholder="${user_name}"></br>
<input type="password" class="form-control input-lg" id="password" placeholder="${password}"></br>
<input type="submit" class="form-control input-lg" id="login" value="Login">
<form class="textbox" style="padding:10px" id="login_form">
<div class="control-group">
<div class="controls">
<input type="text"
size="30"
style="margin-bottom: 15px;"
id="bt_login_user"
placeholder="${login_username}"
minlength="3" data-validation-minlength-message="${login_username_too_short}"
maxlength="16" data-validation-maxlength-message="${login_username_too_long}"
required data-validation-required-message="${login_username_required}"/>
</div>
<div class="controls">
<input type="password"
size="30"
style="margin-bottom: 15px;"
id="bt_login_password"
placeholder="${login_password}"
minlength="5" data-validation-minlength-message="${login_password_too_short}"
maxlength="16" data-validation-maxlength-message="${login_password_too_long}"
required data-validation-required-message="${login_password_required}"/>
</div>
<div class="help-block"></div>
<input type="hidden" />
<button class="btn" style="clear: left; height: 32px; font-size: 13px;"
type="submit"
id="login_submit">${login_login}</button>
</div>
</form>
</div>
</div>
<div style="clear: both;"></div>

View File

@ -14,6 +14,22 @@ var wizard_state = '';
$(document).ready(function() {
$("#login_form input").not("[type=submit]").jqBootstrapValidation({
preventSubmit: true,
submitError: function($form, event, errors) {},
submitSuccess: function($form, event){
$.get('./api.php?call=account&action=login&username='+$('#bt_login_user').val()+'&password_sha='+$.sha1($('#bt_login_password').val())+'&password_md5='+$.md5($('#bt_login_password').val()), function (data) {
if(data == 1){
$('.help-block').html("Login successfull.</br>");
location.reload(true);
} else {
$('.help-block').html("Login not successfull.</br> User & Password combination wrong.")
}
});
event.preventDefault();
}
});
register_menu ();
$('#back a').click(function() {