[Mailman-Users] Integration with PHP

Mark Sapiro mark at msapiro.net
Thu Dec 18 02:44:01 CET 2008


Alberto Pereira wrote:
>
>I'm doing a tiny interface ih PHP for the subscribers of a mailing-list and
>so that they, through that, can:
>
>- subscribe;
>- unsubscribe;
>- change digest;
>...
>
>I'm using the urls for the actions, and all seems working but they change
>the moderation status of the users.
>
>My question is what is the GET variable to change the moderation bit?


The best answer is to look at what the form on the regular web
interface submits, and or look at the source to see how it's
processed. If you are using the 'admin' page, you will see things like

<INPUT name="user%40example.com_mod" type="CHECKBOX" value="off" >

for the moderation setting for the user.

The issue is that when admin.py processes the 'mod' setting, it doesn't
actually check to see if the setting is present in the CGI data, it
just sets the users moderation on if the box is checked and off
otherwise, even if it isn't present in the CGI data.

You could 'fix' Mailman/Cgi/admin.py by changing

            moderate = not not cgidata.getvalue(quser+'_mod')
            mlist.setMemberOption(user, mm_cfg.Moderate, moderate)

to

            if cgidata.has_key(quser+'_mod'):
                moderate = not not cgidata.getvalue(quser+'_mod')
                mlist.setMemberOption(user, mm_cfg.Moderate, moderate)

Otherwise, you need to get the user's moderate setting first and then
set it accordingly.

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list