From 6aff4fde5ce0fb0980bcbc281c869ada8cf4fc33 Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Tue, 19 Sep 2023 22:09:44 +0200 Subject: [PATCH] Allow overriding the interface_base_url for password reset mails, #6580 --- install/tpl/config.inc.php.master | 1 + interface/web/login/password_reset.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/install/tpl/config.inc.php.master b/install/tpl/config.inc.php.master index aa9329fb7b..faed5b8454 100644 --- a/install/tpl/config.inc.php.master +++ b/install/tpl/config.inc.php.master @@ -158,6 +158,7 @@ $conf['timezone'] = '{timezone}'; //** Misc. $conf['interface_logout_url'] = ''; // example: http://www.domain.tld/ +$conf['interface_base_url'] = ''; // example: http://www.domain.tld (no trailing slash) //** Auto Load Modules diff --git a/interface/web/login/password_reset.php b/interface/web/login/password_reset.php index 659075483c..78ec9624b3 100644 --- a/interface/web/login/password_reset.php +++ b/interface/web/login/password_reset.php @@ -84,6 +84,9 @@ if(isset($_POST['username']) && is_string($_POST['username']) && $_POST['usernam else $server_domain = 'https://' . $server_domain; if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != '443') $server_domain .= ':' . $_SERVER['SERVER_PORT']; + if (!empty($conf['interface_base_url'])) { + $server_domain = $conf['interface_base_url']; + } $app->uses('getconf,ispcmail'); $server_config_array = $app->getconf->get_global_config(); -- GitLab