X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fmarketing.php;h=842a8c32cfb58cfb1a3d07b0b618c50eb6f380d2;hb=1d10d3fd659fa8eb7c663d6bb599bc8bbc0feeb3;hp=b9e471051cca42033e52ea1f1fbd42fd26216c9d;hpb=d216d84a490a18e7549774c23cea0b3746d0b049;p=platal.git diff --git a/modules/marketing.php b/modules/marketing.php index b9e4710..842a8c3 100644 --- a/modules/marketing.php +++ b/modules/marketing.php @@ -153,7 +153,7 @@ class MarketingModule extends PLModule $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); } @@ -161,18 +161,25 @@ class MarketingModule extends PLModule 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);