Package WebStack :: Package Resources :: Module Login :: Class LoginResource
[show private | hide private]
[frames | no frames]

Class LoginResource


A resource providing a login screen.

Method Summary
  __init__(self, authenticator, use_redirect, urlencoding, encoding)
Initialise the resource with an 'authenticator'.
  respond(self, trans)
Respond using the transaction 'trans'.
  show_login(self, trans, app, path, qs)
Writes a login screen using the transaction 'trans', including details of the 'app', 'path' and 'qs' which the client was attempting to access.
  show_success(self, trans, app, path, qs)
Writes a success screen using the transaction 'trans', including details of the 'app', 'path' and 'qs' which the client was attempting to access.
  _redirect(self, trans, app, path, qs)
Redirect the client using 'trans' and the given 'app', 'path' and 'qs' details.

Class Variable Summary
str encoding = 'utf-8'
str login_page = '\n<html>\n  <head>\n    <title>Login</titl...
str success_page = '\n<html>\n  <head>\n    <title>Login Exa...

Method Details

__init__(self, authenticator, use_redirect=1, urlencoding=None, encoding=None)
(Constructor)

Initialise the resource with an 'authenticator'.

If the optional 'use_redirect' flag is set to 0, a confirmation screen
is given instead of redirecting the user back to the original
application.

The optional 'urlencoding' parameter allows a special encoding to be
used in producing the redirection path.

The optional 'encoding' parameter allows a special encoding to be used
in producing the login pages.

To change the pages employed by this resource, either redefine the
'login_page' and 'success_page' attributes in instances of this class or
a subclass, or override the 'show_login' and 'show_success' methods.

respond(self, trans)

Respond using the transaction 'trans'.

show_login(self, trans, app, path, qs)

Writes a login screen using the transaction 'trans', including details
of the 'app', 'path' and 'qs' which the client was attempting to access.

show_success(self, trans, app, path, qs)

Writes a success screen using the transaction 'trans', including details
of the 'app', 'path' and 'qs' which the client was attempting to access.

_redirect(self, trans, app, path, qs)

Redirect the client using 'trans' and the given 'app', 'path' and 'qs'
details.

Class Variable Details

encoding

Type:
str
Value:
'utf-8'                                                                

login_page

Type:
str
Value:
'''
<html>
  <head>
    <title>Login</title>
  </head>
  <body>
    <h1>Login</h1>
    <form method="POST">
...                                                                    

success_page

Type:
str
Value:
'''
<html>
  <head>
    <title>Login Example</title>
  </head>
  <body>
    <h1>Login Successful</h1>
    <p>Please proceed <a href="%s%s%s">to the application</a>.</p>
...                                                                    

Generated by Epydoc 2.1 on Thu Mar 1 00:37:14 2007 http://epydoc.sf.net