You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/11/09 15:39:05 UTC
svn commit: r593543 -
/lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/ac/impl/UserAuthenticator.java
Author: andreas
Date: Fri Nov 9 06:39:04 2007
New Revision: 593543
URL: http://svn.apache.org/viewvc?rev=593543&view=rev
Log:
[minor change] code formatting
Modified:
lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/ac/impl/UserAuthenticator.java
Modified: lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/ac/impl/UserAuthenticator.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/ac/impl/UserAuthenticator.java?rev=593543&r1=593542&r2=593543&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/ac/impl/UserAuthenticator.java (original)
+++ lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/ac/impl/UserAuthenticator.java Fri Nov 9 06:39:04 2007
@@ -34,9 +34,9 @@
/**
* @see org.apache.lenya.ac.Authenticator#authenticate(org.apache.lenya.ac.AccreditableManager,
- * org.apache.cocoon.environment.Request)
- * Note that this implementation first checks if the user has authenticated over basic
- * HTTP authentication. If yes, it uses these credentials.
+ * org.apache.cocoon.environment.Request) Note that this implementation first checks if the
+ * user has authenticated over basic HTTP authentication. If yes, it uses these
+ * credentials.
*/
public boolean authenticate(AccreditableManager accreditableManager, Request request)
throws AccessControlException {
@@ -46,21 +46,21 @@
String username = "";
String password = "";
if (request.getHeader("Authorization") != null) {
- encoded = request.getHeader("Authorization");
+ encoded = request.getHeader("Authorization");
}
- if(encoded.indexOf("Basic") > -1) {
- encoded = encoded.trim();
- encoded = encoded.substring(encoded.indexOf(' ')+1);
+ if (encoded.indexOf("Basic") > -1) {
+ encoded = encoded.trim();
+ encoded = encoded.substring(encoded.indexOf(' ') + 1);
unencoded = new String(Base64.decodeBase64(encoded.getBytes()));
}
- if (unencoded.indexOf(":")-1 > -1 ) {
- username = unencoded.substring(0,unencoded.indexOf(":"));
- password = unencoded.substring(unencoded.indexOf(":")+1);
+ if (unencoded.indexOf(":") - 1 > -1) {
+ username = unencoded.substring(0, unencoded.indexOf(":"));
+ password = unencoded.substring(unencoded.indexOf(":") + 1);
}
if (encoded.length() == 0 && request.getParameter("username") != null) {
- username = request.getParameter("username").toLowerCase();
- password = request.getParameter("password");
+ username = request.getParameter("username").toLowerCase();
+ password = request.getParameter("password");
}
if (getLogger().isDebugEnabled()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org