prep login script
This commit is contained in:
parent
b9ca8585ea
commit
fcf8d96acb
@ -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>';
|
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PPAGE(),'wizard_details/js/wizard_details.js').'"></script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
private function css (){
|
private function css (){
|
||||||
return '<link href="lib/bootstrap/css/bootstrap.css" rel="stylesheet">'.
|
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/default_page.css').'" rel="stylesheet">'.
|
||||||
'<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/css/font.css').'" rel="stylesheet">';
|
'<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/css/font.css').'" rel="stylesheet">';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function html(){
|
public function html(){
|
||||||
$vars = array();
|
$vars = array();
|
||||||
|
|||||||
@ -37,9 +37,35 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="lifecraft" style="float: right; padding-right: 10px;">
|
<div class="lifecraft" style="float: right; padding-right: 10px;">
|
||||||
<h3>Login</h3>
|
<h3>Login</h3>
|
||||||
<input type="text" class="form-control input-lg" id="username" placeholder="${user_name}"></br>
|
<form class="textbox" style="padding:10px" id="login_form">
|
||||||
<input type="password" class="form-control input-lg" id="password" placeholder="${password}"></br>
|
<div class="control-group">
|
||||||
<input type="submit" class="form-control input-lg" id="login" value="Login">
|
<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>
|
</div>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
|
|||||||
@ -14,6 +14,22 @@ var wizard_state = '';
|
|||||||
|
|
||||||
$(document).ready(function() {
|
$(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 ();
|
register_menu ();
|
||||||
|
|
||||||
$('#back a').click(function() {
|
$('#back a').click(function() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user