lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andr...@apache.org
Subject cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/ac LDAPUser.java
Date Thu, 21 Aug 2003 12:40:01 GMT
andreas     2003/08/21 05:40:01

  Modified:    src/java/org/apache/lenya/cms/ac LDAPUser.java
  Log:
  added some log messages
  
  Revision  Changes    Path
  1.13      +14 -3     cocoon-lenya/src/java/org/apache/lenya/cms/ac/LDAPUser.java
  
  Index: LDAPUser.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/ac/LDAPUser.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- LDAPUser.java	21 Aug 2003 12:06:16 -0000	1.12
  +++ LDAPUser.java	21 Aug 2003 12:40:01 -0000	1.13
  @@ -64,6 +64,8 @@
   import java.io.File;
   import java.io.FileInputStream;
   import java.io.IOException;
  +import java.io.PrintWriter;
  +import java.io.StringWriter;
   
   import java.util.Hashtable;
   import java.util.Properties;
  @@ -206,18 +208,22 @@
        * @see org.apache.lenya.cms.ac.User#authenticate(java.lang.String)
        */
       public boolean authenticate(String password) {
  +        
           String principal =
               "uid=" + getLdapId() + "," + defaultProperties.getProperty(PARTIAL_USER_DN);
           Context ctx;
   
  +        log.debug("Authenticating with principal [" + principal + "]");
  +        
           try {
               ctx = bind(principal, password);
               close(ctx);
  +            log.debug("Context closed.");
           } catch (NamingException e) {
               // log this failure
  +            // StringWriter writer = new StringWriter();
  +            // e.printStackTrace(new PrintWriter(writer));
               log.info("Bind for user " + principal + " to Ldap server failed: ", e);
  -
  -            return false;
           }
   
           return true;
  @@ -269,6 +275,9 @@
        * @throws NamingException if there are problems establishing the Ldap connection
        */
       private LdapContext bind(String principal, String credentials) throws NamingException
{
  +        
  +        log.info("Binding principal: [" + principal + "]");
  +        
           Hashtable env = new Hashtable();
   
           System.setProperty(
  @@ -287,6 +296,8 @@
           env.put(Context.SECURITY_CREDENTIALS, credentials);
   
           LdapContext ctx = new InitialLdapContext(env, null);
  +        
  +        log.info("Finished binding principal.");
   
           return ctx;
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org


Mime
View raw message