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:
committed by
Zachary Durber
parent
88cd577ef3
commit
4ad0d0f2f5
+9
-1
@@ -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"};
|
||||
}
|
||||
|
||||
+1
-1
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user