svn commit: r593543 - /lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/ac/impl/UserAuthenticator.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
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()) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.