portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r692483 - in /portals/jetspeed-2/portal/branches/security-refactoring: components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java
Date Fri, 05 Sep 2008 16:38:08 GMT
Author: vkumar
Date: Fri Sep  5 09:38:07 2008
New Revision: 692483

URL: http://svn.apache.org/viewvc?rev=692483&view=rev
Log:
Small fixes in User Manager and its implementation

Modified:
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java?rev=692483&r1=692482&r2=692483&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
Fri Sep  5 09:38:07 2008
@@ -78,8 +78,10 @@
 		try
 		{
 			User user = newUser(username, true);
-			savePasswordCredential(new DefaultPasswordCredentialImpl(username, password.toCharArray()));
 			super.addPrincipal(user, null);
+			PasswordCredential pwc = new DefaultPasswordCredentialImpl(user);
+			pwc.setPassword(password.toCharArray());
+			storePasswordCredential(pwc);
 		}
 		catch (PrincipalAlreadyExistsException e)
 		{
@@ -104,8 +106,10 @@
 		try
 		{
 			User user = newUser(username, mapped);
-			savePasswordCredential(new DefaultPasswordCredentialImpl(username, password.toCharArray()));
 			super.addPrincipal(user, null);
+			PasswordCredential pwc = new DefaultPasswordCredentialImpl(user);
+			pwc.setPassword(password.toCharArray());
+			storePasswordCredential(pwc);			
 		}
 		catch (PrincipalAlreadyExistsException e)
 		{
@@ -131,8 +135,10 @@
 		try
 		{
 			User user = newUser(username, mapped);
-			savePasswordCredential(new DefaultPasswordCredentialImpl(username, password.toCharArray()));
 			super.addPrincipal(user, null);
+			PasswordCredential pwc = new DefaultPasswordCredentialImpl(user);
+			pwc.setPassword(password.toCharArray());
+			storePasswordCredential(pwc);			
 		}
 		catch (PrincipalAlreadyExistsException e)
 		{
@@ -159,7 +165,7 @@
 
 	public PasswordCredential getPasswordCredential(User user)
 	{
-		return new DefaultPasswordCredentialImpl(user.getName(), defaultPassword.toCharArray());
+		return null;		
 	}
 
 	public Subject getSubject(String username) throws SecurityException
@@ -274,15 +280,15 @@
 		}
 		catch (PrincipalNotRemovableException pnre)
 		{
-			throw new SecurityException(SecurityException.USER_UPDATE_FAILED.create(username));
+			throw new SecurityException(SecurityException.UNEXPECTED.create(username));
 		}
 		catch (DependentPrincipalException dpe)
 		{
-			throw new SecurityException(SecurityException.USER_UPDATE_FAILED.create(username));
+			throw new SecurityException(SecurityException.UNEXPECTED.create(username));
 		}
 	}
 
-	public void savePasswordCredential(PasswordCredential credential) throws SecurityException
+	public void storePasswordCredential(PasswordCredential credential) throws SecurityException
 	{
 		//TODO Auto-generated method stub
 	}
@@ -318,7 +324,7 @@
 		}
 		catch (PrincipalUpdateException pue)
 		{
-			throw new SecurityException(SecurityException.USER_UPDATE_FAILED.create(user.getName()));
+			throw new SecurityException(SecurityException.UNEXPECTED.create(user.getName()));
 		}
 	}
 

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java?rev=692483&r1=692482&r2=692483&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java
Fri Sep  5 09:38:07 2008
@@ -217,5 +217,5 @@
     
     void setPassword(User user, String oldPassword, String newPassword) throws SecurityException;
     
-    void savePasswordCredential(PasswordCredential credential) throws SecurityException;
+    void storePasswordCredential(PasswordCredential credential) throws SecurityException;
 }
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message