<?php
/***************************************************************************
- * Copyright (C) 2003-2010 Polytechnique.org *
+ * Copyright (C) 2003-2011 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
$res = XDB::query("SELECT r.uid, p.pid, r.forlife, r.bestalias, r.mailorg2,
r.password, r.email, r.services, r.naissance,
pnl.name AS lastname, pnf.name AS firstname,
- pd.promo, p.sex, p.birthdate_ref
+ pd.promo, p.sex, p.birthdate_ref, a.type AS eduType
FROM register_pending AS r
INNER JOIN accounts AS a ON (r.uid = a.uid)
INNER JOIN account_profiles AS ap ON (a.uid = ap.uid AND FIND_IN_SET('owner', ap.perms))
}
list($uid, $pid, $forlife, $bestalias, $emailXorg2, $password, $email, $services,
- $birthdate, $lastname, $firstname, $promo, $sex, $birthdate_ref) = $res->fetchOneRow();
+ $birthdate, $lastname, $firstname, $promo, $sex, $birthdate_ref, $eduType) = $res->fetchOneRow();
+ $isX = ($eduType == 'x');
$yearpromo = substr($promo, 1, 4);
// Prepare the template for display.
// Add the registration email address as first and only redirection.
require_once 'emails.inc.php';
- $user = User::getSilentWithUID($uid);
$redirect = new Redirect($user);
$redirect->add_email($email);
// Congratulate our newly registered user by email.
$mymail = new PlMailer('register/success.mail.tpl');
+ $mymail->addTo("\"{$user->fullName()}\" <{$user->forlifeEmail()}>");
+ if ($isX) {
+ $mymail->setSubject('Bienvenue parmi les X sur le web !');
+ } else {
+ $mymail->setSubject('Bienvenue sur Polytechnique.org !');
+ }
$mymail->assign('forlife', $forlife);
$mymail->assign('firstname', $firstname);
$mymail->send();