Skip to content

Commit

Permalink
MDL-58793 auth: Fix invalid access to $this in settings.php files
Browse files Browse the repository at this point in the history
It has never been guaranteed that settings.php would always be included
from inside the core\plugininfo\auth::load_settings() scope only.
Alternative fix would be to use $plugininfo->name but I think it is
better to be explicit here (same as we are explicit with setting names,
strings etc).
  • Loading branch information
mudrd8mz committed May 8, 2017
1 parent 48ad736 commit 9f29e45
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion auth/cas/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
}

// Display locking / mapping of profile fields.
$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('cas');
$help = get_string('auth_ldapextrafields', 'auth_ldap');
$help .= get_string('auth_updatelocal_expl', 'auth');
$help .= get_string('auth_fieldlock_expl', 'auth');
Expand Down
2 changes: 1 addition & 1 deletion auth/db/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
new lang_string('auth_dbupdateusers_description', 'auth_db'), 0, $yesno));

// Display locking / mapping of profile fields.
$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('db');
display_auth_lock_options($settings, $authplugin->authtype, $authplugin->userfields,
get_string('auth_dbextrafields', 'auth_db'),
true, true, $authplugin->get_custom_user_profile_fields());
Expand Down
2 changes: 1 addition & 1 deletion auth/email/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
new lang_string('auth_emailrecaptcha', 'auth_email'), 0, $options));

// Display locking / mapping of profile fields.
$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('email');
display_auth_lock_options($settings, $authplugin->authtype, $authplugin->userfields,
get_string('auth_fieldlocks_help', 'auth'), false, false);
}
2 changes: 1 addition & 1 deletion auth/fc/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
get_string('changepasswordhelp', 'auth'), '', PARAM_URL));

// Display locking / mapping of profile fields.
$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('fc');
display_auth_lock_options($settings, $authplugin->authtype, $authplugin->userfields,
get_string('auth_fieldlocks_help', 'auth'), false, false);
}
2 changes: 1 addition & 1 deletion auth/imap/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
get_string('changepasswordhelp', 'auth'), '', PARAM_URL));

// Display locking / mapping of profile fields.
$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('imap');
display_auth_lock_options($settings, $authplugin->authtype, $authplugin->userfields,
get_string('auth_fieldlocks_help', 'auth'), false, false);

Expand Down
2 changes: 1 addition & 1 deletion auth/ldap/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
}

// Display locking / mapping of profile fields.
$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('ldap');
$help = get_string('auth_ldapextrafields', 'auth_ldap');
$help .= get_string('auth_updatelocal_expl', 'auth');
$help .= get_string('auth_fieldlock_expl', 'auth');
Expand Down
2 changes: 1 addition & 1 deletion auth/manual/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
new lang_string('expiration_warning_desc', 'auth_manual'), 0, $expirationwarningoptions));

// Display locking / mapping of profile fields.
$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('manual');
display_auth_lock_options($settings, $authplugin->authtype,
$authplugin->userfields, get_string('auth_fieldlocks_help', 'auth'), false, false);
}
2 changes: 1 addition & 1 deletion auth/nntp/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
get_string('changepasswordhelp', 'auth'), '', PARAM_URL));

// Display locking / mapping of profile fields.
$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('nntp');
display_auth_lock_options($settings, $authplugin->authtype, $authplugin->userfields,
get_string('auth_fieldlocks_help', 'auth'), false, false);
}
2 changes: 1 addition & 1 deletion auth/none/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
new lang_string('auth_nonedescription', 'auth_none')));

// Display locking / mapping of profile fields.
$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('none');
display_auth_lock_options($settings, $authplugin->authtype, $authplugin->userfields,
get_string('auth_fieldlocks_help', 'auth'), false, false);
}
2 changes: 1 addition & 1 deletion auth/oauth2/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
$warning = $OUTPUT->notification(get_string('createaccountswarning', 'auth_oauth2'), 'warning');
$settings->add(new admin_setting_heading('auth_oauth2/pluginname', '', $warning));

$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('oauth2');
display_auth_lock_options($settings, $authplugin->authtype, $authplugin->userfields,
get_string('auth_fieldlocks_help', 'auth'), false, false);
}
2 changes: 1 addition & 1 deletion auth/pam/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
new lang_string('auth_pamdescription', 'auth_pam')));

// Display locking / mapping of profile fields.
$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('pam');
display_auth_lock_options($settings, $authplugin->authtype, $authplugin->userfields,
get_string('auth_fieldlocks_help', 'auth'), false, false);
}
2 changes: 1 addition & 1 deletion auth/pop3/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
get_string('changepasswordhelp', 'auth'), '', PARAM_URL));

// Display locking / mapping of profile fields.
$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('pop3');
display_auth_lock_options($settings, $authplugin->authtype, $authplugin->userfields,
get_string('auth_fieldlocks_help', 'auth'), false, false);
}
2 changes: 1 addition & 1 deletion auth/shibboleth/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
get_string('changepasswordhelp', 'auth'), '', PARAM_URL));

// Display locking / mapping of profile fields.
$authplugin = get_auth_plugin($this->name);
$authplugin = get_auth_plugin('shibboleth');
display_auth_lock_options($settings, $authplugin->authtype, $authplugin->userfields,
'', true, false, $authplugin->get_custom_user_profile_fields());

Expand Down

0 comments on commit 9f29e45

Please sign in to comment.