Changeset 6685


Ignore:
Timestamp:
6 Sep 2011, 08:12:13 (13 years ago)
Author:
Henrik Bettermann
Message:

We don't need several login pages in SIRP.

The Login viewlet doesn't need its own pagetemplate. We can use the render method instead.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
3 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/authentication.txt

    r6609 r6685  
    158158
    159159  >>> browser.open('http://localhost/app')
    160   >>> browser.getLink('Staff Login').click()
     160  >>> browser.getLink('Login').click()
    161161  >>> print browser.headers['Status']
    162162  200 Ok
     
    201201  >>> print browser.contents
    202202  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
    203   ...Staff Login
     203  ...Login</a></div>
    204204  ...
    205205
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py

    r6635 r6685  
    265265    grok.view(Interface)
    266266    grok.order(2)
    267 
    268     def isAuthenticated(self):
    269         """Is the calling user authenticated?
    270         """
    271         return self.request.principal.id != 'zope.anybody'
     267    grok.require('waeup.Anonymous')
     268    text = 'Login'
     269    link = 'login'
     270
     271    def render(self):
     272        if self.request.principal.id != 'zope.anybody':
     273            return ''
     274        url = self.view.url(grok.getSite(), self.link)
     275        return u'<div class="portlet"><a href="%s">%s</a></div>' % (
     276                url, self.text)
     277
    272278
    273279class ManageLink(grok.Viewlet):
Note: See TracChangeset for help on using the changeset viewer.