web/application.py
changeset 9040 3c85e734ce00
parent 9032 629a8d49d6f5
child 9066 685ca11d9870
equal deleted inserted replaced
9039:488255d1cf3b 9040:3c85e734ce00
   338         try:
   338         try:
   339             try:
   339             try:
   340                 session = self.get_session(req)
   340                 session = self.get_session(req)
   341                 req.set_session(session)
   341                 req.set_session(session)
   342             except AuthenticationError:
   342             except AuthenticationError:
       
   343                 # Keep the dummy session set at initialisation.
       
   344                 # such session with work to an some extend but raise an
       
   345                 # AuthenticationError on any database access.
       
   346                 pass
   343                 # XXX We want to clean up this approach in the future. But
   347                 # XXX We want to clean up this approach in the future. But
   344                 # several cubes like registration or forgotten password rely on
   348                 # several cubes like registration or forgotten password rely on
   345                 # this principle.
   349                 # this principle.
   346                 req.set_session(DBAPISession(None))
   350             assert req.session is not None
   347             # DENY https acces for anonymous_user
   351             # DENY https acces for anonymous_user
   348             if (req.https
   352             if (req.https
   349                 and req.session.anonymous_session
   353                 and req.session.anonymous_session
   350                 and self.vreg.config['https-deny-anonymous']):
   354                 and self.vreg.config['https-deny-anonymous']):
   351                 # don't allow anonymous on https connection
   355                 # don't allow anonymous on https connection