diff -r d8f2ec7e91fa -r 993997b4b41d web/views/basetemplates.py --- a/web/views/basetemplates.py Tue Oct 13 16:00:09 2009 +0200 +++ b/web/views/basetemplates.py Tue Oct 13 18:20:05 2009 +0200 @@ -58,7 +58,7 @@ # FIXME Deprecated code ? msg = self._cw._('you have been logged out') w(u'

%s

\n' % msg) - if self._cw.config['anonymous-user']: + if self._cw.vreg.config['anonymous-user']: indexurl = self._cw.build_url('view', vid='index', __message=msg) w(u'

%s

' % ( xml_escape(indexurl), @@ -489,7 +489,7 @@ if message: self.display_message() - if self._cw.config['auth-mode'] == 'http': + if self._cw.vreg.config['auth-mode'] == 'http': # HTTP authentication pass else: @@ -505,22 +505,28 @@ def login_form(self, id): _ = self._cw._ self.w(u'

\n' - % xml_escape(login_form_url(self._cw.config, self._cw))) + % xml_escape(login_form_url(self._cw.vreg.config, self._cw))) self.w(u'\n') + self.add_fields() self.w(u'\n') - msg = (self._cw.config['allow-email-login'] and _('login or email')) or _('login') - self.w(u'' % msg) - self.w(u'') - self.w(u'\n') - self.w(u'' % _('password')) - self.w(u'\n') - self.w(u'\n') self.w(u'' % _('log in')) self.w(u'\n') self.w(u'
 \n
\n') self.w(u'
\n') self._cw.html_headers.add_onload('jQuery("#__login:visible").focus()') + def add_fields(self): + msg = (self._cw.vreg.config['allow-email-login'] and _('login or email')) or _('login') + self.add_field('__login', msg, 'text') + self.add_field('__password', self._cw._('password'), 'password') + + def add_field(self, name, label, inputtype): + self.w(u'\n') + self.w(u'' % (name, label)) + self.w(u'\n' % + (name, name, inputtype)) + self.w(u'\n') + def login_form_url(config, req): if req.https: