[Mailman-Users] Modify options-login page

Mark Sapiro mark at msapiro.net
Fri Jan 27 05:40:56 CET 2012

Michele Federle wrote:
>Can anybody give me further information about editing this page??
>I unfortunately don't know python code, but I'm going to learn it as soon as
>I have some time...
>I'd need to redirect users, as they logout from the personal options-page,
>the listinfo-page.

To do this, find the following in Mailman/Cgi/options.py

    if cgidata.has_key('logout'):
        print mlist.ZapCookie(mm_cfg.AuthUser, user)
        loginpage(mlist, doc, user, language)
        print doc.Format()

Replace the lines

        loginpage(mlist, doc, user, language)
        print doc.Format()

so it reads

    if cgidata.has_key('logout'):
        print mlist.ZapCookie(mm_cfg.AuthUser, user)
        listinfo_url = '%slistinfo%s/%s' % (mlist.web_page_url,
        print """Status: 303 See Other
Location: %s

If you see this, <a href=%s>Click to redirect</a>.
""" % (listinfo_url, listinfo_url)

It must be indented exactly as shown and using only spaces, not tabs.
This will cause logout from the user options page to redirect to the
list's listinfo page.

>Then, I'd like to do the same if they mistaken in typing
>the password or the email address and, in this last case, to prompt an error
>like "wrong password" or "not existing email address " !!

If you really mean you would like an authentication failure from the
options login page to return the list's listinfo page with an error
message, that would be difficult to do because the listinfo page
doesn't have a mechanism for reporting errors when invoked with an
HTTP GET. And why would you want to take the user away from the login
page just because of a simple typo in email address or password?

If you just want to replace the "Authentication failed." error message
with something more specific, you could do that, but you would have to
modify the code to first validate the member address, because the
existing code calls the SecurityManager WebAuthenticate() method to
authenticate the entry and it's context (list member, list owner, site
owner) and receives onle a True or False return.

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