From: Vincent Zanotti Date: Sun, 12 Oct 2008 14:12:34 +0000 (+0200) Subject: Converts the remaining bits of the Profile module to hruid. X-Git-Tag: xorg/0.10.0~86^2~4 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=b3bf7395c70480bc26f068c13f0a87d0d6ed6493;p=platal.git Converts the remaining bits of the Profile module to hruid. Signed-off-by: Vincent Zanotti --- diff --git a/modules/profile.php b/modules/profile.php index 94ae300..7a52138 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -324,7 +324,7 @@ class ProfileModule extends PLModule $page->assign('no_private_key', true); } if (Env::v('synchro_ax') == 'confirm' && !is_ax_key_missing()) { - ax_synchronize(S::v('bestalias'), S::v('uid')); + ax_synchronize(S::user()->login(), S::v('uid')); $page->trigSuccess('Ton profil a été synchronisé avec celui du site polytechniciens.com'); } @@ -521,39 +521,24 @@ class ProfileModule extends PLModule function handler_referent(&$page, $x = null) { require_once 'user.func.inc.php'; - - if (is_null($x)) { - return PL_NOT_FOUND; - } - $page->changeTpl('profile/fiche_referent.tpl', SIMPLE); - $res = XDB::query( - "SELECT prenom, nom, user_id, promo, cv, a.alias AS bestalias - FROM auth_user_md5 AS u - INNER JOIN aliases AS a ON (u.user_id=a.id - AND FIND_IN_SET('bestalias', a.flags)) - INNER JOIN aliases AS a1 ON (u.user_id=a1.id - AND a1.alias = {?} - AND a1.type!='homonyme')", $x); - - if ($res->numRows() != 1) { + $user = User::get($x); + if ($user == null) { return PL_NOT_FOUND; } - list($prenom, $nom, $user_id, $promo, $cv, $bestalias) = $res->fetchOneRow(); + $res = XDB::query("SELECT cv FROM auth_user_md5 WHERE user_id = {?}", $user->id()); + $cv = $res->fetchOneCell(); - $page->assign('prenom', $prenom); - $page->assign('nom', $nom); - $page->assign('promo', $promo); - $page->assign('cv', MiniWiki::WikiToHTML($cv, true)); - $page->assign('bestalias', $bestalias); - $page->assign('adr_pro', get_user_details_pro($user_id)); + $page->assign_by_ref('user', $user); + $page->assign('cv', MiniWiki::WikiToHTML($cv, true)); + $page->assign('adr_pro', get_user_details_pro($user->id())); ///// recuperations infos referent //expertise - $res = XDB::query("SELECT expertise FROM mentor WHERE uid = {?}", $user_id); + $res = XDB::query("SELECT expertise FROM mentor WHERE uid = {?}", $user->id()); $page->assign('expertise', $res->fetchOneCell()); //secteurs @@ -563,7 +548,7 @@ class ProfileModule extends PLModule FROM mentor_secteurs AS m LEFT JOIN emploi_secteur AS s ON(m.secteur = s.id) LEFT JOIN emploi_ss_secteur AS ss ON(m.secteur = ss.secteur AND m.ss_secteur = ss.id) - WHERE uid = {?}", $user_id); + WHERE uid = {?}", $user->id()); while (list($sec, $ssec) = $res->next()) { $secteurs[] = $sec; $ss_secteurs[] = $ssec; @@ -576,7 +561,7 @@ class ProfileModule extends PLModule "SELECT gp.pays FROM mentor_pays AS m LEFT JOIN geoloc_pays AS gp ON(m.pid = gp.a2) - WHERE uid = {?}", $user_id); + WHERE uid = {?}", $user->id()); $page->assign('pays', $res->fetchColumn()); $page->addJsLink('close_on_esc.js'); diff --git a/templates/profile/base.tpl b/templates/profile/base.tpl index bfd56f1..198ec25 100644 --- a/templates/profile/base.tpl +++ b/templates/profile/base.tpl @@ -24,9 +24,9 @@ {xsrf_token_field}
{icon name=information title="Voir ma fiche"} Tu peux consulter ta fiche telle que la - voient n'importe quel internaute, - l'AX ou - les X. + voient n'importe quel internaute, + l'AX ou + les X.
{include file="include/flags.radio.tpl" disabled=true withtext=true name="profile_ex_pub"} diff --git a/templates/profile/fiche_referent.tpl b/templates/profile/fiche_referent.tpl index 44e4e16..2be806f 100644 --- a/templates/profile/fiche_referent.tpl +++ b/templates/profile/fiche_referent.tpl @@ -25,8 +25,8 @@
- {$prenom} {$nom}
- X{$promo} -  {$bestalias}@{#globals.mail.domain#} + {$user->fullName()}
+ X{$user->promo()} -  {$user->bestEmail()}
diff --git a/templates/profile/general.tpl b/templates/profile/general.tpl index 0203991..277dab1 100644 --- a/templates/profile/general.tpl +++ b/templates/profile/general.tpl @@ -172,17 +172,17 @@
Ta photo actuelle
-  [ PHOTO ] +  [ PHOTO ] {if $nouvellephoto}
Photo en attente de validation
- + Ta fiche avec cette photo
-  [ PHOTO ] +  [ PHOTO ] {/if} diff --git a/templates/profile/mentor.tpl b/templates/profile/mentor.tpl index 7521a28..587cc57 100644 --- a/templates/profile/mentor.tpl +++ b/templates/profile/mentor.tpl @@ -20,7 +20,7 @@ {* *} {**************************************************************************} -

{icon name=information title="Afficher ma fiche référent"}Tu peux consulter ta fiche référent qui n'est accessible que par les X. +

{icon name=information title="Afficher ma fiche référent"}Tu peux consulter ta fiche référent qui n'est accessible que par les X.

{if (!$expertise)||(!($secteurs|@count))}

diff --git a/templates/profile/trombino.tpl b/templates/profile/trombino.tpl index 842cdb8..de41dae 100644 --- a/templates/profile/trombino.tpl +++ b/templates/profile/trombino.tpl @@ -44,11 +44,11 @@ -  [ PHOTO ] +  [ PHOTO ] {if $submited} -  [ PHOTO ] +  [ PHOTO ] {else} Pas d'image soumise {/if}