Mercurial > dive4elements > river
changeset 3697:2e12518ff5b4
Removed trailing whitespace. Reverted functional change in parsing plain user file.
flys-client/trunk@5396 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sat, 08 Sep 2012 12:22:53 +0000 |
parents | a050cb5f303f |
children | 8e69aca69074 |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/server/LoginServlet.java flys-client/src/main/java/de/intevation/flys/client/server/auth/AuthenticationFactory.java flys-client/src/main/java/de/intevation/flys/client/server/auth/UserClient.java flys-client/src/main/java/de/intevation/flys/client/server/auth/plain/Authenticator.java |
diffstat | 5 files changed, 21 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Sat Sep 08 11:26:30 2012 +0000 +++ b/flys-client/ChangeLog Sat Sep 08 12:22:53 2012 +0000 @@ -1,3 +1,13 @@ +2012-09-08 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/client/server/auth/plain/Authenticator.java: + Reverted functional change from clins last commit. + + * src/main/java/de/intevation/flys/client/server/LoginServlet.java, + src/main/java/de/intevation/flys/client/server/auth/AuthenticationFactory.java, + src/main/java/de/intevation/flys/client/server/auth/UserClient.java: + Removed trailing whitespace. + 2012-09-08 Christian Lins <christian.lins@intevation.de> * src/main/java/de/intevation/flys/client/server/RemoteServiceServlet.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/server/LoginServlet.java Sat Sep 08 11:26:30 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/LoginServlet.java Sat Sep 08 12:22:53 2012 +0000 @@ -49,7 +49,7 @@ @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException + throws ServletException, IOException { String encoding = req.getCharacterEncoding(); String username = req.getParameter("username"); @@ -62,7 +62,7 @@ this.redirectFailure(resp); return; } - + try { Authentication aresp = this.auth(username, password, encoding); if (aresp == null || !aresp.isSuccess()) { @@ -94,7 +94,7 @@ } private Authentication auth(String username, String password, String encoding) - throws AuthenticationException, IOException + throws AuthenticationException, IOException { ServletContext sc = this.getServletContext(); Features features = (Features)sc.getAttribute(Features.CONTEXT_ATTRIBUTE);
--- a/flys-client/src/main/java/de/intevation/flys/client/server/auth/AuthenticationFactory.java Sat Sep 08 11:26:30 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/auth/AuthenticationFactory.java Sat Sep 08 12:22:53 2012 +0000 @@ -13,7 +13,7 @@ if (name == null) { throw new IllegalArgumentException("Authentication type name is null"); } - + if (name.equalsIgnoreCase("was") || name.equalsIgnoreCase("ggina")) { log.debug("Using GGinA authenticator."); @@ -25,7 +25,7 @@ return new de.intevation.flys.client.server.auth.plain.Authenticator(); } - + throw new IllegalArgumentException("Unkown Authentication " + name); } }
--- a/flys-client/src/main/java/de/intevation/flys/client/server/auth/UserClient.java Sat Sep 08 11:26:30 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/auth/UserClient.java Sat Sep 08 12:22:53 2012 +0000 @@ -54,7 +54,7 @@ logger.warn("createUser: given user is null"); return false; } - + logger.debug("Creating new user " + user.getName()); HttpClient client = new HttpClientImpl(this.url); @@ -115,7 +115,7 @@ if(user == null) { throw new IllegalArgumentException("user is null"); } - + HttpClient client = new HttpClientImpl(this.url); Document document = XMLUtils.newDocument();
--- a/flys-client/src/main/java/de/intevation/flys/client/server/auth/plain/Authenticator.java Sat Sep 08 11:26:30 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/auth/plain/Authenticator.java Sat Sep 08 12:22:53 2012 +0000 @@ -96,15 +96,16 @@ try { String line; while ((line = reader.readLine()) != null) { - if (line.startsWith("#")) { + if ((line = line.trim()).length() == 0 + || line.startsWith("#")) { continue; } - + String[] parts = line.split("\\s+"); if (parts.length < 2) { continue; } - + if (parts[0].equals(username)) { log.debug("user '" + username + "' found."); if (parts[1].equals(password)) {