Rename table ml_moderate to email_list_moderate.
[platal.git] / bin / lists.rpc.py
index 0becf2f..a3cec92 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #***************************************************************************
-#*  Copyright (C) 2004-2008 polytechnique.org                              *
+#*  Copyright (C) 2003-2010 Polytechnique.org                              *
 #*  http://opensource.polytechnique.org/                                   *
 #*                                                                         *
 #*  This program is free software; you can redistribute it and/or modify   *
@@ -126,7 +126,7 @@ class BasicAuthXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
     def getUser(self, uid, md5, vhost):
         res = mysql_fetchone ("""SELECT  CONCAT(u.prenom, ' ', u.nom), a.alias, u.perms
                                    FROM  auth_user_md5 AS u
-                             INNER JOIN  aliases       AS a ON ( a.id=u.user_id AND a.type='a_vie' )
+                             INNER JOIN  aliases       AS a ON ( a.uid=u.user_id AND a.type='a_vie' )
                                   WHERE  u.user_id = '%s' AND u.password = '%s' AND u.perms IN ('admin', 'user')
                                   LIMIT  1""" %( uid, md5 ) )
         if res:
@@ -191,8 +191,8 @@ def to_forlife(email):
     if ( fqdn == PLATAL_DOMAIN ) or ( fqdn == PLATAL_DOMAIN2 ):
         res = mysql_fetchone("""SELECT  CONCAT(f.alias, '@%s'), CONCAT(u.prenom, ' ', u.nom)
                                   FROM  auth_user_md5 AS u
-                            INNER JOIN  aliases       AS f ON (f.id=u.user_id AND f.type='a_vie')
-                            INNER JOIN  aliases       AS a ON (a.id=u.user_id AND a.alias='%s' AND a.type!='homonyme')
+                            INNER JOIN  aliases       AS f ON (f.uid=u.user_id AND f.type='a_vie')
+                            INNER JOIN  aliases       AS a ON (a.uid=u.user_id AND a.alias='%s' AND a.type!='homonyme')
                                  WHERE  u.perms IN ('admin', 'user')
                                  LIMIT  1""" %( PLATAL_DOMAIN, mbox ) )
         if res:
@@ -318,12 +318,7 @@ def get_options(userdesc, perms, mlist, opts):
     details = get_list_info(userdesc, perms, mlist)[0]
     return (details, options)
 
-def set_options(userdesc, perms, mlist, vals):
-    """ Set the options of a list.
-            @mlist
-            @edit
-            @admin
-    """
+def set_options(userdesc, perms, mlist, opts, vals):
     for (k, v) in vals.iteritems():
         if k not in opts:
             continue
@@ -677,7 +672,7 @@ def get_bogo_level(userdesc, perms, mlist):
             filterlevel = 3
     return (filterlevel << 1) + unsurelevel
 
-def set_bogo_level(userdesc, perms, vhost, listname, level):
+def set_bogo_level(userdesc, perms, mlist, level):
     """ Set filter to the specified level.
             @mlist
             @edit