From d71752df93c5783cf38da3fdadd4e66000905970 Mon Sep 17 00:00:00 2001 From: Brendan Heywood Date: Mon, 6 Apr 2020 21:44:29 +1000 Subject: [PATCH] MDL-67818 auth_none: Moved to improved Check API AMOS BEGIN MOV [check_noauth_details,auth_none],[checknoauthdetails,auth_none] MOV [check_noauth_error,auth_none],[checknoautherror,auth_none] MOV [check_noauth_name,auth_none],[checknoauthname,auth_none] MOV [check_noauth_ok,auth_none],[checknoauthok,auth_none] AMOS END --- auth/none/classes/check/noauth.php | 17 ++++++++--------- auth/none/lang/en/auth_none.php | 8 ++++---- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/auth/none/classes/check/noauth.php b/auth/none/classes/check/noauth.php index 87384a204fe..7e57907f434 100644 --- a/auth/none/classes/check/noauth.php +++ b/auth/none/classes/check/noauth.php @@ -39,12 +39,12 @@ use core\check\result; class noauth extends \core\check\check { /** - * Constructor + * A link to a place to action this + * + * @return action_link */ - public function __construct() { - $this->id = 'noauth'; - $this->name = get_string('check_noauth_name', 'auth_none'); - $this->actionlink = new \action_link( + public function get_action_link(): ?\action_link { + return new \action_link( new \moodle_url('/admin/settings.php?section=manageauths'), get_string('authsettings', 'admin')); } @@ -54,15 +54,14 @@ class noauth extends \core\check\check { * @return result */ public function get_result(): result { - if (is_enabled_auth('none')) { $status = result::ERROR; - $summary = get_string('check_noauth_error', 'auth_none'); + $summary = get_string('checknoautherror', 'auth_none'); } else { $status = result::OK; - $summary = get_string('check_noauth_ok', 'auth_none'); + $summary = get_string('checknoauthok', 'auth_none'); } - $details = get_string('check_noauth_details', 'auth_none'); + $details = get_string('checknoauthdetails', 'auth_none'); return new result($status, $summary, $details); } diff --git a/auth/none/lang/en/auth_none.php b/auth/none/lang/en/auth_none.php index 34a2a24ad66..4ae197501d9 100644 --- a/auth/none/lang/en/auth_none.php +++ b/auth/none/lang/en/auth_none.php @@ -25,7 +25,7 @@ $string['auth_nonedescription'] = 'Users can sign in and create valid accounts immediately, with no authentication against an external server and no confirmation via email. Be careful using this option - think of the security and administration problems this could cause.'; $string['pluginname'] = 'No authentication'; $string['privacy:metadata'] = 'The No authentication plugin does not store any personal data.'; -$string['check_noauth_details'] = '

The No authentication plugin is not intended for production sites. Please disable it unless this is a development test site.

'; -$string['check_noauth_error'] = 'The No authentication plugin cannot be used on production sites.'; -$string['check_noauth_name'] = 'No authentication'; -$string['check_noauth_ok'] = 'The no authentication plugin is disabled.'; +$string['checknoauthdetails'] = '

The No authentication plugin is not intended for production sites. Please disable it unless this is a development test site.

'; +$string['checknoautherror'] = 'The No authentication plugin cannot be used on production sites.'; +$string['checknoauth'] = 'No authentication'; +$string['checknoauthok'] = 'The no authentication plugin is disabled.';