X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Flists.rpc.py;h=00b498ce120a268f7dc1dcf5e23eba35c949b892;hb=cafb410fea6f257f45da08631c6cdb5c35f86b17;hp=5ce3c683472b3baf3e1f46244d8c980af423c8df;hpb=245923e335d0da5bec9495991a7846be9f0563ab;p=platal.git diff --git a/bin/lists.rpc.py b/bin/lists.rpc.py index 5ce3c68..00b498c 100755 --- a/bin/lists.rpc.py +++ b/bin/lists.rpc.py @@ -137,7 +137,7 @@ class BasicAuthXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): % (PLATAL_DOMAIN, uid, md5)) if res: name, forlife, perms = res - if vhost != PLATAL_DOMAIN: + if vhost != PLATAL_DOMAIN and perms != 'admin': res = mysql_fetchone ("""SELECT m.uid, IF(m.perms = 'admin', 'admin', 'lists') FROM group_members AS m INNER JOIN groups AS g ON (m.asso_id = g.id) @@ -148,6 +148,7 @@ class BasicAuthXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): userdesc = UserDesc(forlife, name, None, 0) return (userdesc, perms, vhost) else: + print >> sys.stderr, "no user found for uid: %s, passwd: %s" % (uid, md5) return None ################################################################################ @@ -241,10 +242,11 @@ def list_call_dispatcher(method, userdesc, perms, vhost, *arg): @root: the handler requires site admin rights """ try: + print >> sys.stderr, "calling method: %s" % method if has_annotation(method, "root") and perms != "admin": return 0 if has_annotation(method, "mlist"): - listname = arg[0] + listname = str(arg[0]) arg = arg[1:] mlist = MailList.MailList(vhost + VHOST_SEP + listname.lower(), lock=0) if has_annotation(method, "admin") and not is_admin_on(userdesc, perms, mlist): @@ -312,7 +314,7 @@ def get_list_info(userdesc, perms, mlist, front_page=0): 'nbsub': len(members) } return (details, members) - return 0 + return None def get_options(userdesc, perms, mlist, opts): """ Get the options of a list. @@ -365,8 +367,9 @@ def get_lists(userdesc, perms, vhost, email=None): except: continue try: - details = get_list_info(udesc, perms, mlist, (email is None and vhost == PLATAL_DOMAIN))[0] - result.append(details) + details = get_list_info(udesc, perms, mlist, (email is None and vhost == PLATAL_DOMAIN)) + if details is not None: + result.append(details[0]) except Exception, e: sys.stderr.write('Can\'t get list %s: %s\n' % (name, str(e))) continue