Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Private Attributes
MoinMoin.action.login.LoginHandler Class Reference

List of all members.

Public Member Functions

def __init__
def handle_multistage
def handle

Public Attributes

 request
 cfg
 pagename
 page

Private Attributes

 _

Detailed Description

Definition at line 20 of file login.py.


Constructor & Destructor Documentation

def MoinMoin.action.login.LoginHandler.__init__ (   self,
  pagename,
  request 
)

Definition at line 21 of file login.py.

00021 
00022     def __init__(self, pagename, request):
00023         self.request = request
00024         self._ = request.getText
00025         self.cfg = request.cfg
00026         self.pagename = pagename
00027         self.page = Page(request, pagename)


Member Function Documentation

Definition at line 54 of file login.py.

00054 
00055     def handle(self):
00056         _ = self._
00057         request = self.request
00058         form = request.values
00059 
00060         error = None
00061 
00062         islogin = form.get('login', '')
00063 
00064         if islogin: # user pressed login button
00065             if request._login_multistage:
00066                 return self.handle_multistage()
00067             if hasattr(request, '_login_messages'):
00068                 for msg in request._login_messages:
00069                     request.theme.add_msg(msg, "error")
00070             return self.page.send_page()
00071 
00072         else: # show login form
00073             request.theme.send_title(_("Login"), pagename=self.pagename)
00074             # Start content (important for RTL support)
00075             request.write(request.formatter.startContent("content"))
00076 
00077             request.write(userform.getLogin(request))
00078 
00079             request.write(request.formatter.endContent())
00080             request.theme.send_footer(self.pagename)
00081             request.theme.send_closing_html()
00082 

Here is the call graph for this function:

Handle a multistage request.

If the auth handler wants a multistage request, we
now set up the login form for that.

Definition at line 28 of file login.py.

00028 
00029     def handle_multistage(self):
00030         """Handle a multistage request.
00031 
00032         If the auth handler wants a multistage request, we
00033         now set up the login form for that.
00034         """
00035         _ = self._
00036         request = self.request
00037         form = html.FORM(method='POST', name='logincontinue', action=self.pagename)
00038         form.append(html.INPUT(type='hidden', name='login', value='login'))
00039         form.append(html.INPUT(type='hidden', name='stage',
00040                                value=request._login_multistage_name))
00041 
00042         request.theme.send_title(_("Login"), pagename=self.pagename)
00043         # Start content (important for RTL support)
00044         request.write(request.formatter.startContent("content"))
00045 
00046         extra = request._login_multistage(request, form)
00047         request.write(unicode(form))
00048         if extra:
00049             request.write(extra)
00050 
00051         request.write(request.formatter.endContent())
00052         request.theme.send_footer(self.pagename)
00053         request.theme.send_closing_html()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 23 of file login.py.

Definition at line 24 of file login.py.

Definition at line 26 of file login.py.

Definition at line 25 of file login.py.

Definition at line 22 of file login.py.


The documentation for this class was generated from the following file: