I am using a jquery function with .post for logging in. This function works in Chrome & IE but not firefox. With firefox I have to try login more than once. The username & password are cache so I am not typing them each time.
$('#submit_login').click(function(e){
$userLogin = $('#user_login_name').val();
$userPassword = $('#user_password').val();
//alert("in submit login" + $userLogin );
$.post("login_ldap.php", {userLogin: $userLogin, userPassword: $userPassword})
.done(function(data, status){
//alert("success");
console.log("Data: " + data + '\nStatus: ' + status);
})
.fail(function(xhr, textStatus, errorThrown) {
alert("Login error");
$("#login_error").text("Login Failed").delay(90000).fadeIn();
console.log("The following error occured: "+ xhr.responseText + " textStatus= " + textStatus + " xhr.error= " + xhr.error + " errorThrown= " +errorThrown);
console.log(e);
//$('#login_error').empty().append(xhr.responseText);
})
.always(function() {
//alert("finished");
});
});
login_ldap.php
try {
echo bricks_usersDB::login_ldap($userLogin, $userPassword);
}
catch ( Exception $e ) {
echo "\nLOGIN ERROR: " . $e->getMessage();
error_log($e->getMessage());
# added header to send error back
header("HTTP/1.0 404 Not Found");
exit();
}