mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-43415 auth_db: Adding custom profile fields to "Lock user fields"
Adding custom profile fields to "Lock user fields". It's needed to sync custom user profile fields with external DB.
This commit is contained in:
parent
88cd577ef3
commit
4ad0d0f2f5
2 changed files with 10 additions and 2 deletions
|
@ -168,7 +168,15 @@ class auth_plugin_db extends auth_plugin_base {
|
|||
*/
|
||||
function db_attributes() {
|
||||
$moodleattributes = array();
|
||||
foreach ($this->userfields as $field) {
|
||||
// If we have custom fields then merge them with user fields.
|
||||
$customfields = $this->get_custom_user_profile_fields();
|
||||
if (!empty($customfields) && !empty($this->userfields)) {
|
||||
$userfields = array_merge($this->userfields, $customfields);
|
||||
} else {
|
||||
$userfields = $this->userfields;
|
||||
}
|
||||
|
||||
foreach ($userfields as $field) {
|
||||
if (!empty($this->config->{"field_map_$field"})) {
|
||||
$moodleattributes[$field] = $this->config->{"field_map_$field"};
|
||||
}
|
||||
|
|
|
@ -270,7 +270,7 @@
|
|||
|
||||
<?php
|
||||
|
||||
print_auth_lock_options($this->authtype, $user_fields, get_string('auth_dbextrafields', 'auth_db'), true, true);
|
||||
print_auth_lock_options($this->authtype, $user_fields, get_string('auth_dbextrafields', 'auth_db'), true, true, $this->get_custom_user_profile_fields());
|
||||
|
||||
?>
|
||||
</table>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue