migrate referent + profile edition
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Wed, 12 Jul 2006 22:18:06 +0000 (22:18 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Wed, 12 Jul 2006 22:18:06 +0000 (22:18 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@454 839d8a87-29fc-0310-9880-83ba4fa771e5

20 files changed:
hooks/tmp.inc.php
htdocs/profil.php [deleted file]
htdocs/referent.php [deleted file]
include/profil/get_general.inc.php
include/profil/verif_adresses.inc.php
include/tabs.inc.php
modules/events.php
modules/profile.php
templates/fiche.tpl
templates/geoloc/form.address.tpl
templates/include/trombi.tpl
templates/login.tpl
templates/nomusage.tpl
templates/orange.tpl
templates/profil.tpl
templates/profil/adresses.tpl
templates/profil/mentor.tpl
templates/profil/naissance.tpl
templates/referent.tpl
templates/register/success.tpl

index db8e254..736b998 100644 (file)
@@ -23,14 +23,14 @@ function tmp_menu()
 {
     global $globals;
 
-    $globals->menu->addPrivateEntry(XOM_CUSTOM,   10, 'Mon profil',         'profil.php');
+    $globals->menu->addPrivateEntry(XOM_CUSTOM,   10, 'Mon profil',         'profile/edit');
     $globals->menu->addPrivateEntry(XOM_CUSTOM,   20, 'Mes contacts',       'carnet/contacts');
     $globals->menu->addPrivateEntry(XOM_CUSTOM,   30, 'Mon carnet',         'carnet/');
     $globals->menu->addPrivateEntry(XOM_CUSTOM,   40, 'Mon mot de passe',   'password');
     $globals->menu->addPrivateEntry(XOM_CUSTOM,   50, 'Mes préférences',    'prefs');
 
     $globals->menu->addPrivateEntry(XOM_GROUPS,   10, 'Trombi promo',       'trombi');
-    $globals->menu->addPrivateEntry(XOM_GROUPS,   20, 'Conseil Pro.',       'referent.php');
+    $globals->menu->addPrivateEntry(XOM_GROUPS,   20, 'Conseil Pro.',       'referent');
     if ($globals->geoloc->use_map())
         $globals->menu->addPrivateEntry(XOM_GROUPS,   10, 'Planisphère',    'geoloc/');
     $globals->menu->addPrivateEntry(XOM_GROUPS,   30, 'Groupes X',          'http://www.polytechnique.net/plan.php');
diff --git a/htdocs/profil.php b/htdocs/profil.php
deleted file mode 100644 (file)
index 42727de..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
- *  http://opensource.polytechnique.org/                                   *
- *                                                                         *
- *  This program is free software; you can redistribute it and/or modify   *
- *  it under the terms of the GNU General Public License as published by   *
- *  the Free Software Foundation; either version 2 of the License, or      *
- *  (at your option) any later version.                                    *
- *                                                                         *
- *  This program is distributed in the hope that it will be useful,        *
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
- *  GNU General Public License for more details.                           *
- *                                                                         *
- *  You should have received a copy of the GNU General Public License      *
- *  along with this program; if not, write to the Free Software            *
- *  Foundation, Inc.,                                                      *
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-new_skinned_page('profil.tpl',AUTH_MDP);
-$page->addCssLink('css/profil.css');
-$page->assign('xorg_title','Polytechnique.org - Mon Profil');
-
-require_once('tabs.inc.php');
-require_once('profil.func.inc.php');
-
-if (Post::has('register_from_ax_question')) {
-    $globals->xdb->query('UPDATE auth_user_quick SET profile_from_ax = 1 WHERE user_id = {?}', Session::getInt('uid'));
-}
-
-require_once('synchro_ax.inc.php');
-if (is_ax_key_missing())
-    $page->assign('no_private_key', true);
-
-if (Env::get('synchro_ax') == 'confirm' && !is_ax_key_missing()) {
-    ax_synchronize(Session::get('bestalias'), Session::getInt('uid'));
-    $page->trig('Ton profil a été synchronisé avec celui du site polytechniciens.com');
-}
-
-//on met a jour $opened_tab et $new_tab qui sont le tab du POST et le tab demande
-// Tout d'abord, quel est le tab actuel ?
-// si on vient d'un POST, old_tab etait le tab courant
-if (Env::has('old_tab') && isset($tabname_array[Env::get('old_tab')])) {
-    // on verifie que la valeur postee existe bien
-    $opened_tab = Env::get('old_tab');
-}
-$new_tab = Env::has('suivant') ? get_next_tab($opened_tab) : $opened_tab;
-
-// pour tous les tabs, la date de naissance pour verifier
-// quelle est bien rentree et la date.
-$res = $globals->xdb->query(
-        "SELECT  naissance, DATE_FORMAT(date,'%d.%m.%Y')
-           FROM  auth_user_md5
-          WHERE  user_id={?}", Session::getInt('uid'));
-list($naissance, $date_modif_profil) = $res->fetchOneRow();
-
-// lorsqu'on n'a pas la date de naissance en base de données
-if (!$naissance)  {
-    // la date de naissance n'existait pas et vient d'être soumise dans la variable
-    if (Env::has('birth')) {
-       //en cas d'erreur :
-       if (!ereg('[0-3][0-9][0-1][0-9][1][9]([0-9]{2})', Env::get('birth'))) {
-           $page->assign('etat_naissance', 'query');
-            $page->trig_run('Date de naissance incorrecte ou incohérente.');
-       }
-      
-       //sinon
-        $birth = sprintf("%s-%s-%s", substr(Env::get('birth'),4,4), substr(Env::get('birth'),2,2), substr(Env::get('birth'),0,2));
-       $globals->xdb->execute("UPDATE auth_user_md5 SET naissance={?} WHERE user_id={?}", $birth, Session::getInt('uid'));
-       $page->assign('etat_naissance','ok');
-       $page->run();
-    } else {
-       $page->assign('etat_naissance','query');
-    }
-    $page->run();//on affiche le formulaire pour naissance
-}
-
-//doit-on faire un update ?
-if (Env::has('modifier') || Env::has('suivant')) {
-    require_once("profil/get_{$opened_tab}.inc.php");
-    require_once("profil/verif_{$opened_tab}.inc.php");
-
-    if($page->nb_errs()) {
-       require_once("profil/assign_{$opened_tab}.inc.php");
-       $page->assign('onglet',$opened_tab);
-       $page->assign('onglet_last',get_last_tab());
-       $page->assign('onglet_tpl',"profil/$opened_tab.tpl");
-       $page->run();
-    }
-
-    $date=date("Y-m-j");//nouvelle date de mise a jour
-
-    //On sauvegarde l'uid pour l'AX
-    /* on sauvegarde les changements dans user_changes :
-    * on a juste besoin d'insérer le user_id de la personne dans la table
-    */
-    $globals->xdb->execute('REPLACE INTO user_changes SET user_id={?}', Session::getInt('uid'));
-
-    if (!Session::has('suid')) {
-       require_once('notifs.inc.php');
-       register_watch_op(Session::getInt('uid'), WATCH_FICHE);
-    }
-
-    // mise a jour des champs relatifs au tab ouvert
-    require_once("profil/update_{$opened_tab}.inc.php");
-    
-    $log =& Session::getMixed('log');
-    $log->log('profil', $opened_tab);
-    $page->assign('etat_update', 'ok');
-}
-
-require_once("profil/get_{$new_tab}.inc.php");
-require_once("profil/verif_{$new_tab}.inc.php");
-require_once("profil/assign_{$new_tab}.inc.php");
-
-$page->assign('onglet',$new_tab);
-$page->assign('onglet_last',get_last_tab());
-$page->assign('onglet_tpl',"profil/$new_tab.tpl");
-$page->run();
-
-// vim:set et sws=4 sw=4 sts=4:
-?>
diff --git a/htdocs/referent.php b/htdocs/referent.php
deleted file mode 100644 (file)
index ff7d12f..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
- *  http://opensource.polytechnique.org/                                   *
- *                                                                         *
- *  This program is free software; you can redistribute it and/or modify   *
- *  it under the terms of the GNU General Public License as published by   *
- *  the Free Software Foundation; either version 2 of the License, or      *
- *  (at your option) any later version.                                    *
- *                                                                         *
- *  This program is distributed in the hope that it will be useful,        *
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
- *  GNU General Public License for more details.                           *
- *                                                                         *
- *  You should have received a copy of the GNU General Public License      *
- *  along with this program; if not, write to the Free Software            *
- *  Foundation, Inc.,                                                      *
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
- ***************************************************************************/
-
-
-require_once("xorg.inc.php");
-new_skinned_page('referent.tpl',AUTH_COOKIE);
-$page->assign('xorg_title','Polytechnique.org - Conseil Pro');
-
-$nb_max_resultats_total    = 100;
-$nb_max_resultats_par_page = 10;
-$show_formulaire           = true;
-$page->assign_by_ref('show_formulaire', $show_formulaire);
-$page->assign('show_resultat', false);
-
-
-$secteur_selectionne    = Post::get('secteur');
-$ss_secteur_selectionne = Post::get('ss_secteur');
-$pays_selectionne       = Post::get('pays', '00');
-$expertise_champ        = Post::get('expertise');
-
-$page->assign('pays_selectionne',$pays_selectionne);
-$page->assign('expertise_champ',$expertise_champ);
-$page->assign('secteur_selectionne',$secteur_selectionne);
-$page->assign('ss_secteur_selectionne',$ss_secteur_selectionne);
-
-//recuperation des noms de secteurs
-$res = $globals->xdb->iterRow("SELECT id, label FROM emploi_secteur");
-$secteurs[''] = '';
-while (list($tmp_id, $tmp_label) = $res->next()) {
-    $secteurs[$tmp_id] = $tmp_label;
-}
-$page->assign_by_ref('secteurs', $secteurs);
-
-//on recupere les sous-secteurs si necessaire
-$ss_secteurs[''] = '';
-if (!empty($secteur_selectionne))
-{
-    $res = $globals->xdb->iterRow("SELECT id, label FROM emploi_ss_secteur WHERE secteur = {?}", $secteur_selectionne);
-    while (list($tmp_id, $tmp_label) = $res->next()) {
-        $ss_secteurs[$tmp_id] = $tmp_label;
-    }
-}
-$page->assign_by_ref('ss_secteurs', $ss_secteurs);
-
-//recuperation des noms de pays
-$res = $globals->xdb->iterRow("SELECT a2, pays FROM geoloc_pays WHERE pays <> '' ORDER BY pays");
-$pays['00'] = '';
-while (list($tmp_id, $tmp_label) = $res->next()) {
-    $pays[$tmp_id] = $tmp_label;
-}
-$page->assign_by_ref('pays', $pays);
-
-//On vient d'un formulaire
-if (Env::has('Chercher')) {
-
-    $champ_select = 'm.uid, a.prenom, a.nom, a.promo, l.alias, m.expertise';
-    $champ_select = $champ_select.', mp.pid';
-    $champ_select = $champ_select.', ms.secteur, ms.ss_secteur';
-
-    $clause_from = ' FROM  mentor        AS m
-                LEFT JOIN  auth_user_md5 AS a ON(m.uid = a.user_id)
-               INNER JOIN  aliases       AS l ON (a.user_id=l.id AND FIND_IN_SET(\'bestalias\',l.flags))
-                LEFT JOIN  mentor_pays   AS mp ON(m.uid = mp.uid)
-                LEFT JOIN  mentor_secteurs AS ms ON(m.uid = ms.uid)';
-
-    $clause_where = '';
-
-    if ($pays_selectionne != '00') {
-        $clause_where = $clause_where." mp.pid = '".addslashes($pays_selectionne)."' AND";
-    }
-    if ($secteur_selectionne) {
-        $clause_where = $clause_where." ms.secteur = '".addslashes($secteur_selectionne)."' AND";
-        if($ss_secteur_selectionne) {
-            $clause_where = $clause_where." ms.ss_secteur = '".addslashes($ss_secteur_selectionne)."' AND";
-        }
-    }
-
-    if($expertise_champ) {
-        $clause_where = $clause_where." MATCH(m.expertise) AGAINST('".addslashes($expertise_champ)."') AND";
-    }
-
-    if($clause_where) {
-
-        $show_formulaire = false;
-        $clause_where    = substr($clause_where, 0, -3); //on vire le dernier AND
-
-        $sql = "SELECT $champ_select $clause_from WHERE $clause_where GROUP BY uid ORDER BY RAND(".Session::getInt('uid').')';
-        $res = $globals->xdb->iterRow($sql);
-
-        if ($res->total() == 0) {
-            $page->assign('recherche_trop_large',true);
-        } else {
-            if (Env::has('page_courante')) {
-                $page_courante = Env::getInt('page_courante');
-            } else {
-                $page_courante = 1;
-            }
-
-            $current_uid = 0;
-            $nb_resultats = 0;
-            $page->assign('resultats',true);
-            $personnes = Array();
-            $page->assign_by_ref('personnes',$personnes);
-            while( (list($uid, $prenom, $nom, $promo, $bestalias,
-                        $expertise_bd, $pays_id, $secteur_id, $ss_secteur_id) = $res->next())
-                    && ($nb_resultats < $nb_max_resultats_total)){
-                if ($current_uid != $uid) {
-                    $current_uid = $uid;
-                    $page_correspondante = (int)($nb_resultats / $nb_max_resultats_par_page) +1;
-                    $nb_resultats++;
-                    if( $page_correspondante == $page_courante){
-                        $pers_trouve['nom'] = $nom;
-                        $pers_trouve['prenom'] = $prenom;
-                        $pers_trouve['promo'] = $promo;
-                        $pers_trouve['bestalias'] = $bestalias;
-                        $pers_trouve['expertise'] = $expertise_bd;
-                        $personnes[] = $pers_trouve;
-                    }
-                }
-            }
-            $nb_pages = (int) ($nb_resultats/$nb_max_resultats_par_page) + 1;
-            $page->assign('nb_pages_total', $nb_pages);
-            $page->assign('page_courante', $page_courante);
-        }
-    }
-}
-
-if ($show_formulaire) {
-    $res = $globals->xdb->query("SELECT count(*) FROM mentor");
-    $page->assign('mentors_number', $res->fetchOneCell());
-}
-
-$page->run();
-
-?>
index cc78409..a8702f3 100644 (file)
@@ -56,7 +56,7 @@ replace_ifset($appli_type1,"appli_type1");
 replace_ifset($appli_type2,"appli_type2");
 replace_ifset($nickname,"nickname");
 
-if(Env::has('modifier') || Env::has('suivant') && Env::get('old_tab') == 'general') {
+if(Env::has('modifier') || Env::has('suivant') && $opened_tab == 'general') {
     $mobile_pub = Env::get('mobile_pub');
     $web_pub = Env::has('web_pub')?'public':'private';
     $freetext_pub = Env::has('freetext_pub')?'public':'private';
index 4fd429f..df30cbe 100644 (file)
@@ -164,7 +164,7 @@ for ($adrid = 1; $adrid <= $nb_adr_max; $adrid++) {
     geoloc_adresse($adrid);
 }
 
-if(Env::get('old_tab', '') == 'adresses' && Env::has('modifier')){ // on ne valide que qd on vient du formulaire
+if ($opened_tab == 'adresses' && Env::has('modifier')){ // on ne valide que qd on vient du formulaire
 $adresses_principales = 0;
 reset($adresses);
 foreach($adresses as $adrid => $adr) {
index de64e5c..30c10b0 100644 (file)
@@ -20,7 +20,7 @@
  ***************************************************************************/
 
 
-$tabname_array = Array(
+$GLOBALS['tabname_array'] = Array(
     "general"  => "Général",
     "adresses" => "Adresses\npersonnelles",
     "poly"     => "Groupes X\nBinets",
@@ -29,35 +29,25 @@ $tabname_array = Array(
     "skill"    => "Compétences\ndiverses",
     "mentor"   => "Mentoring"
 );
-    
-$opened_tab = 'general';
 
-$page->assign("onglets",$tabname_array);
-$page->assign("onglet_last",'mentor');
+$page->assign('onglets', $GLOBALS['tabname_array']);
 
-function get_last_tab(){
-    end($GLOBALS['tabname_array']);
-    return key($GLOBALS['tabname_array']);
-}
+function get_next_tab($tabname) {
+    $tabname_array = $GLOBALS['tabname_array'];
 
-function get_next_tab($tabname){
-    global $tabname_array;
-    reset($tabname_array);
-    $marker = false;
-    while(list($current_tab,$current_tab_desc) = each($tabname_array)){
-        if($current_tab == $tabname){
+    reset ($tabname_array);
+    while (list($current_tab, ) = each($tabname_array)) {
+        if ($current_tab == $tabname){
             $res = key($tabname_array);// each() sets key to the next element
-            if($res != NULL)// if it was the last call of each(), key == NULL => we return the first key
-                return $res;
-            else{
+            if (is_null($res)) {
                 reset($tabname_array);
                 return key($tabname_array);
             }
+            return $res;
         }
     }
-    // We should not arrive to this point, but at least, we return the first key
-    reset($tabname_array);
-    return key($tabname_array);
+
+    return null;
 }
 
 ?>
index b244729..789b651 100644 (file)
@@ -118,10 +118,10 @@ class EventsModule extends PLModule
         // puis par dates croissantes d'expiration
         $promo = Session::getInt('promo');
         $sql = "SELECT  e.id,e.titre,e.texte,a.user_id,a.nom,a.prenom,a.promo,l.alias AS forlife
-                  FROM  evenements    AS e
-            INNER JOIN  auth_user_md5 AS a ON e.user_id=a.user_id
-            INNER JOIN  aliases       AS l ON ( a.user_id=l.id AND l.type='a_vie' )
-            LEFT JOIN   evenements_vus AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
+                  FROM  evenements     AS e
+            INNER JOIN  auth_user_md5  AS a ON e.user_id=a.user_id
+            INNER JOIN  aliases        AS l ON ( a.user_id=l.id AND l.type='a_vie' )
+             LEFT JOIN  evenements_vus AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
                  WHERE  FIND_IN_SET(e.flags, 'valide') AND peremption >= NOW()
                         AND (e.promo_min = 0 || e.promo_min <= {?})
                         AND (e.promo_max = 0 || e.promo_max >= {?})
index 5abe009..b86cbdc 100644 (file)
@@ -29,10 +29,13 @@ class ProfileModule extends PLModule
 
             'fiche.php'        => $this->make_hook('fiche',      AUTH_PUBLIC),
             'profile'          => $this->make_hook('profile',    AUTH_PUBLIC),
+            'profile/edit'     => $this->make_hook('p_edit',     AUTH_MDP),
             '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),
 
+            'referent'         => $this->make_hook('referent',   AUTH_COOKIE),
+            'referent/search'  => $this->make_hook('ref_search', AUTH_COOKIE),
+
             'trombi'  => $this->make_hook('trombi', AUTH_COOKIE),
 
             'vcard'   => $this->make_hook('vcard',  AUTH_COOKIE),
@@ -60,12 +63,13 @@ class ProfileModule extends PLModule
         $pnb = $res->fetchOneCell();
 
         $res = $globals->xdb->query(
-                "SELECT  promo,user_id,a.alias AS forlife,IF(nom_usage='', nom, nom_usage) AS nom,prenom
+                "SELECT  promo, user_id, a.alias AS forlife,
+                         IF (nom_usage='', nom, nom_usage) AS nom, prenom
                    FROM  photo         AS p
              INNER JOIN  auth_user_md5 AS u ON u.user_id=p.uid
              INNER JOIN  aliases       AS a ON ( u.user_id=a.id AND a.type='a_vie' )
                   $where
-               ORDER BY  promo,nom,prenom LIMIT {?}, {?}", $offset*$limit, $limit);
+               ORDER BY  promo, nom, prenom LIMIT {?}, {?}", $offset*$limit, $limit);
 
         return array($pnb, $res->fetchAllAssoc());
     }
@@ -94,7 +98,8 @@ class ProfileModule extends PLModule
                        FROM  photo
                       WHERE  uid={?}", $uid);
 
-            if ((list($type,$data) = $res->fetchOneRow()) && ($photo_pub == 'public' || logged())) {
+            if ((list($type, $data) = $res->fetchOneRow())
+            &&  ($photo_pub == 'public' || logged())) {
                 Header("Content-type: image/$type");
                 echo $data;
             } else {
@@ -195,20 +200,20 @@ class ProfileModule extends PLModule
 
         $photo = $globals->baseurl.'/photo/'.$user['forlife'].($new ? '/req' : '');
 
-        if(!isset($user['y']) and !isset($user['x'])) {
+        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){
+        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){
+        if ($user['y'] > 300) {
             $user['x'] = (integer)($user['x']*300/$user['y']);
             $user['y'] = 300;
         }
-        if($user['x'] < 160){
+        if ($user['x'] < 160) {
             $user['y'] = (integer)($user['y']*160/$user['x']);
             $user['x'] = 160;
         }
@@ -238,6 +243,119 @@ class ProfileModule extends PLModule
         return PL_OK;
     }
 
+    function handler_p_edit(&$page, $opened_tab = 'general')
+    {
+        global $globals;
+
+        $page->changeTpl('profil.tpl');
+
+        $page->addCssLink('css/profil.css');
+        $page->assign('xorg_title', 'Polytechnique.org - Mon Profil');
+
+        require_once 'tabs.inc.php';
+        require_once 'profil.func.inc.php';
+        require_once 'synchro_ax.inc.php';
+
+        if (Post::has('register_from_ax_question')) {
+            $globals->xdb->query('UPDATE auth_user_quick
+                                     SET profile_from_ax = 1
+                                   WHERE user_id = {?}',
+                                 Session::getInt('uid'));
+        }
+
+        if (is_ax_key_missing()) {
+            $page->assign('no_private_key', true);
+        }
+
+        if (Env::get('synchro_ax') == 'confirm' && !is_ax_key_missing()) {
+            ax_synchronize(Session::get('bestalias'), Session::getInt('uid'));
+            $page->trig('Ton profil a été synchronisé avec celui du site polytechniciens.com');
+        }
+
+        // pour tous les tabs, la date de naissance pour verifier
+        // quelle est bien rentree et la date.
+        $res = $globals->xdb->query(
+                "SELECT  naissance, DATE_FORMAT(date, '%d.%m.%Y')
+                   FROM  auth_user_md5
+                  WHERE  user_id={?}", Session::getInt('uid'));
+        list($naissance, $date_modif_profil) = $res->fetchOneRow();
+
+        // lorsqu'on n'a pas la date de naissance en base de données
+        if (!$naissance)  {
+            // la date de naissance n'existait pas et vient d'être soumise dans la variable
+            if (Env::has('birth')) {
+                //en cas d'erreur :
+                if (!ereg('[0-3][0-9][0-1][0-9][1][9]([0-9]{2})', Env::get('birth'))) {
+                    $page->assign('etat_naissance', 'query');
+                    $page->trig('Date de naissance incorrecte ou incohérente.');
+                    return PL_OK;
+                }
+
+                //sinon
+                $birth = sprintf("%s-%s-%s", substr(Env::get('birth'), 4, 4),
+                                 substr(Env::get('birth'), 2, 2),
+                                 substr(Env::get('birth'), 0, 2));
+                $globals->xdb->execute("UPDATE auth_user_md5
+                                           SET naissance={?}
+                                         WHERE user_id={?}", $birth,
+                                       Session::getInt('uid'));
+                $page->assign('etat_naissance', 'ok');
+                return PL_OK;
+            }
+
+            $page->assign('etat_naissance', 'query');
+            return PL_OK; // on affiche le formulaire pour naissance
+        }
+
+        //doit-on faire un update ?
+        if (Env::has('modifier') || Env::has('suivant')) {
+            require_once "profil/get_{$opened_tab}.inc.php";
+            require_once "profil/verif_{$opened_tab}.inc.php";
+
+            if($page->nb_errs()) {
+                require_once "profil/assign_{$opened_tab}.inc.php";
+                $page->assign('onglet', $opened_tab);
+                $page->assign('onglet_tpl', "profil/$opened_tab.tpl");
+                return PL_OK;
+            }
+
+            $date=date("Y-m-j");//nouvelle date de mise a jour
+
+            //On sauvegarde l'uid pour l'AX
+            /* on sauvegarde les changements dans user_changes :
+            * on a juste besoin d'insérer le user_id de la personne dans la table
+            */
+            $globals->xdb->execute('REPLACE INTO user_changes SET user_id={?}',
+                                   Session::getInt('uid'));
+
+            if (!Session::has('suid')) {
+                require_once 'notifs.inc.php';
+                register_watch_op(Session::getInt('uid'), WATCH_FICHE);
+            }
+
+            // mise a jour des champs relatifs au tab ouvert
+            require_once "profil/update_{$opened_tab}.inc.php";
+
+            $log =& Session::getMixed('log');
+            $log->log('profil', $opened_tab);
+            $page->assign('etat_update', 'ok');
+        }
+
+        if (Env::has('suivant')) {
+            redirect($globals->baseurl . '/profile/edit/' .
+                     get_next_tab($opened_tab));
+        }
+
+        require_once "profil/get_{$opened_tab}.inc.php";
+        require_once "profil/verif_{$opened_tab}.inc.php";
+        require_once "profil/assign_{$opened_tab}.inc.php";
+
+        $page->assign('onglet', $opened_tab);
+        $page->assign('onglet_tpl', "profil/$opened_tab.tpl");
+
+        return PL_OK;
+    }
+
     function handler_p_orange(&$page)
     {
         global $globals;
@@ -248,11 +366,11 @@ class ProfileModule extends PLModule
         require_once 'xorg.misc.inc.php';
 
         $res = $globals->xdb->query(
-                "SELECT  u.promo,u.promo_sortie
+                "SELECT  u.promo, u.promo_sortie
                    FROM  auth_user_md5  AS u
                   WHERE  user_id={?}", Session::getInt('uid'));
 
-        list($promo,$promo_sortie_old) = $res->fetchOneRow();
+        list($promo, $promo_sortie_old) = $res->fetchOneRow();
         $page->assign('promo_sortie_old', $promo_sortie_old);
         $page->assign('promo',  $promo);
 
@@ -274,7 +392,7 @@ class ProfileModule extends PLModule
         elseif ($promo_sortie == $promo + 3) {
             $globals->xdb->execute(
                 "UPDATE  auth_user_md5 set promo_sortie={?} 
-                  WHERE  user_id={?}",$promo_sortie,Session::getInt('uid'));
+                  WHERE  user_id={?}", $promo_sortie, Session::getInt('uid'));
                 $page->trig('Ton statut "orange" a été supprimé.');
                 $page->assign('promo_sortie_old', $promo_sortie);
         }
@@ -292,7 +410,7 @@ class ProfileModule extends PLModule
         return PL_OK;
     }
 
-    function handler_p_referent(&$page, $x = null)
+    function handler_referent(&$page, $x = null)
     {
         global $globals;
 
@@ -308,7 +426,8 @@ class ProfileModule extends PLModule
         $res = $globals->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 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);
@@ -359,6 +478,122 @@ class ProfileModule extends PLModule
         return PL_OK;
     }
 
+    function handler_ref_search(&$page)
+    {
+        global $globals;
+
+        $page->changeTpl('referent.tpl');
+
+        $page->assign('xorg_title', 'Polytechnique.org - Conseil Pro');
+
+        $secteur_sel     = Post::get('secteur');
+        $ss_secteur_sel  = Post::get('ss_secteur');
+        $pays_sel        = Post::get('pays', '00');
+        $expertise_champ = Post::get('expertise');
+
+        $page->assign('pays_sel', $pays_sel);
+        $page->assign('expertise_champ', $expertise_champ);
+        $page->assign('secteur_sel', $secteur_sel);
+        $page->assign('ss_secteur_sel', $ss_secteur_sel);
+
+        //recuperation des noms de secteurs
+        $res = $globals->xdb->iterRow("SELECT id, label FROM emploi_secteur");
+        $secteurs[''] = '';
+        while (list($tmp_id, $tmp_label) = $res->next()) {
+            $secteurs[$tmp_id] = $tmp_label;
+        }
+        $page->assign_by_ref('secteurs', $secteurs);
+
+        //on recupere les sous-secteurs si necessaire
+        $ss_secteurs[''] = '';
+        if (!empty($secteur_sel)) {
+            $res = $globals->xdb->iterRow("SELECT id, label FROM emploi_ss_secteur
+                                          WHERE secteur = {?}", $secteur_sel);
+            while (list($tmp_id, $tmp_label) = $res->next()) {
+                $ss_secteurs[$tmp_id] = $tmp_label;
+            }
+        }
+        $page->assign_by_ref('ss_secteurs', $ss_secteurs);
+
+        //recuperation des noms de pays
+        $res = $globals->xdb->iterRow("SELECT a2, pays FROM geoloc_pays
+                                      WHERE pays <> '' ORDER BY pays");
+        $pays['00'] = '';
+        while (list($tmp_id, $tmp_label) = $res->next()) {
+            $pays[$tmp_id] = $tmp_label;
+        }
+        $page->assign_by_ref('pays', $pays);
+
+        // nb de mentors
+        $res = $globals->xdb->query("SELECT count(*) FROM mentor");
+        $page->assign('mentors_number', $res->fetchOneCell());
+
+        if (!Env::has('Chercher')) {
+            return PL_OK;
+        }
+
+        // On vient d'un formulaire
+        $where = array();
+
+        if ($pays_sel != '00') {
+            $where[] = "mp.pid = '".addslashes($pays_sel)."'";
+        }
+        if ($secteur_sel) {
+            $where[] = "ms.secteur = '".addslashes($secteur_sel)."'";
+            if ($ss_secteur_sel) {
+                $where[] = "ms.ss_secteur = '".addslashes($ss_secteur_sel)."'";
+            }
+        }
+        if ($expertise_champ) {
+            $where[] = "MATCH(m.expertise) AGAINST('".addslashes($expertise_champ)."')";
+        }
+
+        if ($where) {
+            $where = join(' AND ', $where);
+
+            $sql = "SELECT  m.uid, a.prenom, a.nom, a.promo,
+                            l.alias AS bestalias, m.expertise, mp.pid,
+                            ms.secteur, ms.ss_secteur
+                      FROM  mentor        AS m
+                 LEFT JOIN  auth_user_md5 AS a ON(m.uid = a.user_id)
+                INNER JOIN  aliases       AS l ON (a.user_id=l.id AND
+                                                   FIND_IN_SET('bestalias', l.flags))
+                 LEFT JOIN  mentor_pays   AS mp ON(m.uid = mp.uid)
+                 LEFT JOIN  mentor_secteurs AS ms ON(m.uid = ms.uid)
+                     WHERE  $where
+                  GROUP BY  uid
+                  ORDER BY  RAND({?})";
+            $res = $globals->xdb->iterator($sql, Session::getInt('uid'));
+
+            if ($res->total() == 0) {
+                $page->assign('recherche_trop_large', true);
+                return PL_OK;
+            }
+
+            $nb_max_res_total = 100;
+            $nb_max_res_ppage = 10;
+
+            $curpage   = Env::getInt('curpage', 1);
+            $personnes = array();
+            $i         = 0;
+
+            while (($pers = $res->next()) && count($personnes) < $nb_max_res_total) {
+                $the_page = intval($i / $nb_max_res_ppage) + 1;
+                if ($the_page == $curpage) {
+                    $personnes[] = $pers;
+                }
+                $i ++;
+            }
+
+            $page->assign('personnes', $personnes);
+            $page->assign('curpage',   $curpage);
+            $page->assign('nb_pages_total',
+                          intval($res->total() / $nb_max_res_ppage) + 1);
+        }
+
+        return PL_OK;
+    }
+
     function handler_p_usage(&$page)
     {
         global $globals;
@@ -369,12 +604,13 @@ class ProfileModule extends PLModule
         require_once 'xorg.misc.inc.php';
 
         $res = $globals->xdb->query(
-                "SELECT  u.nom,u.nom_usage,u.flags,e.alias
+                "SELECT  u.nom, u.nom_usage, u.flags, e.alias
                    FROM  auth_user_md5  AS u
-              LEFT JOIN  aliases        AS e ON(u.user_id = e.id AND FIND_IN_SET('usage',e.flags))
+              LEFT JOIN  aliases        AS e ON(u.user_id = e.id
+                                                AND FIND_IN_SET('usage', e.flags))
                   WHERE  user_id={?}", Session::getInt('uid'));
 
-        list($nom,$usage_old,$flags,$alias_old) = $res->fetchOneRow();
+        list($nom, $usage_old, $flags, $alias_old) = $res->fetchOneRow();
         $flags = new flagset($flags);
         $page->assign('usage_old', $usage_old);
         $page->assign('alias_old',  $alias_old);
@@ -407,7 +643,7 @@ class ProfileModule extends PLModule
         require_once 'trombi.inc.php';
 
         $page->changeTpl('trombipromo.tpl');
-        $page->assign('xorg_title','Polytechnique.org - Trombi Promo');
+        $page->assign('xorg_title', 'Polytechnique.org - Trombi Promo');
 
         if (is_null($promo)) {
             return PL_OK;
index 6ed7256..6750a39 100644 (file)
@@ -33,7 +33,7 @@ function chgMainWinLoc( strPage ) {
 {/literal}
 
 {if $logged and $x.forlife eq $smarty.session.forlife}
-[<a href="javascript:x()" onclick="chgMainWinLoc('{rel}/profil.php')">Modifier ma fiche</a>]
+[<a href="javascript:x()" onclick="chgMainWinLoc('{rel}/profile/edit')">Modifier ma fiche</a>]
 {/if}
 
 <table id="fiche" cellpadding="0" cellspacing="0">
@@ -107,7 +107,7 @@ function chgMainWinLoc( strPage ) {
         {/if}
         {if $logged}
         {if $x.is_referent}
-        [<a href="{rel}/profile/referent/{$x.forlife}" class='popup2'>Ma fiche référent</a>]
+        [<a href="{rel}/referent/{$x.forlife}" class='popup2'>Ma fiche référent</a>]
         {/if}
         {/if}
       </div>
index 0091eaa..a31cf6a 100644 (file)
@@ -33,7 +33,7 @@
          style="border:inherit;background:#AFA"
          onclick="blur()"
        >{$adr.geoloc}</textarea><p class="right">
-       [<a href="{$smarty.server.PHP_SELF}?old_tab={$smarty.request.old_tab}&amp;parsevalid[{$adrid}]=1&amp;modifier=1">Valider</a>]
+       [<a href="{rel}/profile/edit/{$onglet}?parsevalid[{$adrid}]=1&amp;modifier=1">Valider</a>]
        </p>
     {else}
     <tr class="center">
index 1edf1dd..126f34c 100644 (file)
@@ -32,8 +32,8 @@
         <img src="{rel}/photo/{$p.forlife}" width="110" alt=" [ PHOTO ] " />
       </a>
       {if $trombi_admin && $smarty.session.perms eq 'admin'}
-      <a href="{"admin/admin_trombino.php"|url}?uid={$p.user_id}">
-        <img src="{"images/admin.png"}" alt="[admin]" title="[admin]" />
+      <a href="{rel}/admin/admin_trombino.php?uid={$p.user_id}">
+        <img src="{rel}/images/admin.png" alt="[admin]" title="[admin]" />
       </a>
       {/if}
       <br />
index dadd2ab..3b3d49e 100644 (file)
@@ -46,7 +46,7 @@ Bienvenue {$smarty.session.prenom}
   <a href="{rel}/profile/{$smarty.session.forlife}" class="popup2">fiche</a>
   date du {$fiche_incitation|date_format}.
   Il est possible qu'elle ne soit pas à jour.
-  Si tu souhaites la modifier, <a href="profil.php">clique ici !</a>
+  Si tu souhaites la modifier, <a href="{rel}/profile/edit">clique ici !</a>
   </p>
 {/if}
 
@@ -59,7 +59,8 @@ Bienvenue {$smarty.session.prenom}
 
 {if $geoloc_incitation > 0}
   <p>
-    Parmi tes adresses, il y en a {$geoloc_incitation} que nous n'avons pas pu localiser. Clique <a href="{rel}/profil.php?old_tab=adresses">ici</a> pour rectifier.
+    Parmi tes adresses, il y en a {$geoloc_incitation} que nous n'avons pas pu localiser.
+    Clique <a href="{rel}/profile/edit/adresses">ici</a> pour rectifier.
   </p>
 {/if}
 <br />
index 8093f27..8d8c8b5 100644 (file)
@@ -31,7 +31,7 @@
     Pour supprimer ton nom d'usage, fais une demande avec un nom vide et en précisant la raison.
   </p>
   <p>
-    [<a href='{$smarty.server.PHP_SELF}'>Refaire une demande</a>] - [<a href='profil.php'>Retour au profil</a>]
+    [<a href='{$smarty.server.PHP_SELF}'>Refaire une demande</a>] - [<a href='{rel}/profile/edit'>Retour au profil</a>]
   </p>
 {else}
   {if $myusage}
index be8a6df..17d8672 100644 (file)
@@ -56,6 +56,6 @@
 
 {/if}
 
-<p>[<a href="profil.php">Revenir au profil</a>]</p>
+<p>[<a href="{rel}/profile/edit">Revenir au profil</a>]</p>
 
 {* vim:set et sw=2 sts=2 sws=2: *}
index 2ef528c..8bc2ace 100644 (file)
@@ -35,7 +35,7 @@ telle qu'elle appara
 l'<a href="{rel}/profile/{$smarty.session.forlife}?view=ax" class="popup2">AX</a>
 ou à <a href="{rel}/profile/{$smarty.session.forlife}?view=public" class="popup2">tout le monde</a>.</p>
 
-<form action="{$smarty.server.PHP_SELF}" method="post" id="prof_annu">
+<form action="{rel}/profile/edit/{$onglet}" method="post" id="prof_annu">
   <table class="cadre_a_onglet" cellpadding="0" cellspacing="0" style="width: 98%; margin-left:1%;">
     <tr>
       <td>
@@ -44,11 +44,10 @@ ou 
           {if $o eq $onglet}
           <li class="actif">{$i|nl2br}</li>
           {else}
-          <li><a href="{$smarty.server.PHP_SELF}?old_tab={$o}">{$i|nl2br}</a></li>
+          <li><a href="{rel}/profile/edit/{$o}">{$i|nl2br}</a></li>
           {/if}
           {/foreach}
         </ul>
-        <input type="hidden" value="{$onglet}" name="old_tab" />
         <input type="hidden" value="" name="adresse_flag" />
       </td>
     </tr>
@@ -64,15 +63,9 @@ ou 
             <td>
               <input type="submit" value="Valider ces modifications" name="modifier" />
             </td>
-            {if $onglet != $onglet_last}
             <td>
               <input type="submit" value="Valider et passer au prochain onglet" name="suivant" />
             </td>
-            {else}
-            <td>
-              <input type="submit" value="Valider et revenir au premier onglet" name="suivant" />
-            </td>
-            {/if}
           </tr>
         </table>
       </td>
index c59395c..febaf6d 100644 (file)
@@ -47,7 +47,7 @@
         <input type="hidden" name="numero_formulaire[{$adrid}]" value="{$smarty.section.i.index}" />
         {/if}
         {if $adr.nouvelle != 'new'}
-        [<a href="{$smarty.server.PHP_SELF}?old_tab={$smarty.request.old_tab}&amp;adrid_del[{$adrid}]=1" style="color:inherit">La supprimer !</a>]
+        [<a href="{rel}/profile/edit/{$onglet}?adrid_del[{$adrid}]=1" style="color:inherit">La supprimer !</a>]
         {/if}
       </th>
     </tr>
@@ -66,7 +66,7 @@
     {else}
     {assign var="titre" value="Nouvelle adresse&nbsp;:"}
     {/if}
-    {include file="geoloc/form.address.tpl" adr=$adr titre=$titre url="`$smarty.server.PHP_SELF`?old_tab=`$smarty.request.old_tab`"}
+    {include file="geoloc/form.address.tpl" adr=$adr titre=$titre url="profile/edit/`$onglet`"|url}
     <tr>
       <td class="colg">
         <span class="titre">Adresse:</span>
index 22996b9..63772e2 100644 (file)
@@ -75,7 +75,7 @@ te contactent afin de te demander conseil, dans les domaines que tu connais
 bien, et pour lesquels tu pourrais les aider, remplis cette rubrique.<br />
 Tu peux mentionner ici les domaines de compétences, les expériences 
 notamment internationales sur la base desquels tu seras identifiable depuis
-<a href="referent.php">la page de recherche d'un conseil professionnel</a>.
+<a href="{rel}/referent">la page de recherche d'un conseil professionnel</a>.
 </p>
 
 <div class="blocunite_tab">
index 8ee4a47..48878fa 100644 (file)
@@ -31,7 +31,7 @@
 
 <h1>Date de naissance</h1>
 
-<form action="profil.php" method="post">
+<form action="{rel}/profile/edit" method="post">
   <p>
   Avant d'accéder à ton profil pour la première fois, tu dois donner ta date de naissance au format JJMMAAAA.
   Elle ne sera plus demandée par la suite et ne pourra être changée.
index 1b401f1..cb8966e 100644 (file)
@@ -24,8 +24,8 @@
 {literal}
 <script type="text/javascript">
   <!-- Begin
-  function showPage( pNumber ) {
-    document.forms.form_result.page_courante.value = pNumber;
+  function showPage(pNumber) {
+    document.forms.form_result.curpage.value = pNumber;
     document.forms.form_result.submit();
   }
   // End -->
 <p>
 Les critères de recherche que tu as rentrés n'ont pas produit de résultats,
 sans doute car ta requête était trop générale. Nous t'invitons à
-<a href="referent.php">procéder à une nouvelle recherche</a>, en essayant
+<a href="{rel}/referent/search">procéder à une nouvelle recherche</a>, en essayant
 d'être plus précis.
 </p>
-{elseif $resultats}
-<form action="{$smarty.server.PHP_SELF}" method="post" id="form_result">
-  <div class="contact-list" style="clear:both" >
-  <input type="hidden" name="pays" value="{$pays_selectionne}" />
-  <input type="hidden" name="expertise" value="{$expertise_champ}" />
-  <input type="hidden" name="secteur" value="{$secteur_selectionne}" />
-  <input type="hidden" name="ss_secteur" value="{$ss_secteur_selectionne}" />
-  <input type="hidden" name="page_courante" value="1" />
-  <input type="hidden" name="Chercher" value="1" />
-  {section name="resultat" loop=$personnes}
-    <div class="contact">
-      <div class="nom">
-        {$personnes[resultat].nom} {$personnes[resultat].prenom}
-      </div>
-      <div class="appli">
-        X{$personnes[resultat].promo}
-      </div>
-      <div class="bits" style="width: 40%;">
-        <span class='smaller'>
-        <a href="{rel}/profile/{$personnes[resultat].bestalias}" class="popup2">
-          <img src="images/loupe.gif" alt="voir sa fiche" title="Voir sa fiche" /></a> - 
-          <a href="{rel}/profile/referent/{$personnes[resultat].bestalias}" class="popup2">Voir sa fiche référent</a>
-        </span>
-      </div>
-      <div class="long">
-       <table cellspacing="0" cellpadding="0">
-        <tr>
-          <td class="lt">Expertise :</td>
-          <td class="rt" colspan="2">{$personnes[resultat].expertise|nl2br}</td>
-        </tr>
-       </table>
-      </div>
+{elseif $personnes}
+<div class="contact-list" style="clear:both" >
+{foreach from=$personnes item=p}
+  <div class="contact">
+    <div class="nom">
+      {$p.nom} {$p.prenom}
+    </div>
+    <div class="appli">
+      X{$p.promo}
+    </div>
+    <div class="bits" style="width: 40%;">
+      <span class='smaller'>
+      <a href="{rel}/profile/{$p.bestalias}" class="popup2">
+        <img src="{rel}/images/loupe.gif" alt="voir sa fiche" title="Voir sa fiche" /></a> - 
+        <a href="{rel}/referent/{$p.bestalias}" class="popup2">Voir sa fiche référent</a>
+      </span>
+    </div>
+    <div class="long">
+     <table cellspacing="0" cellpadding="0">
+      <tr>
+        <td class="lt">Expertise :</td>
+        <td class="rt" colspan="2">{$p.expertise|nl2br}</td>
+      </tr>
+     </table>
     </div>
-  {/section}
   </div>
+{/foreach}
+</div>
+<form action="{rel}/referent/search" method="post" id="form_result">
   <p>
+    <input type="hidden" name="secteur"    value="{$secteur_sel}" />
+    <input type="hidden" name="ss_secteur" value="{$ss_secteur_sel}" />
+    <input type="hidden" name="pays"       value="{$pays_sel}" />
+    <input type="hidden" name="expertise"  value="{$expertise_champ}" />
+    <input type="hidden" name="curpage"    value="{$curpage}" />
+    <input type="hidden" name="Chercher"   value="1" />
+
     Pages&nbsp;:&nbsp;
     {section name="page_number" start=1 loop=$nb_pages_total+1}
-    {if $smarty.section.page_number.index == $page_courante}
-    {$page_courante} {else}
+    {if $smarty.section.page_number.index == $curpage}
+    {$curpage} {else}
     <a href="javascript:showPage({$smarty.section.page_number.index})">{$smarty.section.page_number.index} </a> 
     {/if}
     {/section}
   </p>
 </form>
-{/if}
-{if $show_formulaire}
+{else}
 <span class="erreur">
   Si tu utilises ce service pour la première fois, lis attentivement le texte
   qui suit.
 </span>
 <p>
-En <a href="profil.php">renseignant sa fiche dans l'annuaire</a>, chacun
+En <a href="{rel}/profile/edit">renseignant sa fiche dans l'annuaire</a>, chacun
 d'entre nous a la possibilité de renseigner, dans la section "Mentoring",
 s'il accepte de recevoir des messages de la part de camarades qui pourraient
 souhaiter lui poser quelques questions et recevoir quelques conseils.<br />
@@ -146,7 +146,7 @@ Actuellement, {$mentors_number} mentors et r
       </td>
       <td >
         <select name="secteur" onchange="javascript:submit()">
-          {html_options options=$secteurs selected=$secteur_selectionne}
+          {html_options options=$secteurs selected=$secteur_sel}
         </select>
       </td>
     </tr>
@@ -156,7 +156,7 @@ Actuellement, {$mentors_number} mentors et r
       </td>
       <td >
         <select name="ss_secteur">
-          {html_options options=$ss_secteurs selected=$ss_secteur_selectionne}
+          {html_options options=$ss_secteurs selected=$ss_secteur_sel}
         </select>
       </td>
     </tr>
@@ -166,7 +166,7 @@ Actuellement, {$mentors_number} mentors et r
       </td>
       <td >
         <select name="pays">
-          {html_options options=$pays selected=$pays_selectionne}
+          {html_options options=$pays selected=$pays_sel}
         </select>
       </td>
     </tr>
index 9418a5b..d154edb 100644 (file)
@@ -92,7 +92,7 @@ trait
 
 <h2>Rejoindre la communauté</h2>
 
-<form action='{rel}/profil.php' method='post'>
+<form action='{rel}/profile/edit' method='post'>
   <p>
   Pour rejoindre la communauté des X sur le web, nous te convions le plus vivement à remplir ton profil !!!
   </p>