portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kimp...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions CreateNewUserAndConfirm.java UpdateAccount.java
Date Mon, 26 Nov 2001 19:25:25 GMT
kimptoc     01/11/26 11:25:25

  Modified:    src/java/org/apache/jetspeed/modules/actions
                        CreateNewUserAndConfirm.java UpdateAccount.java
  Log:
  bug4696- allow create and update user actions to be extended - eg for application specific
user amendments
  
  Revision  Changes    Path
  1.25      +17 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/CreateNewUserAndConfirm.java
  
  Index: CreateNewUserAndConfirm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/CreateNewUserAndConfirm.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- CreateNewUserAndConfirm.java	2001/11/26 16:37:33	1.24
  +++ CreateNewUserAndConfirm.java	2001/11/26 19:25:25	1.25
  @@ -162,8 +162,10 @@
                   user.setLastLogin(new Date(0));
                   user.setFirstName( data.getParameters().getString("firstname") );
                   user.setLastName( data.getParameters().getString("lastname") );
  -                user.setEmail( data.getParameters().getString("email") );             
          
  +                user.setEmail( data.getParameters().getString("email") );   
   
  +                createUser(user);                     
  +
                   // create a unique confirmation string for the new user
                   String confirmValue = GenerateUniqueId.getIdentifier();
       
  @@ -235,6 +237,19 @@
       }
   
       /**
  +     * createUser creates a new user.
  +     * Subclasses can override this method - adding additional user property settings as
needed.
  +     * The default implementation does nothing.
  +     *
  +     * @param user the new user that has been created
  +     *
  +     * @throws Exception passed up from JetspeedSecurity
  +     */
  +    protected void createUser(User user) throws Exception
  +    {        
  +    }
  +
  +    /**
        * bypassConfirmMail allows configurations to bypass sending the confirmation email
        * The new user is logged on and then redirected to the home page
        *
  @@ -279,6 +294,7 @@
           }
           catch ( Exception e )
           {
  +            Log.error(e);
               data.setMessage(e.toString());
               data.setStackTrace(StringUtils.stackTrace(e), e);
               data.setScreenTemplate("Error");
  
  
  
  1.12      +17 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/UpdateAccount.java
  
  Index: UpdateAccount.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/UpdateAccount.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- UpdateAccount.java	2001/05/29 09:59:26	1.11
  +++ UpdateAccount.java	2001/11/26 19:25:25	1.12
  @@ -186,11 +186,27 @@
           if ( changepass ) {
               data.getUser().setPassword(password);
           }
  +
  +        //allow sub-classes to update additional information
  +        updateUser(data);
  +
           TurbineSecurity.saveUser( data.getUser() );
           data.setMessage (Localization.getString("UPDATEACCOUNT_DONE"));
           
       }
  -    
  +
  +    /**
  +     * updateUser updates the user object.
  +     * Subclasses can extend this class and override this method - adding additional custom
settings as needed.
  +     * Note the default implementation does nothing - so no need to call the super version.
  +     *
  +     * @param data Turbine request/session information.
  +     */
  +    protected void updateUser(RunData data)
  +    {
  +        //default version does nothing
  +    }
  +
       private void backToEditAccount( RunData rundata, Hashtable screenData )
       {   
           rundata.getRequest().setAttribute( "ScreenDataEditAccount",
  
  
  

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


Mime
View raw message