aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-07-23 10:42:40 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2020-07-23 10:42:40 +0200
commite0cc95f3aa109134a1eb2b9589b2682bd4fe5d5d (patch)
tree299f2cbf869634a051185eeb34eb1bd81325127a /lib/private/legacy
parent99d0ba5f7ea45bb636cfcfc2de144e25af88b916 (diff)
downloadnextcloud-server-e0cc95f3aa109134a1eb2b9589b2682bd4fe5d5d.tar.gz
nextcloud-server-e0cc95f3aa109134a1eb2b9589b2682bd4fe5d5d.zip
Allow user backends to specify a custom logout url
* Allows SSO backends to do a global logout Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r--lib/private/legacy/OC_User.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/legacy/OC_User.php b/lib/private/legacy/OC_User.php
index c61d99eee74..29c78da6efb 100644
--- a/lib/private/legacy/OC_User.php
+++ b/lib/private/legacy/OC_User.php
@@ -273,6 +273,14 @@ class OC_User {
return $backend->getLogoutUrl();
}
+ $user = \OC::$server->getUserSession()->getUser();
+ if ($user instanceof \OCP\IUser) {
+ $backend = $user->getBackend();
+ if ($backend instanceof \OCP\User\Backend\ICustomLogout) {
+ return $backend->getLogoutUrl();
+ }
+ }
+
$logoutUrl = $urlGenerator->linkToRoute('core.login.logout');
$logoutUrl .= '?requesttoken=' . urlencode(\OCP\Util::callRegister());