+ if ($res->numRows() || $result->numRows()) {
+ if ($res->numRows()) {
+ list($h_id, $expire) = $res->fetchOneRow();
+ if (empty($expire)) {
+ XDB::execute('UPDATE email_source_account
+ SET expire = ADDDATE(NOW(), INTERVAL 1 MONTH)
+ WHERE email = {?} AND type != \'alias_aux\'',
+ $emailXorg);
+ $hrmid = User::makeHomonymHrmid($emailXorg);
+ XDB::execute('INSERT IGNORE INTO homonyms_list (hrmid, uid)
+ VALUES ({?}, {?}), ({?}, {?})',
+ $hrmid, $h_id, $hrmid, $subState->i('uid'));
+ $als = XDB::fetchColumn('SELECT email
+ FROM email_source_account
+ WHERE uid = {?} AND type != \'alias_aux\' AND expire IS NULL',
+ $h_id);
+
+ $homonym = User::getSilentWithUID($h_id);
+ $mailer = new PlMailer('register/lostalias.mail.tpl');
+ $mailer->addTo($homonym);
+ $mailer->setSubject("Perte de ton alias $emailXorg dans un mois !");
+ $mailer->assign('emailXorg', $emailXorg);
+ $mailer->assign('als', join(', ', $als));
+ $mailer->SetTxtBody(wordwrap($msg,72));
+ $mailer->send();
+ }
+ } else {
+ $hrmid = $result->fetchOneCell();