Commit bc9544d4 authored by ale's avatar ale

Redirect users to accounts on login failure

Should prevent Roundcube from displaying its own login form when
the SSO ticket expires.
parent b45d0b4f
Pipeline #3189 passed with stages
in 7 minutes and 8 seconds
......@@ -18,6 +18,7 @@ class sso extends rcube_plugin
$this->add_hook('startup', array($this, 'startup'));
$this->add_hook('authenticate', array($this, 'authenticate'));
$this->add_hook('login_after', array($this, 'login'));
$this->add_hook('login_failed', array($this, 'login_failed'));
$this->add_hook('logout_after', array($this, 'logout'));
$this->add_hook('storage_connect', array($this, 'storage_connect'));
}
......@@ -71,6 +72,12 @@ class sso extends rcube_plugin
return $args;
}
function login_failed($args)
{
header('Location: https://accounts.autistici.org/');
exit;
}
function storage_connect($args)
{
if (!empty($_SERVER['SSO_USER']) && !empty($_SERVER['SSO_TICKET'])) {
......
Markdown is supported
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