This repository has been archived on 2025-04-04. You can view files and clone it, but cannot push or open issues or pull requests.
2016-04-18 01:43:35 +02:00

38 lines
1.3 KiB
JavaScript

$(document).ready(function() {
new SYSTEM('./api.php',1,'start');
register_login();
register_logout();
});
function register_login(){
$("#form_login 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){
window.location.reload();
} else {
$('#help-block-user-password-combi-wrong').attr('style', 'display: block;');
}
});
event.preventDefault();
}
});
}
function register_logout(){
$('#btn_logout').click(function(){
$.get('./api.php?call=account&action=logout', function () {
window.location.reload();
});
})
}
function encode_utf8(c) {
return unescape(encodeURIComponent(c));
}
function decode_utf8(c) {
return decodeURIComponent(escape(c));
}