Changeset 4608 for waeup


Ignore:
Timestamp:
2 Jan 2010, 01:49:04 (15 years ago)
Author:
uli
Message:

Display 'you logged in' only when this really happened.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-layout/src/waeup/browser/pages.py

    r4604 r4608  
    1919
    2020    def update(self, SUBMIT=None, camefrom=None):
    21         self.camefrom = camefrom #self.request.form.get('camefrom', '')
     21        self.camefrom = camefrom
    2222        if SUBMIT is not None:
    23             self.flash('You logged in.')
    24             if not self.camefrom:
    25                 # User might have entered the URL directly. Let's beam
    26                 # him back to our context.
    27                 self.redirect(self.url(self.context))
    28                 return
    29             self.redirect(self.camefrom)
     23            if self.request.principal.id != 'zope.anybody':
     24                self.flash('You logged in.')
     25                if not self.camefrom:
     26                    # User might have entered the URL directly. Let's beam
     27                    # him back to our context.
     28                    self.redirect(self.url(self.context))
     29                    return
     30                self.redirect(self.camefrom)
     31            self.flash('You entered wrong credentials!')
    3032
    3133
Note: See TracChangeset for help on using the changeset viewer.