0
0

Refactored database, refactored config file, corrected login redirection

Moved database function in class "Database";
Corrected database-using webpages accordingly;
Moved config file from PHP to JSON with more config variables;
Corrected login page redirection on wrong username or password.
This commit is contained in:
Bryan Pedini
2019-03-21 12:07:23 +01:00
parent 4eaf1d0829
commit 4a6630bacb
10 changed files with 143 additions and 104 deletions

View File

@@ -1,4 +1,4 @@
function login() {
function login ( ) {
var username = document.getElementById ( "form-username" ).value;
var password = document.getElementById ( "form-password" ).value;
password = SHA512 ( password );
@@ -13,7 +13,7 @@ function login() {
window.location.href = script_name;
}
else {
document.getElementById ( "responsetext" ).innerHTML = response [ 'error_message' ];
console.log ( response [ 'error_message' ] );
}
}
else {
@@ -26,3 +26,11 @@ function login() {
data.append('password', password);
xhr.send( data );
}
$(function ( ) {
$( '.form-group input' ).keyup( function ( e ) {
if ( e.keyCode == 13 ) {
login();
}
});
});