Page MenuHomePhorge

D5890.1779388648.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D5890.1779388648.diff

diff --git a/plugins/kolab/kolab.php b/plugins/kolab/kolab.php
--- a/plugins/kolab/kolab.php
+++ b/plugins/kolab/kolab.php
@@ -44,6 +44,7 @@
$this->add_hook('startup', [$this, 'startupHook']);
$this->add_hook('login_after', [$this, 'loginAfterHook']);
+ $this->add_hook('logout_after', [$this, 'logoutAfterHook']);
$this->add_hook('kolab_2fa_password', [$this, 'kolab2faPassword']);
// Load features and let them do the whole work
@@ -87,6 +88,14 @@
// Read the plugin config, we try to not do this in init()
$this->load_config();
+ // On logout (or when the session expired)...
+ if ($args['task'] == 'logout') {
+ if (!empty($_SESSION['oauth_token'])) {
+ // Remember, because the token will be gone in the logoutAfterHook
+ $this->isSsoSession = true;
+ }
+ }
+
// Load localization
$this->add_texts('localization/', false);
@@ -116,6 +125,20 @@
return $args;
}
+ /**
+ * Handler for 'logout_after' hook
+ */
+ public function logoutAfterHook($args): array
+ {
+ if ($this->isSsoSession) {
+ $rc = \rcube::get_instance();
+ if ($rc->output) {
+ $rc->output->redirect("https://kolab.klab.cc/logout");
+ }
+ }
+ return $args;
+ }
+
/**
* Handler for 'kolab_2fa_password' hook
*

File Metadata

Mime Type
text/plain
Expires
Thu, May 21, 6:37 PM (11 m, 11 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18929525
Default Alt Text
D5890.1779388648.diff (1 KB)

Event Timeline