- $res = XDB::query('SELECT COUNT(*) FROM aliases WHERE alias={?}', $forlife);
- if ($res->fetchOneCell() > 0) {
- return "Tu as un homonyme dans ta promo, il faut traiter ce cas manuellement.<br />".
- "envoie un mail à <a href=\"mailto:support@polytechnique.org\">support@polytechnique.org</a> en expliquant ta situation.";
+ $res = XDB::query("SELECT hruid FROM auth_user_md5 WHERE user_id = {?}", $uid);
+ if ($res->numRows() == 0) {
+ return "Tu n'as pas d'adresse à vie pré-attribuée.<br />"
+ . "Envoie un mail à <a href=\"mailto:support@{$globals->mail->domain}</a>\">"
+ . "support@{$globals->mail->domain}</a> en expliquant ta situation.";
+ } else {
+ // TODO: at the moment forlife == hruid, however we'll have to change
+ // that behaviour when masters will be on plat/al.
+ $forlife = $res->fetchOneCell();