This commit is contained in:
the-djmaze 2022-03-09 13:11:28 +01:00
parent f4cd25f8ad
commit accf860796
4 changed files with 22 additions and 3 deletions

View file

@ -259,7 +259,14 @@ class AppUser extends AbstractApp {
}
logout() {
Remote.request('Logout', () => rl.logoutReload());
Remote.request('Logout', () => {
const customLogoutLink = Settings.app('customLogoutLink');
if (customLogoutLink) {
((window.parent && Settings.app('inIframe')) ? window.parent : window).location.href = customLogoutLink;
} else {
rl.logoutReload()
}
});
}
bootstart() {

View file

@ -675,7 +675,9 @@ class Actions
'adminHostUse' => '' !== $oConfig->Get('security', 'admin_panel_host', ''),
'adminPath' => $oConfig->Get('security', 'admin_panel_key', '') ?: 'admin',
'adminAllowed' => (bool)$oConfig->Get('security', 'allow_admin_panel', true),
) : array());
) : array(
'customLogoutLink' => $oConfig->Get('labs', 'custom_logout_link', ''),
));
}
public function AppData(bool $bAdmin): array

View file

@ -373,6 +373,8 @@ Enables caching in the system'),
'curl_proxy_auth' => array(''),
'in_iframe' => array(false),
'force_https' => array(false),
'custom_login_link' => array(''),
'custom_logout_link' => array(''),
'http_client_ip_check_proxy' => array(false),
'fast_cache_memcache_host' => array('127.0.0.1'),
'fast_cache_memcache_port' => array(11211),

View file

@ -53,7 +53,7 @@ abstract class Service
if ($oConfig->Get('labs', 'force_https', false) && !$oHttp->IsSecure())
{
\header('Location: https://'.$oHttp->GetHost(false, false).$oHttp->GetUrl());
exit(0);
exit;
}
$sQuery = \trim($_SERVER['QUERY_STRING'] ?? '');
@ -140,6 +140,14 @@ abstract class Service
if ($bIndex)
{
if (!$bAdmin) {
$login = $oConfig->Get('labs', 'custom_login_link', '');
if ($login && !$oActions->getAccountFromToken(false)) {
\header("Location: {$login}");
exit;
}
}
// if (!\SnappyMail\HTTP\SecFetch::isEntering()) {
\header('Content-Type: text/html; charset=utf-8');
$oHttp->ServerNoCache();