Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: joist/java/org/joist/account UserMaintenance.java UserMaintenance.properties UserRegistration.java UserRegistration.properties UserSelection.java UserSelection.properties

Project highlights: Architectural Overview

joist
Discussion topic

Back to topic list

CVS update: joist/java/org/joist/account UserMaintenance.java UserMaintenance.properties UserRegistration.java UserRegistration.properties UserSelection.java UserSelection.properties

Author commitlogger at hocus dot collab dot net
Full name commitlogger at hocus dot collab dot net
Date 2000-04-15 21:29:21 PDT
Message User: dlr
  Date: 00/04/15 21:29:21

  Modified: java/org/joist/account UserMaintenance.java
                        UserMaintenance.properties UserRegistration.java
                        UserRegistration.properties UserSelection.java
                        UserSelection.properties
  Log:
  Added functionality from the sourcex fork, along with a general audit.
  
  Revision Changes Path
  1.4 +15 -14 joist/java/org/joist​/account/UserMainten​ance.java
  
  Index: UserMaintenance.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/account/UserMa​intenance.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- UserMaintenance.java 2000/02/29 01:23:56 1.3
  +++ UserMaintenance.java 2000/04/16 04:29:21 1.4
  @@ -66,10 +66,10 @@
     * Display and process the User registration information.
     *
     * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
     *
     * Copyright (c) 1999 dataweb systems, inc.
  - * Copyright (c) 1999, 2000 Collab.Net, Inc.
  + * Copyright (c) 1999, 2000 Collab.Net, Inc.
     */
   
   public class UserMaintenance extends SecureServlet
  @@ -88,7 +88,6 @@
       KeyDef kd = null;
       TableDataSet tds = null;
       String ID = "userID";
  - Integer userID_Int;
       String phase = "start";
       Record userRecord = null;
       Vector userRoles;
  @@ -110,7 +109,8 @@
       String userID = getObjectID(context, ID);
       if ((userID == null) || (userID.length() == 0))
           userID = loginUserID;
  - if (debug) log.debug("UserMaintenance: userID=" + userID + ", loginUserID=" + loginUserID );
  + if (debug) log.debug("UserMaintenance: userID=" + userID +
  + ", loginUserID=" + loginUserID);
   
       // If the target userID is not the loginUserID, then the user needs
       // to have additional privileges to proceed.
  @@ -159,14 +159,14 @@
               redirectToCancel(context);
           }
           else
  + {
               throw new RedirectException("U​nauthorizedAccess");​
  + }
           }
   
  -
           // By default, assume that an update is intended.
           context.put("actionButton", "Update");
   
  -
           // Add a record if indicated
           if (action.equals("Add"))
           {
  @@ -182,11 +182,11 @@
           {
               String loginID = context.getForm("loginID");
               String password = context.getForm("password");
  - userID_Int = userMgr.addUser(connection, context, loginID,
  - password);
  - userID = userID_Int.toString();
  + userID = userMgr.addUser(connection, context, loginID,
  + password).toString();
               if (accessAllowed(rolesPerm, userPerms))
  - userRoleMgr.updateRo​lesForUser(connectio​n, userID, context);
  + userRoleMgr.updateRo​lesForUser(connectio​n, userID,
  + context);
               redirectToCancel(context);
               // REM: action = "Details";
           }
  @@ -220,7 +220,8 @@
               value = context.getForm("country");
                       if (value != null) userRecord.setValue("country", value);
               value = context.getForm("citizenship");
  - if (value != null) userRecord.setValue(​"citizenship", value);
  + if (value != null) userRecord.setValue(​"citizenship",
  + value);
               value = context.getForm("phone");
                       if (value != null) userRecord.setValue("phone", value);
               value = context.getForm("altPhone");
  @@ -245,7 +246,7 @@
   
               // Get the roles that were selected on the form
               HttpServletRequest request = context.getRequest();
  - String [] selectedRoles = context.getFormList("roleID");
  + String[] selectedRoles = context.getFormList("roleID");
               ListElement roleElement;
   
               // Mark the retrieved role selected if it was on the form
  @@ -338,8 +339,8 @@
   
   
           // Retrieve the User information for viewing.
  - if ((action.equals("Details")) ||
  - (action.equals("none")))
  + if (action.equals("Details") ||
  + action.equals("none"))
           {
           if (debug) log.debug("UserMaintenance: Viewing");
           phase = "Getting";
  
  
  
  1.3 +2 -0 joist/java/org/joist​/account/UserMainten​ance.properties
  
  Index: UserMaintenance.properties
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/account/UserMa​intenance.properties​,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- UserMaintenance.properties 2000/01/30 13:00:34 1.2
  +++ UserMaintenance.properties 2000/04/16 04:29:21 1.3
  @@ -1,5 +1,7 @@
   permission=User - My Profile
  +subject=userID
   showRoles=User Role - Assign
   servletTemplate=acco​unt/UserMaintenance.​wm
   servletName=UserMaintenance
  +displayName=User Maintenance
   servletScheme=https
  
  
  
  1.4 +35 -21 joist/java/org/joist​/account/UserRegistr​ation.java
  
  Index: UserRegistration.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/account/UserRe​gistration.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- UserRegistration.java 2000/02/29 01:23:56 1.3
  +++ UserRegistration.java 2000/04/16 04:29:21 1.4
  @@ -68,10 +68,10 @@
     * Display and process the User registration information.
     *
     * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
     *
     * Copyright (c) 1999 dataweb systems, inc.
  - * Copyright (c) 1999, 2000 Collab.Net, Inc.
  + * Copyright (c) 1999, 2000 Collab.Net, Inc.
     */
   
   public class UserRegistration extends UnsecureServlet
  @@ -96,17 +96,16 @@
       // Let the superclass do its part.
       String templateName = super.processRequest​(connection, context);
   
  -
       // Unbundle the context a bit.
       SessionManager sMgr = getSessionManager(context);
       DataManager dMgr = getDataManager(context);
   
  -
       // Check whether the user has already logged in, and prevent any
       // further action.
       if (sMgr.isLoggedIn().b​ooleanValue())
       {
  - context.put("Message", "You are already logged in as a registered user!");
  + context.put("Message",
  + "You are already logged in as a registered user!");
           redirectToCancel(context);
       }
   
  @@ -123,7 +122,6 @@
           context.put("Message", errorMessage);
       }
   
  -
       // Do the database activities: add
       try
       {
  @@ -136,7 +134,7 @@
           validAction = true;
   
           String loginID = context.getForm("loginID");
  - if ((loginID == null) || (loginID.length() == 0))
  + if (loginID == null || loginID.length() == 0)
               context.put("Message", "You entered a blank login ID.");
           else
           {
  @@ -145,27 +143,29 @@
               {
               String password = context.getForm("password");
               userID = uMgr.addUser(connection, context, loginID,
  - password);
  + password);
               context.put("userID", userID);
               context.put("Message", "You are now registered!");
   
  - // Assign to the registered developer role
  + // Assign the role(s) to the user necessary for him/her
  + // to be a registered developer.
               UserRoleManager urMgr =
                   getDataManager(conte​xt).getUserRoleManag​er();
               String userIDstr = userID.toString();
               urMgr.addRoleForUser​(connection, userIDstr,
  - "Registered Developer");
  + "Registered Developer");
               urMgr.addRoleForUser​(connection, userIDstr,
  - "Developer - no Tax ID");
  + "Developer - no Tax ID");
   
               // Automatically log in the user and get permissions.
  - sMgr.loginIsValid(connection, context, loginID, password);
  + sMgr.loginIsValid(connection, context, loginID,
  + password);
               sMgr.getPermissions(connection, context);
   
               // Subscribe the user to the announcement mailing list.
               MailListManager mMgr = dMgr.getMailListManager();
               mMgr.add("developer-announce",
  - (String)context.get("email"));
  + (String)context.get("email"));
   
               // Redirect to the Personal Home Page
               redirectTo("StartPage");
  @@ -181,30 +181,41 @@
               dMgr.registerToClose(tds);
               userRecord = tds.addRecord();
               String value;
  +
  + // Pull some data from the form post and use it to set
  + // the user's information.
               value = context.getForm("loginID");
  - if (value != null) userRecord.setValue("loginID", value);
  + if (value != null)
  + userRecord.setValue("loginID", value);
               value = context.getForm("password");
  - if (value != null) userRecord.setValue("password", value);
  + if (value != null)
  + userRecord.setValue("password", value);
               value = context.getForm("name");
                           if (value != null) userRecord.setValue("name", value);
               value = context.getForm("address1");
  - if (value != null) userRecord.setValue("address1", value);
  + if (value != null)
  + userRecord.setValue("address1", value);
               value = context.getForm("address2");
  - if (value != null) userRecord.setValue("address2", value);
  + if (value != null)
  + userRecord.setValue("address2", value);
               value = context.getForm("city");
                           if (value != null) userRecord.setValue("city", value);
               value = context.getForm("state");
                           if (value != null) userRecord.setValue("state", value);
               value = context.getForm("postalCode");
  - if (value != null) userRecord.setValue(​"postalCode", value);
  + if (value != null)
  + userRecord.setValue(​"postalCode", value);
               value = context.getForm("country");
  - if (value != null) userRecord.setValue("country", value);
  + if (value != null)
  + userRecord.setValue("country", value);
               value = context.getForm("citizenship");
  - if (value != null) userRecord.setValue(​"citizenship", value);
  + if (value != null)
  + userRecord.setValue(​"citizenship", value);
               value = context.getForm("phone");
                           if (value != null) userRecord.setValue("phone", value);
               value = context.getForm("altPhone");
  - if (value != null) userRecord.setValue("altPhone", value);
  + if (value != null)
  + userRecord.setValue("altPhone", value);
               value = context.getForm("fax");
                           if (value != null) userRecord.setValue("fax", value);
               value = context.getForm("cell");
  @@ -213,6 +224,8 @@
                           if (value != null) userRecord.setValue("pager", value);
               value = context.getForm("email");
                           if (value != null) userRecord.setValue("email", value);
  +
  + // Add the user's info to the context.
               context.put("user", userRecord);
               context.put("tds", tds);
               }
  @@ -244,6 +257,7 @@
           userRecord.setValue("cell", "");
           userRecord.setValue("pager", "");
           userRecord.setValue("email", "");
  +
           context.put("user", userRecord);
           context.put("tds", tds);
           }
  
  
  
  1.3 +1 -0 joist/java/org/joist​/account/UserRegistr​ation.properties
  
  Index: UserRegistration.properties
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/account/UserRe​gistration.propertie​s,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- UserRegistration.properties 2000/01/30 13:00:34 1.2
  +++ UserRegistration.properties 2000/04/16 04:29:21 1.3
  @@ -1,3 +1,4 @@
   servletTemplate=acco​unt/UserRegistration​.wm
   servletName=UserRegistration
  +displayName=User Registration
   servletScheme=https
  
  
  
  1.5 +19 -23 joist/java/org/joist​/account/UserSelecti​on.java
  
  Index: UserSelection.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/account/UserSe​lection.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- UserSelection.java 2000/02/29 01:23:56 1.4
  +++ UserSelection.java 2000/04/16 04:29:21 1.5
  @@ -67,10 +67,10 @@
     * for additional processing, such as displaying details of the user.
     *
     * @author Daniel M. Pellegrini <A HREF="mailto:pilgrim​@dataweb-systems.com​">pilgrim@dataweb​-systems.com</A​>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
     *
     * Copyright (c) 1999 dataweb systems, inc.
  - * Copyright (c) 1999, 2000 Collab.Net, Inc.
  + * Copyright (c) 1999, 2000 Collab.Net, Inc.
     */
   
   public class UserSelection extends SecureServlet
  @@ -97,13 +97,10 @@
       String browseIdMatch = "";
       String browseNameMatch = "";
       String browseEmailMatch = "";
  - boolean haveUserID = true;
  + boolean haveUserID = (userID != null && userID.length() > 0);
   
       if (debug) log.debug("UserSelection: enter");
   
  - if ((userID == null) || (userID.length() == 0))
  - haveUserID = false;
  -
       // Let the superclass do it's part.
       String templateName = super.processRequest​(connection, context);
   
  @@ -120,7 +117,6 @@
           context.put("Message", errorMessage);
       }
   
  -
       // Check for redirected form actions before going any further.
       if (action.equals("Details"))
       {
  @@ -142,11 +138,11 @@
       if (action.equals("New"))
       {
           if (debug) log.debug("UserSelection: New redirect");
  + // HELP: Why is this call commented out?
           //JER: setAsCancel(context);
           throw new RedirectException("U​serMaintenance");
       }
   
  -
       // Do the database activities: delete, retrieve, add
       // Retrieve users from the database and put them into context.
       // In the future, the TableDataSet object could be cached in the
  @@ -189,21 +185,21 @@
           browseNameMatch = context.getForm("bro​wse_name_by");
           browseEmailMatch = context.getForm("bro​wse_email_by");
   
  - if (((browseId == null) || (browseId.length() == 0)) &&
  - ((browseName == null) || (browseName.length() == 0)) &&
  - ((browseEmail == null) || (browseEmail.length() == 0)))
  + if ((browseId == null || browseId.length() == 0) &&
  + (browseName == null || browseName.length() == 0) &&
  + (browseEmail == null || browseEmail.length() == 0))
               context.put("Message", "No browse criteria specified");
           else
               context.put("Message",
  - "The following Users match your criteria");
  + "The following Users match your criteria");
           }
   
           if (!validAction) redirectToUnauthorized();
   
           browseUser(connection, context,
  - browseId, browseIdMatch,
  - browseName, browseNameMatch,
  - browseEmail, browseEmailMatch);
  + browseId, browseIdMatch,
  + browseName, browseNameMatch,
  + browseEmail, browseEmailMatch);
   
           if (debug) log.debug("UserSelection: finish Browse");
       }
  @@ -254,11 +250,11 @@
       statement.append("select userID, name from User");
       String connector = " where ";
   
  - if ((browseId != null) && (browseId.length() != 0))
  + if (browseId != null && browseId.length() != 0)
       {
           statement.append(connector);
           statement.append("loginID LIKE ");
  - statement.append(Quo​tedString.from("%" + browseId + "%"));
  + statement.append(Quo​tedString.from('%' + browseId + '%'));
           connector = " and ";
       }
   
  @@ -266,27 +262,27 @@
       {
           statement.append(connector);
           statement.append("name LIKE ");
  - statement.append(Quo​tedString.from("%" + browseName + "%"));
  + statement.append(Quo​tedString.from('%' + browseName + '%'));
           connector = " and ";
       }
   
  - if ((browseEmail != null) && (browseEmail.length() != 0))
  + if (browseEmail != null && browseEmail.length() != 0)
       {
           statement.append(connector);
           statement.append("email LIKE ");
  - statement.append(Quo​tedString.from("%" + browseEmail + "%"));
  + statement.append(Quo​tedString.from('%' + browseEmail + '%'));
       }
   
       statement.append(" order by name");
       String selectStatement = statement.toString();
   
  - QueryDataSet qds = new QueryDataSet ( connection, selectStatement );
  + QueryDataSet qds = new QueryDataSet (connection, selectStatement);
  + getSessionManager(co​ntext).registerToClo​se(qds);
       qds.fetchRecords();
  +
       if (!qds.containsRecord(0))
           context.put("Message", "No matching Users found");
  -
       context.put("tableDataSet", qds);
  -
   
       if (debug) log.debug("UserSelection: browseUser exit");
       }
  
  
  
  1.3 +1 -0 joist/java/org/joist​/account/UserSelecti​on.properties
  
  Index: UserSelection.properties
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/account/UserSe​lection.properties,v​
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- UserSelection.properties 2000/01/30 13:00:34 1.2
  +++ UserSelection.properties 2000/04/16 04:29:21 1.3
  @@ -1,3 +1,4 @@
   permission=User - List
   servletTemplate=admi​n/Selection.wm
   servletName=UserSelection
  +displayName=User Selection

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: joist/java/org/joist/account UserMaintenance.java UserMaintenance.properties UserRegistration.java UserRegistration.properties UserSelection.java UserSelection.properties commitlogger at hocus dot collab dot net commitlogger at hocus dot collab dot net 2000-04-15 21:29:21 PDT
Messages per page: