From dd1b8c3b8e21e2c4d74dfdbffeecaec01ad29d26 Mon Sep 17 00:00:00 2001 From: David Woloszyn Date: Tue, 11 Mar 2025 15:57:24 +1100 Subject: [PATCH] MDL-83692 factor_sms: add notification for SMS gateway restriction --- admin/tool/mfa/factor/sms/lang/en/factor_sms.php | 2 +- admin/tool/mfa/factor/sms/settings.php | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/admin/tool/mfa/factor/sms/lang/en/factor_sms.php b/admin/tool/mfa/factor/sms/lang/en/factor_sms.php index f267ca9d867..6840f844fe3 100644 --- a/admin/tool/mfa/factor/sms/lang/en/factor_sms.php +++ b/admin/tool/mfa/factor/sms/lang/en/factor_sms.php @@ -53,7 +53,7 @@ $string['settings:duration_help'] = 'The period of time that the code is valid.' $string['settings:gateway'] = 'SMS gateway'; $string['settings:gateway_help'] = 'The SMS provider you wish to send messages via'; $string['settings:heading'] = 'Users will receive a 6-digit verification code via SMS, which they must enter to complete the login process. Users will need to register their mobile phone number first.'; -$string['settings:setupdesc'] = '

To use SMS as an authentication factor, you first need to set up an SMS gateway.'; +$string['settings:setupdesc'] = 'To use SMS as an authentication factor, you first need to set up an SMS gateway.'; $string['settings:shortdescription'] = 'Require users to enter a code received via SMS during login.'; $string['settings:smsgateway'] = 'SMS gateway'; $string['settings:smsgateway_help'] = 'Select a gateway from the list, or create a new gateway.'; diff --git a/admin/tool/mfa/factor/sms/settings.php b/admin/tool/mfa/factor/sms/settings.php index 8152f23b792..b0e28f77472 100644 --- a/admin/tool/mfa/factor/sms/settings.php +++ b/admin/tool/mfa/factor/sms/settings.php @@ -106,16 +106,10 @@ if ($ADMIN->fulltree) { ); $settings->hide_if('factor_sms/duration', 'factor_sms/enabled'); } else { - $settings->add( - new admin_setting_description( - 'factor_sms/setupdesc', - '', - new lang_string( - 'settings:setupdesc', - 'factor_sms', - $smsconfigureurl, - ), - ), + $notify = new \core\output\notification( + get_string('settings:setupdesc', 'factor_sms', $smsconfigureurl), + \core\output\notification::NOTIFY_WARNING ); + $settings->add(new admin_setting_heading('factor_sms/setupdesc', '', $OUTPUT->render($notify))); } }