X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=roundup%2Fcgi%2Fclient.py;h=7722865cb365af31b9568eaa4ec6861bec8713de;hb=46e8f3985f24ebb148a0ff4e5b08b6ea23a365ca;hp=10848f0808401e582e5d5814490bff6e235922d7;hpb=5b02534bebaddf9353e060cc44799953ca9638fe;p=roundup.git diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index 10848f0..7722865 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -1,50 +1,25 @@ -# $Id: client.py,v 1.98 2003-02-26 04:08:04 richard Exp $ +# $Id: client.py,v 1.158 2004-02-14 01:17:38 jlgijsbers Exp $ -__doc__ = """ -WWW request handler (also used in the stand-alone server). +"""WWW request handler (also used in the stand-alone server). """ +__docformat__ = 'restructuredtext' import os, os.path, cgi, StringIO, urlparse, re, traceback, mimetypes, urllib -import binascii, Cookie, time, random, MimeWriter, smtplib, socket, quopri +import binascii, Cookie, time, random, stat, rfc822 from roundup import roundupdb, date, hyperdb, password from roundup.i18n import _ -from roundup.cgi.templating import Templates, HTMLRequest, NoTemplate -from roundup.cgi import cgitb -from roundup.cgi.PageTemplates import PageTemplate -from roundup.rfc2822 import encode_header - -class HTTPException(Exception): - pass -class Unauthorised(HTTPException): - pass -class NotFound(HTTPException): - pass -class Redirect(HTTPException): - pass - -# XXX actually _use_ FormError -class FormError(ValueError): - ''' An "expected" exception occurred during form parsing. - - ie. something we know can go wrong, and don't want to alarm the - user with - - We trap this at the user interface level and feed back a nice error - to the user. - ''' - pass - -class SendFile(Exception): - ''' Send a file from the database ''' - -class SendStaticFile(Exception): - ''' Send a static file from the instance html directory ''' +from roundup.cgi import templating, cgitb +from roundup.cgi.actions import * +from roundup.cgi.exceptions import * +from roundup.cgi.form_parser import FormParser +from roundup.mailer import Mailer, MessageSendError def initialiseSecurity(security): - ''' Create some Permissions and Roles on the security object + '''Create some Permissions and Roles on the security object - This function is directly invoked by security.Security.__init__() - as a part of the Security object instantiation. + This function is directly invoked by security.Security.__init__() + as a part of the Security object instantiation. ''' security.addPermission(name="Web Registration", description="User may register through the web") @@ -57,29 +32,44 @@ def initialiseSecurity(security): description="User may manipulate user Roles through the web") security.addPermissionToRole('Admin', p) +# used to clean messages passed through CGI variables - HTML-escape any tag +# that isn't , , and
(including XHTML variants) so +# that people can't pass through nasties like