Skip to content
Snippets Groups Projects
Commit 286582f8 authored by Demian Katz's avatar Demian Katz
Browse files

Added Site/logOutRoute config setting to control post-logout redirect.

- Progress on VUFIND-982.
parent 0eb55caa
No related merge requests found
...@@ -64,6 +64,9 @@ defaultModule = Search ...@@ -64,6 +64,9 @@ defaultModule = Search
; The base VuFind URL will load the "Home" action of this module when the user ; The base VuFind URL will load the "Home" action of this module when the user
; is logged in: ; is logged in:
defaultLoggedInModule = MyResearch defaultLoggedInModule = MyResearch
; The route VuFind will send users to following a log out operation. Set to false
; or omit to attempt to retain the user's current context after log out.
;logOutRoute = home
; This tab will show by default when a record is viewed: ; This tab will show by default when a record is viewed:
defaultRecordTab= Holdings defaultRecordTab= Holdings
; Hide the holdings tab if no holdings are available from the ILS ; Hide the holdings tab if no holdings are available from the ILS
......
...@@ -257,13 +257,18 @@ class MyResearchController extends AbstractBase ...@@ -257,13 +257,18 @@ class MyResearchController extends AbstractBase
*/ */
public function logoutAction() public function logoutAction()
{ {
$logoutTarget = $this->getRequest()->getServer()->get('HTTP_REFERER'); $config = $this->getConfig();
if (empty($logoutTarget)) { if (isset($config->Site->logOutRoute)) {
$logoutTarget = $this->getServerUrl('home'); $logoutTarget = $this->getServerUrl($config->Site->logOutRoute);
} } else {
$logoutTarget = $this->getRequest()->getServer()->get('HTTP_REFERER');
if (empty($logoutTarget)) {
$logoutTarget = $this->getServerUrl('home');
}
// clear querystring parameters // clear querystring parameters
$logoutTarget = preg_replace('/\?.*/', '', $logoutTarget); $logoutTarget = preg_replace('/\?.*/', '', $logoutTarget);
}
return $this->redirect() return $this->redirect()
->toUrl($this->getAuthManager()->logout($logoutTarget)); ->toUrl($this->getAuthManager()->logout($logoutTarget));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment