Fixes.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 15 Jan 2009 22:38:00 +0000 (23:38 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 15 Jan 2009 22:38:00 +0000 (23:38 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/profile.php
classes/user.php
modules/profile/general.inc.php
templates/profile/general.tpl

index a848ca6..49109fb 100644 (file)
@@ -162,9 +162,11 @@ class Profile
         } catch (UserNotFoundException $e) {
             /* Let say we can identify a profile using the identifiers of its owner.
              */
-            $user = User::getSilent($login);
-            if ($user && $user->hasProfile()) {
-                return $user->profile();
+            if (!($login instanceof PlUser)) {
+                $user = User::getSilent($login);
+                if ($user && $user->hasProfile()) {
+                    return $user->profile();
+                }
             }
             return null;
         }
index 11e232e..29b4904 100644 (file)
@@ -29,6 +29,10 @@ class User extends PlUser
     {
         global $globals;
 
+        if ($login instanceof User) {
+            $machin->id();
+        }
+
         if ($login instanceof Profile) {
             $this->_profile = $login;
             $this->_profile_fetched = true;
index 210d25c..f260c16 100644 (file)
@@ -163,7 +163,7 @@ class ProfileSearchNames implements ProfileSetting
                 $name = trim($name);
                 XDB::execute("INSERT INTO  profile_name_search (particle, name, typeid, pid)
                                    VALUES  ({?}, {?}, {?}, {?})",
-                             $particle, $name, $sn['typeid'], $this->pid());
+                             $particle, $name, $sn['typeid'], $page->pid());
             }
         }
         XDB::execute("UPDATE  profile_display
@@ -171,7 +171,7 @@ class ProfileSearchNames implements ProfileSetting
                               directory_name = {?}, short_name = {?}, sort_name = {?}
                        WHERE  pid = {?}",
                      $this->public_name, $this->private_name, $this->directory_name,
-                     $this->short_name, $this->sort_name, $this->pid());
+                     $this->short_name, $this->sort_name, $page->pid());
         /*require_once('user.func.inc.php');
         user_reindex(S::v('uid'));*/
     }
index 8205ece..45aeba0 100644 (file)
     <td>
       <span class="titre">Date de naissance</span>
     </td>
-    <td><input type="text" {if $errors.birthdate}class="error"{/if} name="naissance" value="{$birthdate}" /></td>
+    <td><input type="text" {if $errors.birthdate}class="error"{/if} name="birthdate" value="{$birthdate}" /></td>
   </tr>
   <tr>
     <td>