mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
removed condition 'if ($userupdate) {' (ie if user has capability moodle/user:update) then freeze fields locked by admin / auth plug ins. Now fields are always frozen.
This commit is contained in:
parent
dd07bbac59
commit
9958e84f3c
1 changed files with 9 additions and 12 deletions
|
@ -295,21 +295,18 @@ class user_edit_form extends moodleform {
|
||||||
$mform->hardFreeze('address');
|
$mform->hardFreeze('address');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// disable fields that are locked by auth plugins
|
/// disable fields that are locked by auth plugins
|
||||||
if ($userupdate) {
|
$fields = get_user_fieldnames();
|
||||||
$fields = get_user_fieldnames();
|
$freezefields = array();
|
||||||
$freezefields = array();
|
foreach ($fields as $field) {
|
||||||
foreach ($fields as $field) {
|
$configvariable = 'field_lock_' . $field;
|
||||||
$configvariable = 'field_lock_' . $field;
|
if (isset($authplugin->config->{$configvariable}) and
|
||||||
if (isset($authplugin->config->{$configvariable}) and
|
( $authplugin->config->{$configvariable} === 'locked' or
|
||||||
( $authplugin->config->{$configvariable} === 'locked' or
|
( $authplugin->config->{$configvariable} === 'unlockedifempty' and !empty($user->$field)) ) ) {
|
||||||
( $authplugin->config->{$configvariable} === 'unlockedifempty' and !empty($user->$field)) ) ) {
|
$freezefields[] = $field;
|
||||||
$freezefields[] = $field;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$mform->hardFreeze($freezefields);
|
|
||||||
}
|
}
|
||||||
|
$mform->hardFreeze($freezefields);
|
||||||
|
|
||||||
/// Next the customisable categories
|
/// Next the customisable categories
|
||||||
if ($categories = get_records_select('user_info_category', '1', 'sortorder ASC')) {
|
if ($categories = get_records_select('user_info_category', '1', 'sortorder ASC')) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue