1.1 --- a/WebStack/Resources/Login.py Sun Jan 14 16:40:32 2007 +0000
1.2 +++ b/WebStack/Resources/Login.py Thu Jan 18 18:58:45 2007 +0000
1.3 @@ -4,7 +4,7 @@
1.4 Login resources which redirect clients back to an application after a successful
1.5 login.
1.6
1.7 -Copyright (C) 2004, 2005 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2004, 2005, 2006, 2007 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This library is free software; you can redistribute it and/or
1.11 modify it under the terms of the GNU Lesser General Public
1.12 @@ -55,8 +55,10 @@
1.13
1.14 # Check for a submitted login form.
1.15
1.16 + fields_body = trans.get_fields_from_body(self.encoding)
1.17 +
1.18 if fields_body.has_key("login"):
1.19 - if self.authenticator.authenticate(trans, fields_body.get("username"), fields_body.get("password")):
1.20 + if self.authenticator.authenticate(trans, fields_body.get("username", [None])[0], fields_body.get("password", [None])[0]):
1.21 self._redirect(trans, app, path, qs)
1.22 # The above method does not return.
1.23
1.24 @@ -97,7 +99,7 @@
1.25 <h1>Login</h1>
1.26 <form method="POST">
1.27 <p>Username: <input name="username" type="text" size="12"/></p>
1.28 - <p>Password: <input name="password" type="text" size="12"/></p>
1.29 + <p>Password: <input name="password" type="password" size="12"/></p>
1.30 <p><input name="login" type="submit" value="Login"/></p>
1.31 <input name="app" type="hidden" value="%s"/>
1.32 <input name="path" type="hidden" value="%s"/>