motdepasse -> password
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 9 Jul 2006 00:02:52 +0000 (00:02 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 9 Jul 2006 00:02:52 +0000 (00:02 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@400 839d8a87-29fc-0310-9880-83ba4fa771e5

hooks/tmp.inc.php
htdocs/motdepasse.php [deleted file]
include/login.conf.php
modules/platal.php
templates/inscription/step4.tpl [deleted file]
templates/preferences.tpl

index e83fd3f..dcca4ef 100644 (file)
@@ -26,7 +26,7 @@ function tmp_menu()
     $globals->menu->addPrivateEntry(XOM_CUSTOM,   10, 'Mon profil',         'profil.php');
     $globals->menu->addPrivateEntry(XOM_CUSTOM,   20, 'Mes contacts',       'carnet/mescontacts.php');
     $globals->menu->addPrivateEntry(XOM_CUSTOM,   30, 'Mon carnet',         'carnet/');
-    $globals->menu->addPrivateEntry(XOM_CUSTOM,   40, 'Mon mot de passe',   'motdepasse.php');
+    $globals->menu->addPrivateEntry(XOM_CUSTOM,   40, 'Mon mot de passe',   'password');
     $globals->menu->addPrivateEntry(XOM_CUSTOM,   50, 'Mes préférences',    'preferences');
 
     $globals->menu->addPrivateEntry(XOM_GROUPS,   10, 'Trombi/Site promo',  'trombipromo.php');
diff --git a/htdocs/motdepasse.php b/htdocs/motdepasse.php
deleted file mode 100644 (file)
index a590dd1..0000000
+++ /dev/null
@@ -1,46 +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');
-
-if (Post::has('response2'))  {
-    require_once('secure_hash.inc.php');
-    $password = Post::get('response2');
-    $_SESSION['password'] = $password;
-    
-    $globals->xdb->execute('UPDATE auth_user_md5 SET password={?} WHERE user_id={?}', $password, Session::getInt('uid'));
-    
-    $log =& Session::getMixed('log');
-    $log->log('passwd', '');
-
-    if (Cookie::get('ORGaccess')) {
-        setcookie('ORGaccess', hash_encrypt($password), (time()+25920000), '/', '' ,0);
-    }
-
-    new_skinned_page('motdepasse.success.tpl', AUTH_MDP);
-    $page->run();
-}
-
-new_skinned_page('motdepasse.tpl', AUTH_MDP);
-$page->addJsLink('javascript/motdepasse.js');
-$page->assign('xorg_title','Polytechnique.org - Mon mot de passe');
-$page->run();
-?>
index 6d8faca..c577dfd 100644 (file)
@@ -5,15 +5,15 @@ $pub_nbCol = 2 ;
 
 // Liens apparaissant toujours
 $pub_tjs = array(
-    "motdepasse.php" => "Changer mon mot de passe" ,
-    "Docs/Dons"      => "Faire un don à l'association Polytechnique.org"
+    'password'   => 'Changer mon mot de passe' ,
+    'Docs/Dons'  => 'Faire un don à l\'association Polytechnique.org'
     ) ;
 
 // Liens apparaissant de façon aléatoire
 $pub_rnd = array(
-    "newsletter/show.php?nid=last"                 => "Afficher la dernière newsletter" ,
-    "http://www.polytechnique.net"                 => "Vers les autres sites polytechniciens" ,
+    'newsletter/show.php?nid=last'                 => 'Afficher la dernière newsletter' ,
+    'http://www.polytechnique.net'                 => 'Vers les autres sites polytechniciens' ,
     "trombipromo.php?xpromo={$_SESSION["promo"]}"   => "Voir le trombi de ma promo" ,
-    "banana/"                                       => "Un petit tour du côté des forums !!"
+    'banana/'                                       => 'Un petit tour du côté des forums !!'
     ) ;
 ?>
index 356927f..640e1ca 100644 (file)
@@ -25,6 +25,7 @@ class PlatalModule extends PLModule
     {
         return array(
             'preferences' => $this->make_hook('prefs', AUTH_COOKIE),
+            'password'    => $this->make_hook('password', AUTH_MDP),
             'skin'        => $this->make_hook('skin', AUTH_COOKIE),
         );
     }
@@ -68,6 +69,38 @@ class PlatalModule extends PLModule
         return PL_OK;
     }
 
+    function handler_password(&$page)
+    {
+        global $globals;
+
+        if (Post::has('response2'))  {
+            require_once 'secure_hash.inc.php';
+
+            $_SESSION['password'] = $password = Post::get('response2');
+
+            $globals->xdb->execute('UPDATE  auth_user_md5 
+                                       SET  password={?}
+                                     WHERE  user_id={?}', $password,
+                                     Session::getInt('uid'));
+
+            $log =& Session::getMixed('log');
+            $log->log('passwd', '');
+
+            if (Cookie::get('ORGaccess')) {
+                setcookie('ORGaccess', hash_encrypt($password), (time()+25920000), '/', '' ,0);
+            }
+
+            $page->changeTpl('motdepasse.success.tpl');
+            $page->run();
+        }
+
+        $page->changeTpl('motdepasse.tpl');
+        $page->addJsLink('javascript/motdepasse.js');
+        $page->assign('xorg_title','Polytechnique.org - Mon mot de passe');
+
+        return PL_OK;
+    }
+
     function handler_skin(&$page)
     {
         global $globals;
diff --git a/templates/inscription/step4.tpl b/templates/inscription/step4.tpl
deleted file mode 100644 (file)
index 3a2bad3..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-{**************************************************************************}
-{*                                                                        *}
-{*  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               *}
-{*                                                                        *}
-{**************************************************************************}
-
-<h1>Dernière étape</h1>
-<p>
-  Tu as maintenant accès au site en utilisant les paramètres reçus par mail.
-  Ton adresse électronique à vie <strong>{$forlife}@polytechnique.org</strong>
-  est déjà ouverte, essaie-la !
-</p>
-<p>
-  Remarque: m4x.org est un domaine "discret" qui veut dire "mail for X" et
-  qui comporte exactement les mêmes adresses que le domaine polytechnique.org.
-</p>
-<p>
-<strong><a href="{#globals.baseurl#}/motdepasse.php">Clique ici pour changer ton mot de passe.</a></strong>
-</p>
-<p>
-  N'oublie pas : si tu perds ton mot de passe, nous n'avons aucun engagement, en
-  particulier en termes de rapidité, mais pas seulement, à te redonner accès au
-  site. Cela peut prendre plusieurs semaines, les pertes de mot de passe sont
-  traitées avec la priorité minimale.
-</p>
-
-{* vim:set et sw=2 sts=2 sws=2: *}
index 56ced8b..29b6004 100644 (file)
@@ -55,7 +55,7 @@
   </tr>
   <tr class="impair">
     <td>
-      <h3><a href="{"motdepasse.php"|url}">Changer mon mot de passe pour le site</a></h3>
+      <h3><a href="{rel}/password">Changer mon mot de passe pour le site</a></h3>
       <div class='explication'>
         permet de changer ton mot de passe pour accéder au site Polytechnique.org
       </div>