[Mailman-Users] hide lists from listinfo page only (leave onadmin page)

Mark Sapiro msapiro at value.net
Fri Oct 7 19:12:48 CEST 2005


Xiaoyan Ma wrote:

>Each semester we create a few hundreds course mailing lists, prepopulate them, and delete them by 
>the end of the semester.  If we want to hide these lists from the listinfo page only, can I modify 
>the listinfo.py file, store the name of these lists in an arrey say called "notshowns" and then 
>add a logic right after "listnames.sort()", for name in listnames but not in notshowns ....
>
>.....
>for name in listnames:(but not in notshowns)


Presumably this is pseudocode. It's not Python. Python might be

for name in listnames:
      if name in notshowns:
          continue


>      mlist = MailList.MailList(name, lock=0)
>         if mlist.advertised:
>             if mm_cfg.VIRTUAL_HOST_OVERVIEW
>              mlist.web_page_url.find(hostname) == -1:
>                 # List is for different identity of this host - skip it.
>                 continue
>             else:
>                 advertised.append((mlist.GetScriptURL('listinfo'),
>                                    mlist.real_name,
>                                    mlist.description))
>...
>
>1. Is it safe to modify the logic of this file?


Yes (as long as you don't make a mistake :-), but see 2.


>2. What will happen during upgrades?


The upgrade listinfo.py will replace the one with your changes. You
will have to remake your changes in the new file.


>BTW, there is a ../mailman/cgi-bin/listinfo file:
>
>.../mailman/cgi-bin/listinfo: setgid ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for 
>GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
>
>The size of this file seems to stay the same after the listinfo.py has been modified. How is this 
>file related to listinfo.py file?


This and all the files in cgi-bin/ are the security wrappers which are
invoked directly by the web server. They perform a few checks and then
call the corresponding Python module in Mailman/Cgi via the
scripts/driver script. The source for these files is in
src/cgi-wrapper.c and src/common.[ch]

There may be other ways to do this that don't require maintenance of a
separate list. E.g., you could modify admin.py to display all lists
regardless of the setting of advertised. Then lists with advertised
set to No would be displayed on the admin overview but not the
listinfo overview.

Also, what is the goal? If it is simply to avoid 'clutter' on the
listinfo overview but still allow 'one click' access to the admin
page, then you may be on the right track, but if you are trying to
actually 'hide' the existence or name of the lists, anyone can go to
the admin overview page and see them.

--
Mark Sapiro <msapiro at value.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