Revision: 8094
          http://svn.sourceforge.net/mailman/?rev=8094&view=rev
Author:   mindlace23
Date:     2006-11-16 15:47:49 -0800 (Thu, 16 Nov 2006)

Log Message:
-----------
attempting makefile action

Modified Paths:
--------------
    branches/soc2006-webui/Mailman/Archiver/Archiver.py
    branches/soc2006-webui/Mailman/Cgi/edithtml.py
    branches/soc2006-webui/Mailman/Cgi/private.py
    branches/soc2006-webui/Mailman/Cgi/wsgi_app.py
    branches/soc2006-webui/Mailman/MailList.py
    branches/soc2006-webui/configure
    branches/soc2006-webui/configure.in

Added Paths:
-----------
    branches/soc2006-webui/Mailman/WebUI/templates/fragments/Makefile.in
    branches/soc2006-webui/Mailman/WebUI/templates/pieces/Makefile.in

Modified: branches/soc2006-webui/Mailman/Archiver/Archiver.py
===================================================================
--- branches/soc2006-webui/Mailman/Archiver/Archiver.py 2006-11-13 12:43:17 UTC 
(rev 8093)
+++ branches/soc2006-webui/Mailman/Archiver/Archiver.py 2006-11-16 23:47:49 UTC 
(rev 8094)
@@ -136,15 +136,13 @@
 
     def GetBaseArchiveURL(self):
         if self.archive_private:
-            url = self.GetScriptURL('private')
+            url = self.GetScriptURL('private') + '/index.html'
         else:
             web_host = config.domains.get(self.host_name, self.host_name)
             url = config.PUBLIC_ARCHIVE_URL % {
                 'listname': self.internal_name(),
                 'hostname': web_host,
                 }
-        if not url.endswith('/'):
-            url += '/'
         return url
 
     def __archive_file(self, afn):

Modified: branches/soc2006-webui/Mailman/Cgi/edithtml.py
===================================================================
--- branches/soc2006-webui/Mailman/Cgi/edithtml.py      2006-11-13 12:43:17 UTC 
(rev 8093)
+++ branches/soc2006-webui/Mailman/Cgi/edithtml.py      2006-11-16 23:47:49 UTC 
(rev 8094)
@@ -27,9 +27,11 @@
 from Mailman import i18n
 from Mailman import MailList
 from Mailman import Utils
+from Mailman import Defaults
 from Mailman.Cgi import Auth
 from Mailman.htmlformat import *
 from Mailman.HTMLFormatter import HTMLFormatter
+from Mailman.configuration import config
 
 _ = i18n._
 
@@ -54,8 +56,8 @@
     doc = Document()
 
     # Set up the system default language
-    i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE)
-    doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE)
+    i18n.set_language(config.DEFAULT_SERVER_LANGUAGE)
+    doc.set_language(config.DEFAULT_SERVER_LANGUAGE)
 
     parts = Utils.GetPathPieces()
     if not parts:
@@ -82,8 +84,8 @@
     cgidata = cgi.FieldStorage()
 
     # Editing the html for a list is limited to the list admin and site admin.
