]> git.mjollnir.org Git - moodle.git/commitdiff
auth/db/lib (bugfix) only update mdl fields during login if 'onlogin' set
authormartinlanghoff <martinlanghoff>
Thu, 28 Sep 2006 01:05:10 +0000 (01:05 +0000)
committermartinlanghoff <martinlanghoff>
Thu, 28 Sep 2006 01:05:10 +0000 (01:05 +0000)
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).

auth/db/lib.php

index b2f2aead37b9b38eda0f58644b273d95d5cd7e3b..153192b80952faa108c47710f443c72a3c61aaea 100644 (file)
@@ -212,7 +212,7 @@ function auth_sync_users ($do_updates=0) {
         $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
                 }
             }