You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2008/05/24 01:07:03 UTC

svn commit: r659705 - /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java

Author: elecharny
Date: Fri May 23 16:07:02 2008
New Revision: 659705

URL: http://svn.apache.org/viewvc?rev=659705&view=rev
Log:
Reverted to the working version

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java?rev=659705&r1=659704&r2=659705&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java Fri May 23 16:07:02 2008
@@ -25,6 +25,7 @@
 
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.util.StringTools;
 
 
 /**
@@ -47,6 +48,11 @@
     /** the authentication level for this principal */
     private final AuthenticationLevel authenticationLevel;
     
+    /** The userPassword
+     * @todo security risk remove this immediately
+     */
+    private byte[] userPassword;
+
 
     /**
      * Creates a new LDAP/X500 principal without any group associations.  Keep
@@ -66,6 +72,7 @@
         }
         
         this.authenticationLevel = authenticationLevel;
+        this.userPassword = null;
     }
 
     /**
@@ -81,6 +88,7 @@
     {
         this.name = name;
         this.authenticationLevel = authenticationLevel;
+        this.userPassword = userPassword;
     }
 
 
@@ -92,6 +100,7 @@
     {
         name = new LdapDN();
         authenticationLevel = AuthenticationLevel.NONE;
+        userPassword = null;
     }
 
 
@@ -133,6 +142,18 @@
      */
     public String toString()
     {
-        return "['" + name.getUpName() + /*"', '" + StringTools.utf8ToString( userPassword ) +*/ "']'";
+        return "['" + name.getUpName() + "', '" + StringTools.utf8ToString( userPassword ) +"']'";
+    }
+
+
+    public byte[] getUserPassword()
+    {
+        return userPassword;
+    }
+
+
+    public void setUserPassword( byte[] userPassword )
+    {
+        this.userPassword = userPassword;
     }
 }