X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fregister.php;h=6d73d7fc10e1f7c2dfdfbb10919c4f5ab1ba2fbe;hb=338a593464bb61f1bd54754e116a07db618ca73b;hp=a85bf6c50ffd4f3aee8acd8b8796cd9c1df64150;hpb=af3f07c5b62a4deed058149c33a5129fce20f47b;p=platal.git diff --git a/modules/register.php b/modules/register.php index a85bf6c..6d73d7f 100644 --- a/modules/register.php +++ b/modules/register.php @@ -85,8 +85,13 @@ class RegisterModule extends PLModule case 1: if (Post::has('promo')) { $promo = Post::i('promo'); - if ($promo < 1900 || $promo > date('Y')) { - $err = "La promotion saisie est incorrecte !"; + $res = XDB::query("SELECT COUNT(*) + FROM auth_user_md5 + WHERE perms='pending' AND deces = '0000-00-00' + AND promo = {?}", + $promo); + if (!$res->fetchOneCell()) { + $err = "La promotion saisie est incorrecte ou tous les camardes de cette promo sont inscrits !"; } else { $sub_state['step'] = 2; $sub_state['promo'] = $promo; @@ -177,7 +182,7 @@ class RegisterModule extends PLModule } $_SESSION['sub_state'] = $sub_state; - $page->changeTpl('register/step'.intval($sub_state['step']).'.tpl', SIMPLE); + $page->changeTpl('register/step'.intval($sub_state['step']).'.tpl'); if (isset($err)) { $page->trig($err); } @@ -193,7 +198,7 @@ class RegisterModule extends PLModule global $globals; $page->changeTpl('register/end.tpl'); - + $_SESSION['sub_state'] = array('step' => 5); require_once('user.func.inc.php'); if ($hash) { @@ -259,8 +264,7 @@ class RegisterModule extends PLModule global $platal; $platal->on_subscribe($forlife, $uid, $promo, $password); - require_once('xorg.mailer.inc.php'); - $mymail = new XOrgMailer('register/inscription.reussie.tpl'); + $mymail = new PlMailer('register/inscription.reussie.tpl'); $mymail->assign('forlife', $forlife); $mymail->assign('prenom', $prenom); $mymail->send(); @@ -282,8 +286,7 @@ class RegisterModule extends PLModule XDB::execute("UPDATE register_mstats SET success=NOW() WHERE uid={?}", $uid); while (list($salias, $snom, $sprenom, $sfemme) = $res->next()) { - require_once('diogenes/diogenes.hermes.inc.php'); - $mymail = new HermesMailer(); + $mymail = new PlMailer(); $mymail->setSubject("$prenom $nom s'est inscrit à Polytechnique.org !"); $mymail->setFrom('"Marketing Polytechnique.org" '); $mymail->addTo("\"$sprenom $snom\" <$salias@{$globals->mail->domain}>"); @@ -308,6 +311,7 @@ class RegisterModule extends PLModule { $page->changeTpl('register/success.tpl'); + $_SESSION['sub_state'] = array('step' => 5); if (Env::has('response2')) { $_SESSION['password'] = $password = Post::v('response2');