MDL-58793 auth: Fix invalid access to $this in settings.php files

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).
This commit is contained in:
David Mudrák
2017-05-08 11:47:29 +02:00
parent 48ad73619f
commit 9f29e45e15
13 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -264,7 +264,7 @@ if ($ADMIN->fulltree) {
}
// 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');
+1 -1
View File
@@ -135,7 +135,7 @@ if ($ADMIN->fulltree) {
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());
+1 -1
View File
@@ -40,7 +40,7 @@ if ($ADMIN->fulltree) {
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);
}
+1 -1
View File
@@ -55,7 +55,7 @@ if ($ADMIN->fulltree) {
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);
}
+1 -1
View File
@@ -55,7 +55,7 @@ if ($ADMIN->fulltree) {
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);
+1 -1
View File
@@ -295,7 +295,7 @@ if ($ADMIN->fulltree) {
}
// 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');
+1 -1
View File
@@ -72,7 +72,7 @@ if ($ADMIN->fulltree) {
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);
}
+1 -1
View File
@@ -44,7 +44,7 @@ if ($ADMIN->fulltree) {
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);
}
+1 -1
View File
@@ -31,7 +31,7 @@ if ($ADMIN->fulltree) {
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);
}
+1 -1
View File
@@ -29,7 +29,7 @@ if ($ADMIN->fulltree) {
$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);
}
+1 -1
View File
@@ -31,7 +31,7 @@ if ($ADMIN->fulltree) {
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);
}
+1 -1
View File
@@ -59,7 +59,7 @@ if ($ADMIN->fulltree) {
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);
}
+1 -1
View File
@@ -75,7 +75,7 @@ if ($ADMIN->fulltree) {
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());