Adds check for corps.
[platal.git] / classes / user.php
index 4d4a28a..6a3be38 100644 (file)
@@ -327,11 +327,11 @@ class User extends PlUser
 
     /** Return the main profile attached with this account if any.
      */
-    public function profile($forceFetch = false)
+    public function profile($forceFetch = false, $fields = 0x0000, $visibility = null)
     {
         if (!$this->_profile_fetched || $forceFetch) {
             $this->_profile_fetched = true;
-            $this->_profile = Profile::get($this);
+            $this->_profile = Profile::get($this, $fields, $visibility);
         }
         return $this->_profile;
     }
@@ -813,7 +813,7 @@ class User extends PlUser
         XDB::execute('UPDATE  log_last_sessions
                          SET  id = {?}
                        WHERE  uid = {?}',
-                     $newuser->id());
+                     $lastSession, $newuser->id());
         XDB::execute('DELETE FROM  accounts
                             WHERE  uid = {?}',
                      $this->id());