X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Flists.rpc.py;h=694cee9b93f864832e81bcea52fad2d61041862d;hb=1f58ccb1e75eca08fbd04971d617ea372bc77b5a;hp=85bc78e5867527140ffc0d0f6fb9793ded5901fa;hpb=fc240413a7393da07ab0aa7b496dda5e5933fee8;p=platal.git diff --git a/bin/lists.rpc.py b/bin/lists.rpc.py index 85bc78e..694cee9 100755 --- a/bin/lists.rpc.py +++ b/bin/lists.rpc.py @@ -1,6 +1,6 @@ #!/usr/bin/env python #*************************************************************************** -#* Copyright (C) 2004-2008 polytechnique.org * +#* Copyright (C) 2004-2009 polytechnique.org * #* http://opensource.polytechnique.org/ * #* * #* This program is free software; you can redistribute it and/or modify * @@ -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 @@ -787,8 +782,7 @@ def check_options_runner(userdesc, perms, mlist, listname, correct): if mlist.real_name.lower() != listname: options['real_name'] = listname, mlist.real_name if correct: mlist.real_name = listname - details = get_list_info(userdesc, perms, mlist)[0] - return (details, options) + return 1 def check_options(userdesc, perms, vhost, listname, correct=False): @@ -868,25 +862,22 @@ def create_list(userdesc, perms, vhost, listname, desc, advertise, modlevel, ins mlist.header_filter_rules = [] mlist.header_filter_rules.append(('X-Spam-Flag: Unsure, tests=bogofilter', mm_cfg.HOLD, False)) mlist.header_filter_rules.append(('X-Spam-Flag: Yes, tests=bogofilter', mm_cfg.HOLD, False)) - mlist.Save() - mlist.Unlock() if ON_CREATE_CMD != '': try: os.system(ON_CREATE_CMD + ' ' + name) except: pass - check_options(userdesc, perms, mlist, True) + check_options_runner(userdesc, perms, mlist, listname.lower(), True) mass_subscribe(userdesc, perms, mlist, members) - - # avoid the "-1 mail to moderate" bug - mlist = MailList.MailList(name) - mlist._UpdateRecords() mlist.Save() - - return 1 finally: mlist.Unlock() - return 0 + + # avoid the "-1 mail to moderate" bug + mlist = MailList.MailList(name) + mlist._UpdateRecords() + mlist.Save() + return 1 def delete_list(userdesc, perms, mlist, del_archives=0): """ Delete the list.