no need to update user record on every login
Tony Mack [Fri, 2 Nov 2012 01:37:17 +0000 (21:37 -0400)]
planetlab/includes/plc_session_sso.php

index 7b0654a..f9d1e81 100644 (file)
@@ -88,13 +88,7 @@ class PLCSessionSSO
         global $adm;
         $api = $this->api;    
         list($local_person) = $adm->GetPersons(array('email'=>$person['email'], 'peer_id'=>NULL));
-        if ($local_person) 
-        {
-            // Update existing account details
-            unset($local_person['enabled']);
-            $adm->UpdatePerson($local_person['person_id'], $person);
-        }
-        else
+        if (!$local_person) 
         {
             // Add new account
             $adm->AddPerson($person);
@@ -104,6 +98,7 @@ class PLCSessionSSO
             foreach ($remote_sites as $remote_site) {
                 $adm->AddPersonToSite($person['email'], $remote_site['login_base']);
             }
+            list($local_person) = $adm->GetPersons(array('email'=>$person['email'], 'peer_id'=>NULL));
         }
 
         # Sync keys