From: Vincent Zanotti Date: Sun, 24 Aug 2008 17:54:36 +0000 (+0200) Subject: Updates the cron scripts to the new User/Hruid model. X-Git-Tag: xorg/0.10.0~86^2~25 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=d293e17c2f13ba1e27ef843b485fe6fb0edcc069;p=platal.git Updates the cron scripts to the new User/Hruid model. Signed-off-by: Vincent Zanotti --- diff --git a/bin/cron/checkdb.php b/bin/cron/checkdb.php index b891fec..f70e566 100755 --- a/bin/cron/checkdb.php +++ b/bin/cron/checkdb.php @@ -85,6 +85,10 @@ check("SELECT u.user_id, nom, prenom, promo, check("select uid from adresses where pub != 'private' and pub !='ax' and pub != 'public'", "Utiliseur n'ayant pas de flag de publicite pour une adresse"); check("select uid from tels where tel_pub != 'private' and tel_pub !='ax' and tel_pub != 'public'", "Utiliseur n'ayant pas de flag de publicite pour un numero de telephone"); +/* validite des hruid */ +check("SELECT user_id, nom, prenom, promo FROM auth_user_md5 WHERE hruid IS NULL OR hruid = ''", + "Utilisateur n'ayant pas de hruid."); + /* validite de aliases */ check("SELECT a.* FROM aliases AS a diff --git a/bin/cron/emails.check.php b/bin/cron/emails.check.php index c9690c9..1ed5a4d 100755 --- a/bin/cron/emails.check.php +++ b/bin/cron/emails.check.php @@ -68,18 +68,18 @@ if (count($conflits) > 0) { * Check dead emails */ if ($panne_level > 0) { - $sql = "SELECT e.email, a.alias AS forlife + $sql = "SELECT e.email, u.hruid FROM emails AS e - INNER JOIN aliases AS a ON a.id = e.uid AND a.type = 'a_vie' + INNER JOIN auth_user_md5 AS u ON u.user_id = e.uid WHERE e.panne_level = $panne_level AND e.flags = 'active' - ORDER BY a.alias"; + ORDER BY u.hruid"; $res = Xdb::query($sql); if ($res->numRows()) { $result = $res->fetchAllAssoc(); echo "Nouvelles adresses en panne detectees :\n"; foreach ($result as $assoc) { - echo '* ' . $assoc['email'] . ' pour ' . $assoc['forlife'] . "\n"; + echo '* ' . $assoc['email'] . ' pour ' . $assoc['hruid'] . "\n"; } echo "\n\n"; diff --git a/bin/cron/rapports_inscription.php b/bin/cron/rapports_inscription.php index d25f1fd..b7e9167 100755 --- a/bin/cron/rapports_inscription.php +++ b/bin/cron/rapports_inscription.php @@ -1,6 +1,6 @@ #!/usr/bin/php5 -q total()) { // --------------------------------------- $res = XDB::iterRow( - "SELECT forlife, email, date - FROM register_pending - WHERE hash != 'INSCRIT' - ORDER BY date"); + "SELECT u.hruid, r.email, r.date + FROM register_pending AS r + LEFT JOIN auth_user_md5 AS u ON (u.user_id = r.uid) + WHERE r.hash != 'INSCRIT' + ORDER BY r.date"); if ($b = $res->total()) { $MESSAGE.="\n$b INSCRIPTIONS NON CONFIRMEES:\n"; while (list($usern, $mail, $quand) = $res->next()) { @@ -38,14 +39,13 @@ if ($b = $res->total()) { $res = XDB::query('SELECT COUNT(DISTINCT uid), COUNT(*) FROM register_marketing'); list($a, $b) = $res->fetchOneRow(); -$MESSAGE .= "\n$c INSCRIPTIONS SOLICITÉES :\n"; +$MESSAGE .= "\nINSCRIPTIONS SOLICITÉES :\n"; $MESSAGE .= " $a utilisateurs\n $b adresses email\n"; // --------------------------------------- $MESSAGE .= "\n\n"; -require_once('../../classes/plmailer.php'); $mailer = new PlMailer(); $mailer->setSubject("$a confirmées, $b en attente et $c sollicitées"); $mailer->setFrom($globals->register->notif);