mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 05:01:43 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
ddfe87a82c
|
@ -292,6 +292,7 @@
|
||||||
- show preview of documents on clipboard
|
- show preview of documents on clipboard
|
||||||
- minor improvements in restapi
|
- minor improvements in restapi
|
||||||
- update layout of tab for attachments
|
- update layout of tab for attachments
|
||||||
|
- remove session when calling logout of restapi
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 5.1.32
|
Changes in version 5.1.32
|
||||||
|
|
|
@ -258,7 +258,24 @@ class RestapiController { /* {{{ */
|
||||||
$userobj = $this->container->userobj;
|
$userobj = $this->container->userobj;
|
||||||
$settings = $this->container->config;
|
$settings = $this->container->config;
|
||||||
|
|
||||||
setcookie("mydms_session", '', time()-3600, $settings->_httpRoot);
|
if(isset($_COOKIE['mydms_session'])) {
|
||||||
|
$dms_session = $_COOKIE["mydms_session"];
|
||||||
|
$db = $dms->getDb();
|
||||||
|
|
||||||
|
$session = new SeedDMS_Session($db);
|
||||||
|
$session->load($dms_session);
|
||||||
|
|
||||||
|
// If setting the user id to 0 worked, it would be a way to logout a
|
||||||
|
// user. It doesn't work because of a foreign constraint in the database
|
||||||
|
// won't allow it. So we keep on deleting the session and the cookie on
|
||||||
|
// logout
|
||||||
|
// $session->setUser(0); does not work because of foreign user constraint
|
||||||
|
|
||||||
|
if(!$session->delete($dms_session)) {
|
||||||
|
UI::exitError(getMLText("logout"),$db->getErrorMsg());
|
||||||
|
}
|
||||||
|
setcookie("mydms_session", '', time()-3600, $settings->_httpRoot);
|
||||||
|
}
|
||||||
return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>''), 200);
|
return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>''), 200);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user