[add] Logout uses generic error messages

Refactored some messages from the generic modals
This commit is contained in:
2018-08-12 10:39:44 -06:00
parent 1605b1cea3
commit 0ec20a4c67
2 changed files with 41 additions and 43 deletions

View File

@@ -1,3 +1,7 @@
/**
* Destorys the session for the current user and redirects
* back to the login form
*/
function logout() {
var baseUrl = getbaseUrl();
@@ -8,10 +12,19 @@ function logout() {
success:function(data){
window.location.replace(baseUrl + '/html/login.php');
},
error:function(x) {
if (x.status==500){
$('#modalLoginError').modal('show');
document.getElementById('modalLoginErrorBody').innerHTML = "The user or password didnt match, please try again";
error:function(x,e) {
if (x.status==0) {
$('#modal_error_internet').modal('show');
} else if(x.status==404) {
$('#modal_error_404').modal('show');
} else if(x.status==500) {
$('#modal_error_500').modal('show');
} else if(e=='parsererror') {
$('#modal_error_parsererror').modal('show');
} else if(e=='timeout'){
$('#modal_error_timeout').modal('show');
} else {
$('#modal_error_otro').modal('show');
}
},
});