summaryrefslogtreecommitdiff
path: root/Mailman/Cgi/admindb.py
Commit message (Collapse)AuthorAgeFilesLines
...
* main(): don't call handle_no_list() with a 'doc' argument: it doesn't wanttwouters2001-07-101-1/+1
| | | | it, and we don't have it to start with!
* Better syslog() calling conventions. Also, don't mark syslog messagesbwarsaw2001-06-271-1/+1
| | | | as translatable.
* main(): Convert to the new world order for web authentication,bwarsaw2001-05-311-13/+18
| | | | | | | | allowing the list-admin, list-moderator, or site-moderator access to the admindb. Also, don't hard code the background color. handle_no_list(): Clean this up by using Utils.ScriptURL() to give us the url to the admin overview page.
* show_requests(): Instead of passing in the list's preferred language,bwarsaw2001-05-181-1/+1
| | | | | simply pass in the MailList object; maketext() digs the preferred language out of the list object.
* main(): Add an explicit call to sys.exit() in the sigterm_handler() sobwarsaw2001-05-031-5/+15
| | | | | that race conditions can't trick us into trying to Save() when we don't have the list lock.
* Fixes to handle User-Hits-Stop-Button problems, specifically,bwarsaw2001-05-021-1/+8
| | | | | | | | | | | | | | | | | | | | | | | main(): Set up a signal handler to catch SIGTERM, and unlock the mailing list when this happens. This has the side effect of aborting any changes to the MailList object that this web hit may have made. This is necessary due to semantics of Apache's mod_cgi: when the browser closes the socket, eventually Apache receives a SIGPIPE (on output to the closed socket). This causes Apache to SIGTERM the cgi process, wait three seconds, then SIGKILL it. We want to be able to clean up the locks, so the best we can do is try to unlock the list on the SIGTERM. Once we get SIGKILLed, there's nothing we can do. This change also moves the Save() call into the try: block so that the finally: block /only/ unlocks the list. Thus, the list gets unlocked in most situations. There are still race conditions where 1) the config.db file could be corrupted; 2) list locks could still be unreleased. Given the semantics of signals in Python, the interaction of Apache's mod_cgi, and other factors, this is the best we can do, and it should be better than the old situation. XXX What do other web servers or cgi execution environments do?
* show_post_requests(): Mark another string as translatable.bwarsaw2001-03-021-1/+1
|
* show_post_requests(): Of course Thomas Wouters is right, cgi.escape()bwarsaw2001-03-011-4/+1
| | | | on the subject text is the right thing to use.
* More i18n changes.bwarsaw2001-03-011-106/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At module scope, set the system language to the server's default, until we know which list this is a request on. main(): Don't lock the list until absolutely necessary. Also, once the list is instantiated, set the system language to the list's preferred language. Once the html results document object is created, set its language to the list's preferred language too. HandleRequests() -> process_form() PrintRequests() -> show_requests() handle_no_list(): Be sure to set the document's language to the server's default (since there is no instantiated list at this point). show_requests(): Support DEFER and DISCARD on subscription requests, just like as for held posts. PrintAddMemberRequest(): Inlined and removed. PrintPostRequest() -> show_post_requests() show_post_requests(): Convert to using the mimelib interface (it's a minor shame that we have to reparse the message object to display it on this page). Watch for mimelib.Errors.MessageParseError's which could result if the held message is corrupted. If this occurs, we discard the message, but that may not be the right thing to do. process_form(): Don't save the MailList object here; that happens in the finally: clause in main(). Also some minor verbiage and formatting changes.
* De-string-module-ification.bwarsaw2001-03-011-6/+14
| | | | | | | | | | | | | Conversion to mimelib API. PrintPostRequest(): We must html quote the Subject: text since this gets displayed in-line in the page. E.g. if you had the following header in a held message Subject: </table> it would royally screw the admindb display. Thanks to Brian Youmans for first reporting this problem.
* Untabification.bwarsaw2001-02-281-19/+21
|
* Fix some _() wrappings to use local variables.bwarsaw2001-02-281-3/+4
| | | | | Fix the Utils.maketext() calls to pass the language in as a keyword argument.
* jcrey's latest round of I18N changes.bwarsaw2000-12-261-2/+6
|
* First round integration of Juan Carlos's translatable string markings.bwarsaw2000-12-071-38/+39
|
* Fixes for a minor local security hole. Some of the CGI scripts couldbwarsaw2000-09-291-4/+2
| | | | | | | | | | | bomb with tracebacks if PATH_INFO environment variable wasn't defined. Fixed this by making them all use Utils.GetPathPieces() and "doing something sensible" when that returned a false value. Also, edithtml is now hidden behind a login screen, so there's no need to enter the list password to edit the html. You can't even get to the list of files to edit unless you've admin authenticated. Closes SF bug #114091, Jitterbug PR# 24.
* PrintRequests(): Now that all footers contain links to the adminbwarsaw2000-09-151-7/+1
| | | | | pages, we can remove the extra links from the "no pending requests" information.
* PrintPostRequest(): Hack around a usability issue pointed out bybwarsaw2000-09-121-7/+12
| | | | | | | | | Jeremy Hylton. The `Action:' buttons in horizontal placement are confusing: does the button go with the word before it or after it? Hard to tell without scanning the whole line. Unfortunately, vertical placement takes up too much real-estate. This compromise puts the buttons underneath the words.
* PrintPostRequest(): Default forward address is -owner instead ofbwarsaw2000-09-091-1/+1
| | | | -admin to avoid processing by the bounce subsystem.
* Cleanups to fix relative/absolute script url calculation in responsebwarsaw2000-08-011-3/+3
| | | | | | | | to SF Bug #110753. Specifically, PrintRequests(): Use Utils.ScriptURL() instead of GetNestingLevel(), and GetScriptURL() instead of GetRelativeScriptURL(). Also fix usage of GetOptionsURL() for new interface.
* authenticated(): Removed (see Mailman/Cgi/Auth.py).bwarsaw2000-07-201-45/+5
| | | | | main(): Use the new Mailman.Cgi.Auth module for performing the authentication stuff.
* main(), authenticate(): Factored out of main(), this function nowbwarsaw2000-07-191-51/+62
| | | | | | | | | | | | | handles all the tasks of authentication. It returns 1 if auth succeeded, 0 if it failed. On failure it also prints the admin login page, so main() should just exit. Note: authenticate() here is slightly different than the function in admin.py, but they should be folded in together since they largely do the same work. PrintRequests(): No need to pass in the cgi data, since it isn't used in this function.
* main(): syslog() call needs the log file as first argument. Found bybwarsaw2000-06-271-1/+1
| | | | Ron Jarrell.
* PrintAddMemberRequest(): First value should be mm_cfg.SUBSCRIBE.bwarsaw2000-06-201-1/+1
|
* PrintPostRequest(), PrintAddMemberRequest(): Use the new valuesbwarsaw2000-06-201-2/+5
| | | | | parameter to RadioButtonArray() constructor, and use the new symbolic constants instead of the hardcoded values.
* PrintPostRequest(): Fixed the call to discard a message when the givenbwarsaw2000-06-191-1/+1
| | | | message id was lost.
* Several UI and functional changes. Better layout and better text inbwarsaw2000-06-151-20/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | places. For held subscriptions, the displayed order of `subscribe' and `refuse' is changed so that the refused button is right next to the refusal explanation. After suggestions by many people, split the headers and body into different textboxes for held messages. Before held messages often got truncated in their headers, and the bodies couldn't be seen. Instead of providing a button to view the entire message (which would be more difficult to implement through the admindb authentication blockade), it is now possible to forward the message to a given address. This defaults to the <listname>-admin address. Use this combined with the new `Defer' action to get a copy of the full message for review before deciding what to do with it. In addition to the new `Defer' action, held messages can be `preserved' for the site admin by copying the message to the $PREFIX/spam directory. This is useful for abusive messages that need closer or long term scrutiny. Message rejection notices are taken from the msgdata['rejection-notice'] value, placed their by the Hold.py module.
* PrintAddMemberRequest(): It makes for better usability if the `refuse'bwarsaw2000-06-141-1/+1
| | | | button is just to the left of the refusal-reason text box.
* Convert all uses of sys.stderr.write() and mlist.LogMsg() to the newbwarsaw2000-06-021-2/+2
| | | | syslog() interface.
* PrintPostRequest(): For backwards compatibility, the info tuple can bebwarsaw2000-05-091-1/+5
| | | | length 5 or length 6.
* Some meager consistency in handling errors when trying to open thebwarsaw2000-04-041-4/+8
| | | | | | | | | | | | | | mailing list. In all cases, catch the base exception class MMListError, and output HTML indicating the specified list doesn't exist. A more detail message gets printed to logs/error (the str() of the actual exception details). Also: admin.py - Don't catch MMBadConfigError around mlist.parse_matching_header_opt() since this method doesn't ever raise that exception. Actually, that exception isn't raised anywhere in Mailman, so it's been removed.
* Update the copyright lines to include the years 1999 & 2000.bwarsaw2000-03-211-3/+1
|
* PrintPostRequest(): Snarf the message text out of the file systembwarsaw1999-11-151-3/+20
| | | | | | | instead of getting handed it from the requests database. If we can't open the file for reading, the message was lost, so print an information message and tidy up the housekeeping (this last is a bit of a kludge though).
* A few misc cleanupsbwarsaw1999-11-111-4/+8
|
* main(): Ensure that the list is saved in the finally clausebwarsaw1999-11-111-0/+7
| | | | | HandleRequests(): Catch MMAlreadyAMember errors and print something sensible.
* Massively restructured for integration with the new request APIbwarsaw1999-11-101-228/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (i.e. ListAdmin.py). Also several changes to the layout of request pages that I think make using them much nicer. - There's a preamble which actually explains what you're supposed to do on this page. - There's only two "Submit All Data" buttons. I found the multiple submit buttons just too darn confusing (hard to explain == hard to use). Guido concurred. - The tables have no cellpadding so they aren't as spread out. - Each posting hold tells you "N of #" so you know how many more are shown below. - Layout of posting holds has changed so you see immediately 1) who it's from; 2) why the message was held; 3) what the subject of the message is. Next you see the action buttons, followed by the explanation text box. Finally you see the full text of the message in a separate text box. This should make handling extremely long messages much easier because they don't clutter up the main page too much. Also, Guido had an excellent suggestion: Let the admin edit the full text of the message in this box! Probably wouldn't be to hard to do, actually.
* SecurityManager:hmeland1999-06-131-34/+22
| | | | | | | | | | | | | | | | | | * New method WebAuthenticate(). Takes up to three keyword arguments: user-address, password and cookie-suffix. If password is supplied (and authenticates OK), issue a cookie -- otherwise try to do authentication based on cookies. * MakeCookie(): Changed to actually return a finished Cookie object. Takes one (non-optional) argument; the created cookie's name. Fixed bug in setting of cookie's path. * CheckCookie(): Now takes cookie's name as single argument, and can raise various MMAuthenticationErrors if that cookie doesn't authenticate OK. admin.py: Do explicit re-authentication when changing list admin password. admin.py, admindb.py and private.py: Removed isAuthenticated() function -- use MailList.WebAuthenticate() instead. This removed the need to import Cookie, so now we don't.
* Changes to fix the CGI cookie security flaw reported by John Morton.hmeland1999-06-111-2/+2
| | | | | | | | | SecurityManager: New functions MakeCookie() and CheckCookie(). These functions work with cookies containing cookie creation and expire time, the client's IP number, and a checksum hash of these values as well as a secret (the lists (encrypted) admin password). admin.py, admindb.py and private.py: isAuthenticated now uses these new cookie functions.
* Filled in the TextArea for likely administrivia with the message iklm1999-05-011-5/+10
| | | | | | | | | always (repeatedly!) type in. This means that admins are going to have to erase the message if they're rejecting for a different reason - but the vast proportion of messages i reject are for this reason, while for spammers i often discard, and who cares if they get a confusing message, anyway? Refined a few error messages ("intenting to visit"?).
* Provide a tad more space for the administrator to explain why aklm1999-03-101-1/+1
| | | | | | | | posting is being rejected. (This enables them to explain the right place to send administrivia, for example.) ((Barry - i know these are niggly little things - it's all i have time for. I just want to mention that i'm really greatful that you've been taking care of as much of the substantial stuff as you've been doing!))
* Utils.GetRequestURI(): New function, returns the full virtual path thehmeland1999-03-021-1/+1
| | | | | | | | | | calling CGI script was invoked with. Uses (non-standard, but convenient) environment variable REQUEST_URI when available, otherwise SCRIPT_NAME and PATH_INFO (which are part of the CGI/1.1 spec) if available, or simply returns optional argument `fallback' (which defaults to None). Cgi/admin.py, Cgi/admindb.py: Use it when generating admin authentication page.
* main(): take care of special cases where CGI extension needs to bebwarsaw1999-02-281-2/+2
| | | | added to script path.
* main(): when crafting the admlogin.txt and there's no REQUEST_URI, fixbwarsaw1999-01-091-1/+1
| | | | cut-and-paste error (found by Balazs Nagy).
* HandleRequests(): the entries in the FieldStorage `form' could be abwarsaw1999-01-091-1/+4
| | | | | list, and not have a `value' attribute. Don't try to int()ify them if so.
* Reorganize administrator authentication so that it is done up-frontbwarsaw1998-12-191-77/+132
| | | | | | | | | | | | | | | | instead of on each pending message. Two advantages: you can't even see the held messages if you don't have the password, and it's also easier to deal with the held messages this way. Two nasty bits: most of the code was copied from admin.py, so there's a lot of crufty duplication of effort (but then, all the CGI stuff could go through a major cleaning). Also, if there are no messages being held, that information is given without need for admin password. That seems innocuous enough. Also got rid of a couple of eval()s lurking in the code. I think they were just there to do string->int conversion, and there's a much safer way of doing this.
* robustified:cotton1998-10-231-1/+7
| | | | | | | | admindb assumed that there was the environmental variable "PATH_INFO". If there is not, as would be the case if someone visited <base-url>/admindb, then it would throw a key error. Now it says that the user should specify a list name. scott
* PrintRequests(): happened to notice a typo while here.klm1998-07-201-2/+3
|
* PrintRequests(): call to list.RequestsPending() becomesklm1998-07-201-1/+1
| | | | list.NumRequestsPending() (missed this one when i made the change).
* Add more disgusting global variable references, just to avoidbwarsaw1998-06-231-1/+17
| | | | NameErrors.
* Convert all module names to their new names. Import all modules frombwarsaw1998-06-191-39/+49
| | | | | | | the Mailman package (using the semi-bogus, but quickly implemented from ... import style). main()-ify, but needed a few bogus global decls
* These are the files that used to be in ../cgi, except they no longerviega1998-06-141-0/+232
handle logging to an error file, and no longer import paths. Also, any checks for __main__ have been removed.