You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/11/07 22:07:25 UTC

[12/14] git commit: [#6783] ticket:463 Don't display 'Forgot password?' link if auth provider doesn't support recovery

[#6783] ticket:463 Don't display 'Forgot password?' link if auth provider doesn't support recovery


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/aa9a89c3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/aa9a89c3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/aa9a89c3

Branch: refs/heads/master
Commit: aa9a89c39795c5032ac81d4f25648bb9aaefbabb
Parents: 4c1a5f1
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Nov 5 09:09:03 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu Nov 7 21:05:05 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/widgets/auth_widgets.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/aa9a89c3/Allura/allura/lib/widgets/auth_widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/auth_widgets.py b/Allura/allura/lib/widgets/auth_widgets.py
index 5b9bf2b..f83ec48 100644
--- a/Allura/allura/lib/widgets/auth_widgets.py
+++ b/Allura/allura/lib/widgets/auth_widgets.py
@@ -34,12 +34,17 @@ class LoginForm(ForgeForm):
     class fields(ew_core.NameList):
         username = ew.TextField(label='Username')
         password = ew.PasswordField(label='Password')
-        if plugin.LocalAuthenticationProvider.forgotten_password_process:
-            link = ew.HTMLField(text='<a href="./forgotten_password">Forgot password?</a>')
+        link = ew.HTMLField(text='<a href="./forgotten_password">Forgot password?</a>')
 
     class hidden_fields(ew_core.NameList):
         return_to = ew.HiddenField()
 
+    def __init__(self, *args, **kw):
+        super(LoginForm, self).__init__(*args, **kw)
+        if not plugin.AuthenticationProvider.get(request).forgotten_password_process:
+            # auth provider has no method of recovering password - do not show the link
+            self.fields.link.text = ''
+
     @validator
     def validate(self, value, state=None):
         try: