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
This commit is contained in:
Brendan Heywood
2020-04-06 22:08:33 +10:00
parent 26bb3c24d2
commit d71752df93
2 changed files with 12 additions and 13 deletions
+8 -9
View File
@@ -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);
}
+4 -4
View File
@@ -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'] = '<p>The <em>No authentication</em> plugin is not intended for production sites. Please disable it unless this is a development test site.</p>';
$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'] = '<p>The <em>No authentication</em> plugin is not intended for production sites. Please disable it unless this is a development test site.</p>';
$string['checknoautherror'] = 'The No authentication plugin cannot be used on production sites.';
$string['checknoauth'] = 'No authentication';
$string['checknoauthok'] = 'The no authentication plugin is disabled.';