diff MoinMoin/theme/__init__.py @ 3139:0c0fd7c894a3

allow auth methods that don't need input at all to skip input form
author Johannes Berg <johannes AT sipsolutions DOT net>
date Wed, 27 Feb 2008 15:31:28 +0100
parents dafb1b4e75e5
children c25bc6e9ad61
line wrap: on
line diff
--- a/MoinMoin/theme/__init__.py	Wed Feb 27 15:29:10 2008 +0100
+++ b/MoinMoin/theme/__init__.py	Wed Feb 27 15:31:28 2008 +0100
@@ -285,9 +285,13 @@
                 userlinks.append(d['page'].link_to(request, text=_('Logout', formatted=False),
                                                    querystr={'action': 'logout', 'logout': 'logout'}, id='logout', rel='nofollow'))
         else:
+            query = {'action': 'login'}
+            # special direct-login link if the auth methods want no input
+            if request.cfg.auth_login_inputs == ['special_no_input']:
+                query['login'] = '1'
             if request.cfg.auth_have_login:
                 userlinks.append(d['page'].link_to(request, text=_("Login", formatted=False),
-                                                   querystr={'action': 'login'}, id='login', rel='nofollow'))
+                                                   querystr=query, id='login', rel='nofollow'))
 
         userlinks = [u'<li>%s</li>' % link for link in userlinks]
         html = u'<ul id="username">%s</ul>' % ''.join(userlinks)