BIG FIX: session_name with logout ....
This commit is contained in:
parent
bdf119700c
commit
1400d445ee
|
@ -30,6 +30,8 @@
|
||||||
if( !isset($_SESSION['PERM']) ) $_SESSION['PERM'] = [];
|
if( !isset($_SESSION['PERM']) ) $_SESSION['PERM'] = [];
|
||||||
if( !isset($_SESSION['USER']) ) $_SESSION['USER'] = [];
|
if( !isset($_SESSION['USER']) ) $_SESSION['USER'] = [];
|
||||||
if( !isset($_SESSION['ADMIN']) ) $_SESSION['ADMIN'] = [];
|
if( !isset($_SESSION['ADMIN']) ) $_SESSION['ADMIN'] = [];
|
||||||
|
if( !isset($_SESSION['NAME']) ) $_SESSION['NAME'] = '';
|
||||||
|
if( !isset($_SESSION['WS']) ) $_SESSION['WS'] = true;
|
||||||
|
|
||||||
|
|
||||||
/* (2) Gestion de AUTH (authentification)
|
/* (2) Gestion de AUTH (authentification)
|
||||||
|
|
|
@ -52,6 +52,7 @@ class admin{
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
/* (1) Update session */
|
/* (1) Update session */
|
||||||
$_SESSION['TOKEN'] = 'a'.$fetched_admin['token'];
|
$_SESSION['TOKEN'] = 'a'.$fetched_admin['token'];
|
||||||
|
$_SESSION['WS'] = true; // to tell websocket we are connected
|
||||||
new AuthSystemDefault;
|
new AuthSystemDefault;
|
||||||
|
|
||||||
/* (2) Return status */
|
/* (2) Return status */
|
||||||
|
@ -105,4 +106,10 @@ class admin{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function DELETE_logout(){
|
||||||
|
$_SESSION = [];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ class user{
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
/* (1) Update session */
|
/* (1) Update session */
|
||||||
$_SESSION['TOKEN'] = 'u'.$fetched_user['token'];
|
$_SESSION['TOKEN'] = 'u'.$fetched_user['token'];
|
||||||
|
$_SESSION['WS'] = true; // to tell websocket we are connected
|
||||||
new AuthSystemDefault;
|
new AuthSystemDefault;
|
||||||
|
|
||||||
/* (2) Return status */
|
/* (2) Return status */
|
||||||
|
@ -104,4 +105,10 @@ class user{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function DELETE_logout(){
|
||||||
|
$_SESSION = [];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
*/
|
*/
|
||||||
public function load(){
|
public function load(){
|
||||||
|
|
||||||
if( !isset($_SESSION['NAME']) || strlen($_SESSION['NAME']) == 0 ){
|
if( $_SESSION['WS'] || strlen($_SESSION['NAME']) == 0 ){
|
||||||
|
|
||||||
// ask with websocketInterop
|
// ask with websocketInterop
|
||||||
$wsi = new wsinterop('localhost', 9998);
|
$wsi = new wsinterop('localhost', 9998);
|
||||||
|
@ -63,6 +63,8 @@
|
||||||
$wsi->close();
|
$wsi->close();
|
||||||
$wsi = null;
|
$wsi = null;
|
||||||
|
|
||||||
|
$_SESSION['WS'] = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
if( file_exists(__ROOT__."/view/home.php") )
|
if( file_exists(__ROOT__."/view/home.php") )
|
||||||
include __ROOT__."/view/home.php";
|
include __ROOT__."/view/home.php";
|
||||||
|
|
|
@ -25,6 +25,13 @@
|
||||||
"output": {
|
"output": {
|
||||||
"registered": { "description": "UID du nouvel administrateur", "type": "id" }
|
"registered": { "description": "UID du nouvel administrateur", "type": "id" }
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"DELETE logout": {
|
||||||
|
"description": "Déconnexion utilisateur",
|
||||||
|
"permissions": [],
|
||||||
|
"parameters": {},
|
||||||
|
"output": {}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -56,6 +63,13 @@
|
||||||
"output": {
|
"output": {
|
||||||
"registered": { "description": "UID du nouvel utilisateur", "type": "id" }
|
"registered": { "description": "UID du nouvel utilisateur", "type": "id" }
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"DELETE logout": {
|
||||||
|
"description": "Déconnexion utilisateur",
|
||||||
|
"permissions": [],
|
||||||
|
"parameters": {},
|
||||||
|
"output": {}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue