portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed/webapp/WEB-INF/db jetspeed.properties jetspeed.script
Date Fri, 07 Jun 2002 10:02:08 GMT
taylor      2002/06/07 03:02:07

  Modified:    src/java/org/apache/jetspeed/modules/actions Tag:
                        security_14 CreateNewUserAndConfirm.java
                        JLoginUser.java UpdateAccount.java
               src/java/org/apache/jetspeed/modules/actions/portlets/security
                        Tag: security_14 GroupUpdateAction.java
                        RoleUpdateAction.java UserBrowserAction.java
                        UserRoleUpdateAction.java UserUpdateAction.java
               src/java/org/apache/jetspeed/om/security Tag: security_14
                        BaseJetspeedUser.java
               src/java/org/apache/jetspeed/om/security/turbine Tag:
                        security_14 TurbineUserPeer.java
               src/java/org/apache/jetspeed/services Tag: security_14
                        JetspeedSecurity.java JetspeedUserManagement.java
               src/java/org/apache/jetspeed/services/psmlmanager Tag:
                        security_14 PsmlImporter.java
               src/java/org/apache/jetspeed/services/rundata Tag:
                        security_14 DefaultJetspeedRunData.java
                        JetspeedRunData.java
               src/java/org/apache/jetspeed/services/security Tag:
                        security_14 JetspeedDBSecurityService.java
                        JetspeedSecurityService.java
                        PortalAuthentication.java UserManagement.java
               src/java/org/apache/jetspeed/services/security/turbine Tag:
                        security_14 TurbineAuthentication.java
                        TurbineUserManagement.java
               src/java/org/apache/jetspeed/util/servlet Tag: security_14
                        EcsServletResponse.java
               webapp/WEB-INF/conf Tag: security_14
                        JetspeedSecurity.properties
                        JetspeedSecurity.template
               webapp/WEB-INF/db Tag: security_14 jetspeed.properties
                        jetspeed.script
  Log:
  - decoupling of Turbine Security completed (almost) for Authorization, Authentication, User Mgt.
  
  - still to complete: disable all base actions calls from JLogin, SessionValidator, ..., Roles, Groups, ACLs, Access Checks per Security function
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.32.2.1  +19 -9     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.32
  retrieving revision 1.32.2.1
  diff -u -r1.32 -r1.32.2.1
  --- CreateNewUserAndConfirm.java	26 Apr 2002 21:19:10 -0000	1.32
  +++ CreateNewUserAndConfirm.java	7 Jun 2002 10:02:05 -0000	1.32.2.1
  @@ -58,6 +58,8 @@
   // java.util
   import java.util.Date;
   
  +import org.apache.jetspeed.om.security.JetspeedUser;
  +
   // Jetspeed modules
   import org.apache.jetspeed.util.template.JetspeedLink;
   import org.apache.jetspeed.util.template.JetspeedLinkFactory;
  @@ -80,9 +82,6 @@
   import org.apache.turbine.util.GenerateUniqueId;
   import org.apache.turbine.util.StringUtils;
   
  -// turbine.om
  -import org.apache.turbine.om.security.User;
  -
   // profiler
   import org.apache.jetspeed.services.Profiler;
   
  @@ -160,11 +159,21 @@
   
               String CHNAME = Localization.getString("CREATENEWUSERANDCONFIRM_DUPLICATEMSG");
   
  -            if (!JetspeedSecurity.accountExists(username))
  +            boolean accountExists = true;
  +            try
  +            {
  +                JetspeedSecurity.getUser(username);
  +            }
  +            catch(SecurityException e)
  +            {
  +                accountExists = false;
  +            }
  +
  +            if (!accountExists)
               {
                   Date now = new Date();
   
  -                User user = JetspeedSecurity.getUserInstance();
  +                JetspeedUser user = JetspeedSecurity.getUserInstance();
   
                   user.setUserName( username );
                   user.setCreateDate(now);
  @@ -193,7 +202,8 @@
                   // Store the user object.
                   data.setUser(user);
   
  -                JetspeedSecurity.addUser(user, pass1, data);
  +                user.setPassword(pass1);
  +                JetspeedSecurity.addUser(user);
                   if (!enableMail && !newUserApproval)
                   {
                     user.setHasLoggedIn(new Boolean (true));
  @@ -255,7 +265,7 @@
        *
        * @throws Exception passed up from JetspeedSecurity
        */
  -    protected void createUser(User user, RunData data) throws Exception
  +    protected void createUser(JetspeedUser user, RunData data) throws Exception
       {
       }
   
  @@ -269,11 +279,11 @@
        */
       private void bypassConfirmMail(RunData data, String username, String password)
       {
  -        User usr = null;
  +        JetspeedUser usr = null;
           try
           {
             // Authenticate the user and get the object.
  -          usr = JetspeedSecurity.getAuthenticatedUser( username, password );
  +          usr = JetspeedSecurity.login( username, password );
   
             // Store the user object.
             data.setUser(usr);
  
  
  
  1.23.2.2  +21 -22    jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/JLoginUser.java
  
  Index: JLoginUser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/JLoginUser.java,v
  retrieving revision 1.23.2.1
  retrieving revision 1.23.2.2
  diff -u -r1.23.2.1 -r1.23.2.2
  --- JLoginUser.java	30 May 2002 07:04:09 -0000	1.23.2.1
  +++ JLoginUser.java	7 Jun 2002 10:02:05 -0000	1.23.2.2
  @@ -70,28 +70,23 @@
   import org.apache.turbine.modules.Action;
   import org.apache.turbine.modules.ActionEvent;
   import org.apache.turbine.modules.ActionLoader;
  -import org.apache.turbine.om.security.peer.RolePeer;
  -import org.apache.turbine.om.security.peer.TurbineUserPeer;
  -import org.apache.turbine.om.security.peer.UserGroupRolePeer;
  -import org.apache.turbine.om.security.User;
  -import org.apache.turbine.services.db.TurbineDB;
   import org.apache.turbine.services.localization.Localization;
  -import org.apache.turbine.services.resources.TurbineResources;
   import org.apache.turbine.services.velocity.TurbineVelocity;
  -import org.apache.turbine.util.db.Criteria;
   import org.apache.turbine.services.template.TurbineTemplate;
   import org.apache.turbine.util.Log;
   import org.apache.turbine.util.mail.SimpleEmail;
   import org.apache.turbine.util.mail.Email;
  -import org.apache.turbine.util.RunData;
   import org.apache.turbine.util.DynamicURI;
  -import org.apache.turbine.util.security.UnknownEntityException;
  +import org.apache.turbine.util.RunData;
   import org.apache.jetspeed.services.TemplateLocator;
   
  +
  +import org.apache.jetspeed.om.security.JetspeedUser;
  +
  +import org.apache.jetspeed.services.rundata.JetspeedRunData;
   import org.apache.jetspeed.services.resources.JetspeedResources;
  -import org.apache.jetspeed.services.Profiler;
   import org.apache.jetspeed.services.JetspeedSecurity;
  -import org.apache.jetspeed.om.security.JetspeedUser;
  +import org.apache.jetspeed.services.security.JetspeedSecurityException;
   
   /**
       This class is responsible for logging a user into the system. It is also
  @@ -106,16 +101,18 @@
       * called when the password reminder button is pressed.
       * sends a user their password
       **/
  -    public void doReminder( RunData data ) throws Exception
  +    public void doReminder( RunData rundata ) throws Exception
       {
  +        JetspeedRunData data = (JetspeedRunData)rundata;
  +
           try {
               String username = data.getParameters().getString("username", "");
   
  -            User user = null;
  +            JetspeedUser user = null;
   
               try {
                   user = JetspeedSecurity.getUser(username);
  -            } catch (UnknownEntityException ignored) {
  +            } catch (JetspeedSecurityException ignored) {
               }
   
               if (user == null)
  @@ -181,8 +178,10 @@
       }
   
   
  -    public void doPerform( RunData data ) throws Exception
  +    public void doPerform( RunData rundata ) throws Exception
       {
  +        JetspeedRunData data = (JetspeedRunData)rundata;
  +
           // This prevents a db hit on second Action call during page
           // generation.  Turbine removes everything from the Session
           // before calling this method, so in this case we should
  @@ -211,7 +210,7 @@
               // if not, then send them to the ConfirmRegistration screen            
               String username = data.getParameters().getString("username", "");
               String password = data.getParameters().getString("password", "");
  -            User user = JetspeedSecurity.getUser(username);
  +            JetspeedUser user = JetspeedSecurity.getUser(username);
   
               if (user == null)
               {
  @@ -265,10 +264,10 @@
   
           if ( data.getUser().hasLoggedIn())
           {
  -            if  (JetspeedSecurity.getAutoLogonDisable())
  +            if  (JetspeedSecurity.isDisableAccountCheckEnabled())
               {
                   // dst: this needs some refactoring. I don't believe this api is necessary
  -                JetspeedSecurity.resetUserCheck(data.getParameters().getString("username", ""));
  +                JetspeedSecurity.resetDisableAccountCheck(data.getParameters().getString("username", ""));
               }        
   
               String confirmed = data.getUser().getConfirmed();
  @@ -317,7 +316,7 @@
                   {
                     loginCookieValue = ""+Math.random();
                     data.getUser().setPerm("logincookie",loginCookieValue);
  -                  JetspeedSecurity.saveUser( data.getUser() );
  +                  JetspeedSecurity.saveUser( data.getJetspeedUser() );
                   } 
                   else 
                   {
  @@ -326,7 +325,7 @@
                     {
                       loginCookieValue = ""+Math.random();
                       data.getUser().setPerm("logincookie",loginCookieValue);
  -                    JetspeedSecurity.saveUser( data.getUser() );
  +                    JetspeedSecurity.saveUser( data.getJetspeedUser() );
                     }
                   }
   
  @@ -354,9 +353,9 @@
           else
           {
               // disable user after a configurable number of strikes
  -            if  (JetspeedSecurity.getAutoLogonDisable())
  +            if  (JetspeedSecurity.isDisableAccountCheckEnabled())
               {
  -                boolean disabled = JetspeedSecurity.disableUserCheck(data.getParameters().getString("username", ""));
  +                boolean disabled = JetspeedSecurity.checkDisableAccount(data.getParameters().getString("username", ""));
                   if (disabled)
                   {
                       data.setMessage(Localization.getString("JLOGINUSER_ACCOUNT_DISABLED"));
  
  
  
  1.16.2.1  +11 -7     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.16
  retrieving revision 1.16.2.1
  diff -u -r1.16 -r1.16.2.1
  --- UpdateAccount.java	27 Apr 2002 11:22:15 -0000	1.16
  +++ UpdateAccount.java	7 Jun 2002 10:02:05 -0000	1.16.2.1
  @@ -63,6 +63,8 @@
   // Jetspeed
   import org.apache.jetspeed.services.resources.JetspeedResources;
   import org.apache.jetspeed.services.JetspeedSecurity;
  +import org.apache.jetspeed.services.security.JetspeedSecurityException;
  +import org.apache.jetspeed.services.rundata.JetspeedRunData;
   
   // Turbine
   import org.apache.turbine.modules.Action;
  @@ -82,8 +84,10 @@
    */
   public class UpdateAccount extends Action
   {
  -    public void doPerform( RunData data ) throws Exception
  +    public void doPerform( RunData rundata ) throws Exception
       {
  +        JetspeedRunData data = (JetspeedRunData)rundata;
  +
           // check to make sure the user has logged in before accessing this screen
           if ( ! data.getUser().hasLoggedIn() )
           {
  @@ -215,7 +219,7 @@
                 {
                   loginCookieValue = ""+Math.random();
                   data.getUser().setPerm("logincookie",loginCookieValue);
  -                JetspeedSecurity.saveUser( data.getUser() );
  +                JetspeedSecurity.saveUser( data.getJetspeedUser() );
                 }
   
                 Cookie userName = new Cookie("username",data.getUser().getUserName());
  @@ -269,7 +273,7 @@
                   //Send confirmation email if different than current
                   data.getUser().setEmail( email );
                   data.getUser().setConfirmed( GenerateUniqueId.getIdentifier() );
  -                JetspeedSecurity.saveUser( data.getUser() );
  +                JetspeedSecurity.saveUser( data.getJetspeedUser() );
                   ActionLoader.getInstance().exec(data, "SendConfirmationEmail");
                   // add in the username to the parameters because ConfirmRegistration needs it
                   data.getParameters().add("username", data.getUser().getUserName() );
  @@ -278,7 +282,7 @@
               }
           else
               {       
  -                JetspeedSecurity.saveUser( data.getUser() );
  +                JetspeedSecurity.saveUser( data.getJetspeedUser() );
               }
               
           // update currently logged in information that might have changed
  @@ -289,8 +293,8 @@
           {
               try
               {
  -              JetspeedSecurity.changePassword(data.getUser(),oldPassword, password);
  -            } catch (PasswordMismatchException e)
  +              JetspeedSecurity.changePassword(data.getJetspeedUser(),oldPassword, password);
  +            } catch (JetspeedSecurityException e)
               {
                   data.setMessage(Localization.getString("UPDATEACCOUNT_BADOLDPASSWORD"));
                   backToEditAccount( data, screenData );
  @@ -301,7 +305,7 @@
           //allow sub-classes to update additional information
           updateUser(data);
   
  -        JetspeedSecurity.saveUser( data.getUser() );
  +        JetspeedSecurity.saveUser( data.getJetspeedUser() );
           data.setMessage (Localization.getString("UPDATEACCOUNT_DONE"));
           
       }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.1   +3 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/security/GroupUpdateAction.java
  
  Index: GroupUpdateAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/security/GroupUpdateAction.java,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- GroupUpdateAction.java	29 Mar 2002 20:12:32 -0000	1.5
  +++ GroupUpdateAction.java	7 Jun 2002 10:02:05 -0000	1.5.2.1
  @@ -83,7 +83,7 @@
    * This action sets up the template context for editing security groups in the Turbine database.
    *
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  - * @version $Id: GroupUpdateAction.java,v 1.5 2002/03/29 20:12:32 taylor Exp $
  + * @version $Id: GroupUpdateAction.java,v 1.5.2.1 2002/06/07 10:02:05 taylor Exp $
    */
   
   public class GroupUpdateAction extends VelocityPortletAction
  @@ -212,7 +212,7 @@
               //
               // add the group
               ///
  -            JetspeedSecurity.addGroup(group, rundata);
  +            JetspeedSecurity.addGroup(group);
   
           }
           catch (EntityExistsException e)
  @@ -303,7 +303,7 @@
               //
               // remove the group
               //
  -            JetspeedSecurity.removeGroup(group, rundata);
  +            JetspeedSecurity.removeGroup(group);
   
           }
           catch (Exception e)
  
  
  
  1.7.2.1   +3 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/security/RoleUpdateAction.java
  
  Index: RoleUpdateAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/security/RoleUpdateAction.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- RoleUpdateAction.java	29 Mar 2002 20:12:32 -0000	1.7
  +++ RoleUpdateAction.java	7 Jun 2002 10:02:05 -0000	1.7.2.1
  @@ -83,7 +83,7 @@
    * This action sets up the template context for editing security roles in the Turbine database.
    *
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  - * @version $Id: RoleUpdateAction.java,v 1.7 2002/03/29 20:12:32 taylor Exp $
  + * @version $Id: RoleUpdateAction.java,v 1.7.2.1 2002/06/07 10:02:05 taylor Exp $
    */
   public class RoleUpdateAction extends VelocityPortletAction
   {
  @@ -211,7 +211,7 @@
               //
               // add the role
               ///
  -            JetspeedSecurity.addRole(role, rundata);
  +            JetspeedSecurity.addRole(role);
   
           }
           catch (EntityExistsException e)
  @@ -302,7 +302,7 @@
               //
               // remove the role
               //
  -            JetspeedSecurity.removeRole(role, rundata);
  +            JetspeedSecurity.removeRole(role);
   
           }
           catch (Exception e)
  
  
  
  1.6.2.1   +12 -6     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/security/UserBrowserAction.java
  
  Index: UserBrowserAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/security/UserBrowserAction.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- UserBrowserAction.java	28 Apr 2002 21:00:00 -0000	1.6
  +++ UserBrowserAction.java	7 Jun 2002 10:02:05 -0000	1.6.2.1
  @@ -65,7 +65,6 @@
   import org.apache.turbine.util.DynamicURI;
   
   import org.apache.turbine.util.security.RoleSet;
  -import org.apache.turbine.util.db.Criteria;
   
   // turbine om
   import org.apache.turbine.om.security.User;
  @@ -76,6 +75,7 @@
   
   // jetspeed services
   import org.apache.jetspeed.services.JetspeedSecurity;
  +import org.apache.jetspeed.services.security.JetspeedSecurityException;
   import org.apache.jetspeed.services.resources.JetspeedResources;
   
   // jetspeed velocity
  @@ -84,12 +84,14 @@
   
   import java.util.Arrays;
   import java.util.List;
  +import java.util.Iterator;
  +import java.util.ArrayList;
   
   /**
    * This action sets up the template context for browsing of users in the Turbine database.
    *
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  - * @version $Id: UserBrowserAction.java,v 1.6 2002/04/28 21:00:00 kimptoc Exp $
  + * @version $Id: UserBrowserAction.java,v 1.6.2.1 2002/06/07 10:02:05 taylor Exp $
    */
   public class UserBrowserAction extends VelocityPortletAction
   {
  @@ -145,10 +147,14 @@
               //hack to make the static variables visible in template
               context.put("s_config", new FieldMethodizer( context.get("config") ) );
   
  -            Criteria criteria = new Criteria();
  -            User[] users = JetspeedSecurity.getUsers(criteria);
  +            Iterator users = JetspeedSecurity.getUsers();
  +            
   
  -            List userList = Arrays.asList(users);
  +            List userList = new ArrayList();
  +            while (users.hasNext())
  +            {
  +                userList.add(users.next());
  +            }
   
               int currentPage = rundata.getParameters().getInt(DISPLAY_PAGE, 1);
   
  @@ -193,7 +199,7 @@
   
   
           }
  -        catch (DataBackendException e)
  +        catch (JetspeedSecurityException e)
           {
             // log the error msg
               Log.error(e);
  
  
  
  1.4.2.1   +3 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/security/UserRoleUpdateAction.java
  
  Index: UserRoleUpdateAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/security/UserRoleUpdateAction.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- UserRoleUpdateAction.java	29 Mar 2002 20:12:32 -0000	1.4
  +++ UserRoleUpdateAction.java	7 Jun 2002 10:02:05 -0000	1.4.2.1
  @@ -76,8 +76,7 @@
   import org.apache.turbine.util.security.RoleSet;
   import org.apache.turbine.util.db.Criteria;
   import org.apache.turbine.util.security.AccessControlList;
  -import org.apache.turbine.util.security.DataBackendException;
  -import org.apache.turbine.util.security.UnknownEntityException;
  +import org.apache.jetspeed.services.security.JetspeedSecurityException;
   
   // jetspeed services
   import org.apache.jetspeed.services.JetspeedSecurity;
  @@ -93,7 +92,7 @@
    * for a given user.
    *
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  - * @version $Id: UserRoleUpdateAction.java,v 1.4 2002/03/29 20:12:32 taylor Exp $
  + * @version $Id: UserRoleUpdateAction.java,v 1.4.2.1 2002/06/07 10:02:05 taylor Exp $
    */
   public class UserRoleUpdateAction extends VelocityPortletAction
   {
  @@ -290,7 +289,7 @@
                                          Context context,
                                          RunData rundata,
                                          String userid)
  -        throws UnknownEntityException, DataBackendException
  +        throws Exception
       {
           // get master list of roles
           Criteria criteria = new Criteria();
  
  
  
  1.11.2.2  +8 -7      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/security/UserUpdateAction.java
  
  Index: UserUpdateAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/security/UserUpdateAction.java,v
  retrieving revision 1.11.2.1
  retrieving revision 1.11.2.2
  diff -u -r1.11.2.1 -r1.11.2.2
  --- UserUpdateAction.java	30 May 2002 07:04:10 -0000	1.11.2.1
  +++ UserUpdateAction.java	7 Jun 2002 10:02:05 -0000	1.11.2.2
  @@ -104,7 +104,7 @@
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
    * @author <a href="mailto:kimptoc_mail@yahoo.com">Chris Kimpton</a>
    * @author <a href="mailto:paulsp@apache.org">Paul Spencer</a>
  - * @version $Id: UserUpdateAction.java,v 1.11.2.1 2002/05/30 07:04:10 taylor Exp $
  + * @version $Id: UserUpdateAction.java,v 1.11.2.2 2002/06/07 10:02:05 taylor Exp $
    */
   public class UserUpdateAction extends VelocityPortletAction
   {
  @@ -164,7 +164,7 @@
               {
                   // get the primary key and put the object in the context
                   String username = rundata.getParameters().getString(SecurityConstants.PARAM_ENTITY_ID);
  -                user = (JetspeedUser)JetspeedSecurity.getUser(username);
  +                user = JetspeedSecurity.getUser(username);
                   context.put(SecurityConstants.CONTEXT_USER, user);
               }
   
  @@ -229,7 +229,7 @@
               //
               // create a new user
               //
  -            user = (JetspeedUser)JetspeedSecurity.getUserInstance();
  +            user = JetspeedSecurity.getUserInstance();
               rundata.getParameters().setProperties(user);
   
               String password = rundata.getParameters().getString("password");
  @@ -249,7 +249,8 @@
               //
               // add the user
               ///
  -            JetspeedSecurity.addUser(user, password, rundata);
  +            user.setPassword(password);
  +            JetspeedSecurity.addUser(user);
   
   
           }
  @@ -483,9 +484,9 @@
               boolean disabled = (strDisabled != null);
               user.setDisabled(disabled);
   
  -            if  (!disabled && oldDisabled && JetspeedSecurity.getAutoLogonDisable())
  +            if  (!disabled && oldDisabled && JetspeedSecurity.isDisableAccountCheckEnabled())
               {
  -                JetspeedSecurity.resetUserCheck(name);
  +                JetspeedSecurity.resetDisableAccountCheck(name);
               }
   
               //
  @@ -562,7 +563,7 @@
               //
               // remove the user
               //
  -            JetspeedSecurity.removeUser(user, rundata);
  +            JetspeedSecurity.removeUser(user.getUserName());
   
           }
           catch (Exception e)
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.4   +6 -6      jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/BaseJetspeedUser.java
  
  Index: BaseJetspeedUser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/BaseJetspeedUser.java,v
  retrieving revision 1.3.2.3
  retrieving revision 1.3.2.4
  diff -u -r1.3.2.3 -r1.3.2.4
  --- BaseJetspeedUser.java	5 Jun 2002 01:21:52 -0000	1.3.2.3
  +++ BaseJetspeedUser.java	7 Jun 2002 10:02:06 -0000	1.3.2.4
  @@ -53,7 +53,7 @@
    */
   package org.apache.jetspeed.om.security;
   
  -import org.apache.jetspeed.services.JetspeedSecurity;
  +import org.apache.jetspeed.services.JetspeedUserManagement;
   
   import org.apache.turbine.om.security.User;
   import org.apache.turbine.om.security.SecurityObject;
  @@ -79,7 +79,7 @@
    * for custom attributes). 
    *
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  - * @version $Id: BaseJetspeedUser.java,v 1.3.2.3 2002/06/05 01:21:52 taylor Exp $
  + * @version $Id: BaseJetspeedUser.java,v 1.3.2.4 2002/06/07 10:02:06 taylor Exp $
    */
   public class BaseJetspeedUser /*extends SecurityObject*/ implements JetspeedUser
   {
  @@ -687,7 +687,7 @@
               if (hasLoggedIn())
               {
                  if ( JetspeedResources.getBoolean("automatic.logout.save", false) )
  -                    JetspeedSecurity.saveUser(this);
  +                    JetspeedUserManagement.saveUser(this);
               }
           }
           catch ( Exception e )
  @@ -711,13 +711,13 @@
       public void save()
           throws Exception
       {
  -        if (JetspeedSecurity.accountExists(this))
  +        if (this.isNew())
           {
  -            JetspeedSecurity.saveUser(this);
  +            JetspeedUserManagement.saveUser(this);
           }
           else
           {
  -            JetspeedSecurity.addUser(this, getPassword());
  +            JetspeedUserManagement.addUser(this);
           }
       }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.4   +0 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/turbine/Attic/TurbineUserPeer.java
  
  Index: TurbineUserPeer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/turbine/Attic/TurbineUserPeer.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- TurbineUserPeer.java	5 Jun 2002 01:21:52 -0000	1.1.2.3
  +++ TurbineUserPeer.java	7 Jun 2002 10:02:06 -0000	1.1.2.4
  @@ -256,7 +256,6 @@
           Criteria criteria = new Criteria();
           if ( !user.isNew() )
           {
  -            System.out.println("$$$ User IS NOT NEW");
               criteria.add(USER_ID, new NumberKey(user.getUserId()));
           }
   
  @@ -266,8 +265,6 @@
               {
                   String key = new StringBuffer(TABLE_NAME)
                       .append('.').append(columnNames[i]).toString();
  -
  -                System.out.println("setting column = " + key);
   
                   criteria.add( key,
                                 permData.remove(TurbineUserPeer.columnNames[i]) );
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.10.2.6  +352 -88   jakarta-jetspeed/src/java/org/apache/jetspeed/services/JetspeedSecurity.java
  
  Index: JetspeedSecurity.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/JetspeedSecurity.java,v
  retrieving revision 1.10.2.5
  retrieving revision 1.10.2.6
  diff -u -r1.10.2.5 -r1.10.2.6
  --- JetspeedSecurity.java	5 Jun 2002 01:21:53 -0000	1.10.2.5
  +++ JetspeedSecurity.java	7 Jun 2002 10:02:06 -0000	1.10.2.6
  @@ -54,28 +54,35 @@
   
   package org.apache.jetspeed.services;
   
  -import org.apache.turbine.services.security.TurbineSecurity;
  +import java.util.Iterator;
  +import java.security.Principal;
  +
   import org.apache.turbine.om.security.User;
   import org.apache.turbine.om.security.Group;
   import org.apache.turbine.om.security.Role;
  -import org.apache.jetspeed.services.security.*;
  -import org.apache.turbine.util.RunData;
  -import org.apache.jetspeed.om.registry.RegistryEntry;
  -import org.apache.turbine.util.security.DataBackendException;
  -import org.apache.turbine.util.security.EntityExistsException;
  -import org.apache.jetspeed.om.profile.ProfileException;
  -import org.apache.turbine.util.security.UnknownEntityException;
  -import org.apache.turbine.util.security.PasswordMismatchException;
  +import org.apache.turbine.om.security.Permission;
  +
  +import org.apache.turbine.util.Log;
  +import org.apache.jetspeed.services.rundata.JetspeedRunData;
  +import org.apache.turbine.services.TurbineServices;
   
   import org.apache.jetspeed.portal.Portlet;
   
   import org.apache.jetspeed.om.profile.Entry;
  +import org.apache.jetspeed.om.profile.ProfileException;
  +import org.apache.jetspeed.om.registry.RegistryEntry;
   import org.apache.jetspeed.om.security.JetspeedUser;
  +import org.apache.jetspeed.om.security.JetspeedUserFactory;
  +import org.apache.jetspeed.om.security.UserNamePrincipal;
  +
   import org.apache.jetspeed.services.JetspeedPortalAccessController;
  -import org.apache.jetspeed.services.security.PortalResource;
   import org.apache.jetspeed.services.JetspeedUserManagement;
   import org.apache.jetspeed.services.JetspeedAuthentication;
  -import org.apache.turbine.util.Log;
  +
  +import org.apache.jetspeed.services.security.JetspeedSecurityService;
  +import org.apache.jetspeed.services.security.JetspeedSecurityException;
  +import org.apache.jetspeed.services.security.PortalResource;
  +import org.apache.jetspeed.services.security.LoginException;
   
   /**
    * <P>This is a commodity static accessor class around the 
  @@ -83,10 +90,10 @@
    * 
    * @see org.apache.jetspeed.services.security.JetspeedSecurityService
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  - * @version $Id: JetspeedSecurity.java,v 1.10.2.5 2002/06/05 01:21:53 taylor Exp $
  + * @version $Id: JetspeedSecurity.java,v 1.10.2.6 2002/06/07 10:02:06 taylor Exp $
    */
   
  -abstract public class JetspeedSecurity extends TurbineSecurity
  +abstract public class JetspeedSecurity /* extends TurbineSecurity */
   {
       public static final String PERMISSION_VIEW = "view";
       public static final String PERMISSION_CUSTOMIZE = "customize";
  @@ -104,6 +111,53 @@
       public static final String JETSPEED_ROLE_USER = "user";
       public static final String JETSPEED_ROLE_ADMIN = "admin";
   
  +    /** 
  +     * Commodity method for getting a reference to the service
  +     * singleton
  +     */
  +    public static JetspeedSecurityService getService()
  +    {
  +        return (JetspeedSecurityService)TurbineServices
  +                .getInstance()
  +                .getService(JetspeedSecurityService.SERVICE_NAME);     
  +    }
  +
  +    //////////////////////////////////////////////////////////////////////////
  +    // PortalAuthentication
  +    /////////////////////////////////////////////////////////////////////////
  +
  +    /**
  +     * @see PortalAuthentication#login
  +     */
  +    public static JetspeedUser login(String username, String password)
  +        throws LoginException
  +    {
  +        return JetspeedAuthentication.login(username, password);
  +    }
  +
  +    /**
  +     * @see PortalAuthentication#getAnonymousUser
  +     */
  +    public static JetspeedUser getAnonymousUser()
  +        throws LoginException
  +    {
  +        return JetspeedAuthentication.getAnonymousUser();
  +    }
  +
  +    /**
  +     * @see PortalAuthentication#logout
  +     */
  +    public static void logout()
  +        throws LoginException
  +    {
  +        JetspeedAuthentication.logout();
  +    }
  +
  +
  +    //////////////////////////////////////////////////////////////////////////
  +    // PortalAuthorization
  +    /////////////////////////////////////////////////////////////////////////
  +
       /**
        * @see JetspeedPortalAccessController#checkPermission
        */
  @@ -136,106 +190,142 @@
           return JetspeedPortalAccessController.checkPermission(user, resource, action);
       }
   
  +
  +    //////////////////////////////////////////////////////////////////////////
  +    // UserManagement
  +    /////////////////////////////////////////////////////////////////////////
  +
       /**
  -     * @see JetspeedSecurityService#checkPermission
  +     * @see UserManagement#getUser
        */
  -    public static boolean checkPermission(RunData runData, String permission, Portlet portlet)
  +    public static JetspeedUser getUser(Principal principal) 
  +        throws JetspeedSecurityException
       {
  -        return checkPermission((JetspeedUser) runData.getUser(), portlet, permission);
  +        return JetspeedUserManagement.getUser(principal);
       }
   
       /**
  -     * @see JetspeedSecurityService#checkPermission
  +     * @see UserManagement#getUsers
        */
  -    public static boolean checkPermission(RunData runData, String permission, RegistryEntry entry)
  +    public static Iterator getUsers()
  +        throws JetspeedSecurityException
       {
  -      return checkPermission((JetspeedUser) runData.getUser(), new PortalResource( entry), permission);
  +        return JetspeedUserManagement.getUsers();
       }
   
       /**
  -     * @see JetspeedSecurityService#checkPermission
  +     * @see UserManagement#saveUser
        */
  -    public static boolean checkPermission(String user, String action, Portlet portlet)
  +    public static void saveUser( JetspeedUser user )
  +        throws JetspeedSecurityException
       {
  -        try
  -        {
  -            return checkPermission((JetspeedUser) JetspeedSecurity.getUser(user), portlet, action);
  -        } catch (Exception e)
  -        {
  -            Log.error(e.toString());
  -            return false;
  -        }
  +        JetspeedUserManagement.saveUser(user);
       }
   
       /**
  -     * @see JetspeedSecurityService#addUser
  +     * @see UserManagement#addUser
        */
  -   public static void addUser( User user, String password, RunData data )
  -        throws Exception
  +    public static void addUser( JetspeedUser user )
  +        throws JetspeedSecurityException
       {
  -       ((JetspeedSecurityService)getService()).addUser(user, password, data);
  +        JetspeedUserManagement.addUser(user);
       }
   
       /**
  -     * @see JetspeedSecurityService#removeUser
  +     * @see UserManagement#getUsers(String)
        */
  -   public static void removeUser( User user, RunData data )
  -        throws Exception
  +    public static Iterator getUsers(String filter)
  +        throws JetspeedSecurityException
       {
  -       ((JetspeedSecurityService)getService()).removeUser(user, data);
  +        return JetspeedUserManagement.getUsers(filter);
       }
   
       /**
  -     * @see JetspeedSecurityService#addGroup
  -     */
  -   public static void addGroup( Group group, RunData data )
  -        throws Exception
  +     * @see UserManagement#removeUser
  +     */    
  +    public static void removeUser(Principal principal)
  +        throws JetspeedSecurityException
  +    {
  +        JetspeedUserManagement.removeUser(principal);
  +    }
  +
  +    /**
  +     * 
  +     */    
  +    public static JetspeedUser getUser(String username) 
  +        throws JetspeedSecurityException
  +    {
  +        return JetspeedUserManagement.getUser(new UserNamePrincipal(username));
  +    }
  +
  +    /**
  +     * 
  +     */    
  +    public static void removeUser(String username)
  +        throws JetspeedSecurityException
       {
  -       ((JetspeedSecurityService)getService()).addGroup(group, data);
  +        JetspeedUserManagement.removeUser(new UserNamePrincipal(username));
       }
   
  +
  +    //////////////////////////////////////////////////////////////////////////
  +    // CredentialsManagement
  +    /////////////////////////////////////////////////////////////////////////
  +
       /**
  -     * @see JetspeedSecurityService#removeGroup
  +     * @see CredentialsManagement#changePassword
        */
  -   public static void removeGroup( Group group, RunData data )
  -        throws Exception
  +    public static void changePassword( JetspeedUser user,
  +                         String oldPassword, 
  +                         String newPassword )
  +        throws JetspeedSecurityException
       {
  -       ((JetspeedSecurityService)getService()).removeGroup(group, data);
  +        JetspeedUserManagement.changePassword(user, oldPassword, newPassword);
  +    
       }
   
       /**
  -     * @see JetspeedSecurityService#addRole
  +     * @see CredentialsManagement#forcePassword
        */
  -   public static void addRole( Role role, RunData data )
  -        throws Exception
  +    public static void forcePassword( JetspeedUser user, String password )
  +        throws JetspeedSecurityException
       {
  -       ((JetspeedSecurityService)getService()).addRole(role, data);
  +        JetspeedUserManagement.forcePassword(user, password);
       }
   
       /**
  -     * @see JetspeedSecurityService#removeRole
  +     * @see CredentialsManagement#encryptPassword
        */
  -   public static void removeRole( Role role, RunData data )
  -        throws Exception
  +    public static String encryptPassword( String password )
  +        throws JetspeedSecurityException
       {
  -       ((JetspeedSecurityService)getService()).removeRole(role, data);
  +        return JetspeedUserManagement.encryptPassword(password);
       }
  +     
  +    //////////////////////////////////////////////////////////////////////////
  +    //
  +    // Required JetspeedSecurity Functions
  +    //
  +    // Required Features provided by default JetspeedSecurity
  +    //
  +    //////////////////////////////////////////////////////////////////////////
   
       /**
  -     * @see JetspeedSecurityService#getAuthenticatedUser
  -   public static User getAuthenticatedUser(String username, String password)
  -        throws DataBackendException, UnknownEntityException, PasswordMismatchException
  +     * @see JetspeedSecurityService#getUserInstance
  +     */
  +    public static JetspeedUser getUserInstance()
       {
  -       try
  -       {
  -           JetspeedUser user = JetspeedAuthentication.login(username, password);
  -       }
  -       catch(JetspeedSecurityException e)
  -       {
  -           throw new 
  -       }
  +        return ((JetspeedSecurityService)getService()).getUserInstance();
       }
  -*/
  +
  +
  +    //////////////////////////////////////////////////////////////////////////
  +    //
  +    // Optional JetspeedSecurity Features 
  +    //
  +    // Features are not required to be implemented by Security Provider
  +    //
  +    //////////////////////////////////////////////////////////////////////////
   
       /**
        * @see JetspeedSecurityService#convertUserName
  @@ -254,49 +344,223 @@
       }
   
       /**
  -     * @see JetspeedSecurityService#disableUserCheck
  +     * @see JetspeedSecurityService#checkDisableAcccount
        */
  -    public static boolean disableUserCheck(String username)
  +    public static boolean checkDisableAccount(String username)
       {
  -       return ((JetspeedSecurityService)getService()).disableUserCheck(username);
  +        return ((JetspeedSecurityService)getService()).checkDisableAccount(username);
       }
   
       /**
  -     * @see JetspeedSecurityService#resetUserCheck
  +     * @see JetspeedSecurityService#isDisableCountCheckEnabled
        */
  -    public static void resetUserCheck(String username)
  +    public static boolean isDisableAccountCheckEnabled()
       {
  -       ((JetspeedSecurityService)getService()).resetUserCheck(username);
  +       return ((JetspeedSecurityService)getService()).isDisableAccountCheckEnabled();
       }
   
  -    public static boolean getAutoLogonDisable()
  +    /**
  +     * @see JetspeedSecurityService#resetDisableAccountCheck
  +     */
  +    public static void resetDisableAccountCheck(String username)
       {
  -       return ((JetspeedSecurityService)getService()).getAutoLogonDisable();
  +       ((JetspeedSecurityService)getService()).resetDisableAccountCheck(username);
       }
   
  -/*
  -    public static User getUser( String username ) 
  -        throws DataBackendException, UnknownEntityException
  +
  +
  +    //////////////////////////////////////////////////////////////////////////
  +    //
  +    // PortalAuthorization - Helpers
  +    //
  +    /////////////////////////////////////////////////////////////////////////
  +
  +    /**
  +     * @see JetspeedSecurityService#checkPermission
  +     */
  +    public static boolean checkPermission(JetspeedRunData runData, String action, Portlet portlet)
       {
  -        return JetspeedUserManagement.getUser(username);
  +        return checkPermission(runData.getJetspeedUser(), portlet, action);
       }
   
  -    public static User[] getUsers( Criteria criteria )
  -        throws DataBackendException
  +    /**
  +     * @see JetspeedSecurityService#checkPermission
  +     */
  +    public static boolean checkPermission(JetspeedRunData runData, String action, RegistryEntry entry)
       {
  -        return JetspeedUserManagement.getUsers(criteria);
  +      return checkPermission(runData.getJetspeedUser(), new PortalResource(entry), action);
       }
   
  -    public static User getAnonymousUser()
  -        throws UnknownEntityException
  +                   
  +
  +    ///////////////////////////////////////////////////////////////////////////
  +    // TRANSITION -- DUMMY FUNCTIONS
  +    //////////////////////////////////////////////////////////////////////////
  +
  +
  +    public static void addGroup( Group group )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +         org.apache.turbine.util.security.EntityExistsException
  +    {
  +       org.apache.turbine.services.security.TurbineSecurity.addGroup(group);
  +    }
  +    
  +    public static void removeGroup( Group group )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +           org.apache.turbine.util.security.UnknownEntityException
  +    {
  +       org.apache.turbine.services.security.TurbineSecurity.removeGroup(group);
  +    }
  +    
  +    public static void addRole(Role role)
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +         org.apache.turbine.util.security.EntityExistsException
       {
  -        return JetspeedUserManagement.getAnonymousUser();
  +       org.apache.turbine.services.security.TurbineSecurity.addRole(role);
  +    }
  +    
  +    public static void removeRole(Role role)
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +           org.apache.turbine.util.security.UnknownEntityException
  +    {
  +        org.apache.turbine.services.security.TurbineSecurity.removeRole(role);
  +                                            
  +    }
  +    
  +    public static Role getNewRole( String roleName )
  +        throws org.apache.turbine.util.security.TurbineSecurityException
  +    {
  +       return org.apache.turbine.services.security.TurbineSecurity.getNewRole(roleName);
       }
   
  -    public static void saveUser( User user )
  -        throws UnknownEntityException, DataBackendException
  +
  +    public static org.apache.turbine.util.security.RoleSet getRoles( org.apache.turbine.util.db.Criteria criteria )
  +    throws org.apache.turbine.util.security.DataBackendException
       {
  -        JetspeedUserManagement.saveUser(user);
  +       return org.apache.turbine.services.security.TurbineSecurity.getRoles(criteria);
  +    }
  +    
  +    public static org.apache.turbine.util.security.AccessControlList getACL( User user ) 
  +       throws org.apache.turbine.util.security.DataBackendException, 
  +              org.apache.turbine.util.security.UnknownEntityException
  +    {
  +        return org.apache.turbine.services.security.TurbineSecurity.getACL(user);
  +    }
  +    
  +    public static org.apache.turbine.om.security.Role getRole( String roleName )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +          org.apache.turbine.util.security.UnknownEntityException
  +    {
  +       return org.apache.turbine.services.security.TurbineSecurity.getRole(roleName);
  +    }
  +
  +    public static Group getGroup( String groupName )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +         org.apache.turbine.util.security.UnknownEntityException
  +    {
  +    return org.apache.turbine.services.security.TurbineSecurity.getGroup(groupName);
  +    }
  +
  +    public static org.apache.turbine.util.security.GroupSet getGroups( org.apache.turbine.util.db.Criteria criteria )
  +    throws org.apache.turbine.util.security.DataBackendException
  +    {
  +       return org.apache.turbine.services.security.TurbineSecurity.getGroups(criteria);
  +    }
  +
  +    public static org.apache.turbine.util.security.PermissionSet getPermissions( org.apache.turbine.util.db.Criteria criteria )
  +    throws org.apache.turbine.util.security.DataBackendException
  +    {
  +        return org.apache.turbine.services.security.TurbineSecurity.getPermissions(criteria);
  +    }
  +
  +    public static org.apache.turbine.util.security.PermissionSet getPermissions( Role role )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +         org.apache.turbine.util.security.UnknownEntityException
  +    {
  +        return org.apache.turbine.services.security.TurbineSecurity.getPermissions(role);
  +    }
  +
  +    public static Group getNewGroup( String groupName )
  +    throws org.apache.turbine.util.security.DataBackendException
  +    {
  +        return org.apache.turbine.services.security.TurbineSecurity.getNewGroup(groupName);    
       }
  -  */
  +
  +    public static void saveGroup( Group group )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +         org.apache.turbine.util.security.UnknownEntityException
  +    {
  +        org.apache.turbine.services.security.TurbineSecurity.saveGroup(group);    
  +    }
  +
  +    public static void saveRole( Role role )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +         org.apache.turbine.util.security.UnknownEntityException
  +    {
  +        org.apache.turbine.services.security.TurbineSecurity.saveRole(role);    
  +    }
  +
  +    public static Permission getPermission( String permissionName )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +         org.apache.turbine.util.security.UnknownEntityException
  +    {
  +        return org.apache.turbine.services.security.TurbineSecurity.getPermission(permissionName);
  +    }
  +
  +    public static Permission getNewPermission( String permissionName )
  +    throws org.apache.turbine.util.security.DataBackendException
  +    {
  +       return org.apache.turbine.services.security.TurbineSecurity.getNewPermission(permissionName);
  +    }
  +
  +    public static void addPermission( Permission permission )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +         org.apache.turbine.util.security.EntityExistsException
  +    {
  +        org.apache.turbine.services.security.TurbineSecurity.addPermission(permission);
  +    }
  +
  +    public static void savePermission( Permission permission )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +         org.apache.turbine.util.security.UnknownEntityException
  +    {
  +        org.apache.turbine.services.security.TurbineSecurity.savePermission(permission);    
  +    }
  +
  +    public static void removePermission(Permission permission)                               
  +        throws Exception
  +    {
  +        org.apache.turbine.services.security.TurbineSecurity.removePermission(permission);
  +                                            
  +    }
  +
  +    public static void grant( User user, Group group, Role role )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +         org.apache.turbine.util.security.UnknownEntityException
  +    {
  +        org.apache.turbine.services.security.TurbineSecurity.grant(user, group, role);
  +    }
  +
  +    public static void grant( Role role, Permission permission )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +         org.apache.turbine.util.security.UnknownEntityException
  +    {
  +        org.apache.turbine.services.security.TurbineSecurity.grant(role, permission);
  +    }
  +
  +    public static void revoke( Role role, Permission permission )
  +    throws org.apache.turbine.util.security.DataBackendException, 
  +         org.apache.turbine.util.security.UnknownEntityException
  +    {
  +        org.apache.turbine.services.security.TurbineSecurity.revoke(role, permission);
  +    }
  +
  +    public static void revoke( User user, Group group, Role role )
  +     throws org.apache.turbine.util.security.DataBackendException, 
  +          org.apache.turbine.util.security.UnknownEntityException
  +     {
  +         org.apache.turbine.services.security.TurbineSecurity.revoke(user, group, role);
  +     }
  +
  +
   }
  
  
  
  1.1.2.3   +35 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/services/Attic/JetspeedUserManagement.java
  
  Index: JetspeedUserManagement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/Attic/JetspeedUserManagement.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- JetspeedUserManagement.java	5 Jun 2002 01:21:53 -0000	1.1.2.2
  +++ JetspeedUserManagement.java	7 Jun 2002 10:02:06 -0000	1.1.2.3
  @@ -72,7 +72,7 @@
    * Static accessor for the PortalAccessController service
    *
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  - * @version $Id: JetspeedUserManagement.java,v 1.1.2.2 2002/06/05 01:21:53 taylor Exp $
  + * @version $Id: JetspeedUserManagement.java,v 1.1.2.3 2002/06/07 10:02:06 taylor Exp $
    */
   public abstract class JetspeedUserManagement
   {
  @@ -143,5 +143,39 @@
           getService().removeUser(principal);
       }
       
  +    ///////////////////////////////////////////////////////////////////////
  +    // Credentials Management
  +    //////////////////////////////////////////////////////////////////////
  +
  +    /**
  +     * @see org.apache.jetspeed.services.security.UserManagement#changePassword
  +     */
  +    public static void changePassword( JetspeedUser user,
  +                         String oldPassword, 
  +                         String newPassword )
  +        throws JetspeedSecurityException
  +    {
  +        getService().changePassword(user, oldPassword, newPassword);
  +    }
  +
  +    /**
  +     * @see org.apache.jetspeed.services.security.UserManagement#forcePassword
  +     */
  +    public static void forcePassword( JetspeedUser user, String password )
  +        throws JetspeedSecurityException
  +    {
  +        getService().forcePassword(user, password);
  +    }
  +
  +
  +    /**
  +     * @see org.apache.jetspeed.services.security.UserManagement#encryptPassword
  +     */
  +    public static String encryptPassword( String password )
  +        throws JetspeedSecurityException
  +    {
  +        return getService().encryptPassword(password);
  +    }
  +
   }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.1   +5 -5      jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/PsmlImporter.java
  
  Index: PsmlImporter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/PsmlImporter.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- PsmlImporter.java	10 May 2002 18:29:19 -0000	1.8
  +++ PsmlImporter.java	7 Jun 2002 10:02:06 -0000	1.8.2.1
  @@ -66,6 +66,8 @@
   
   // Jetspeed Security service
   import org.apache.jetspeed.services.JetspeedSecurity;
  +import org.apache.jetspeed.services.security.JetspeedSecurityException;
  +import org.apache.jetspeed.services.security.UnknownUserException;
   
   // Profile and ProfileLocator interface 
   import org.apache.jetspeed.om.profile.Profile;
  @@ -75,8 +77,6 @@
   import org.apache.turbine.services.InitializationException;
   import org.apache.turbine.util.TurbineConfig;
   
  -import org.apache.turbine.util.security.DataBackendException; 
  -import org.apache.turbine.util.security.UnknownEntityException; 
   import org.apache.turbine.util.Log;
   import javax.servlet.ServletConfig;
   
  @@ -84,7 +84,7 @@
    * Reads all PSML files from the file system and imports them into PSML DB
    *
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  - * @version $Id: PsmlImporter.java,v 1.8 2002/05/10 18:29:19 taylor Exp $
  + * @version $Id: PsmlImporter.java,v 1.8.2.1 2002/06/07 10:02:06 taylor Exp $
    */
   public class PsmlImporter
   {   
  @@ -172,11 +172,11 @@
               }
               return false;   // record not found
           }
  -        catch (UnknownEntityException e)
  +        catch (UnknownUserException e)
           {
               return false;  // record not found
           }
  -        catch (DataBackendException e)
  +        catch (JetspeedSecurityException e)
           {
               Log.error("Error detecting database on import: " , e);    
               System.out.println("Error detecting database on import: " + e.toString());
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.11.2.1  +13 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/services/rundata/DefaultJetspeedRunData.java
  
  Index: DefaultJetspeedRunData.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/rundata/DefaultJetspeedRunData.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- DefaultJetspeedRunData.java	14 May 2002 17:35:32 -0000	1.11
  +++ DefaultJetspeedRunData.java	7 Jun 2002 10:02:06 -0000	1.11.2.1
  @@ -56,6 +56,8 @@
   
   import org.apache.turbine.util.Log;
   
  +import org.apache.jetspeed.om.security.JetspeedUser;
  +
   import org.apache.jetspeed.portal.Portlet;
   import org.apache.jetspeed.om.profile.Profile;
   import org.apache.jetspeed.capability.CapabilityMap;
  @@ -79,7 +81,7 @@
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
    * @author <a href="mailto:sgala@apache.org">Santiago Gala</a>
    * @author <a href="mailto:paulsp@apache.org">Paul Spencer</a>
  - * @version $Id: DefaultJetspeedRunData.java,v 1.11 2002/05/14 17:35:32 ggolden Exp $
  + * @version $Id: DefaultJetspeedRunData.java,v 1.11.2.1 2002/06/07 10:02:06 taylor Exp $
    */
   public class DefaultJetspeedRunData extends DefaultTurbineRunData
       implements JetspeedRunData
  @@ -436,5 +438,15 @@
           return service.getSessionState(pageInstanceId + id);
   
       }   // getPortletSessionState
  +
  +    /**
  +     * Returns the Jetspeed User (same as getUser without cast)
  +     *
  +     * @return the current user.
  +     */
  +    public JetspeedUser getJetspeedUser()
  +    {
  +        return (JetspeedUser)getUser();
  +    }
   
   }
  
  
  
  1.6.2.1   +9 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/services/rundata/JetspeedRunData.java
  
  Index: JetspeedRunData.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/rundata/JetspeedRunData.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- JetspeedRunData.java	3 May 2002 15:05:56 -0000	1.6
  +++ JetspeedRunData.java	7 Jun 2002 10:02:06 -0000	1.6.2.1
  @@ -59,6 +59,7 @@
   import org.apache.jetspeed.capability.CapabilityMap;
   import org.apache.jetspeed.services.statemanager.SessionState;
   import org.apache.turbine.services.rundata.TurbineRunData;
  +import org.apache.jetspeed.om.security.JetspeedUser;
   
   /**
    * This interface extends the RunData interface with methods 
  @@ -68,7 +69,7 @@
    * interface in future releases of Turbine</note>
    *
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: JetspeedRunData.java,v 1.6 2002/05/03 15:05:56 ggolden Exp $
  + * @version $Id: JetspeedRunData.java,v 1.6.2.1 2002/06/07 10:02:06 taylor Exp $
    */
   public interface JetspeedRunData extends TurbineRunData
   {
  @@ -77,6 +78,13 @@
       public int CUSTOMIZE = 1;
       public int MAXIMIZE = 2;
       
  +    /**
  +     * Returns the Jetspeed User (same as getUser without cast)
  +     *
  +     * @return the current user.
  +     */
  +    public JetspeedUser getJetspeedUser();
  +
       /**
        * Returns the portlet id referenced in this request
        *
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.18.2.2  +181 -362  jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/JetspeedDBSecurityService.java
  
  Index: JetspeedDBSecurityService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/JetspeedDBSecurityService.java,v
  retrieving revision 1.18.2.1
  retrieving revision 1.18.2.2
  diff -u -r1.18.2.1 -r1.18.2.2
  --- JetspeedDBSecurityService.java	30 May 2002 07:04:10 -0000	1.18.2.1
  +++ JetspeedDBSecurityService.java	7 Jun 2002 10:02:06 -0000	1.18.2.2
  @@ -66,12 +66,16 @@
   import org.apache.jetspeed.om.registry.RegistryEntry;
   import org.apache.jetspeed.om.registry.Security;
   import org.apache.jetspeed.om.security.JetspeedUser;
  +import org.apache.jetspeed.om.security.JetspeedUserFactory;
  +import org.apache.jetspeed.om.security.UserNamePrincipal;
   
   import org.apache.jetspeed.portal.Portlet;
   import org.apache.jetspeed.portal.PortletController;
   import org.apache.jetspeed.portal.PortletSet;
   
   import org.apache.jetspeed.services.JetspeedSecurity;
  +import org.apache.jetspeed.services.JetspeedUserManagement;
  +import org.apache.jetspeed.services.JetspeedPortalAccessController;
   import org.apache.jetspeed.services.Profiler;
   import org.apache.jetspeed.services.PsmlManager;
   import org.apache.jetspeed.services.Registry;
  @@ -82,17 +86,13 @@
   import org.apache.turbine.om.security.Role;
   
   import org.apache.turbine.services.TurbineServices;
  +import org.apache.turbine.services.TurbineBaseService;
   import org.apache.turbine.services.InitializationException;
   import org.apache.turbine.services.resources.ResourceService;
  -import org.apache.turbine.services.security.db.DBSecurityService;
   
   import org.apache.turbine.util.Log;
  -import org.apache.turbine.util.RunData;
  +import org.apache.jetspeed.services.rundata.JetspeedRunData;
   import org.apache.turbine.util.security.AccessControlList;
  -import org.apache.turbine.util.security.DataBackendException;
  -import org.apache.turbine.util.security.EntityExistsException;
  -import org.apache.turbine.util.security.UnknownEntityException;
  -import org.apache.turbine.util.security.PasswordMismatchException;
   
   
   /**
  @@ -101,11 +101,11 @@
    *
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
    * @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>
  - * @version $Id: JetspeedDBSecurityService.java,v 1.18.2.1 2002/05/30 07:04:10 taylor Exp $
  + * @version $Id: JetspeedDBSecurityService.java,v 1.18.2.2 2002/06/07 10:02:06 taylor Exp $
    */
   
   
  -public class JetspeedDBSecurityService extends DBSecurityService
  +public class JetspeedDBSecurityService extends TurbineBaseService
                                          implements JetspeedSecurityService
   {
   
  @@ -129,6 +129,7 @@
       boolean caseInsensitiveUsername = false;
       boolean caseInsensitivePassword = false;
       boolean caseInsensitiveUpper = true;
  +
       int strikeCount = 3;             // 3 within the interval
       int strikeMax = 20;              // 20 total failures 
       long strikeInterval = 300;  // five minutes
  @@ -137,6 +138,8 @@
   
       private static HashMap users = new HashMap();
   
  +    private static Object sem = new Object();
  +
       /**
        * This is the early initialization method called by the 
        * Turbine <code>Service</code> framework
  @@ -181,304 +184,62 @@
           setInit(true);
        }
   
  - 
  -    /**
  -     * given a user, checks if a user has access to a given portlet for the given action
  -     *
  -     * @param user the username.
  -     * @param permission the permission for which permission is being checked.
  -     * @param portlet the portlet resource
  -     * @exception Sends a RegistryException if the manager can't add
  -     *            the provided entry
  -     */
  -    public boolean checkPermission(String user, String permission, Portlet portlet)
  -    {
  -        // TODO: for a user, you will need to build the ACLs
  -        // since Turbine only builds the ACLs for the currently logged on user
  -        return false;
  -    }
   
  -    /**
  -     * given the rundata, checks if the currently logged on user has access to a given portlet for the given action
  +    //////////////////////////////////////////////////////////////////////////
  +    //
  +    // Required JetspeedSecurity Functions
  +    //
  +    // Required Features provided by default JetspeedSecurity
  +    //
  +    //////////////////////////////////////////////////////////////////////////
  +
  +    /*
  +     * Factory to create a new JetspeedUser, using JetspeedUserFactory.
  +     * The class that is created by the default JetspeedUserFactory is configured
  +     * in the JetspeedSecurity properties:
        *
  -     * @param rundata the request rundata.
  -     * @param permission the jetspeed-action (view, edit, customize, delete...) for which permission is being checked.
  -     * @param portlet the portlet resource
  -     * @exception Sends a RegistryException if the manager can't add
  -     *            the provided entry
  -     */
  -    public boolean checkPermission(RunData runData, String permission, Portlet portlet)
  -    {
  -        String portletName = portlet.getName();
  -        RegistryEntry entry = (RegistryEntry)Registry.getEntry(Registry.PORTLET, portletName);
  -        //portlet is not a portlet - probably a controller or control
  -        if (entry==null) {
  -            PortletSet ps  = portlet.getPortletConfig().getPortletSet();
  -            if (ps != null) {
  -                PortletController pc = ps.getController();
  -                if (pc != null) {
  -                    portletName = pc.getConfig().getName();
  -                    entry = (RegistryEntry)Registry.getEntry(Registry.PORTLET_CONTROLLER, portletName);
  -                }
  -            }
  -        }
  -        if (entry==null) {
  -            return checkPermission(runData, permission);
  -        }
  -        return checkPermission(runData, permission, entry);   
  -    }
  -
  -    /**
  -     * given the rundata, checks if the currently logged on user has access to a given portlet for the given action
  +     *    services.JetspeedSecurity.user.class=
  +     *        org.apache.jetspeed.om.security.BaseJetspeedUser
        *
  -     * @param rundata the request rundata.
  -     * @param permission the jetspeed-action (view, edit, customize, delete...) for which permission is being checked.
  -     * @param entry the registry entry from the registry.
  -     * @exception Sends a RegistryException if the manager can't add
  -     *            the provided entry
  +     * @return JetspeedUser a newly created user that implements JetspeedUser.
        */
  -    public boolean checkPermission(RunData runData, String permission, RegistryEntry entry)
  -    {        
  -        Security security = entry.getSecurity();
  -        if (null == security)
  -            return checkDefaultPermission( runData, permission);
  -        String securityRole = security.getRole();
  -        if (null == securityRole)
  -            return checkDefaultPermission( runData, permission);
  -
  -        // determine if Portlet has specified role
  -        AccessControlList acl = runData.getACL();
  -        if (null == acl)
  -            return false;
  -
  -        if (!acl.hasRole( securityRole, JetspeedSecurity.JETSPEED_GROUP ))
  -            return false;
  -
  -        return checkPermission(runData,permission);
  -    }
  -
  -    /**
  -     * given the rundata, checks if the currently logged on user has access for the given action
  -     *
  -     * @param rundata the request rundata.
  -     * @param permission the jetspeed-action (view, edit, customize, delete...) for which permission is being checked.
  -     * @param entry the registry entry from the registry.
  -     * @exception Sends a RegistryException if the manager can't add
  -     *            the provided entry
  -     */
  -    public boolean checkPermission(RunData runData, String permission)
  -    {        
  -        // determine if user has specified role
  -        AccessControlList acl = runData.getACL();
  -        if (null == acl)
  -            return false;
  -
  -        // check for role having permission
  -        if (null != permission) // specifying null - skip permission check
  -        {
  -            // first check the global permission - which overrides other permissions
  -            if ( acl.hasPermission( permission ) )
  -                return true;
  -
  -            if ( !acl.hasPermission( permission, JetspeedSecurity.JETSPEED_GROUP ) )
  -                return false;
  -        }
  -
  -        return true;
  -    }
  -
  -   /**
  -     * Adds a user to the backend database.
  -     * Adds the default user role for this user.
  -     * Creates a default user profile in the PSML directory.
  -     * 
  -     * @param user The Turbine User object to be added to the database.
  -     * @param password The user's password.
  -     * @param rundata The request rundata.
  -     * @exception Can throw database exceptions or profiler exceptions
  -     *            
  -     */ 
  -    public void addUser( User user, String password, RunData data )
  -        throws Exception
  -    {
  -        addUser(user, password);
  -
  -        for (int ix = 0; ix < roles.length; ix++)
  -        {
  -            try
  -            {
  -                grant(user, 
  -                      getGroup(JetspeedSecurity.JETSPEED_GROUP), 
  -                      getRole(roles[ix]));
  -//                    getRole(JetspeedSecurity.JETSPEED_ROLE_USER));
  -            }
  -            catch(Exception e)
  -            {
  -                Log.error("Could not grant role: " + roles[ix] + " to user " + user.getUserName(), e);
  -            }
  -        }
  -        try
  -        {
  -            Profile profile = new BaseProfile();
  -            profile.setUser(user);
  -            profile.setMediaType("html");
  -            Profiler.createProfile(data, profile);
  -        }
  -        catch (Exception e)
  -        {
  -            removeUser(user);
  -            throw e;
  -        }
  -    }
  -
  -   /**
  -     * Removes user from the backend database.
  -     * Removes the user's profile in the PSML directory.
  -     * 
  -     * @param user The Turbine User object to be added to the database.
  -     * @param rundata The request rundata.
  -     * @exception Can throw database exceptions or profiler exceptions
  -     *            
  -     */ 
  -    public void removeUser( User user, RunData data )
  -        throws Exception
  +    public JetspeedUser getUserInstance()
       {
  -        PsmlManager.removeUserDocuments(user);
  -        removeUser(user);
  -    }
  -
  -   /**
  -     * Adds a group to the backend database.
  -     * Creates a default group profile in the PSML directory.
  -     * 
  -     * @param group The Turbine Group object to be added to the database.
  -     * @param rundata The request rundata.
  -     * @exception Can throw database exceptions or profiler exceptions
  -     *            
  -     */ 
  -    public void addGroup( Group group, RunData data )
  -        throws Exception
  -    {
  -        addGroup(group);
  -
           try
           {
  -            Profile profile = new BaseProfile();
  -            profile.setGroup(group);
  -            profile.setMediaType("html");
  -            Profiler.createProfile(data, profile);
  +            return JetspeedUserFactory.getInstance();
           }
  -        catch (Exception e)
  +        catch (UserException e)
           {
  -            removeGroup(group);
  -            throw e;
  +            return null;
           }
       }
   
  -   /**
  -     * Removes group from the backend database.
  -     * Removes the group's profile in the PSML directory.
  -     * 
  -     * @param group The Turbine Group object to be added to the database.
  -     * @param rundata The request rundata.
  -     * @exception Can throw database exceptions or profiler exceptions
  -     *            
  -     */ 
  -    public void removeGroup( Group group, RunData data )
  -        throws Exception
  -    {
  -        PsmlManager.removeGroupDocuments(group);
  -        removeGroup(group);
  -    }
  +    //////////////////////////////////////////////////////////////////////////
  +    //
  +    // Optional JetspeedSecurity Features 
  +    //
  +    // Features are not required to be implemented by Security Provider
  +    //
  +    //////////////////////////////////////////////////////////////////////////
   
  -   /**
  -     * Adds a role to the backend database.
  -     * Creates a default role profile in the PSML directory.
  -     * 
  -     * @param role The Turbine Role object to be added to the database.
  -     * @param rundata The request rundata.
  -     * @exception Can throw database exceptions or profiler exceptions
  -     *            
  -     */ 
  -    public void addRole( Role role, RunData data )
  -        throws Exception
  -    {
  -        addRole(role);
  -
  -        try
  -        {
  -            Profile profile = new BaseProfile();
  -            profile.setRole(role);
  -            profile.setMediaType("html");
  -            Profiler.createProfile(data, profile);
  -        }
  -        catch (Exception e)
  -        {
  -            removeRole(role);
  -            throw e;
  -        }
  -    }
  -
  -   /**
  -     * Removes role from the backend database.
  -     * Removes the role's profile in the PSML directory.
  -     * 
  -     * @param role The Turbine Role object to be added to the database.
  -     * @param rundata The request rundata.
  -     * @exception Can throw database exceptions or profiler exceptions
  -     *            
  -     */ 
  -    public void removeRole( Role role, RunData data )
  -        throws Exception
  -    {
  -        PsmlManager.removeRoleDocuments(role);
  -        removeRole(role);
  -    }
  -
  -    private boolean checkDefaultPermission(RunData runData, String permission) {
  -        String defaultPermissions[] = null;
  -        ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
  -                                                     .getResources(JetspeedSecurityService.SERVICE_NAME);
  -
  -        try {
  -            if ( (runData.getUser() == null) || !runData.getUser().hasLoggedIn() ) {
  -                defaultPermissions = serviceConf.getStringArray(CONFIG_DEFAULT_PERMISSION_ANONYMOUS);
  -            } else {
  -                defaultPermissions = serviceConf.getStringArray(CONFIG_DEFAULT_PERMISSION_LOGGEDIN);
  -            }
  -        } catch (Exception e) {
  -            e.printStackTrace();
  -        }
  -        for (int i = 0; i < defaultPermissions.length; i++) {
  -            if (defaultPermissions[i].equals("*"))
  -                return true;
  -            if (defaultPermissions[i].equals(permission))
  -                return true;
  -        }
  -        return false;
  -    }
  -
  -    /**
  -     * Authenticates an user, and constructs an User object to represent him/her.
  +    /*
  +     * During logon, the username can be case sensitive or case insensitive.
  +     *
  +     * Given a username, converts the username to either lower or upper case.
  +     * This optional feature is configurable from the JetspeedSecurity.properties:
  +     *
  +     *     <code>services.JetspeedSecurity.caseinsensitive.username = true/false</code>
  +     *     <code>services.JetspeedSecurity.caseinsensitive.upper = true/false</code>
  +     *
  +     * If <code>caseinsensitive.username</code> is true,  
  +     * then conversion is enabled and the username will be converted before 
  +     * being sent to the Authentication provider.
  +     *
  +     * @param username The username to be converted depending on configuration.
  +     * @return The converted username.
        *
  -     * @param username The user name.
  -     * @param password The user password.
  -     * @return An authenticated Turbine User.
  -     * @throws DataBackendException if there was an error accessing the data backend.
  -     * @throws UnknownEntityException if user account is not present.
  -     * @throws PasswordMismatchException if the supplied password was incorrect.
        */
  -    public User getAuthenticatedUser(String username, String password)
  -        throws DataBackendException, UnknownEntityException, PasswordMismatchException
  -    {
  -        username = convertUserName(username);
  -        password = convertPassword(password);
  -
  -        // Authenticate the user and get the object.
  -        JetspeedUser user = (JetspeedUser)super.getAuthenticatedUser( username, password );
  -        return user;
  -    }
  -
       public String convertUserName(String username)
       {
           if (caseInsensitiveUsername)
  @@ -488,6 +249,23 @@
           return username;
       }
   
  +    /*
  +     * During logon, the password can be case sensitive or case insensitive.
  +     *
  +     * Given a password, converts the password to either lower or upper case.
  +     * This optional feature is configurable from the JetspeedSecurity.properties:
  +     *
  +     *     <code>services.JetspeedSecurity.caseinsensitive.password = true/false</code>
  +     *     <code>services.JetspeedSecurity.caseinsensitive.upper = true/false</code>
  +     *
  +     * If <code>caseinsensitive.password</code> is true,  
  +     * then conversion is enabled and the password will be converted before 
  +     * being sent to the Authentication provider.
  +     *
  +     * @param password The password to be converted depending on configuration.
  +     * @return The converted password.
  +     *
  +     */
       public String convertPassword(String password)
       {
           if (caseInsensitivePassword)
  @@ -497,9 +275,34 @@
           return password;
       }
   
  -    private static Object sem = new Object();
  -
  -    public boolean disableUserCheck(String username)
  +    /*
  +     * Logon Failure / Account Disabling Feature
  +     *
  +     * Checks and tracks failed user-logon attempts.
  +     * If the user fails to logon after a configurable number of logon attempts,
  +     * then the user's account will be disabled.
  +     *
  +     * This optional feature is configurable from the JetspeedSecurity.properties:
  +     *
  +     *     <code>services.JetspeedSecurity.logon.auto.disable=false</code>
  +     *
  +     * The example setting below allows for 3 logon strikes per 300 seconds.
  +     * When the strike.count is exceeded over the strike.interval, the account
  +     * is disabled. The strike.max is the cumulative maximum.
  +     *
  +     *     <code>services.JetspeedSecurity.logon.strike.count=3</code>
  +     *     <code>services.JetspeedSecurity.logon.strike.interval=300</code>
  +     *     <code>services.JetspeedSecurity.logon.strike.max=10</code>
  +     *
  +     * These settings are not persisted, and in a distributed environment are 
  +     * only tracked per node.
  +     *
  +     * @param username The username to be checked.
  +     * @return True if the strike count reached the maximum threshold and the
  +     *         user's account was disabled, otherwise False.
  +     *
  +     */
  +    public boolean checkDisableAccount(String username)
       {
           username = convertUserName(username);
    
  @@ -524,7 +327,7 @@
                   if (user != null)
                   {
                       user.setDisabled(true);
  -                    saveUser(user);
  +                    JetspeedSecurity.saveUser(user);
                   }
               }
               catch (Exception e)
  @@ -535,26 +338,38 @@
           return disabled;
       }
   
  -    public void enableAccount(String username, boolean enable)
  +    /*
  +     * Logon Failure / Account Disabling Feature
  +     *    
  +     * Returns state of the the logon failure / account disabling feature.
  +     * 
  +     * If the user fails to logon after a configurable number of logon attempts,
  +     * then the user's account will be disabled.
  +     *
  +     * @see JetspeedSecurityService#checkLogonFailures
  +     *
  +     * @return True if the feature is enabled, false if the feature is disabled.
  +     *
  +     */
  +    public boolean isDisableAccountCheckEnabled()
       {
  -        try
  -        {
  -            // disable the account
  -            username = convertUserName(username);
  -            JetspeedUser user = (JetspeedUser)JetspeedSecurity.getUser(username);
  -            if (user != null)
  -            {
  -                user.setDisabled(!enable);
  -                saveUser(user);
  -            }
  -        }
  -        catch (Exception e)
  -        {
  -             Log.error("Could not enable/disable user: " + username + e);
  -        }
  -    }        
  +        return autoLogonDisable;
  +    }
   
  -    public void resetUserCheck(String username)
  +    /*
  +     * Logon Failure / Account Disabling Feature
  +     *    
  +     * Resets counters for the logon failure / account disabling feature.
  +     * 
  +     * If the user fails to logon after a configurable number of logon attempts,
  +     * then the user's account will be disabled.
  +     *
  +     * @see JetspeedSecurityService#checkLogonFailures
  +     *
  +     * @param username The username to reset the logon failure counters.
  +     *
  +     */
  +    public void resetDisableAccountCheck(String username)
       {
           // TODO: make this work across a cluster of servers
           username = convertUserName(username);
  @@ -570,70 +385,74 @@
           stat.reset();
       }
       
  +
  +    //////////////////////////////////////////////////////////////////////////
  +    //
  +    // Optional JetspeedSecurity Helpers
  +    //
  +    //////////////////////////////////////////////////////////////////////////
  +
       /**
  -     * Creates new user account with specified attributes. The password will be
  -     * converted using convertPassword()
  +     * Helper to UserManagement.
  +     * Retrieves a <code>JetspeedUser</code> given the primary principle username.
  +     * The principal can be any valid Jetspeed Security Principal:
  +     *   <code>org.apache.jetspeed.om.security.UserNamePrincipal</code>
  +     *   <code>org.apache.jetspeed.om.security.UserIdPrincipal</code>
  +     *   
  +     * The security service may optionally check the current user context
  +     * to determine if the requestor has permission to perform this action.
        *
  -     * @param user the object describing account to be created.
  -     * @throws DataBackendException if there was an error accessing the data backend.
  -     * @throws EntityExistsException if the user account already exists.
  -     * @see convertPassword()
  +     * @param username The username principal.
  +     * @return a <code>JetspeedUser</code> associated to the principal identity.
  +     * @exception UserException when the security provider has a general failure retrieving a user.
  +     * @exception UnknownUserException when the security provider cannot match
  +     *            the principal identity to a user.
  +     * @exception InsufficientPrivilegeException when the requestor is denied due to insufficient privilege 
        */
  -    public void addUser( User user, String password )
  -        throws DataBackendException, EntityExistsException
  +
  +    public JetspeedUser getUser(String username) 
  +        throws JetspeedSecurityException
       {
  -        super.addUser(user, convertPassword(password));
  +        return JetspeedUserManagement.getUser(new UserNamePrincipal(username));
       }
   
   
       /**
  -     * Change the password for an User.  The password will be converted
  -     * using convertPassword()
  +     * Helper to PortalAuthorization.
  +     * Gets a <code>JetspeedUser</code> from rundata, authorize user to perform the secured action on
  +     * the given <code>Portlet</code> resource. If the user does not have
  +     * sufficient privilege to perform the action on the resource, the check returns false,
  +     * otherwise when sufficient privilege is present, checkPermission returns true.
        *
  -     * @param user an User to change password for.
  -     * @param oldPassword the current password supplied by the user.
  -     * @param newPassword the current password requested by the user.
  -     * @exception PasswordMismatchException if the supplied password was 
  -     *            incorrect.
  -     * @exception UnknownEntityException if the user's record does not
  -     *            exist in the database.
  -     * @exception DataBackendException if there is a problem accessing the
  -     *            storage.
  -     * @see convertPassword()
  +     * @param rundata request that the user is taken from rundatas
  +     * @param action the secured action to be performed on the resource by the user.     
  +     * @param portlet the portlet resource.
  +     * @return boolean true if the user has sufficient privilege.
        */
  -    public void changePassword( User user, String oldPassword, String newPassword )
  -        throws PasswordMismatchException, UnknownEntityException, 
  -               DataBackendException
  +    public boolean checkPermission(JetspeedRunData runData, String action, Portlet portlet)
       {
  -        super.changePassword(user, convertPassword(oldPassword), convertPassword(newPassword));
  +        return JetspeedPortalAccessController.checkPermission(runData.getJetspeedUser(),
  +                                                       portlet,
  +                                                       action);
       }
   
       /**
  -     * Forcibly sets new password for an User.  The password will be converted
  -     * using convertPassword()
  +     * Helper to PortalAuthorization.
  +     * Gets a <code>JetspeedUser</code> from rundata, authorize user to perform the secured action on
  +     * the given <code>Entry</code> resource. If the user does not have
  +     * sufficient privilege to perform the action on the resource, the check returns false,
  +     * otherwise when sufficient privilege is present, checkPermission returns true.
        *
  -     * This is supposed by the administrator to change the forgotten or
  -     * compromised passwords. Certain implementatations of this feature
  -     * would require administrative level access to the authenticating
  -     * server / program.
  -     *
  -     * @param user an User to change password for.
  -     * @param password the new password.
  -     * @exception UnknownEntityException if the user's record does not
  -     *           exist in the database.
  -     * @exception DataBackendException if there is a problem accessing the
  -     *           storage.
  -     * @see convertPassword()
  -     */
  -    public void forcePassword( User user, String password )
  -        throws UnknownEntityException, DataBackendException
  -    {
  -        super.forcePassword(user, convertPassword(password));
  -    }
  -
  -    public boolean getAutoLogonDisable()
  -    {
  -       return autoLogonDisable;
  +     * @param rundata request that the user is taken from rundatas
  +     * @param action the secured action to be performed on the resource by the user.     
  +     * @param entry the portal entry resource.
  +     * @return boolean true if the user has sufficient privilege.
  +    public boolean checkPermission(JetspeedRunData runData, String action, RegistryEntry entry)
  +    {
  +        return JetspeedPortalAccessController.checkPermission(runData.getJetspeedUser(),
  +                                                       entry,
  +                                                       action);
       }
  +     */
   
   }
  
  
  
  1.7.2.2   +186 -33   jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/JetspeedSecurityService.java
  
  Index: JetspeedSecurityService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/JetspeedSecurityService.java,v
  retrieving revision 1.7.2.1
  retrieving revision 1.7.2.2
  diff -u -r1.7.2.1 -r1.7.2.2
  --- JetspeedSecurityService.java	30 May 2002 07:04:10 -0000	1.7.2.1
  +++ JetspeedSecurityService.java	7 Jun 2002 10:02:06 -0000	1.7.2.2
  @@ -59,14 +59,14 @@
   import org.apache.turbine.om.security.User;
   import org.apache.turbine.om.security.Role;
   import org.apache.turbine.om.security.Group;
  -import org.apache.turbine.util.RunData;
  -import org.apache.turbine.util.security.EntityExistsException;
  -import org.apache.turbine.util.security.DataBackendException;
  -import org.apache.turbine.util.security.UnknownEntityException;
  -import org.apache.turbine.util.security.PasswordMismatchException;
  +import org.apache.jetspeed.services.rundata.JetspeedRunData;
  +import org.apache.turbine.services.Service;
   
  +import org.apache.jetspeed.om.security.JetspeedUser;
   import org.apache.jetspeed.om.profile.Profile;
   import org.apache.jetspeed.om.profile.ProfileException;
  +import org.apache.jetspeed.portal.Portlet;
  +import org.apache.jetspeed.om.registry.RegistryEntry;
   
   /**
    * The Security Service manages Users, Groups Roles and Permissions in the 
  @@ -75,44 +75,197 @@
    * for controlling access to portal resources (portlets, panes).
    *
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  - * @version $Id: JetspeedSecurityService.java,v 1.7.2.1 2002/05/30 07:04:10 taylor Exp $
  + * @version $Id: JetspeedSecurityService.java,v 1.7.2.2 2002/06/07 10:02:06 taylor Exp $
    */
   
   
  -public interface JetspeedSecurityService extends SecurityService, AccessControl
  +public interface JetspeedSecurityService extends Service
   {
      /** The name of this service */
      public String SERVICE_NAME = "JetspeedSecurity";
   
  -   public void addUser( User user, String password, RunData data )
  -        throws Exception;
  - 
  -    public void removeUser( User user, RunData data ) 
  -        throws Exception;
  -
  -   public void addGroup( Group group, RunData data )
  -        throws Exception;
  - 
  -    public void removeGroup( Group group, RunData data )
  -        throws Exception;
  -
  -   public void addRole( Role role, RunData data )
  -        throws Exception;
  - 
  -    public void removeRole( Role role, RunData data )
  -        throws Exception;
  -
  -    public User getAuthenticatedUser(String username, String password)
  -        throws DataBackendException, UnknownEntityException, PasswordMismatchException;
  -
  +   //////////////////////////////////////////////////////////////////////////
  +   //
  +   // Required JetspeedSecurity Functions
  +   //
  +   // Required Features provided by default JetspeedSecurity
  +   //
  +   //////////////////////////////////////////////////////////////////////////
  +
  +   /*
  +    * Factory to create a new JetspeedUser, using JetspeedUserFactory.
  +    * The class that is created by the default JetspeedUserFactory is configured
  +    * in the JetspeedSecurity properties:
  +    *
  +    *    services.JetspeedSecurity.user.class=
  +    *        org.apache.jetspeed.om.security.BaseJetspeedUser
  +    *
  +    * @return JetspeedUser a newly created user that implements JetspeedUser.
  +    */
  +   public JetspeedUser getUserInstance();
  +
  +
  +    //////////////////////////////////////////////////////////////////////////
  +    //
  +    // Optional JetspeedSecurity Features 
  +    //
  +    // Features are not required to be implemented by Security Provider
  +    //
  +    //////////////////////////////////////////////////////////////////////////
  +
  +    /*
  +     * During logon, the username can be case sensitive or case insensitive.
  +     *
  +     * Given a username, converts the username to either lower or upper case.
  +     * This optional feature is configurable from the JetspeedSecurity.properties:
  +     *
  +     *     <code>services.JetspeedSecurity.caseinsensitive.username = true/false</code>
  +     *     <code>services.JetspeedSecurity.caseinsensitive.upper = true/false</code>
  +     *
  +     * If <code>caseinsensitive.username</code> is true,  
  +     * then conversion is enabled and the username will be converted before 
  +     * being sent to the Authentication provider.
  +     *
  +     * @param username The username to be converted depending on configuration.
  +     * @return The converted username.
  +     *
  +     */
       public String convertUserName(String username);
   
  +    /*
  +     * During logon, the password can be case sensitive or case insensitive.
  +     *
  +     * Given a password, converts the password to either lower or upper case.
  +     * This optional feature is configurable from the JetspeedSecurity.properties:
  +     *
  +     *     <code>services.JetspeedSecurity.caseinsensitive.password = true/false</code>
  +     *     <code>services.JetspeedSecurity.caseinsensitive.upper = true/false</code>
  +     *
  +     * If <code>caseinsensitive.password</code> is true,  
  +     * then conversion is enabled and the password will be converted before 
  +     * being sent to the Authentication provider.
  +     *
  +     * @param password The password to be converted depending on configuration.
  +     * @return The converted password.
  +     *
  +     */
       public String convertPassword(String password);
   
  -    public boolean disableUserCheck(String username);
  -
  -    public void resetUserCheck(String username);
  -
  -    public boolean getAutoLogonDisable();
  +    /*
  +     * Logon Failure / Account Disabling Feature
  +     *
  +     * Checks and tracks failed user-logon attempts.
  +     * If the user fails to logon after a configurable number of logon attempts,
  +     * then the user's account will be disabled.
  +     *
  +     * This optional feature is configurable from the JetspeedSecurity.properties:
  +     *
  +     *     <code>services.JetspeedSecurity.logon.auto.disable=false</code>
  +     *
  +     * The example setting below allows for 3 logon strikes per 300 seconds.
  +     * When the strike.count is exceeded over the strike.interval, the account
  +     * is disabled. The strike.max is the cumulative maximum.
  +     *
  +     *     <code>services.JetspeedSecurity.logon.strike.count=3</code>
  +     *     <code>services.JetspeedSecurity.logon.strike.interval=300</code>
  +     *     <code>services.JetspeedSecurity.logon.strike.max=10</code>
  +     *
  +     * These settings are not persisted, and in a distributed environment are 
  +     * only tracked per node.
  +     *
  +     * @param username The username to be checked.
  +     * @return True if the strike count reached the maximum threshold and the
  +     *         user's account was disabled, otherwise False.
  +     *
  +     */
  +    public boolean checkDisableAccount(String username);
  +
  +    /*
  +     * Logon Failure / Account Disabling Feature
  +     *    
  +     * Returns state of the the logon failure / account disabling feature.
  +     * 
  +     * If the user fails to logon after a configurable number of logon attempts,
  +     * then the user's account will be disabled.
  +     *
  +     * @see JetspeedSecurityService#checkLogonFailures
  +     *
  +     * @return True if the feature is enabled, false if the feature is disabled.
  +     *
  +     */
  +    public boolean isDisableAccountCheckEnabled();
  +
  +    /*
  +     * Logon Failure / Account Disabling Feature
  +     *    
  +     * Resets counters for the logon failure / account disabling feature.
  +     * 
  +     * If the user fails to logon after a configurable number of logon attempts,
  +     * then the user's account will be disabled.
  +     *
  +     * @see JetspeedSecurityService#checkLogonFailures
  +     *
  +     * @param username The username to reset the logon failure counters.
  +     *
  +     */
  +    public void resetDisableAccountCheck(String username);
  +
  +
  +    //////////////////////////////////////////////////////////////////////////
  +    //
  +    // Optional JetspeedSecurity Helpers
  +    //
  +    //////////////////////////////////////////////////////////////////////////
  +
  +
  +    /**
  +     * Helper to UserManagement.
  +     * Retrieves a <code>JetspeedUser</code> given the primary principle username.
  +     * The principal can be any valid Jetspeed Security Principal:
  +     *   <code>org.apache.jetspeed.om.security.UserNamePrincipal</code>
  +     *   <code>org.apache.jetspeed.om.security.UserIdPrincipal</code>
  +     *   
  +     * The security service may optionally check the current user context
  +     * to determine if the requestor has permission to perform this action.
  +     *
  +     * @param username The username principal.
  +     * @return a <code>JetspeedUser</code> associated to the principal identity.
  +     * @exception UserException when the security provider has a general failure retrieving a user.
  +     * @exception UnknownUserException when the security provider cannot match
  +     *            the principal identity to a user.
  +     * @exception InsufficientPrivilegeException when the requestor is denied due to insufficient privilege 
  +     */
  +
  +    public JetspeedUser getUser(String username) 
  +        throws JetspeedSecurityException;
  +
  +
  +    /**
  +     * Helper to PortalAuthorization.
  +     * Gets a <code>JetspeedUser</code> from rundata, authorize user to perform the secured action on
  +     * the given <code>Portlet</code> resource. If the user does not have
  +     * sufficient privilege to perform the action on the resource, the check returns false,
  +     * otherwise when sufficient privilege is present, checkPermission returns true.
  +     *
  +     * @param rundata request that the user is taken from rundatas
  +     * @param action the secured action to be performed on the resource by the user.     
  +     * @param portlet the portlet resource.
  +     * @return boolean true if the user has sufficient privilege.
  +     */
  +    public boolean checkPermission(JetspeedRunData runData, String action, Portlet portlet);
  +
  +    /**
  +     * Helper to PortalAuthorization.
  +     * Gets a <code>JetspeedUser</code> from rundata, authorize user to perform the secured action on
  +     * the given <code>Entry</code> resource. If the user does not have
  +     * sufficient privilege to perform the action on the resource, the check returns false,
  +     * otherwise when sufficient privilege is present, checkPermission returns true.
  +     *
  +     * @param rundata request that the user is taken from rundatas
  +     * @param action the secured action to be performed on the resource by the user.     
  +     * @param entry the portal entry resource.
  +     * @return boolean true if the user has sufficient privilege.
  +     */
  +    //public boolean checkPermission(JetspeedRunData runData, String action, RegistryEntry entry);
   
   }
  
  
  
  1.1.2.5   +4 -2      jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/Attic/PortalAuthentication.java
  
  Index: PortalAuthentication.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/Attic/PortalAuthentication.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- PortalAuthentication.java	30 May 2002 07:04:11 -0000	1.1.2.4
  +++ PortalAuthentication.java	7 Jun 2002 10:02:06 -0000	1.1.2.5
  @@ -54,6 +54,8 @@
   
   package org.apache.jetspeed.services.security;
   
  +import org.apache.turbine.services.Service;
  +
   import org.apache.jetspeed.om.security.JetspeedUser;
   
   /**
  @@ -68,10 +70,10 @@
    * <p> To logout the caller simply needs to invoke the <code>logout</code> method.  
    * 
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  - * @version $Id: PortalAuthentication.java,v 1.1.2.4 2002/05/30 07:04:11 taylor Exp $
  + * @version $Id: PortalAuthentication.java,v 1.1.2.5 2002/06/07 10:02:06 taylor Exp $
    */
   
  -public interface PortalAuthentication
  +public interface PortalAuthentication extends Service
   {
       public String SERVICE_NAME = "PortalAuthentication";
   
  
  
  
  1.1.2.4   +2 -2      jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/Attic/UserManagement.java
  
  Index: UserManagement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/Attic/UserManagement.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- UserManagement.java	30 May 2002 07:04:11 -0000	1.1.2.3
  +++ UserManagement.java	7 Jun 2002 10:02:06 -0000	1.1.2.4
  @@ -67,10 +67,10 @@
    * user management technology.
    *
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  - * @version $Id: UserManagement.java,v 1.1.2.3 2002/05/30 07:04:11 taylor Exp $
  + * @version $Id: UserManagement.java,v 1.1.2.4 2002/06/07 10:02:06 taylor Exp $
    */
   
  -public interface UserManagement extends Service  
  +public interface UserManagement extends Service, CredentialsManagement  
   {
       public String SERVICE_NAME = "UserManagement";
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +10 -121   jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/turbine/Attic/TurbineAuthentication.java
  
  Index: TurbineAuthentication.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/turbine/Attic/TurbineAuthentication.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- TurbineAuthentication.java	5 Jun 2002 01:21:53 -0000	1.1.2.5
  +++ TurbineAuthentication.java	7 Jun 2002 10:02:07 -0000	1.1.2.6
  @@ -65,6 +65,7 @@
   import org.apache.jetspeed.services.security.PortalAuthentication;
   import org.apache.jetspeed.services.security.LoginException;
   
  +import org.apache.jetspeed.services.JetspeedSecurity;
   import org.apache.jetspeed.om.security.JetspeedUser;
   import org.apache.jetspeed.om.security.JetspeedUserFactory;
   import org.apache.jetspeed.om.security.UserNamePrincipal;
  @@ -80,13 +81,6 @@
   import org.apache.jetspeed.services.rundata.JetspeedRunData;
   import org.apache.turbine.services.rundata.RunDataService;
   
  -// Password encryption
  -import javax.mail.internet.MimeUtility;
  -import java.security.MessageDigest;
  -import java.io.OutputStream;
  -import java.io.ByteArrayOutputStream;
  -
  -
   /**
    * <p> The <code>TurbineAuthentication</code> class is a default Jetspeed
    * security provider, implementing the <code>PortalAuthentication</code> interface.
  @@ -96,30 +90,12 @@
    * This service does not use any of the Turbine security or user management classes.
    * 
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  - * @version $Id: TurbineAuthentication.java,v 1.1.2.5 2002/06/05 01:21:53 taylor Exp $
  + * @version $Id: TurbineAuthentication.java,v 1.1.2.6 2002/06/07 10:02:07 taylor Exp $
    */
                                                                
  -public class TurbineAuthentication  extends TurbineBaseService
  -                                    implements PortalAuthentication 
  +public class TurbineAuthentication  extends    TurbineBaseService
  +                                    implements PortalAuthentication
   {
  -    private final static String CONFIG_CASEINSENSITIVE_USERNAME = "caseinsensitive.username";
  -    private final static String CONFIG_CASEINSENSITIVE_PASSWORD = "caseinsensitive.password";
  -    private final static String CONFIG_CASEINSENSITIVE_UPPER = "caseinsensitive.upper";
  -    private final static String CONFIG_LOGON_STRIKE_COUNT = "logon.strike.count";
  -    private final static String CONFIG_LOGON_STRIKE_MAX = "logon.strike.max";
  -    private final static String CONFIG_LOGON_STRIKE_INTERVAL = "logon.strike.interval";
  -    private final static String CONFIG_SECURE_PASSWORDS_KEY = "secure.passwords";
  -    private final static String CONFIG_SECURE_PASSWORDS_ALGORITHM = "secure.passwords.algorithm";
  -
  -    boolean caseInsensitiveUsername = false;
  -    boolean caseInsensitivePassword = false;
  -    boolean caseInsensitiveUpper = true;
  -    int strikeCount = 3;             // 3 within the interval
  -    int strikeMax = 20;              // 20 total failures 
  -    long strikeInterval = 300;  // five minutes
  -
  -    static boolean securePasswords = false;
  -    static String passwordsAlgorithm = "SHA";
   
       /** The JetspeedRunData Service. */
       private JetspeedRunDataService runDataService = null;
  @@ -142,12 +118,13 @@
       {
           JetspeedUser user = null;
   
  -        username = convertUserName(username);
  -        password = convertPassword(password);
  +        username = JetspeedSecurity.convertUserName(username);
  +        password = JetspeedSecurity.convertPassword(password);
          
           try
           {
               user = JetspeedUserManagement.getUser(new UserNamePrincipal(username));
  +            password = JetspeedSecurity.encryptPassword(password);
           }                            
           catch (UnknownUserException e)
           {
  @@ -158,8 +135,6 @@
               throw new LoginException(e.toString());
           }
   
  -        password = encryptPassword(password);
  -
           if(!user.getPassword().equals(password))
           {
               throw new FailedLoginException("Credential authentication failure");
  @@ -245,23 +220,6 @@
           ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                        .getResources(JetspeedSecurityService.SERVICE_NAME);
   
  -        caseInsensitiveUsername = serviceConf.getBoolean(CONFIG_CASEINSENSITIVE_USERNAME, 
  -                                                         caseInsensitiveUsername);
  -        caseInsensitivePassword = serviceConf.getBoolean(CONFIG_CASEINSENSITIVE_PASSWORD, 
  -                                                         caseInsensitivePassword);
  -        caseInsensitiveUpper = serviceConf.getBoolean(CONFIG_CASEINSENSITIVE_UPPER, 
  -                                                      caseInsensitiveUpper);
  -
  -        strikeCount = serviceConf.getInt(CONFIG_LOGON_STRIKE_COUNT, strikeCount);
  -        strikeInterval = serviceConf.getLong(CONFIG_LOGON_STRIKE_INTERVAL, strikeInterval);
  -        strikeMax = serviceConf.getInt(CONFIG_LOGON_STRIKE_MAX, strikeMax);
  -
  -
  -        securePasswords = serviceConf.getBoolean(CONFIG_SECURE_PASSWORDS_KEY,
  -                                                 securePasswords);
  -        passwordsAlgorithm = serviceConf.getString(CONFIG_SECURE_PASSWORDS_ALGORITHM,
  -                                                  passwordsAlgorithm);
  -
           this.runDataService =
               (JetspeedRunDataService)TurbineServices.getInstance()
                   .getService(RunDataService.SERVICE_NAME);
  @@ -270,76 +228,7 @@
           setInit(true);
        }
   
  -    /**
  -     * Given a username, converts to upper or lower case depending on the
  -     * Jetspeed configuration settings.
  -     *
  -     * @return the username converted to either lower or upper case.
  -     */
  -    protected String convertUserName(String username)
  -    {
  -        if (caseInsensitiveUsername)
  -        { 
  -            username = (caseInsensitiveUpper) ? username.toUpperCase() : username.toLowerCase(); 
  -        } 
  -        return username;
  -    }
  -
  -    /**
  -     * Given a password, converts to upper or lower case depending on the
  -     * Jetspeed configuration settings.
  -     *
  -     * @return the password converted to either lower or upper case.
  -     */
  -    protected String convertPassword(String password)
  -    {
  -        if (caseInsensitivePassword)
  -        { 
  -            password = (caseInsensitiveUpper) ? password.toUpperCase() : password.toLowerCase(); 
  -        } 
  -        return password;
  -    }
  -
  -    /**
  -     * This method provides client-side encryption of passwords.
  -     *
  -     * If <code>secure.passwords</code> are enabled in TurbineResources,
  -     * the password will be encrypted, if not, it will be returned unchanged.
  -     * The <code>secure.passwords.algorithm</code> property can be used
  -     * to chose which digest algorithm should be used for performing the
  -     * encryption. <code>SHA</code> is used by default.
  -     *
  -     * @param password the password to process
  -     * @param algorithm the encryption algorithm to use.
  -     * @return processed password
  -     */
  -    public static String encryptPassword(String password)
  -    {
  -        if (!securePasswords)
  -            return password;
  -
  -        if(password == null)
  -            return null;
  -
  -        try
  -        {
  -            MessageDigest md = MessageDigest.getInstance(passwordsAlgorithm);
  -            // We need to use unicode here, to be independent of platform's
  -            // default encoding. Thanks to SGawin for spotting this.
  -            byte[] digest = md.digest(password.getBytes("UTF-8"));
  -            ByteArrayOutputStream bas = new ByteArrayOutputStream(digest.length + digest.length / 3 + 1);
  -            OutputStream encodedStream = MimeUtility.encode(bas, "base64");
  -            encodedStream.write(digest);
  -            return bas.toString();
  -        }
  -        catch (Exception e)
  -        {
  -            Log.error("Unable to encrypt password."+e.getMessage());
  -            Log.error(e);
  -
  -            return null;
  -        }
  -    }
  +    ////////////////////////////////////////////////////////////////////////////
   
       protected JetspeedUser getUserFromContext()
       {
  @@ -349,7 +238,6 @@
               if (rundata != null)
               {
                   JetspeedUser user = (JetspeedUser)rundata.getUser();
  -                System.out.println("@@@@@@@ got user" + user.getName());
   
               }
           }
  @@ -363,9 +251,10 @@
               JetspeedRunData rundata = this.runDataService.getCurrentRunData();
               if (rundata != null)
               {
  -                System.out.println("@@@@@@@ putting user" + user.getName());
                   rundata.setUser(user);
               }
           }
       }
  +
  +
   }
  
  
  
  1.1.2.4   +160 -4    jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/turbine/Attic/TurbineUserManagement.java
  
  Index: TurbineUserManagement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/turbine/Attic/TurbineUserManagement.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- TurbineUserManagement.java	5 Jun 2002 01:21:53 -0000	1.1.2.3
  +++ TurbineUserManagement.java	7 Jun 2002 10:02:07 -0000	1.1.2.4
  @@ -80,26 +80,44 @@
   import org.apache.jetspeed.om.security.UserNamePrincipal;
   import org.apache.jetspeed.om.security.UserIdPrincipal;
   
  +import org.apache.jetspeed.services.JetspeedSecurity;
   import org.apache.jetspeed.services.security.UserManagement;
   import org.apache.jetspeed.services.security.JetspeedSecurityService;
   
  +import org.apache.jetspeed.services.security.CredentialsManagement;
   import org.apache.jetspeed.services.security.UserException;
   import org.apache.jetspeed.services.security.UnknownUserException;
   import org.apache.jetspeed.services.security.NotUniqueUserException;
   import org.apache.jetspeed.services.security.JetspeedSecurityException;
   
  +// Password encryption
  +import javax.mail.internet.MimeUtility;
  +import java.security.MessageDigest;
  +import java.io.OutputStream;
  +import java.io.ByteArrayOutputStream;
  +
   
   /**
    * Default Jetspeed-Turbine User Management implementation 
    *
    * 
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  - * @version $Id: TurbineUserManagement.java,v 1.1.2.3 2002/06/05 01:21:53 taylor Exp $
  + * @version $Id: TurbineUserManagement.java,v 1.1.2.4 2002/06/07 10:02:07 taylor Exp $
    */
   
   public class TurbineUserManagement extends TurbineBaseService
  -                                   implements UserManagement
  +                                   implements UserManagement,
  +                                              CredentialsManagement
   {
  +    private final static String CONFIG_SECURE_PASSWORDS_KEY = "secure.passwords";
  +    private final static String CONFIG_SECURE_PASSWORDS_ALGORITHM = "secure.passwords.algorithm";
  +
  +    boolean securePasswords = false;
  +    String passwordsAlgorithm = "SHA";
  +
  +    ///////////////////////////////////////////////////////////////////////////
  +    // User Management Interfaces
  +    ///////////////////////////////////////////////////////////////////////////
   
       /**
        * Retrieves a <code>JetspeedUser</code> given the primary principle.
  @@ -256,13 +274,13 @@
       public void addUser(JetspeedUser user)
           throws JetspeedSecurityException
       {
  -        if(accountExists(user, false))
  +        if(accountExists(user))
           {
               throw new NotUniqueUserException("The account '" + 
                   user.getUserName() + "' already exists");
           }
           String initialPassword = user.getPassword();
  -        String encrypted = TurbineAuthentication.encryptPassword(initialPassword);
  +        String encrypted = JetspeedSecurity.encryptPassword(initialPassword);
           user.setPassword(encrypted);
           Criteria criteria = TurbineUserPeer.buildCriteria(user);
           try
  @@ -325,6 +343,127 @@
       }
   
   
  +    ///////////////////////////////////////////////////////////////////////////
  +    // Credentials Management
  +    ///////////////////////////////////////////////////////////////////////////
  +    
  +    /**
  +     * Allows for a user to change their own password.
  +     *
  +     * @param user the JetspeedUser to change password 
  +     * @param oldPassword the current password supplied by the user.
  +     * @param newPassword the current password requested by the user.
  +     * @exception UserException when the security provider has a general failure retrieving a user.
  +     * @exception UnknownUserException when the security provider cannot match
  +     *            the principal identity to a user.
  +     * @exception InsufficientPrivilegeException when the requestor is denied due to insufficient privilege 
  +     */
  +    public void changePassword( JetspeedUser user,
  +                                String oldPassword, 
  +                                String newPassword )
  +        throws JetspeedSecurityException
  +    {
  +        oldPassword = JetspeedSecurity.convertPassword(oldPassword);
  +        newPassword = JetspeedSecurity.convertPassword(newPassword);
  +
  +        String encrypted = JetspeedSecurity.encryptPassword(oldPassword);
  +        if(!accountExists(user))
  +        {
  +            throw new UnknownUserException("The account '" + 
  +                user.getUserName() + "' does not exist");
  +        }
  +        if(!user.getPassword().equals(encrypted))
  +        {
  +            throw new UserException(
  +                "The supplied old password for '" + user.getUserName() +
  +                "' was incorrect");
  +        }
  +        user.setPassword(JetspeedSecurity.encryptPassword(newPassword));
  +        // save the changes in the database immediately, to prevent the password
  +        // being 'reverted' to the old value if the user data is lost somehow
  +        // before it is saved at session's expiry. 
  +        saveUser(user);
  +    }
  +
  +    /**
  +     * Forcibly sets new password for a User.
  +     *
  +     * Provides an administrator the ability to change the forgotten or
  +     * compromised passwords. Certain implementatations of this feature
  +     * would require administrative level access to the authenticating
  +     * server / program.
  +     *     
  +     * @param user the user to change the password for.
  +     * @param password the new password.   
  +     * @exception UserException when the security provider has a general failure retrieving a user.
  +     * @exception UnknownUserException when the security provider cannot match
  +     *            the principal identity to a user.
  +     * @exception InsufficientPrivilegeException when the requestor is denied due to insufficient privilege 
  +     */
  +    public void forcePassword( JetspeedUser user, String password )
  +        throws JetspeedSecurityException
  +    {
  +        if(!accountExists(user))
  +        {
  +            throw new UnknownUserException("The account '" + 
  +                user.getUserName() + "' does not exist");
  +        }
  +        user.setPassword(JetspeedSecurity.encryptPassword(password));
  +        // save the changes in the database immediately, to prevent the 
  +        // password being 'reverted' to the old value if the user data 
  +        // is lost somehow before it is saved at session's expiry. 
  +        saveUser(user);
  +    }
  +
  +    /**
  +     * This method provides client-side encryption of passwords.
  +     *
  +     * If <code>secure.passwords</code> are enabled in JetspeedSecurity properties,
  +     * the password will be encrypted, if not, it will be returned unchanged.
  +     * The <code>secure.passwords.algorithm</code> property can be used
  +     * to chose which digest algorithm should be used for performing the
  +     * encryption. <code>SHA</code> is used by default.
  +     *
  +     * @param password the password to process
  +     * @return processed password
  +     */
  +    public String encryptPassword( String password )
  +        throws JetspeedSecurityException
  +    {
  +        if (securePasswords == false)
  +        {
  +            return password;
  +        }
  +        if(password == null)
  +        {
  +            return null;
  +        }
  +
  +        try
  +        {
  +            MessageDigest md = MessageDigest.getInstance(passwordsAlgorithm);
  +            // We need to use unicode here, to be independent of platform's
  +            // default encoding. Thanks to SGawin for spotting this.
  +            byte[] digest = md.digest(password.getBytes("UTF-8"));
  +            ByteArrayOutputStream bas = new ByteArrayOutputStream(digest.length + digest.length / 3 + 1);
  +            OutputStream encodedStream = MimeUtility.encode(bas, "base64");
  +            encodedStream.write(digest);
  +            return bas.toString();
  +        }
  +        catch (Exception e)
  +        {
  +            Log.error("Unable to encrypt password."+e.getMessage());
  +            Log.error(e);
  +
  +            return null;
  +        }
  +    }
  +
  +    ///////////////////////////////////////////////////////////////////////////
  +    // Service Init
  +    ///////////////////////////////////////////////////////////////////////////
  +
  +
       /**
        * This is the early initialization method called by the 
        * Turbine <code>Service</code> framework
  @@ -343,10 +482,19 @@
           ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                        .getResources(JetspeedSecurityService.SERVICE_NAME);
   
  +        securePasswords = serviceConf.getBoolean(CONFIG_SECURE_PASSWORDS_KEY,
  +                                                  securePasswords);
  +        passwordsAlgorithm = serviceConf.getString(CONFIG_SECURE_PASSWORDS_ALGORITHM,
  +                                                   passwordsAlgorithm);
  +
   
           setInit(true);
        }
   
  +    ///////////////////////////////////////////////////////////////////////////
  +    // Internal
  +    ///////////////////////////////////////////////////////////////////////////
  +
       /**
        * Check whether a specified user's account exists.
        *
  @@ -358,6 +506,12 @@
        * @throws UserException if there was a general db access error 
        *         
        */
  +    protected boolean accountExists( JetspeedUser user )
  +        throws UserException
  +    {
  +        return accountExists(user, false);
  +    }
  +
       protected boolean accountExists( JetspeedUser user, boolean checkUniqueId )
           throws UserException
       {
  @@ -387,6 +541,8 @@
           }
           return true;
       }
  +
  +
   
   }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.1   +6 -0      jakarta-jetspeed/src/java/org/apache/jetspeed/util/servlet/EcsServletResponse.java
  
  Index: EcsServletResponse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/servlet/EcsServletResponse.java,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- EcsServletResponse.java	13 Sep 2001 17:42:49 -0000	1.5
  +++ EcsServletResponse.java	7 Jun 2002 10:02:07 -0000	1.5.2.1
  @@ -350,4 +350,10 @@
           // silently fail
       }
   
  +    public void resetBuffer()
  +    {
  +        // silently fail
  +        //added by Ben Woodward
  +    }
  +
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.8   +4 -3      jakarta-jetspeed/webapp/WEB-INF/conf/Attic/JetspeedSecurity.properties
  
  Index: JetspeedSecurity.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/conf/Attic/JetspeedSecurity.properties,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- JetspeedSecurity.properties	4 Jun 2002 04:21:24 -0000	1.1.2.7
  +++ JetspeedSecurity.properties	7 Jun 2002 10:02:07 -0000	1.1.2.8
  @@ -1,5 +1,5 @@
   # -------------------------------------------------------------------
  -# $Id: JetspeedSecurity.properties,v 1.1.2.7 2002/06/04 04:21:24 taylor Exp $
  +# $Id: JetspeedSecurity.properties,v 1.1.2.8 2002/06/07 10:02:07 taylor Exp $
   #
   # This is the configuration file for JetspeedSecurity
   #
  @@ -7,6 +7,7 @@
   # escape the comma (i.e. '\,')
   #
   # -------------------------------------------------------------------
  +services.JetspeedSecurity.classname=org.apache.jetspeed.services.security.JetspeedDBSecurityService
   
   #########################################
   # Authentication Service                #
  @@ -18,7 +19,7 @@
   # Authorization Service                 #
   #########################################
   
  -services.PortalAccessController.classname=org.apache.jetspeed.services.security.registry.RegistryAccessController
  +services.PortalAccessController.classname=@services.PortalAccessController.classname@
   
   #########################################
   # User Management Service               #
  @@ -38,7 +39,7 @@
   # User Class
   #
   services.JetspeedSecurity.user.class=org.apache.jetspeed.om.security.BaseJetspeedUser
  -services.JetspeedSecurity.user.persisted.class=org.apache.jetspeed.om.security.turbine.TurbineUser
  +# services.JetspeedSecurity.user.persisted.class=org.apache.jetspeed.om.security.turbine.TurbineUser
   
   #
   # This is used by the SecurityService to make the password checking
  
  
  
  1.1.2.4   +3 -2      jakarta-jetspeed/webapp/WEB-INF/conf/Attic/JetspeedSecurity.template
  
  Index: JetspeedSecurity.template
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/conf/Attic/JetspeedSecurity.template,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- JetspeedSecurity.template	4 Jun 2002 03:47:31 -0000	1.1.2.3
  +++ JetspeedSecurity.template	7 Jun 2002 10:02:07 -0000	1.1.2.4
  @@ -1,5 +1,5 @@
   # -------------------------------------------------------------------
  -# $Id: JetspeedSecurity.template,v 1.1.2.3 2002/06/04 03:47:31 taylor Exp $
  +# $Id: JetspeedSecurity.template,v 1.1.2.4 2002/06/07 10:02:07 taylor Exp $
   #
   # This is the configuration file for JetspeedSecurity
   #
  @@ -7,6 +7,7 @@
   # escape the comma (i.e. '\,')
   #
   # -------------------------------------------------------------------
  +services.JetspeedSecurity.classname=org.apache.jetspeed.services.security.JetspeedDBSecurityService
   
   #########################################
   # Authentication Service                #
  @@ -38,7 +39,7 @@
   # User Class
   #
   services.JetspeedSecurity.user.class=org.apache.jetspeed.om.security.BaseJetspeedUser
  -services.JetspeedSecurity.user.persisted.class=org.apache.jetspeed.om.security.turbine.TurbineUser
  +# services.JetspeedSecurity.user.persisted.class=org.apache.jetspeed.om.security.turbine.TurbineUser
   
   #
   # This is used by the SecurityService to make the password checking
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.11.2.4  +1 -1      jakarta-jetspeed/webapp/WEB-INF/db/jetspeed.properties
  
  Index: jetspeed.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/db/jetspeed.properties,v
  retrieving revision 1.11.2.3
  retrieving revision 1.11.2.4
  diff -u -r1.11.2.3 -r1.11.2.4
  --- jetspeed.properties	30 May 2002 07:04:12 -0000	1.11.2.3
  +++ jetspeed.properties	7 Jun 2002 10:02:07 -0000	1.11.2.4
  @@ -1,4 +1,4 @@
   #Hypersonic SQL database
  -#Wed May 29 22:49:31 PDT 2002
  +#Fri Jun 07 02:56:59 PDT 2002
   version=1.4
   modified=yes
  
  
  
  1.13.2.4  +3 -4      jakarta-jetspeed/webapp/WEB-INF/db/jetspeed.script
  
  Index: jetspeed.script
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/db/jetspeed.script,v
  retrieving revision 1.13.2.3
  retrieving revision 1.13.2.4
  diff -u -r1.13.2.3 -r1.13.2.4
  --- jetspeed.script	30 May 2002 07:04:12 -0000	1.13.2.3
  +++ jetspeed.script	7 Jun 2002 10:02:07 -0000	1.13.2.4
  @@ -99,7 +99,7 @@
   INSERT INTO TURBINE_ROLE VALUES(2,'admin',NULL)
   INSERT INTO TURBINE_GROUP VALUES(1,'Jetspeed',NULL)
   INSERT INTO TURBINE_GROUP VALUES(2,'apache',NULL)
  -INSERT INTO TURBINE_USER VALUES(0,'turbine','turbine','Tommy','Turbine','david@bluesunrise.com','CONFIRMED',NULL,NULL,'2001-11-11 18:45:32.671','F','aced0005737200136a6176612e7574696c2e486173687461626c6513bb0f25214ae4b803000246000a6c6f6164466163746f724900097468726573686f6c6478703f400000000000027708000000030000000174000f5f6163636573735f636f756e746572737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b02000078700000007678')
  +INSERT INTO TURBINE_USER VALUES(0,'turbine','turbine','Tommy','Turbine','david@bluesunrise.com','CONFIRMED',NULL,NULL,'2002-06-04 16:05:25.712','F','aced0005737200136a6176612e7574696c2e486173687461626c6513bb0f25214ae4b803000246000a6c6f6164466163746f724900097468726573686f6c6478703f4000000000000577080000000700000003740008756e69747465737474000074000f5f6163636573735f636f756e746572737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b020000787000000076740007555345525f49447400013078')
   INSERT INTO TURBINE_USER VALUES(1,'admin','jetspeed','Jetspeed','Admin','david@bluesunrise.com','CONFIRMED',NULL,NULL,'2001-11-11 18:45:41.671','F','aced0005737200136a6176612e7574696c2e486173687461626c6513bb0f25214ae4b803000246000a6c6f6164466163746f724900097468726573686f6c6478703f400000000000027708000000030000000174000f5f6163636573735f636f756e746572737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b0200007870000000a978')
   INSERT INTO TURBINE_ROLE_PERMISSION VALUES(1,1)
   INSERT INTO TURBINE_ROLE_PERMISSION VALUES(1,2)
  @@ -120,7 +120,7 @@
   INSERT INTO ID_TABLE VALUES(1,'TURBINE_PERMISSION',100,10)
   INSERT INTO ID_TABLE VALUES(2,'TURBINE_ROLE',120,10)
   INSERT INTO ID_TABLE VALUES(3,'TURBINE_GROUP',100,10)
  -INSERT INTO ID_TABLE VALUES(4,'TURBINE_USER',160,10)
  +INSERT INTO ID_TABLE VALUES(4,'TURBINE_USER',290,10)
   INSERT INTO ID_TABLE VALUES(5,'TURBINE_SCHEDULED_JOB',100,10)
   INSERT INTO ID_TABLE VALUES(6,'TURBINE_ROLE_PERMISSION',100,10)
   INSERT INTO ID_TABLE VALUES(7,'TURBINE_USER_GROUP_ROLE',100,10)
  @@ -139,5 +139,4 @@
   INSERT INTO COFFEES VALUES('KenyanGrade',2,7.99,1,2)
   INSERT INTO COFFEES VALUES('JoeGrade',3,7.99,1,2)
   INSERT INTO COFFEES VALUES('CantThinkOfAnymoreGrade',4,7.99,1,2)
  -/*C2*/CONNECT USER sa PASSWORD ""
  -/*C3*/CONNECT USER sa PASSWORD ""
  +/*C4*/CONNECT USER sa PASSWORD ""
  
  
  

--
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