--- /dev/null
+#!/usr/bin/php4 -q
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2004 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+require('./connect.db.inc.php');
+
+$date = date('Y-m-d');
+$stamp = date('Ymd000000');
+$like = date('%-m-d');
+
+$globals->db->query("INSERT INTO watch_ops (uid, cid, known, date)
+ SELECT user_id, 4, '$date', $stamp
+ FROM auth_user_md5
+ WHERE naissance LIKE '$like'");
+
+
+?>
'contact_sql' => '1'
),
'watch_promo' => Array('wfield' => 'promo', 'ufield' => 'promo', 'need_contact' => true,
- 'freq_sql' => ' AND ( wc.type = "basic" OR wc.type="near" AND (w.promo <= u.promo+1 AND w.promo >= u.promo-1) )',
+ 'freq_sql' => ' AND ( wc.type = "basic" OR wc.type="near" AND (w.promo <= v.promo+1 AND w.promo >= v.promo-1) )',
'contact_sql' => 'NOT (c.contact IS NULL)'
),
'watch_nonins' => Array('wfield' => 'ni_id', 'ufield' => 'user_id', 'need_contact' => false,
$sql .= "
FROM $table AS w
INNER JOIN auth_user_md5 AS u ON(u.{$our['ufield']} = w.{$our['wfield']})
- INNER JOIN auth_user_quick AS q ON(q.user_id = w.uid)";
+ INNER JOIN auth_user_quick AS q ON(q.user_id = w.uid)
+ INNER JOIN auth_user_md5 AS v ON(v.user_id = q.user_id)";
if ($mail) {
$sql .="
- INNER JOIN auth_user_md5 AS v ON(v.user_id = q.user_id)
INNER JOIN aliases AS b ON(b.id = q.user_id AND FIND_IN_SET('bestalias', b.flags))";
}
if ($our['need_contact']) {
update watch_cat set type='often' where frequent=1;
alter table watch_cat drop column frequent;
insert into watch_cat (id, short, mail, type) values(4, 'Anniversaires', 'Ces camarades ont feté leur anniversaire cette semaine', 'near');
+
+replace into watch_sub (uid, cid) select user_id, 4 from auth_user_md5 where perms in ('admin', 'user') and deces=0;
(*) apt-get install php-banana (may not be on public servers)
and add a rewrite rule on www.polytechnique.org (http and https) :
^/banana/([^/]*/.*)$ /usr/share/banana/\$1
+
+(*) install the new cron : bin/cron/notifs.birthday.php
+ suggested :
+ 0 1 * * * ...../bin/cron/notifs.birthday.php
"