1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| <script>
$(document).ready(function(){
var is_COOKIE_expired = 'no';
function check_COOKIE()
{
$.ajax({
url:"includes/check_session.php",
method:"POST",
success:function(data)
{
if(data == '1')
{
$('#loginModal').modal({
backdrop: 'static',
keyboard: false,
});
is_COOKIE_expired = 'yes';
}
}
})
}
var count_interval = setInterval(function(){
check_COOKIE();
if(is_COOKIE_expired == 'yes')
{
clearInterval(count_interval);
}
}, 10000);
$('#login_form').on('submit', function(event){
event.preventDefault();
$.ajax({
url:"includes/relogin.php",
method:"POST",
data:$(this).serialize(),
success:function(data){
// if(data == 'ERREUR')
if(data.indexOf("ERREUR") != -1)
{
// alert('ERREUR !');
$('#error_message').html('MOT DE PASSE INVALIDE !');
}
else
{
$('.modal-backdrop').remove();
$('#loginModal').hide();
}
}
});
});
});
</script> |
Partager