portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security ChangePasswordPortlet.java
Date Thu, 03 Feb 2005 01:28:11 GMT
ate         2005/02/02 17:28:11

  Modified:    applications/security/src/java/org/apache/jetspeed/portlets/security/resources
                        ChgPwdResources_en.properties
                        ChgPwdResources_nl.properties
                        ChgPwdResources.properties
               applications/security/src/java/org/apache/jetspeed/portlets/security
                        ChangePasswordPortlet.java
  Log:
  Improved password validation messages using more specialized exceptions
  
  Revision  Changes    Path
  1.4       +4 -1      jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/ChgPwdResources_en.properties
  
  Index: ChgPwdResources_en.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/ChgPwdResources_en.properties,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ChgPwdResources_en.properties	25 Nov 2004 02:25:57 -0000	1.3
  +++ ChgPwdResources_en.properties	3 Feb 2005 01:28:11 -0000	1.4
  @@ -31,6 +31,9 @@
   chgpwd.error.currentPasswordNull=Current password is required
   chgpwd.error.newPasswordNull=New password is required
   chgpwd.error.newPasswordsDoNotMatch=Passwords do not match
  +chgpwd.error.invalidPassword=Invalid current password
  +chgpwd.error.invalidNewPassword=Invalid new password
  +chgpwd.error.passwordAlreadyUsed=Password already used
   chgpwd.label.Logout=Logout
   chgpwd.message.change.required=Your password needs to be changed.
   chgpwd.message.expires.today=Your password will expire today.
  
  
  
  1.3       +4 -1      jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/ChgPwdResources_nl.properties
  
  Index: ChgPwdResources_nl.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/ChgPwdResources_nl.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ChgPwdResources_nl.properties	25 Nov 2004 02:25:57 -0000	1.2
  +++ ChgPwdResources_nl.properties	3 Feb 2005 01:28:11 -0000	1.3
  @@ -29,6 +29,9 @@
   chgpwd.error.currentPasswordNull=Huidige Wachtwoord is verplicht
   chgpwd.error.newPasswordNull=Nieuw Wachtwoord is verplicht
   chgpwd.error.newPasswordsDoNotMatch=Wachtwoorden komen niet overeen
  +chgpwd.error.invalidPassword=Huidig wachtwoord incorrect
  +chgpwd.error.invalidNewPassword=Ongeldig nieuw wachtwoord
  +chgpwd.error.passwordAlreadyUsed=Wachtwoord reeds eerder gebruikt
   chgpwd.label.Logout=Uitloggen
   chgpwd.message.change.required=Het wachtwoord moet gewijzigd worden.
   chgpwd.message.expires.today=Het wachtwoord verloopt vandaag.
  
  
  
  1.3       +4 -1      jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/ChgPwdResources.properties
  
  Index: ChgPwdResources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/ChgPwdResources.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ChgPwdResources.properties	25 Nov 2004 02:25:57 -0000	1.2
  +++ ChgPwdResources.properties	3 Feb 2005 01:28:11 -0000	1.3
  @@ -29,6 +29,9 @@
   chgpwd.error.currentPasswordNull=Current password is required
   chgpwd.error.newPasswordNull=New password is required
   chgpwd.error.newPasswordsDoNotMatch=Passwords do not match
  +chgpwd.error.invalidPassword=Invalid current password
  +chgpwd.error.invalidNewPassword=Invalid new password
  +chgpwd.error.passwordAlreadyUsed=Password already used
   chgpwd.label.Logout=Logout
   chgpwd.message.change.required=Your password needs to be changed.
   chgpwd.message.expires.today=Your password will expire today.
  
  
  
  1.6       +17 -1     jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/ChangePasswordPortlet.java
  
  Index: ChangePasswordPortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/ChangePasswordPortlet.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ChangePasswordPortlet.java	4 Jan 2005 15:50:37 -0000	1.5
  +++ ChangePasswordPortlet.java	3 Feb 2005 01:28:11 -0000	1.6
  @@ -32,6 +32,9 @@
   import javax.servlet.http.HttpServletRequest;
   
   import org.apache.jetspeed.request.RequestContext;
  +import org.apache.jetspeed.security.InvalidNewPasswordException;
  +import org.apache.jetspeed.security.InvalidPasswordException;
  +import org.apache.jetspeed.security.PasswordAlreadyUsedException;
   import org.apache.jetspeed.security.PasswordCredential;
   import org.apache.jetspeed.security.SecurityException;
   import org.apache.jetspeed.security.UserManager;
  @@ -169,8 +172,21 @@
                           RequestContext requestContext = (RequestContext)actionRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
                 
                           requestContext.setSessionAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT,
subject);
                       }
  +                    catch ( InvalidPasswordException ipe )
  +                    {
  +                        errorMessages.add(bundle.getString("chgpwd.error.invalidPassword"));
  +                    }
  +                    catch ( InvalidNewPasswordException inpe )
  +                    {
  +                        errorMessages.add(bundle.getString("chgpwd.error.invalidNewPassword"));
  +                    }
  +                    catch ( PasswordAlreadyUsedException paue )
  +                    {
  +                        errorMessages.add(bundle.getString("chgpwd.error.passwordAlreadyUsed"));
  +                    }
                       catch ( SecurityException e)
                       {
  +                        // todo: localization of all exception messages
                           errorMessages.add(e.getMessage());
                       }
                   }
  
  
  

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


Mime
View raw message