web/views/basecontrollers.py
branchstable
changeset 9700 da7d341cca76
parent 9229 739ae5366bed
child 10222 75d6096216d7
child 10406 9c7461bf99a7
equal deleted inserted replaced
9699:990676d3f39f 9700:da7d341cca76
    90     __select__ = ~anonymous_user()
    90     __select__ = ~anonymous_user()
    91 
    91 
    92     def publish(self, rset=None):
    92     def publish(self, rset=None):
    93         """log in the instance"""
    93         """log in the instance"""
    94         path = self._cw.form.get('postlogin_path', '')
    94         path = self._cw.form.get('postlogin_path', '')
    95         # redirect expect an url, not a path. Also path may contains a query
    95         # redirect expect a URL, not a path. Also path may contains a query
    96         # string, hence should not be given to _cw.build_url()
    96         # string, hence should not be given to _cw.build_url()
    97         raise Redirect(self._cw.base_url() + path)
    97         raise Redirect(self._cw.base_url() + path)
    98 
    98 
    99 
    99 
   100 class LogoutController(Controller):
   100 class LogoutController(Controller):
   108         # * in http auth mode, url will be ignored
   108         # * in http auth mode, url will be ignored
   109         # * in cookie mode redirecting to the index view is enough : either
   109         # * in cookie mode redirecting to the index view is enough : either
   110         #   anonymous connection is allowed and the page will be displayed or
   110         #   anonymous connection is allowed and the page will be displayed or
   111         #   we'll be redirected to the login form
   111         #   we'll be redirected to the login form
   112         msg = self._cw._('you have been logged out')
   112         msg = self._cw._('you have been logged out')
   113         # force base_url so on dual http/https configuration, we generate an url
   113         # force base_url so on dual http/https configuration, we generate a URL
   114         # on the http version of the site
   114         # on the http version of the site
   115         return self._cw.build_url('view', vid='loggedout',
   115         return self._cw.build_url('view', vid='loggedout',
   116                                   base_url=self._cw.vreg.config['base-url'])
   116                                   base_url=self._cw.vreg.config['base-url'])
   117 
   117 
   118 
   118