r1428: In Authentication::_syncBugdarUser(), only run UserAPI->update() if fields...
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 5 Mar 2007 04:43:48 +0000 (04:43 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 5 Mar 2007 04:43:48 +0000 (04:43 +0000)
includes/auth/auth.php

index 5484da0b1a4f479a4e91240ae72539956c4c21ef..14c3539d0385e019dd89bc356c4d3e050b7e126a 100644 (file)
@@ -284,13 +284,23 @@ class Authentication
                unset($fields['authid']);
                unset($fields['password']);
                
+               $change = false;
+               
                $user = new UserAPI($this->registry);
                $user->set('userid', $this->authUser[ $this->fieldMap['authid'] ]);
+               $user->set_condition();
                foreach ($fields AS $bugdar => $authdb)
                {
-                       $user->set($bugdar, $this->authUser["$authdb"]);
+                       if ($this->bugdarUser["$bugdar"] != $this->authUser["$authDb"])
+                       {
+                               $user->set($bugdar, $this->authUser["$authdb"]);
+                               $change = true;
+                       }
+               }
+               if ($change)
+               {
+                       $user->update();
                }
-               $user->update();
        }
        
        // ###################################################################