X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Fcron%2Fhomonyms.php;h=fd7bb480ff1098a15be8fef40bed322d2101e497;hb=e557b0dbd21096d0fdd5c18f62dab460d20c90c3;hp=567fbd81472dce6aea0dc1ea2945e313be2936b4;hpb=5e1513f67936a6c6866113d260746711af4ea2ee;p=platal.git diff --git a/bin/cron/homonyms.php b/bin/cron/homonyms.php index 567fbd8..fd7bb48 100755 --- a/bin/cron/homonyms.php +++ b/bin/cron/homonyms.php @@ -21,25 +21,24 @@ ***************************************************************************/ /** - * Requires destruction of aliases: a first notification 10 days before + * Requires destruction of aliases: a first notification 7 days before * destruction, a second on the date. */ require 'connect.db.inc.php'; -$resRobot = XDB::iterator("SELECT uid, alias, expire - FROM aliases - WHERE (expire = NOW() + INTERVAL 7 DAY OR expire <= NOW()) - AND type = 'alias'"); +$resRobot = XDB::iterator("SELECT uid, email, expire + FROM email_source_account + WHERE expire <= NOW() + INTERVAL 7 DAY"); while ($old = $resRobot->next()) { $res = XDB::query('SELECT a.hruid - FROM homonyms AS h - INNER JOIN accounts AS a ON (h.uid = a.uid) - WHERE homonyme_id = {?}', - $old['id']); + FROM homonyms_list AS h + INNER JOIN accounts AS a ON (h.uid = a.uid) + WHERE h.hrmid = {?}', + User::makeHomonymHrmid($old['email'])); $hruids = $res->fetchColumn(); - $homonym = User::getSilent($old['id']); - $req = new HomonymeReq($homonym, $old['alias'], $hruids, $old['expire'] > date("Y-m-d")); + $homonym = User::getSilent($old['uid']); + $req = new HomonymeReq($homonym, $old['email'], $hruids, $old['expire'] > date("Y-m-d")); $req->submit(); }