[add] Logout uses generic error messages
Refactored some messages from the generic modals
This commit is contained in:
@@ -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');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user