$mymail->addTo($mails);
$mymail->setSubject('Ton certificat d\'authentification');
$mymail->setTxtBody("Visite la page suivante qui expire dans six heures :
-{$globals->baseurl}/tmpPWD.php?certificat=$url
+{$globals->baseurl}/tmpPWD/$url
Si en cliquant dessus tu n'y arrives pas, copie intégralement l'adresse dans la barre de ton navigateur.
+++ /dev/null
-<?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");
-
-$globals->xdb->execute('DELETE FROM perte_pass WHERE DATE_SUB(NOW(), INTERVAL 380 MINUTE) > created');
-
-$certif = Env::get('certificat');
-$res = $globals->xdb->query('SELECT uid FROM perte_pass WHERE certificat={?}', $certif);
-
-if ($ligne = $res->fetchOneAssoc()) {
- $uid = $ligne["uid"];
- if (Post::has('response2')) {
- $password = Post::get('response2');
- $logger = new DiogenesCoreLogger($uid);
- $globals->xdb->query('UPDATE auth_user_md5 SET password={?} WHERE user_id={?} AND perms IN("admin","user")', $password, $uid);
- $globals->xdb->query('DELETE FROM perte_pass WHERE certificat={?}', $certif);
- $logger->log("passwd","");
- new_skinned_page('tmpPWD.success.tpl', AUTH_PUBLIC);
- $page->run();
- } else {
- new_skinned_page('motdepasse.tpl', AUTH_PUBLIC);
- $page->addJsLink('javascript/motdepasse.js');
- $page->run();
- }
-} else {
- new_skinned_page('index.tpl', AUTH_PUBLIC);
- $page->kill("Cette adresse n'existe pas ou n'existe plus sur le serveur.");
-}
-
-?>
htdocs/images/sk_default_lesX.gif
htdocs/images/sk_default_snapshot.png
htdocs/images/sk_default_titre.gif
-htdocs/index.php
htdocs/javascript/do_challenge_response.js
htdocs/javascript/md5.js
htdocs/javascript/xorg.js
-htdocs/motdepasse.php
-htdocs/preferences.php
htdocs/recovery.php
-htdocs/tmpPWD.php
include/validations.inc.php
include/xml-rpc-client.inc.php
include/platal/database.inc.php
return array(
'preferences' => $this->make_hook('prefs', AUTH_COOKIE),
'password' => $this->make_hook('password', AUTH_MDP),
+ 'tmpPWD' => $this->make_hook('tmpPWD', AUTH_PUBLIC),
'skin' => $this->make_hook('skin', AUTH_COOKIE),
);
}
return PL_OK;
}
+ function handler_tmpPWD(&$page, $certif = null)
+ {
+ global $globals;
+
+ $globals->xdb->execute('DELETE FROM perte_pass
+ WHERE DATE_SUB(NOW(), INTERVAL 380 MINUTE) > created');
+
+ $res = $globals->xdb->query('SELECT uid FROM perte_pass WHERE certificat={?}', $certif);
+ $ligne = $res->fetchOneAssoc();
+ if (!$ligne) {
+ $page->changeTpl('index.tpl');
+ $page->kill("Cette adresse n'existe pas ou n'existe plus sur le serveur.");
+ }
+
+ $uid = $ligne["uid"];
+ if (Post::has('response2')) {
+ $password = Post::get('response2');
+ $logger = new DiogenesCoreLogger($uid);
+ $globals->xdb->query('UPDATE auth_user_md5 SET password={?}
+ WHERE user_id={?} AND perms IN("admin","user")',
+ $password, $uid);
+ $globals->xdb->query('DELETE FROM perte_pass WHERE certificat={?}', $certif);
+ $logger->log("passwd","");
+ $page->changeTpl('tmpPWD.success.tpl');
+ } else {
+ $page->changeTpl('motdepasse.tpl');
+ $page->addJsLink('javascript/motdepasse.js');
+ }
+
+ return PL_OK;
+ }
+
function handler_skin(&$page)
{
global $globals;