Previous operation was update all moodle fields from the external database
during each login & sync ignoring this setting. Now if this setting is
'oncreation' then the field is only copied once (on creation of user).
$updatekeys = array();
foreach ($all_keys as $key) {
if (preg_match('/^field_updatelocal_(.+)$/',$key, $match)) {
- if ($pcfg->{$match[0]}) { // if it has a true value
+ if ($pcfg->{$key} === 'onlogin') {
array_push($updatekeys, $match[1]); // the actual key name
}
}