29 from logilab.common.date import strptime |
29 from logilab.common.date import strptime |
30 |
30 |
31 from cubicweb import (NoSelectableObject, ObjectNotFound, ValidationError, |
31 from cubicweb import (NoSelectableObject, ObjectNotFound, ValidationError, |
32 AuthenticationError, typed_eid) |
32 AuthenticationError, typed_eid) |
33 from cubicweb.utils import CubicWebJsonEncoder |
33 from cubicweb.utils import CubicWebJsonEncoder |
34 from cubicweb.selectors import authenticated_user, match_form_params |
34 from cubicweb.selectors import authenticated_user, anonymous_user, match_form_params |
35 from cubicweb.mail import format_mail |
35 from cubicweb.mail import format_mail |
36 from cubicweb.web import Redirect, RemoteCallFailed, DirectResponse, json_dumps, json |
36 from cubicweb.web import Redirect, RemoteCallFailed, DirectResponse, json_dumps, json |
37 from cubicweb.web.controller import Controller |
37 from cubicweb.web.controller import Controller |
38 from cubicweb.web.views import vid_from_rset, formrenderers |
38 from cubicweb.web.views import vid_from_rset, formrenderers |
39 |
39 |
76 return wrapper |
76 return wrapper |
77 |
77 |
78 |
78 |
79 class LoginController(Controller): |
79 class LoginController(Controller): |
80 __regid__ = 'login' |
80 __regid__ = 'login' |
|
81 __select__ = anonymous_user() |
81 |
82 |
82 def publish(self, rset=None): |
83 def publish(self, rset=None): |
83 """log in the instance""" |
84 """log in the instance""" |
84 if self._cw.vreg.config['auth-mode'] == 'http': |
85 if self._cw.vreg.config['auth-mode'] == 'http': |
85 # HTTP authentication |
86 # HTTP authentication |