You've already forked OpenShorte.old
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:
12
js/login.js
12
js/login.js
@@ -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();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user