-    if not mlist.WebAuthenticate((mm_cfg.AuthListAdmin,
-                                  mm_cfg.AuthSiteAdmin),
+    if not mlist.WebAuthenticate((Defaults.AuthListAdmin,
+                                  Defaults.AuthSiteAdmin),
                                  cgidata.getvalue('adminpw', '')):
         if cgidata.has_key('admlogin'):
             # This is a re-authorization attempt

Modified: branches/soc2006-webui/Mailman/Cgi/private.py
===================================================================
--- branches/soc2006-webui/Mailman/Cgi/private.py       2006-11-13 12:43:17 UTC 
(rev 8093)
+++ branches/soc2006-webui/Mailman/Cgi/private.py       2006-11-16 23:47:49 UTC 
(rev 8094)
@@ -139,7 +139,7 @@
         print 'Content-type: text/html; charset=' + charset + '\n\n'
         # Put the original full path in the authorization form, but avoid
         # trailing slash if we're not adding parts.  We add it below.
-        action = mlist.GetScriptURL('private', absolute=1)
+        action = mlist.GetScriptURL('private')
         if parts[1:]:
             action = os.path.join(action, SLASH.join(parts[1:]))
         # If we added '/index.html' to true_filename, add a slash to the URL.

Modified: branches/soc2006-webui/Mailman/Cgi/wsgi_app.py
===================================================================
--- branches/soc2006-webui/Mailman/Cgi/wsgi_app.py      2006-11-13 12:43:17 UTC 
(rev 8093)
+++ branches/soc2006-webui/Mailman/Cgi/wsgi_app.py      2006-11-16 23:47:49 UTC 
(rev 8094)
@@ -16,8 +16,10 @@
 # USA.
 
 import os
+import re
 import sys
 
+from urlparse import urlparse
 from cStringIO import StringIO
 from email import message_from_string
 
@@ -25,6 +27,9 @@
 
 # XXX Should this be configurable in Defaults.py?
 STEALTH_MODE = False
+MOVED_RESPONSE = '302 Found'
+# Above is for debugging convenience. We should use:
+# MOVED_RESPONSE = '301 Moved Permanently'
 
 
 
@@ -35,12 +40,16 @@
 SCRIPTS = ['admin', 'admindb', 'confirm', 'create',
            'edithtml', 'listinfo', 'options', 'private',
            'rmlist', 'roster', 'subscribe']
+ARCHVIEW = ['private']
 
 SLASH   = '/'
 NL2     = '\n\n'
 CRLF2   = '\r\n\r\n'
 
+dotonly = re.compile(r'^\.+$')
 
+SCRIPT_BASE = urlparse(config.DEFAULT_URL_PATTERN)[2]
+
 
 # WSGI to CGI wrapper.  Mostly copied from scripts/driver.
 def mailman_app(environ, start_response):
@@ -62,11 +71,40 @@
 
         path = environ['PATH_INFO']
         paths = path.split(SLASH)
+        # sanity check for paths
+        spaths = [ i for i in paths[1:] if i and not dotonly.match(i) ]
+        # Do some path mangling here because someone may access with
+        # trailing slash for script.  (Eg., /mailman/listinfo/ ->
+        # /mailman/listinfo)  Use of SCRIPT_BASE breaks relative
+        # URI principle but we do believe mailman WSGI should NOT exposed
+        # to the Internet.
+        if spaths != paths[1:]:
+            if path == SLASH:
+                newpath = SCRIPT_BASE + 'listinfo'
+            else:
+                # Sanitize URI by spaths
+                if paths[1] not in ARCHVIEW:
+                    newpath = SCRIPT_BASE + SLASH.join(spaths)
+                else:
+                    # 'private' is different because, if trailing slash is
+                    # present, it silently redirecte to index.html.
+                    # Let's make it explicit here.
+                    newpath = SCRIPT_BASE + SLASH.join(spaths) + '/index.html'
+            start_response(MOVED_RESPONSE, [('Location', newpath)])
+            return 'Location: ' + newpath
         script = paths[1]
         if script in SCRIPTS:
             environ['SCRIPT_NAME'] = script
             if len(paths) > 2:
-                environ['PATH_INFO'] = SLASH + SLASH.join(paths[2:])
+                path_info = SLASH + SLASH.join(paths[2:])
+                if script in ARCHVIEW \
+                   and len(paths) in (3,4) \
+                   and not paths[-1].split('.')[-1] in ('html', 'txt', 'gz'):
+                    # /private/listname or /private/listname/YYYYmm
+                    newpath = SCRIPT_BASE + SLASH.join(spaths) + '/index.html'
+                    start_response(MOVED_RESPONSE, [('Location', newpath)])
+                    return 'Location: ' + newpath
+                environ['PATH_INFO'] = path_info
             else:
                 environ['PATH_INFO'] = ''
             # Reverse proxy environment.

Modified: branches/soc2006-webui/Mailman/MailList.py
===================================================================
--- branches/soc2006-webui/Mailman/MailList.py  2006-11-13 12:43:17 UTC (rev 
8093)
+++ branches/soc2006-webui/Mailman/MailList.py  2006-11-16 23:47:49 UTC (rev 
8094)
@@ -263,8 +263,11 @@
             acct, host = tuple(member.split('@'))
             return "[EMAIL PROTECTED]" % (acct, self.umbrella_member_suffix, 
host)
 
-    def GetScriptURL(self, target):
-        return Utils.ScriptURL(target) + '/' + self.fqdn_listname
+    def GetScriptURL(self, target, absolute=False):
+        if absolute:
+            return self.web_page_url + target + '/' + self.fqdn_listname
+        else:
+            return Utils.ScriptURL(target) + '/' + self.fqdn_listname
 
     def GetOptionsURL(self, user, obscure=False, absolute=False):
         url = self.GetScriptURL('options', absolute)

Added: branches/soc2006-webui/Mailman/WebUI/templates/fragments/Makefile.in
===================================================================
--- branches/soc2006-webui/Mailman/WebUI/templates/fragments/Makefile.in        
                        (rev 0)
+++ branches/soc2006-webui/Mailman/WebUI/templates/fragments/Makefile.in        
2006-11-16 23:47:49 UTC (rev 8094)
@@ -0,0 +1,70 @@
+# Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software 
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
+
+# NOTE: Makefile.in is converted into Makefile by the configure script
+# in the parent directory.  Once configure has run, you can recreate
+# the Makefile by running just config.status.
+
+# Variables set by configure
+
+VPATH=         @srcdir@
+srcdir=        @srcdir@
+bindir=        @bindir@
+prefix=        @prefix@
+exec_prefix=   @exec_prefix@
+DESTDIR=
+
+CC=            @CC@
+CHMOD=         @CHMOD@
+INSTALL=       @INSTALL@
+
+DEFS=          @DEFS@
+
+# Customizable but not set by configure
+
+OPT=           @OPT@
+CFLAGS=                $(OPT) $(DEFS)
+PACKAGEDIR=    $(prefix)/Mailman/WebUI/templates/fragments
+SHELL=         /bin/sh
+
+MODULES=       *
+
+# Modes for directories and executables created by the install
+# process.  Default to group-writable directories but
+# user-only-writable for executables.
+DIRMODE=       775
+EXEMODE=       755
+FILEMODE=      644
+INSTALL_PROGRAM=$(INSTALL) -m $(EXEMODE)
+
+
+# Rules
+
+all:
+
+install: 
+       for f in $(MODULES); \
+       do \
+           $(INSTALL) -m $(FILEMODE) $(srcdir)/$$f $(DESTDIR)$(PACKAGEDIR); \
+       done
+
+finish:
+
+clean:
+
+distclean:
+       -rm *.pyc
+       -rm Makefile

Added: branches/soc2006-webui/Mailman/WebUI/templates/pieces/Makefile.in
===================================================================
--- branches/soc2006-webui/Mailman/WebUI/templates/pieces/Makefile.in           
                (rev 0)
+++ branches/soc2006-webui/Mailman/WebUI/templates/pieces/Makefile.in   
2006-11-16 23:47:49 UTC (rev 8094)
@@ -0,0 +1,70 @@
+# Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software 
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
+
+# NOTE: Makefile.in is converted into Makefile by the configure script
+# in the parent directory.  Once configure has run, you can recreate
+# the Makefile by running just config.status.
+
+# Variables set by configure
+
+VPATH=         @srcdir@
+srcdir=        @srcdir@
+bindir=        @bindir@
+prefix=        @prefix@
+exec_prefix=   @exec_prefix@
+DESTDIR=
+
+CC=            @CC@
+CHMOD=         @CHMOD@
+INSTALL=       @INSTALL@
+
+DEFS=          @DEFS@
+
+# Customizable but not set by configure
+
+OPT=           @OPT@
+CFLAGS=                $(OPT) $(DEFS)
+PACKAGEDIR=    $(prefix)/Mailman/WebUI/templates/pieces
+SHELL=         /bin/sh
+
+MODULES=       *
+
+# Modes for directories and executables created by the install
+# process.  Default to group-writable directories but
+# user-only-writable for executables.
+DIRMODE=       775
+EXEMODE=       755
+FILEMODE=      644
+INSTALL_PROGRAM=$(INSTALL) -m $(EXEMODE)
+
+
+# Rules
+
+all:
+
+install: 
+       for f in $(MODULES); \
+       do \
+           $(INSTALL) -m $(FILEMODE) $(srcdir)/$$f $(DESTDIR)$(PACKAGEDIR); \
+       done
+
+finish:
+
+clean:
+
+distclean:
+       -rm *.pyc
+       -rm Makefile

Modified: branches/soc2006-webui/configure
===================================================================
--- branches/soc2006-webui/configure    2006-11-13 12:43:17 UTC (rev 8093)
+++ branches/soc2006-webui/configure    2006-11-16 23:47:49 UTC (rev 8094)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 8051 .
+# From configure.in Revision: 8089 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59 for GNU Mailman 2.2.0a0.
 #
@@ -4312,7 +4312,7 @@
 # scripts.  They're removed on a make distclean, so we make them here.
 mkdir -p build/bin build/contrib build/cron
 
-                                                                               
                                                                                
                                                                                
                                                   
ac_config_files="$ac_config_files misc/paths.py Mailman/Defaults.py 
Mailman/mm_cfg.py.dist src/Makefile misc/Makefile bin/Makefile 
Mailman/bin/Makefile Mailman/Makefile Mailman/Cgi/Makefile 
Mailman/Archiver/Makefile Mailman/Commands/Makefile Mailman/Handlers/Makefile 
Mailman/Bouncers/Makefile Mailman/Queue/Makefile Mailman/Queue/tests/Makefile 
Mailman/MTA/Makefile Mailman/Gui/Makefile templates/Makefile cron/Makefile 
scripts/Makefile messages/Makefile cron/crontab.in misc/mailman Makefile 
Mailman/testing/Makefile Mailman/testing/bounces/Makefile tests/Makefile 
tests/msgs/Makefile $SCRIPTS"
+                                                                               
                                                                                
                                                                                
                                                                                
                     ac_config_files="$ac_config_files misc/paths.py 
Mailman/Defaults.py Mailman/mm_cfg.py.dist src/Makefile misc/Makefile 
bin/Makefile Mailman/bin/Makefile Mailman/Makefile Mailman/Cgi/Makefile 
Mailman/Archiver/Makefile Mailman/Commands/Makefile Mailman/Handlers/Makefile 
Mailman/Bouncers/Makefile Mailman/Queue/Makefile Mailman/Queue/tests/Makefile 
Mailman/MTA/Makefile Mailman/Gui/Makefile Mailman/WebUI/Makefile 
Mailman/WebUI/templates/Makefile Mailman/WebUI/templates/pieces/Makefile 
Mailman/WebUI/templates/fragments/Makefile Mailman/WebUI/static/Makefile 
templates/Makefile cron/Makefile scripts/Makefile messages/Makefile 
cron/crontab.in misc/ma!
 ilman Makefile Mailman/testing/Makefile Mailman/testing/bounces/Makefile 
tests/Makefile tests/msgs/Makefile $SCRIPTS"
           ac_config_commands="$ac_config_commands default"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -4885,6 +4885,11 @@
   "Mailman/Queue/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES 
Mailman/Queue/tests/Makefile" ;;
   "Mailman/MTA/Makefile" ) CONFIG_FILES="$CONFIG_FILES Mailman/MTA/Makefile" ;;
   "Mailman/Gui/Makefile" ) CONFIG_FILES="$CONFIG_FILES Mailman/Gui/Makefile" ;;
