Merge remote branch 'origin/xorg/maint' into xorg/1.0.2/master
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 16 Dec 2010 20:09:39 +0000 (21:09 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 16 Dec 2010 20:09:39 +0000 (21:09 +0100)
bin/cron/cron_ml_moderate.php
bin/lists.rpc.py
core
include/reminder/ml.inc.php
modules/payment.php
modules/register.php
modules/xnetevents.php
modules/xnetgrp.php

index c6d22a6..c4d16b5 100755 (executable)
@@ -26,6 +26,11 @@ ini_set('memory_limit', '128M');
 $sent_mails = 0;
 $handler    = time();
 
+/* Cleanup dead locks */
+XDB::execute('UPDATE  email_list_moderate
+                 SET  handler = NULL
+               WHERE  handler < NOW() - 300');
+
 while ($sent_mails < $globals->lists->max_mail_per_min
        && time() - $handler < 60) {
     // take a lock on a mail
index e9529ae..00b498c 100755 (executable)
@@ -148,7 +148,7 @@ class BasicAuthXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
             userdesc = UserDesc(forlife, name, None, 0)
             return (userdesc, perms, vhost)
         else:
-            print "no user found for uid: %s, passwd: %s" % (uid, md5)
+            print >> sys.stderr, "no user found for uid: %s, passwd: %s" % (uid, md5)
             return None
 
 ################################################################################
@@ -242,7 +242,7 @@ def list_call_dispatcher(method, userdesc, perms, vhost, *arg):
         @root:  the handler requires site admin rights
     """
     try:
-        print "calling method: %s" % method
+        print >> sys.stderr, "calling method: %s" % method
         if has_annotation(method, "root") and perms != "admin":
             return 0
         if has_annotation(method, "mlist"):
diff --git a/core b/core
index 7299bfc..798c1f4 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 7299bfcef8ccaffa52ecd0ca3adf92c84f79c248
+Subproject commit 798c1f4b15f14569c1f37d848db93ec4f65518b6
index 2bb8ba3..c5ee810 100644 (file)
@@ -39,7 +39,7 @@ class ReminderMl extends Reminder
                     if ($domain != $current_domain) {
                         $current_domain = $domain;
                     }
-                    $client = new MMList(S::v('uid'), S::v('password'), $domain);
+                    $client = new MMList(S::user(), $domain);
                     $client->subscribe($sub);
                 }
             }
@@ -72,7 +72,7 @@ class ReminderMl extends Reminder
         while (list($sub, $domain) = $res->next()) {
             if ($current_domain != $domain) {
                 $current_domain = $domain;
-                $client = new MMList(S::v('uid'), S::v('password'), $domain);
+                $client = new MMList(S::user(), $domain);
             }
             list($details, ) = $client->get_members($sub);
             $lists["$sub@$domain"] = $details;
index 06ddd9c..39f8193 100644 (file)
@@ -483,7 +483,7 @@ class PaymentModule extends PLModule
             }
             $res = XDB::query("SELECT  1
                                  FROM  group_events AS e
-                           INNER JOIN  group_event_participants AS ep ON (ep.eid = e.eid AND uid = {?})
+                           INNER JOIN  group_event_participants AS ep ON (ep.eid = e.eid AND e.uid = {?})
                                 WHERE  e.paiement_id = {?} AND e.asso_id = {?}",
                               S::i('uid'), $pid, $globals->asso('id'));
             if ($res->numRows() == 0) {
index b2c4a3d..c70a365 100644 (file)
@@ -372,7 +372,7 @@ class RegisterModule extends PLModule
                         XDB::execute('INSERT IGNORE INTO  group_members (uid, asso_id)
                                                   VALUES  ({?}, {?})',
                                      $uid, $asso_id);
-                        $mmlist = new MMList($uid, S::v('password'));
+                        $mmlist = new MMList($user);
                         $mmlist->subscribe("promo" . S::v('promo'));
                     }
                     break;
index e1fe8bf..bae5758 100644 (file)
@@ -416,7 +416,8 @@ class XnetEventsModule extends PLModule
               ON DUPLICATE KEY UPDATE  asso_id = VALUES(asso_id), uid = VALUES(uid), intitule = VALUES(intitule),
                                        paiement_id = VALUES(paiement_id), descriptif = VALUES(descriptif), debut = VALUES(debut),
                                        fin = VALUES(fin), show_participants = VALUES(show_participants), short_name = VALUES(short_name),
-                                       deadline_inscription = VALUES(deadline_inscription), noinvite = VALUES(noinvite)',
+                                       deadline_inscription = VALUES(deadline_inscription), noinvite = VALUES(noinvite),
+                                       accept_nonmembre = VALUES(accept_nonmembre)',
                          $evt['eid'], $evt['asso_id'], $evt['uid'],
                          $evt['intitule'], $evt['paiement_id'], $evt['descriptif'],
                          $evt['debut'], $evt['fin'], $evt['show_participants'],
index 5080fb5..a558cbf 100644 (file)
@@ -249,8 +249,7 @@ class XnetGrpModule extends PLModule
         global $globals;
 
         $page->changeTpl('xnetgrp/mail.tpl');
-        $mmlist = new MMList(S::v('uid'), S::v('password'),
-                           $globals->asso('mail_domain'));
+        $mmlist = new MMList(S::user(), $globals->asso('mail_domain'));
         $page->assign('listes', $mmlist->get_lists());
         $page->assign('user', S::user());
         $page->addJsLink('ajax.js');