Back to index

plone3  3.1.7
Classes | Functions | Variables
PluggableAuthService.plugins.RequestTypeSniffer Namespace Reference

Classes

class  IRequestTypeSnifferPlugin
class  RequestTypeSniffer

Functions

def registerSniffer
def addRequestTypeSnifferPlugin
def webdavSniffer
def xmlrpcSniffer
def ftpSniffer
def browserSniffer

Variables

tuple _sniffers = ()
tuple manage_addRequestTypeSnifferForm

Function Documentation

def PluggableAuthService.plugins.RequestTypeSniffer.addRequestTypeSnifferPlugin (   dispatcher,
  id,
  title = None,
  REQUEST = None 
)
Add a RequestTypeSnifferPlugin to a Pluggable Auth Service. 

Definition at line 58 of file RequestTypeSniffer.py.

00058 
00059 def addRequestTypeSnifferPlugin( dispatcher, id, title=None, REQUEST=None ):
00060     """ Add a RequestTypeSnifferPlugin to a Pluggable Auth Service. """
00061 
00062     rts = RequestTypeSniffer(id, title)
00063     dispatcher._setObject(rts.getId(), rts)
00064 
00065     if REQUEST is not None:
00066         REQUEST['RESPONSE'].redirect(
00067                                 '%s/manage_workspace'
00068                                 '?manage_tabs_message='
00069                                 'RequestTypeSniffer+added.'
00070                             % dispatcher.absolute_url())
00071 

Definition at line 135 of file RequestTypeSniffer.py.

00135 
00136 def browserSniffer(request):
00137     # If it's none of the above, it's very likely a browser request.
00138     for sniffer in (webdavSniffer, ftpSniffer, xmlrpcSniffer):
00139         if sniffer(request):
00140             return False
00141     return True
00142 
00143 registerSniffer(IBrowserRequest, browserSniffer)

Here is the call graph for this function:

Definition at line 129 of file RequestTypeSniffer.py.

00129 
00130 def ftpSniffer(request):
00131     if isinstance(request, FTPRequest):
00132         return True
00133 
00134 registerSniffer(IFTPRequest, ftpSniffer)

Here is the call graph for this function:

Definition at line 49 of file RequestTypeSniffer.py.

00049 
00050 def registerSniffer(iface, func):
00051     global _sniffers
00052     registry = list(_sniffers)
00053     registry.append((iface, func))
00054     _sniffers = tuple(registry)

Here is the caller graph for this function:

Definition at line 104 of file RequestTypeSniffer.py.

00104 
00105 def webdavSniffer(request):
00106     dav_src = request.get('WEBDAV_SOURCE_PORT', None)
00107     method = request.get('REQUEST_METHOD', 'GET').upper()
00108     path_info = request.get('PATH_INFO', '')
00109 
00110     if dav_src:
00111         return True
00112 
00113     if method not in ('GET', 'POST'):
00114         return True
00115 
00116     if method in ('GET',) and path_info.endswith('manage_DAVget'):
00117         return True
00118 
00119 registerSniffer(IWebDAVRequest, webdavSniffer)

Here is the call graph for this function:

Definition at line 120 of file RequestTypeSniffer.py.

00120 
00121 def xmlrpcSniffer(request):
00122     response = request['RESPONSE']
00123     method = request.get('REQUEST_METHOD', 'GET').upper()
00124 
00125     if method in ('GET', 'POST') and isinstance(response, xmlrpc.Response):
00126         return True
00127 
00128 registerSniffer(IXMLRPCRequest, xmlrpcSniffer)

Here is the call graph for this function:


Variable Documentation

Definition at line 47 of file RequestTypeSniffer.py.

Initial value:
00001 PageTemplateFile(
00002     'www/rtsAdd', globals(), __name__='manage_addRequestTypeSnifferForm' )

Definition at line 55 of file RequestTypeSniffer.py.