Ignore:
Timestamp:
18 May 2009, 08:22:57 (16 years ago)
Author:
uli
Message:

Add login pages/viewlets for students/staff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/authentication.py

    r4129 r4135  
    3838
    3939class Login(grok.View):
     40    """A general login page used in case of not found resources, etc.
     41    """
    4042    grok.context(IWAeUPObject)
    4143    # grok.require('zope.Public') # XXX: Does not work in ftests!
     
    4547        if SUBMIT is not None:
    4648            self.redirect(self.camefrom)
    47            
     49
     50class LoginStaff(grok.View):
     51    """A login page for staff members.
     52    """
     53    grok.context(IWAeUPObject)
     54    grok.template('login')
     55
     56    def update(self, SUBMIT=None):
     57        if SUBMIT is None:
     58            return
     59        self.redirect(self.url(grok.getSite()))
     60   
     61class LoginStudent(grok.View):
     62    """A login page for students.
     63    """
     64    grok.context(IWAeUPObject)
     65    grok.template('login')
     66
     67    def update(self, SUBMIT=None):
     68        if SUBMIT is None:
     69            return
     70        self.redirect(self.url(grok.getSite()))
     71
    4872class LoginMain(grok.Viewlet):
    4973    grok.viewletmanager(MainArea)
     
    5175    grok.view(Login)
    5276
     77class LoginMainStaff(grok.Viewlet):
     78    grok.viewletmanager(MainArea)
     79    grok.context(IWAeUPObject)
     80    grok.view(LoginStaff)
     81
     82class LoginMainStudent(grok.Viewlet):
     83    grok.viewletmanager(MainArea)
     84    grok.context(IWAeUPObject)
     85    grok.view(LoginStudent)
     86
     87   
    5388class Logout(grok.Viewlet):
    5489    grok.viewletmanager(LeftSidebar)
Note: See TracChangeset for help on using the changeset viewer.