+  "Mailman/WebUI/Makefile" ) CONFIG_FILES="$CONFIG_FILES 
Mailman/WebUI/Makefile" ;;
+  "Mailman/WebUI/templates/Makefile" ) CONFIG_FILES="$CONFIG_FILES 
Mailman/WebUI/templates/Makefile" ;;
+  "Mailman/WebUI/templates/pieces/Makefile" ) CONFIG_FILES="$CONFIG_FILES 
Mailman/WebUI/templates/pieces/Makefile" ;;
+  "Mailman/WebUI/templates/fragments/Makefile" ) CONFIG_FILES="$CONFIG_FILES 
Mailman/WebUI/templates/fragments/Makefile" ;;
+  "Mailman/WebUI/static/Makefile" ) CONFIG_FILES="$CONFIG_FILES 
Mailman/WebUI/static/Makefile" ;;
   "templates/Makefile" ) CONFIG_FILES="$CONFIG_FILES templates/Makefile" ;;
   "cron/Makefile" ) CONFIG_FILES="$CONFIG_FILES cron/Makefile" ;;
   "scripts/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;

Modified: branches/soc2006-webui/configure.in
===================================================================
--- branches/soc2006-webui/configure.in 2006-11-13 12:43:17 UTC (rev 8093)
+++ branches/soc2006-webui/configure.in 2006-11-16 23:47:49 UTC (rev 8094)
@@ -641,6 +641,10 @@
            Mailman/Handlers/Makefile Mailman/Bouncers/Makefile
            Mailman/Queue/Makefile Mailman/Queue/tests/Makefile
           Mailman/MTA/Makefile Mailman/Gui/Makefile
+          Mailman/WebUI/Makefile Mailman/WebUI/templates/Makefile
+          Mailman/WebUI/templates/pieces/Makefile
+          Mailman/WebUI/templates/fragments/Makefile
+           Mailman/WebUI/static/Makefile
            templates/Makefile cron/Makefile scripts/Makefile messages/Makefile
            cron/crontab.in misc/mailman Makefile
           Mailman/testing/Makefile Mailman/testing/bounces/Makefile


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to