From 0c467e71156092f78ba67e82832df95efd6bdc34 Mon Sep 17 00:00:00 2001 From: peckpeck Date: Thu, 14 Dec 2023 10:08:37 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B07067=20-=20Add=20setting=20to=20change?= =?UTF-8?q?=20default=20"password=20change"=20URL=20(#540)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add a setting to change default "password change" URL * Apply suggestions from code review --------- Co-authored-by: Molkobain --- application/loginform.class.inc.php | 6 +++++- core/config.class.inc.php | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/application/loginform.class.inc.php b/application/loginform.class.inc.php index 683456a41..f1b65f57c 100644 --- a/application/loginform.class.inc.php +++ b/application/loginform.class.inc.php @@ -140,7 +140,11 @@ class LoginForm extends AbstractLoginFSMExtension implements iLoginUIExtension $oLoginContext->AddBlockExtension('login_form_footer', new LoginBlockExtension('extensionblock/loginformfooter.html.twig')); $bEnableResetPassword = MetaModel::GetConfig()->Get('forgot_password'); - $sResetPasswordUrl = utils::GetAbsoluteUrlAppRoot() . 'pages/UI.php?loginop=forgot_pwd'; + $sResetPasswordUrl = MetaModel::GetConfig()->Get('forgot_password.url'); + if ($sResetPasswordUrl == '') + { + $sResetPasswordUrl = utils::GetAbsoluteUrlAppRoot() . 'pages/UI.php?loginop=forgot_pwd'; + } $aData = array( 'bEnableResetPassword' => $bEnableResetPassword, 'sResetPasswordUrl' => $sResetPasswordUrl, diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 9698d9027..59677915f 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -889,6 +889,14 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => false, ], + 'forgot_password.url' => [ + 'type' => 'string', + 'description' => 'Set this value to your "forgot password" service URL if it should be handled out of '.ITOP_APPLICATION_SHORT.'. Note that it will apply to all users (iTop users, LDAP users, ...)', + 'default' => '', + 'value' => '', + 'source_of_value' => '', + 'show_in_conf_sample' => false, + ], 'deadline_format' => [ 'type' => 'string', 'description' => 'The format used for displaying "deadline" attributes: any string with the following placeholders: $date$, $difference$',