From: x2000habouzit Date: Tue, 11 Jul 2006 21:55:25 +0000 (+0000) Subject: bye bye fiche.php ! X-Git-Tag: xorg/0.9.11~451 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=e8599c21fcbd18beb8551368450174f35774794a;p=platal.git bye bye fiche.php ! a compat forwarder is still present git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@448 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/bin/cron/notifs.send.php b/bin/cron/notifs.send.php index feaa0c1..4680c33 100755 --- a/bin/cron/notifs.send.php +++ b/bin/cron/notifs.send.php @@ -54,8 +54,8 @@ EOF; require_once('../../plugins/modifier.date_format.php'); $date = smarty_modifier_date_format($x['date'], '%d %b %Y'); $text .= " - (X{$x['promo']}) {$x['prenom']} {$x['nom']} le $date\n"; - $text .= " {$globals->baseurl}/fiche.php?user={$x['bestalias']}&force_login=1\n\n"; - $html .= "
  • (X{$x['promo']}) {$x['prenom']} {$x['nom']} le $date
  • \n"; + $text .= " {$globals->baseurl}/profile/{$x['bestalias']}&force_login=1\n\n"; + $html .= "
  • (X{$x['promo']}) {$x['prenom']} {$x['nom']} le $date
  • \n"; } $text .= "\n"; $html .= "\n"; diff --git a/htdocs.net/fiche.php b/htdocs.net/fiche.php index 6d05057..8058809 100644 --- a/htdocs.net/fiche.php +++ b/htdocs.net/fiche.php @@ -1,4 +1,4 @@ diff --git a/htdocs/fiche.php b/htdocs/fiche.php deleted file mode 100644 index 2453df2..0000000 --- a/htdocs/fiche.php +++ /dev/null @@ -1,105 +0,0 @@ -kill("cette page n'existe pas"); -} - -if (Env::has('user')) { - $login = get_user_forlife(Env::get('user')); - if ($login === false) { - $page->kill(""); - } -} - -if (Env::has('mat')) { - $res = $globals->xdb->query( - "SELECT alias - FROM aliases AS a - INNER JOIN auth_user_md5 AS u ON (a.id=u.user_id AND a.type='a_vie') - WHERE matricule={?}", Env::getInt('mat')); - $login = $res->fetchOneCell(); - if (empty($login)) { - $page->kill("cette page n'existe pas"); - } -} - -$new = Env::get('modif') == 'new'; -$user = get_user_details($login, Session::getInt('uid'), $view); -$title = $user['prenom'] . ' ' . empty($user['nom_usage']) ? $user['nom'] : $user['nom_usage']; -$page->assign('xorg_title', $title); - -// photo - -$photo = 'photo/'.$user['forlife'].($new ? '/req' : ''); - -if(!isset($user['y']) and !isset($user['x'])) { - list($user['x'], $user['y']) = getimagesize("images/none.png"); -} -if(!isset($user['y']) or $user['y'] < 1) $user['y']=1; -if(!isset($user['x']) or $user['x'] < 1) $user['x']=1; -if($user['x'] > 240){ - $user['y'] = (integer)($user['y']*240/$user['x']); - $user['x'] = 240; -} -if($user['y'] > 300){ - $user['x'] = (integer)($user['x']*300/$user['y']); - $user['y'] = 300; -} -if($user['x'] < 160){ - $user['y'] = (integer)($user['y']*160/$user['x']); - $user['x'] = 160; -} - -$page->assign('logged', has_user_right('private', $view)); -if (!has_user_right($user['photo_pub'], $view)) { - $photo = ""; -} - -$page->assign_by_ref('x', $user); -$page->assign('photo_url', $photo); -// alias virtual -$res = $globals->xdb->query( - "SELECT alias - FROM virtual - INNER JOIN virtual_redirect USING(vid) - INNER JOIN auth_user_quick ON ( user_id = {?} AND emails_alias_pub = 'public' ) - WHERE ( redirect={?} OR redirect={?} ) - AND alias LIKE '%@{$globals->mail->alias_dom}'", - Session::getInt('uid'), $user['forlife'].'@'.$globals->mail->domain, $user['forlife'].'@'.$globals->mail->domain2); -$page->assign('virtualalias', $res->fetchOneCell()); - -$page->addJsLink('javascript/close_on_esc.js'); -$page->run(); - -// vim:set et sws=4 sw=4 sts=4: -?> diff --git a/include/banana.inc.php b/include/banana.inc.php index f537fda..84d50f3 100644 --- a/include/banana.inc.php +++ b/include/banana.inc.php @@ -24,7 +24,7 @@ require_once('banana/banana.inc.php'); function hook_formatDisplayHeader($_header,$_text) { global $globals; if ($_header == 'x-org-id') { - return $_text . ' [baseurl . '/profile/' . $_text . '" class="popup2">fiche]'; } } diff --git a/modules/profile.php b/modules/profile.php index 2ecfc87..5abe009 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -27,6 +27,8 @@ class ProfileModule extends PLModule 'photo' => $this->make_hook('photo', AUTH_PUBLIC), 'photo/change' => $this->make_hook('photo_change', AUTH_MDP), + 'fiche.php' => $this->make_hook('fiche', AUTH_PUBLIC), + 'profile' => $this->make_hook('profile', AUTH_PUBLIC), 'profile/orange' => $this->make_hook('p_orange', AUTH_MDP), 'profile/referent' => $this->make_hook('p_referent', AUTH_MDP), 'profile/usage' => $this->make_hook('p_usage', AUTH_MDP), @@ -37,6 +39,13 @@ class ProfileModule extends PLModule ); } + /* XXX COMPAT */ + function handler_fiche(&$page) + { + return $this->handler_profile($page, Env::get('user')); + } + + function _trombi_getlist($offset, $limit) { global $globals; @@ -146,6 +155,89 @@ class ProfileModule extends PLModule return PL_OK; } + function handler_profile(&$page, $x = null) + { + if (is_null($x)) { + return PL_NOT_FOUND; + } + + global $globals; + require_once 'user.func.inc.php'; + + $page->changeTpl('fiche.tpl'); + $page->assign('simple', true); + + $view = 'private'; + if (!logged() || Env::get('view') == 'public') $view = 'public'; + if (logged() && Env::get('view') == 'ax') $view = 'ax'; + + if (is_numeric($x)) { + $res = $globals->xdb->query( + "SELECT alias + FROM aliases AS a + INNER JOIN auth_user_md5 AS u ON (a.id=u.user_id AND a.type='a_vie') + WHERE matricule={?}", $x); + $login = $res->fetchOneCell(); + } else { + $login = get_user_forlife($x); + } + + if (empty($login)) { + return PL_NOT_FOUND; + } + + $new = Env::get('modif') == 'new'; + $user = get_user_details($login, Session::getInt('uid'), $view); + $title = $user['prenom'] . ' ' . empty($user['nom_usage']) ? $user['nom'] : $user['nom_usage']; + $page->assign('xorg_title', $title); + + // photo + + $photo = $globals->baseurl.'/photo/'.$user['forlife'].($new ? '/req' : ''); + + if(!isset($user['y']) and !isset($user['x'])) { + list($user['x'], $user['y']) = getimagesize("images/none.png"); + } + if(!isset($user['y']) or $user['y'] < 1) $user['y']=1; + if(!isset($user['x']) or $user['x'] < 1) $user['x']=1; + if($user['x'] > 240){ + $user['y'] = (integer)($user['y']*240/$user['x']); + $user['x'] = 240; + } + if($user['y'] > 300){ + $user['x'] = (integer)($user['x']*300/$user['y']); + $user['y'] = 300; + } + if($user['x'] < 160){ + $user['y'] = (integer)($user['y']*160/$user['x']); + $user['x'] = 160; + } + + $page->assign('logged', has_user_right('private', $view)); + if (!has_user_right($user['photo_pub'], $view)) { + $photo = ""; + } + + $page->assign_by_ref('x', $user); + $page->assign('photo_url', $photo); + // alias virtual + $res = $globals->xdb->query( + "SELECT alias + FROM virtual + INNER JOIN virtual_redirect USING(vid) + INNER JOIN auth_user_quick ON ( user_id = {?} AND emails_alias_pub = 'public' ) + WHERE ( redirect={?} OR redirect={?} ) + AND alias LIKE '%@{$globals->mail->alias_dom}'", + Session::getInt('uid'), + $user['forlife'].'@'.$globals->mail->domain, + $user['forlife'].'@'.$globals->mail->domain2); + $page->assign('virtualalias', $res->fetchOneCell()); + + $page->addJsLink('javascript/close_on_esc.js'); + + return PL_OK; + } + function handler_p_orange(&$page) { global $globals; diff --git a/plugins/pmwiki.platalSkin.php b/plugins/pmwiki.platalSkin.php index 2ac91cb..634b7fa 100644 --- a/plugins/pmwiki.platalSkin.php +++ b/plugins/pmwiki.platalSkin.php @@ -12,7 +12,7 @@ $InputTags['e_form'] = array( // set profiles to point to plat/al fiche Markup('[[~platal', '<[[~', '/\[\[~([^|\]]*)\|([^\]]*)\]\]/e', 'PreserveText("=", \'$2\', "")'); + .'/profile/$1" class="popup2">$2\', "")'); // prevent restorelinks before block apply (otherwise [[Sécurité]] will give // .../Se9'>Sécurité diff --git a/templates/admin/evenements.tpl b/templates/admin/evenements.tpl index f86c9a7..52a9840 100644 --- a/templates/admin/evenements.tpl +++ b/templates/admin/evenements.tpl @@ -41,7 +41,7 @@ diff --git a/templates/admin/homonymes.tpl b/templates/admin/homonymes.tpl index 41b671d..3d84b13 100644 --- a/templates/admin/homonymes.tpl +++ b/templates/admin/homonymes.tpl @@ -62,7 +62,7 @@ @@ -44,7 +44,7 @@ {foreach from=$valid->comments item=c} diff --git a/templates/carnet/panel.tpl b/templates/carnet/panel.tpl index 2c584d4..60028d3 100644 --- a/templates/carnet/panel.tpl +++ b/templates/carnet/panel.tpl @@ -65,7 +65,7 @@ Il faut pour cel {if $key is odd} diff --git a/templates/fiche.tpl b/templates/fiche.tpl index 132ad0e..6ed7256 100644 --- a/templates/fiche.tpl +++ b/templates/fiche.tpl @@ -44,21 +44,21 @@ function chgMainWinLoc( strPage ) { {$x.prenom} {if $x.nom_usage eq ""}{$x.nom}{else}{$x.nom_usage} ({$x.nom}){/if} {if $logged} {if $x.nickname} (aka {$x.nickname}){/if}  - - Afficher la carte de visite + + Afficher la carte de visite {if !$x.is_contact} - Ajouter à mes contacts + Ajouter à mes contacts {else} - Retirer de mes contacts + Retirer de mes contacts {/if} {perms level=admin} - admin + admin {/perms} {/if} diff --git a/templates/geoloc/index.tpl b/templates/geoloc/index.tpl index 122cace..b1cc88f 100644 --- a/templates/geoloc/index.tpl +++ b/templates/geoloc/index.tpl @@ -26,7 +26,7 @@ {literal} function ficheXorg(id) { - window.open('../fiche.php?user='+id,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=840,height=600'); + window.open('{rel}/profile/'+id,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=840,height=600'); } {/literal} {if !$no_annu} diff --git a/templates/include/form.valid.homonymes.tpl b/templates/include/form.valid.homonymes.tpl index caaedac..6d90bc5 100644 --- a/templates/include/form.valid.homonymes.tpl +++ b/templates/include/form.valid.homonymes.tpl @@ -30,7 +30,7 @@ diff --git a/templates/include/form.valid.listes.tpl b/templates/include/form.valid.listes.tpl index 38ed03c..a9002a9 100644 --- a/templates/include/form.valid.listes.tpl +++ b/templates/include/form.valid.listes.tpl @@ -54,7 +54,7 @@ @@ -62,7 +62,7 @@ diff --git a/templates/include/form.valid.nomusage.tpl b/templates/include/form.valid.nomusage.tpl index fb1ccf7..9253215 100644 --- a/templates/include/form.valid.nomusage.tpl +++ b/templates/include/form.valid.nomusage.tpl @@ -37,7 +37,7 @@ diff --git a/templates/include/minifiche.tpl b/templates/include/minifiche.tpl index 0c2d67d..7add961 100644 --- a/templates/include/minifiche.tpl +++ b/templates/include/minifiche.tpl @@ -26,7 +26,7 @@ @@ -56,7 +56,7 @@ *}Retirer de la liste de mes surveillances {/if} {elseif $c.wasinscrit} - {* + {* *}Afficher la fiche {if !$c.dcd} {* diff --git a/templates/include/trombi.tpl b/templates/include/trombi.tpl index 5d54562..1edf1dd 100644 --- a/templates/include/trombi.tpl +++ b/templates/include/trombi.tpl @@ -28,7 +28,7 @@ {/if} diff --git a/templates/listes/admin.tpl b/templates/listes/admin.tpl index d108305..f9bb46c 100644 --- a/templates/listes/admin.tpl +++ b/templates/listes/admin.tpl @@ -48,7 +48,7 @@ qui y diff --git a/templates/listes/trombi.tpl b/templates/listes/trombi.tpl index 357a1a3..1f98e0c 100644 --- a/templates/listes/trombi.tpl +++ b/templates/listes/trombi.tpl @@ -79,7 +79,7 @@ diff --git a/templates/login.tpl b/templates/login.tpl index f21628f..dadd2ab 100644 --- a/templates/login.tpl +++ b/templates/login.tpl @@ -43,7 +43,7 @@ Bienvenue {$smarty.session.prenom} {if $fiche_incitation}

    La dernière mise à jour de ta - fiche + fiche date du {$fiche_incitation|date_format}. Il est possible qu'elle ne soit pas à jour. Si tu souhaites la modifier, clique ici ! @@ -97,7 +97,7 @@ Bienvenue {$smarty.session.prenom} {/tidy}

    SommaireAnnonce proposée par - + {$ev.prenom} {$ev.nom} X{$ev.promo}

    diff --git a/templates/marketing/private.tpl b/templates/marketing/private.tpl index b0aa4b1..c6b959f 100644 --- a/templates/marketing/private.tpl +++ b/templates/marketing/private.tpl @@ -64,7 +64,7 @@ sa derni {iterate from=$addr item=a} - + diff --git a/templates/marketing/this_week.tpl b/templates/marketing/this_week.tpl index 287edc5..397ec2c 100644 --- a/templates/marketing/this_week.tpl +++ b/templates/marketing/this_week.tpl @@ -45,7 +45,7 @@ {$in.promo} diff --git a/templates/profil.tpl b/templates/profil.tpl index 2ef8291..2ef528c 100644 --- a/templates/profil.tpl +++ b/templates/profil.tpl @@ -29,9 +29,11 @@

    {$e}

    {/foreach} -

    Tu peux consulter l'état actuel de ta fiche -telle qu'elle apparaîtra pour un camarade, -ou telle qu'elle apparaîtra dans l'annuaire de l'AX ou à tout le monde.

    +

    +Tu peux consulter l'état actuel de ta fiche +telle qu'elle apparaîtra pour un camarade, ou telle qu'elle apparaîtra dans l'annuaire de +l'AX +ou à tout le monde.

    - Posté par {$ev.prenom} {$ev.nom} (X{$ev.promo}) + Posté par {$ev.prenom} {$ev.nom} (X{$ev.promo})
    {$user.expire|date_format} - fiche + fiche edit {if $user.type eq 'alias'} mailer diff --git a/templates/admin/synchro_ax.tpl b/templates/admin/synchro_ax.tpl index 4e1c406..dcfb04a 100644 --- a/templates/admin/synchro_ax.tpl +++ b/templates/admin/synchro_ax.tpl @@ -57,7 +57,7 @@ {/if}
    Les fiches de cet utilisateur :
    diff --git a/templates/admin/utilisateurs.tpl b/templates/admin/utilisateurs.tpl index 22dc021..ed50de2 100644 --- a/templates/admin/utilisateurs.tpl +++ b/templates/admin/utilisateurs.tpl @@ -202,7 +202,7 @@ function act_fwd(fwd, activate) {
    - [Voir fiche] + [Voir fiche] diff --git a/templates/admin/valider.tpl b/templates/admin/valider.tpl index b4735ae..7f0728d 100644 --- a/templates/admin/valider.tpl +++ b/templates/admin/valider.tpl @@ -34,7 +34,7 @@
    Demandeur : - + {$valid->prenom} {$valid->nom} (X{$valid->promo})
    - {$c[0]} + {$c[0]} {$c[1]}
    {if $smarty.section.row.first}{$p}{/if} {if $promo[row].inscrit} - + {$promo[row].prenom} {$promo[row].nom} {if !$promo[row].contact} diff --git a/templates/carnet/rss.tpl b/templates/carnet/rss.tpl index e202ed8..81b744a 100644 --- a/templates/carnet/rss.tpl +++ b/templates/carnet/rss.tpl @@ -58,7 +58,7 @@ [{$notifs->_cats[$cid].short}] {$x.prenom} {$x.nom} ({$x.promo}) - le {$x.date|date_format|utf8_encode} - {#globals.baseurl#}/fiche.php?user={$x.bestalias}&force_login=1 + {#globals.baseurl#}/profile/{$x.bestalias}?force_login=1 diff --git a/templates/emails/send.tpl b/templates/emails/send.tpl index e931a7c..e1fae05 100644 --- a/templates/emails/send.tpl +++ b/templates/emails/send.tpl @@ -99,7 +99,7 @@ - {$contact.prenom} {$contact.nom} (X{$contact.promo}) + {$contact.prenom} {$contact.nom} (X{$contact.promo})
    Homonymes : {foreach from=$valid->homonymes_forlife item=o} - {$o} + {$o} {/foreach}
    Gestionnaires : {foreach from=$valid->owners item=o} - {$o} + {$o} {/foreach}
    Membres : {foreach from=$valid->members item=o} - {$o} + {$o} {/foreach}
    Probleme d'homonymie ! - {$valid->homonyme} + {$valid->homonyme}
    - +  [ PHOTO ] {if $trombi_admin && $smarty.session.perms eq 'admin'} @@ -37,7 +37,7 @@ {/if}
    - + {$p.prenom} {$p.nom}{if $trombi_show_promo} ({$p.promo}){/if}
    {foreach from=$xs item=x} {if $promo} - {$x.n} + {$x.n} {else} {$x.l} {/if} @@ -82,7 +82,7 @@ qui y {foreach from=$xs item=x} {if $promo} - {$x.n} + {$x.n} {else} {$x.l} {/if} diff --git a/templates/listes/members.tpl b/templates/listes/members.tpl index 1fc2ff6..5178b2a 100644 --- a/templates/listes/members.tpl +++ b/templates/listes/members.tpl @@ -91,7 +91,7 @@ {foreach from=$xs item=x} {if $promo} - {$x.n}
    + {$x.n}
    {else} {$x.l}
    {/if} diff --git a/templates/listes/moderate.tpl b/templates/listes/moderate.tpl index 58b74d6..1301f01 100644 --- a/templates/listes/moderate.tpl +++ b/templates/listes/moderate.tpl @@ -37,7 +37,7 @@ {foreach from=$subs item=s}
    {$s.name}{if $s.login} - {* + {* *}Afficher la fiche {/if}  [ PHOTO ]
    - + {$x.n} ({$promo})
    {$a.email}{$a.alias} {if $a.type eq user}(*){/if}{$a.alias} {if $a.type eq user}(*){/if} {$a.date|date_format|default:'-'} {$a.last|date_format|default:'-'} {$a.nb|default:"-"} - + {$in.nom} {$in.prenom}
    diff --git a/templates/profil/general.tpl b/templates/profil/general.tpl index 91b8f64..3cd6652 100644 --- a/templates/profil/general.tpl +++ b/templates/profil/general.tpl @@ -217,7 +217,7 @@ Voilà la photo qui apparaîtra sur la fiche de ton profil{if $nouvellephoto} (tu viens de changer ta photo, celle-ci correspond à ton ancien profil car la nouvelle n'a pas encore été validée par un administrateur du site ! - Ta fiche avec la nouvelle photo) + Ta fiche avec la nouvelle photo) {/if}. {if $admin || $e.show_participants} diff --git a/templates/xnet/groupe/evt-admin.tpl b/templates/xnet/groupe/evt-admin.tpl index 156cec4..502561b 100644 --- a/templates/xnet/groupe/evt-admin.tpl +++ b/templates/xnet/groupe/evt-admin.tpl @@ -81,7 +81,7 @@ Ils ont pay @@ -126,7 +126,7 @@ Ils ont pay
    diff --git a/templates/referent.tpl b/templates/referent.tpl index a2ae163..1b401f1 100644 --- a/templates/referent.tpl +++ b/templates/referent.tpl @@ -61,7 +61,7 @@ d'
    - + voir sa fiche - Voir sa fiche référent diff --git a/templates/xnet/groupe/annuaire.tpl b/templates/xnet/groupe/annuaire.tpl index 02899a7..9e5358b 100644 --- a/templates/xnet/groupe/annuaire.tpl +++ b/templates/xnet/groupe/annuaire.tpl @@ -64,7 +64,7 @@ Fonctionnalit
    {$m.promo} {if $m.x} - [fiche] + [fiche] [vcard] mail {else} diff --git a/templates/xnet/groupe/evenements.tpl b/templates/xnet/groupe/evenements.tpl index 5ae5477..de67a5d 100644 --- a/templates/xnet/groupe/evenements.tpl +++ b/templates/xnet/groupe/evenements.tpl @@ -74,7 +74,7 @@ Ev
    annonceur : - {$e.prenom} {$e.nom} ({$e.promo}) + {$e.prenom} {$e.nom} ({$e.promo})
    {$m.promo} - [fiche] + [fiche] [vcard] mail {$m.promo} {if $m.x} - [fiche] + [fiche] [vcard] mail {else} diff --git a/templates/xnet/groupe/inscrire.tpl b/templates/xnet/groupe/inscrire.tpl index a57bd11..6b1c540 100644 --- a/templates/xnet/groupe/inscrire.tpl +++ b/templates/xnet/groupe/inscrire.tpl @@ -26,7 +26,7 @@

    Demande de la part de : {$prenom} {$nom} (X{$promo}) - Voir sa fiche + Voir sa fiche

    @@ -71,7 +71,7 @@ Bien cordialement, -- Ma fiche sur Polytechnique.org : -https://www.polytechnique.org/fiche.php?user={$smarty.session.forlife} +https://www.polytechnique.org/profile/{$smarty.session.forlife}
    diff --git a/templates/xnet/groupe/membres-edit.tpl b/templates/xnet/groupe/membres-edit.tpl index 8beae03..a675992 100644 --- a/templates/xnet/groupe/membres-edit.tpl +++ b/templates/xnet/groupe/membres-edit.tpl @@ -26,7 +26,7 @@ Édition du profil de {$user.prenom} {$user.nom} {if $user.origine eq 'X'} (X{$user.promo}) - Voir la fiche + Voir la fiche {/if} Suppression du compte Ecrire un mail diff --git a/templates/xnet/groupe/telepaiement.tpl b/templates/xnet/groupe/telepaiement.tpl index 9b2740c..c97b2a2 100644 --- a/templates/xnet/groupe/telepaiement.tpl +++ b/templates/xnet/groupe/telepaiement.tpl @@ -51,7 +51,7 @@ Voici la liste des paiements en ligne possible pour le groupe {$asso.nom}
    {$p.date|date_format:"%d/%m/%y"} {$p.prenom} {$p.nom} - [fiche] + [fiche] [mail] X {$p.promo}