<?php
/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
+ * Copyright (C) 2003-2007 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
WHERE user_id={?} AND perms='pending'", $uid);
if (list($nom, $prenom, $promo, $matricule) = $res->fetchOneRow()) {
- require_once('register.inc.php');
+ require_once('user.func.inc.php');
$matricule_X = get_X_mat($matricule);
$page->assign('nom', $nom);
$page->assign('prenom', $prenom);
$res = XDB::query("SELECT date, relance FROM register_pending
WHERE uid = {?}", $uid);
- if (list($pending, $relance) = $res->fetchOneCell()) {
+ if (list($pending, $relance) = $res->fetchOneRow()) {
$page->assign('pending', $pending);
$page->assign('relance', $relance);
}
function handler_broken(&$page, $uid = null)
{
+ require_once('user.func.inc.php');
$page->changeTpl('marketing/broken.tpl');
if (is_null($uid)) {
- return;
+ return PL_NOT_FOUND;
+ }
+ $forlife = get_user_forlife($uid);
+ if (!$forlife) {
+ return PL_NOT_FOUND;
+ } elseif ($forlife == S::v('forlife')) {
+ pl_redirect('emails/redirect');
}
$res = Xdb::query("SELECT u.nom, u.prenom, u.promo, a.alias AS forlife
FROM auth_user_md5 AS u
INNER JOIN aliases AS a ON a.id = u.user_id
- WHERE u.user_id = {?}", S::i('uid'));
+ WHERE a.alias = {?}", $forlife);
if (!$res->numRows()) {
- return;
+ return PL_NOT_FOUND;
}
$user = $res->fetchOneAssoc();
$page->assign('user', $user);
$email = trim(Post::v('mail'));
if (Post::has('valide') && strlen($email) > 0) {
- require_once('diogenes/diogenes.hermes.inc.php');
- $mailer = new HermesMailer();
+ $mailer = new PlMailer();
$mailer->setFrom(S::v('bestalias') . '@polytechnique.org');
$mailer->addTo('resetpass@polytechnique.org');
$mailer->setSubject("Proposition d'adresse mail pour " . $user['forlife']);