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] = '';
|
$_SESSION['AUTH'][1] = '';
|
||||||
|
|
||||||
|
|
||||||
/* [1] On recherche un entrepot avec ce nom
|
/* [1] On recherche un administrateur avec ce nom
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$getUsername = new Repo('admin/getByUsername', [
|
$getUsername = new Repo('admin/getByUsername', [
|
||||||
$_SESSION['WAREHOUSE']['id'],
|
$_SESSION['WAREHOUSE']['id'],
|
||||||
|
|
|
@ -90,6 +90,17 @@
|
||||||
color: #F64247;
|
color: #F64247;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#FORM > #logout{
|
||||||
|
color: #888;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#FORM > #logout:hover{
|
||||||
|
text-decoration: underline;
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<body style='background-color: <?= $_SESSION['WAREHOUSE']['theme']; ?>;'>
|
<body style='background-color: <?= $_SESSION['WAREHOUSE']['theme']; ?>;'>
|
||||||
|
|
||||||
|
@ -104,6 +115,7 @@
|
||||||
|
|
||||||
<input type='button' value='AUTHENTIFICATION' id='admin-submit'>
|
<input type='button' value='AUTHENTIFICATION' id='admin-submit'>
|
||||||
<span id='err-box'></span>
|
<span id='err-box'></span>
|
||||||
|
<span id='logout'>Changer d'entrepot</span>
|
||||||
<span></span>
|
<span></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -120,6 +132,7 @@
|
||||||
var aPassword = document.getElementById('admin-password');
|
var aPassword = document.getElementById('admin-password');
|
||||||
var aSubmit = document.getElementById('admin-submit');
|
var aSubmit = document.getElementById('admin-submit');
|
||||||
var errBox = document.getElementById('err-box');
|
var errBox = document.getElementById('err-box');
|
||||||
|
var logout = document.getElementById('logout');
|
||||||
|
|
||||||
aName.focus();
|
aName.focus();
|
||||||
|
|
||||||
|
@ -165,6 +178,26 @@
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
aSubmit.addEventListener('click', handler, false);
|
aSubmit.addEventListener('click', handler, false);
|
||||||
aForm.addEventListener('keypress', 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>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in New Issue