Skip to content

Commit

Permalink
MDL-67818 auth_none: Moved to improved Check API
Browse files Browse the repository at this point in the history
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
  • Loading branch information
brendanheywood committed Apr 6, 2020
1 parent 26bb3c2 commit d71752d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
17 changes: 8 additions & 9 deletions auth/none/classes/check/noauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
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'));
}
Expand All @@ -54,15 +54,14 @@ public function __construct() {
* @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);
}
Expand Down
8 changes: 4 additions & 4 deletions auth/none/lang/en/auth_none.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.';

0 comments on commit d71752d

Please sign in to comment.