From: Florent Bruneau Date: Thu, 15 Jan 2009 22:38:00 +0000 (+0100) Subject: Fixes. X-Git-Tag: xorg/1.0.0~332^2~412 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=455ea0c945b03435bd30ded9c92b7f2619f42af0;p=platal.git Fixes. Signed-off-by: Florent Bruneau --- diff --git a/classes/profile.php b/classes/profile.php index a848ca6..49109fb 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -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; } diff --git a/classes/user.php b/classes/user.php index 11e232e..29b4904 100644 --- a/classes/user.php +++ b/classes/user.php @@ -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; diff --git a/modules/profile/general.inc.php b/modules/profile/general.inc.php index 210d25c..f260c16 100644 --- a/modules/profile/general.inc.php +++ b/modules/profile/general.inc.php @@ -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'));*/ } diff --git a/templates/profile/general.tpl b/templates/profile/general.tpl index 8205ece..45aeba0 100644 --- a/templates/profile/general.tpl +++ b/templates/profile/general.tpl @@ -114,7 +114,7 @@ Date de naissance - +