Possibilité de déconnection de l'entrepot au moment de la connexion administrateur
This commit is contained in:
parent
6690a6e887
commit
fcd7480ac2
|
@ -79,7 +79,7 @@
|
|||
$_SESSION['AUTH'][1] = '';
|
||||
|
||||
|
||||
/* [1] On recherche un entrepot avec ce nom
|
||||
/* [1] On recherche un administrateur avec ce nom
|
||||
=========================================================*/
|
||||
$getUsername = new Repo('admin/getByUsername', [
|
||||
$_SESSION['WAREHOUSE']['id'],
|
||||
|
|
|
@ -90,6 +90,17 @@
|
|||
color: #F64247;
|
||||
}
|
||||
|
||||
#FORM > #logout{
|
||||
color: #888;
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#FORM > #logout:hover{
|
||||
text-decoration: underline;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
</style>
|
||||
<body style='background-color: <?= $_SESSION['WAREHOUSE']['theme']; ?>;'>
|
||||
|
||||
|
@ -104,6 +115,7 @@
|
|||
|
||||
<input type='button' value='AUTHENTIFICATION' id='admin-submit'>
|
||||
<span id='err-box'></span>
|
||||
<span id='logout'>Changer d'entrepot</span>
|
||||
<span></span>
|
||||
</div>
|
||||
|
||||
|
@ -120,6 +132,7 @@
|
|||
var aPassword = document.getElementById('admin-password');
|
||||
var aSubmit = document.getElementById('admin-submit');
|
||||
var errBox = document.getElementById('err-box');
|
||||
var logout = document.getElementById('logout');
|
||||
|
||||
aName.focus();
|
||||
|
||||
|
@ -165,6 +178,26 @@
|
|||
=========================================================*/
|
||||
aSubmit.addEventListener('click', handler, false);
|
||||
aForm.addEventListener('keypress', handler, false);
|
||||
|
||||
/* [3] Gestion de la déconnexion
|
||||
=========================================================*/
|
||||
logout.addEventListener('click', function(){
|
||||
/* (1) On rédige une requête fausse (pour déconnecter) */
|
||||
var request = {
|
||||
path: 'authentificationDefault/warehouse',
|
||||
name: '-.-',
|
||||
password: ''
|
||||
};
|
||||
|
||||
/* (2) On envoie la requête */
|
||||
api.send(request, function(response){
|
||||
if( response.ModuleError == 0 ){
|
||||
if( response.status == false )
|
||||
document.location = '/';
|
||||
}
|
||||
});
|
||||
|
||||
}, false);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
Loading…
Reference in New Issue