7164778 usermgr: Remove Advanced settings button from New User dialog in User Manager GUI
authorLokanath Das <Lokanath.Das@Sun.COM>
Thu, 31 May 2012 08:41:19 -0700
changeset 843 190d2b5889a8
parent 842 9da05efee3cd
child 844 55358dcf0cb2
7164778 usermgr: Remove Advanced settings button from New User dialog in User Manager GUI 7164785 usermgr: User Manager GUI gets into a weird state when the usermgr rad module causes error or dies 7171382 usermgr: some typos in Help
components/visual-panels/usermgr/src/apis/usermgr.xml
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/AddUserAction.java
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/DeleteUserAction.java
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/GroupsPanel.java
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/MainControl.java
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/RolesPanel.java
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserManagedObject.java
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrBasicPanel.java
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrEmptyPanel.java
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrPanelDescriptor.java
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrUtils.java
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-admrights.html
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-advtab.html
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-moduser.html
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usrmgr-admrole.html
components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/resources/Resources.properties
components/visual-panels/usermgr/system-management-visual-panels-panel-usermgr.p5m
--- a/components/visual-panels/usermgr/src/apis/usermgr.xml	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/apis/usermgr.xml	Thu May 31 08:41:19 2012 -0700
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <!--
- Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
 
  CDDL HEADER START
 
@@ -649,7 +649,7 @@
 			</argument>
 		</method>
 
-		<method name="setScope">
+		<method name="selectScope">
 			<summary>
 				sets the name-service repository scope.
 			</summary>
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/AddUserAction.java	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/AddUserAction.java	Thu May 31 08:41:19 2012 -0700
@@ -58,7 +58,7 @@
     // Inner classes
     //
 
-    protected class Data implements ActionListener {
+    protected class Data {
 	//
 	// Instance data
 	//
@@ -84,7 +84,6 @@
 	private JOptionPane pane;
 	private JDialog dialog;
         private static final String ACTION_ADV_SETTINGS = "settings";
-        private AdvancedSettingsDialog advDialog = null;
 	private UserMgrPanelDescriptor descriptor = null;
 	private ActionString actString = null;
 
@@ -304,50 +303,14 @@
 	gbc.gridx = GridBagConstraints.RELATIVE;
         form.add(passConfirmField, gbc);
 
-	// Advanced Settings
-	actString = new ActionString("usermgr.advanced.settings");
-	JButton advSettings = new JButton(actString.getString());
-	advSettings.setActionCommand(ACTION_ADV_SETTINGS);
-	advSettings.addActionListener(this);
-	advSettings.setMnemonic(actString.getMnemonic());
-
-	// Add to the layout
-	gbc.gridx = 0;
-	gbc.gridy++;
-	gbc.gridwidth = GridBagConstraints.REMAINDER;
-	gbc.anchor = GridBagConstraints.SOUTHWEST;
-	form.add(advSettings, gbc);
+	// Disable password fields if the admin can set password
+	if (descriptor.canChangePassword(null) == false) {
+	    passField.setEnabled(false);
+	    passConfirmField.setEnabled(false);
+	}
 
 	return form;
     }
-
-	/**
-	 * action listener for Adv settings button
-	 */
-        @Override
-        public void actionPerformed(ActionEvent e)  {
-            String actionCmd = e.getActionCommand();
-	    if (actionCmd == ACTION_ADV_SETTINGS) {
-		UserMgrPanelDescriptor descriptor =
-			control.getPanelDescriptor();
-		if (umo == null || user == null) {
-		    user = new UserImpl();
-		    umo = new UserManagedObject(descriptor, user, null);
-		}
-
-		if (advDialog == null ||
-		    descriptor.isTypeRole() != advDialog.isTypeRole()) {
-		    advDialog = new AdvancedSettingsDialog(
-			getHasComponent().getComponent(), descriptor, umo);
-		} else {
-		    advDialog.setUser(umo);
-		}
-		advDialog.show();
-		if (advDialog.getValue() == JOptionPane.OK_OPTION) {
-		    advDialog.update();
-    		}
-	    }
-        }
     }
 
     //
@@ -454,8 +417,7 @@
 	    umo.setUser(user, password);
 	}
 
-	descriptor.addToAddList(umo);
-	descriptor.saveAddedUsers();
+	descriptor.saveAddedUser(umo);
 
 	// Navigate to the newly created user
 	Navigable navigable = new SimpleNavigable(
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/DeleteUserAction.java	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/DeleteUserAction.java	Thu May 31 08:41:19 2012 -0700
@@ -116,8 +116,7 @@
 	if (!selection.isEmpty()) {
 	    UserMgrPanelDescriptor descriptor = (UserMgrPanelDescriptor)
 		control.getPanelDescriptor();
-	    descriptor.addToDeleteList(selection.get(0));
-	    descriptor.saveDeletedUsers();
+	    descriptor.saveDeletedUser(selection.get(0));
 	    // If the running Control is a UserMgrControl for a just-deleted
 	    // service, reset the Control and navigate back to its parent
 	    Control child = control.getRunningChild();
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/GroupsPanel.java	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/GroupsPanel.java	Thu May 31 08:41:19 2012 -0700
@@ -313,24 +313,6 @@
             } else if (node.getUserObject() instanceof GroupTreeNode) {
                 GroupTreeNode groupsdef = (GroupTreeNode) node.getUserObject();
                 setText(groupsdef.toString());
-
-                if (selected) {
-                    if (node.isEnabled()) {
-                        cr.setTextSelectionColor(SystemColor.textText);
-                    } else {
-                        cr.setTextSelectionColor(
-			    SystemColor.inactiveCaptionText);
-		    }
-
-                } else {
-                    if (node.isEnabled()) {
-                        cr.setTextNonSelectionColor(SystemColor.textText);
-                    } else {
-
-                        cr.setTextNonSelectionColor(
-                        SystemColor.inactiveCaptionText);
-                    }
-                }
             }
 
             super.getTreeCellRendererComponent(tree, value, selected, expanded,
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/MainControl.java	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/MainControl.java	Thu May 31 08:41:19 2012 -0700
@@ -80,11 +80,6 @@
     protected void save() throws ActionAbortedException, ActionFailedException,
 	ActionUnauthorizedException {
 
-	// First delete any users, then add new users, then modify users
-	getPanelDescriptor().saveDeletedUsers();
-
-	getPanelDescriptor().saveAddedUsers();
-
 	getPanelDescriptor().saveModifiedUsers();
 	control.clearChanges();
 
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/RolesPanel.java	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/RolesPanel.java	Thu May 31 08:41:19 2012 -0700
@@ -316,24 +316,6 @@
             } else if (node.getUserObject() instanceof RoleTreeNode) {
                 RoleTreeNode rolesdef = (RoleTreeNode) node.getUserObject();
                 setText(rolesdef.toString());
-
-                if (selected) {
-                    if (node.isEnabled()) {
-                        cr.setTextSelectionColor(SystemColor.textText);
-                    } else {
-                        cr.setTextSelectionColor(
-			    SystemColor.inactiveCaptionText);
-		    }
-
-                } else {
-                    if (node.isEnabled()) {
-                        cr.setTextNonSelectionColor(SystemColor.textText);
-                    } else {
-
-                        cr.setTextNonSelectionColor(
-                        SystemColor.inactiveCaptionText);
-                    }
-                }
             }
 
             super.getTreeCellRendererComponent(tree, value, selected, expanded,
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserManagedObject.java	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserManagedObject.java	Thu May 31 08:41:19 2012 -0700
@@ -44,9 +44,6 @@
     //
     // Static data
     //
-    public static final String PASSWORD = "PASSWORD";
-    public static final String NOTACTIVE = "NOTACTIVATED";
-
 
     // Icons - for user, roles
     protected static final List<ImageIcon> userIcons = Finder.getIcons(
@@ -316,14 +313,6 @@
 	return isNewUser;
     }
 
-    public boolean hasPassword() {
-        if (getAccountStatus().equals(PASSWORD)) {
-	    return (true);
-	}
-
-	return (false);
-    }
-
     // Update the "auto-generated" properties for the newly created user
     public void updateUser(User user) {
 	userIdProperty.update(user.getUserID(), true);
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrBasicPanel.java	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrBasicPanel.java	Thu May 31 08:41:19 2012 -0700
@@ -166,6 +166,13 @@
 	public MutableProperty<char[]> getPassConfirmProperty() {
 	    return passConfirmProperty;
 	}
+
+	//
+	// Enable/Disable the fields
+	public void setEnabled(boolean enabled) {
+	    passField.setEnabled(enabled);
+	    passConfirmField.setEnabled(enabled);
+	}
     }
 
     //
@@ -237,7 +244,6 @@
 	// Sanity check -- the UI should be updated only on the event thread
 	assert EventQueue.isDispatchThread();
 
-
 	this.umo = umo;
 	descriptor = paneldesc;
 
@@ -285,13 +291,10 @@
 	getPassConfirmProperty().update(
 	    umo.getPassProperty().getSavedValue(), false);
 
-	if (umo.hasPassword()) {
-	    changepassStr = Finder.getString("usermgr.basic.label.changepass");
-	} else {
-	    changepassStr = Finder.getString("usermgr.basic.label.initialpass");
-	}
+	changepassStr = Finder.getString("usermgr.basic.label.changepass");
 
 	passPanel.setCollapsed(true);
+	passPanel.setEnabled(descriptor.canChangePassword(umo));
 
 	settingsProperty.update(false, true);
     }
@@ -302,6 +305,7 @@
 
     private JPanel createForm() {
 	JPanel form = new JPanel(new GridBagLayout());
+	form.setOpaque(false);
 	GridBagConstraints gbc = new GridBagConstraints();
 	int width = GUIUtil.getTextFieldWidth();
         int hGap = GUIUtil.getHalfGap();
@@ -488,4 +492,11 @@
     public void clearChanges() {
         settingsProperty.update(false, true);
     }
+
+    /**
+     * Enable/Disable the password panel
+     */
+    public void enablePassword(boolean enabled) {
+	passPanel.setEnabled(enabled);
+    }
 }
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrEmptyPanel.java	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrEmptyPanel.java	Thu May 31 08:41:19 2012 -0700
@@ -50,6 +50,7 @@
 	msgLabel.setVerticalTextPosition(SwingConstants.CENTER);
 
 	setLayout(new BorderLayout());
+	setOpaque(false);
 	add(msgLabel);
     }
 }
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrPanelDescriptor.java	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrPanelDescriptor.java	Thu May 31 08:41:19 2012 -0700
@@ -46,7 +46,8 @@
 
 public class UserMgrPanelDescriptor
     extends AbstractPanelDescriptor<UserManagedObject>
-    implements SwingPanelDescriptor<UserManagedObject>, HasIcons {
+    implements SwingPanelDescriptor<UserManagedObject>, HasIcons,
+    ConnectionListener {
 
     //
     // Static data
@@ -62,6 +63,11 @@
     public static final String SCOPE_FILES = "files";
     public static final String MATCH_ALL = "*";
 
+    public static final String PASSWORD = "PASSWORD";
+    public static final String NOTACTIVATED = "NOTACTIVATED";
+    public static final String LOCKED = "LOCKED";
+    public static final String UNKNOWN = "UNKNOWN";
+
     //
     // Instance data
     //
@@ -75,19 +81,16 @@
     private String typeStr = USER_TYPE_NORMAL;
     private String matchStr = MATCH_ALL;
 
-    private List<UserManagedObject> deleteList =
-	new ArrayList<UserManagedObject> ();
-    private List<UserManagedObject> addList =
-	new ArrayList<UserManagedObject> ();
+    // Assignable lists
+    private List<String> scopeList = null;
+    private List<String> shellList = null;
+    private List<Group> groupList = null;
+    private List<String> profileList = null;
+    private List<String> authList = null;
+    private List<String> roleList = null;
+    private List<String> supplgroups = null;
 
-    private MutableProperty<Integer> addedProperty =
-	new IntegerProperty();
-    private MutableProperty<Integer> deletedProperty =
-	new IntegerProperty();
-    {
-	getChangeableAggregator().addChangeables(
-	    addedProperty, deletedProperty);
-    }
+    private User defUser = null;
 
     //
     // Constructors
@@ -104,7 +107,7 @@
      *		    a handle to interact with the Visual Panels client
      */
     public UserMgrPanelDescriptor(String id, ClientContext context)
-	throws TrackerException {
+	throws TrackerException, ActionFailedException {
 
         super(id, context);
 
@@ -116,13 +119,10 @@
 	// Initialize list of users
 	initUsers(SCOPE_FILES, USER_TYPE_NORMAL, MATCH_ALL);
 
-	// Keep track of users added/deleted
-	addedProperty.update(0, true);
-	deletedProperty.update(0, true);
-
         control = new PanelFrameControl<UserMgrPanelDescriptor>(this);
         mc = new MainControl(this);
 	control.addChildren(mc);
+	context.addConnectionListener(this);
     }
 
     //
@@ -229,67 +229,46 @@
 	addChildren(toAdd);
     }
 
-    public void addToAddList(UserManagedObject toAdd) {
-	addedProperty.setValue(addedProperty.getValue() + 1);
-	addList.add(toAdd);
-    }
-
-    public void addToDeleteList(UserManagedObject toRemove) {
-	deletedProperty.setValue(deletedProperty.getValue() + 1);
-	deleteList.add(toRemove);
-    }
-
-    public void saveDeletedUsers() throws ActionAbortedException,
+    public void saveDeletedUser(UserManagedObject umo)
+        throws ActionAbortedException,
 	ActionFailedException, ActionUnauthorizedException {
 
-	Iterator<UserManagedObject> it = deleteList.iterator();
-	while (it.hasNext()) {
-	    UserManagedObject umo = it.next();
-	    try {
-		getUserMgrBean().deleteUser(umo.getName());
-		deleteUserManagedObject(umo);
-		it.remove();
-		deletedProperty.setValue(deletedProperty.getValue() - 1);
-	    } catch (SecurityException se) {
-		throw new ActionUnauthorizedException(se);
-	    } catch (ObjectException e) {
-		UserMgrError ume = e.getPayload(UserMgrError.class);
-		String msg = Finder.getString("usermgr.error.invalidData");
-		String err = Finder.getString(
-		    "usermgr.error.delete", umo.getUsername());
-		getLog().log(Level.SEVERE, err + msg, e);
-		throw new ActionFailedException(err + msg);
-	    // Any other remaining exceptions
-	    } catch (Exception e) {
-		String msg = Finder.getString("usermgr.error.system");
-		String err = Finder.getString(
-		    "usermgr.error.delete", umo.getUsername());
-		getLog().log(Level.SEVERE, err + msg, e);
-		throw new ActionFailedException(err + msg);
-	    }
+	try {
+	    getUserMgrBean().deleteUser(umo.getName());
+	    deleteUserManagedObject(umo);
+	} catch (SecurityException se) {
+	    throw new ActionUnauthorizedException(se);
+	} catch (ObjectException e) {
+	    UserMgrError ume = e.getPayload(UserMgrError.class);
+	    String msg = Finder.getString("usermgr.error.invalidData");
+	    String err = Finder.getString(
+		"usermgr.error.delete", umo.getUsername());
+	    getLog().log(Level.SEVERE, err + msg, e);
+	    throw new ActionFailedException(err + msg);
+	// Any other remaining exceptions
+	} catch (Exception e) {
+	    String msg = Finder.getString("usermgr.error.system");
+	    String err = Finder.getString(
+		"usermgr.error.delete", umo.getUsername());
+	    getLog().log(Level.SEVERE, err + msg, e);
+	    throw new ActionFailedException(err + msg);
 	}
     }
 
-    public void saveAddedUsers() throws ActionAbortedException,
+    public void saveAddedUser(UserManagedObject umo)
+        throws ActionAbortedException,
 	ActionFailedException, ActionUnauthorizedException {
 
-	Iterator<UserManagedObject> it = addList.iterator();
-	while (it.hasNext()) {
-	    UserManagedObject umo = it.next();
-	    try {
-		char[] password = umo.getPassword();
-		User user = getUserMgrBean().addUser(
-		    umo.getNewUser(), password);
-		addUserManagedObject(umo);
-		Arrays.fill(password, (char)0);
+	try {
+	    char[] password = umo.getPassword();
+	    User user = getUserMgrBean().addUser(umo.getNewUser(), password);
+	    addUserManagedObject(umo);
+	    Arrays.fill(password, (char)0);
+	    umo.updateUser(user);
 
-		it.remove();
-		addedProperty.setValue(addedProperty.getValue() - 1);
-		umo.updateUser(user);
-	    } catch (SecurityException se) {
-		throw new ActionUnauthorizedException(se);
-	    } catch (ObjectException e) {
-		e.printStackTrace();
+	} catch (SecurityException se) {
+	    throw new ActionUnauthorizedException(se);
+	} catch (ObjectException e) {
 		UserMgrError ume = e.getPayload(UserMgrError.class);
 		String msg;
 		UserMgrErrorType error = (ume != null) ?
@@ -310,15 +289,13 @@
 		getLog().log(Level.SEVERE, err + msg, e);
     		deleteUserManagedObject(umo);
 		throw new ActionFailedException(err + msg);
-	    // Any other remaining exceptions
-	    } catch (Exception e) {
+	// Any other remaining exceptions
+	} catch (Exception e) {
 		String msg = Finder.getString("usermgr.error.system");
 		String err = Finder.getString(
 		    "usermgr.error.add", umo.getUsername());
 		getLog().log(Level.SEVERE, err + msg, e);
 		throw new ActionFailedException(err + msg);
-	    }
-	    umo.getChangeableAggregator().save();
 	}
     }
 
@@ -372,112 +349,53 @@
     }
 
     public List<Group> getGroups() {
-	try {
-	    return getUserMgrBean().getgroups();
-        } catch (ObjectException e) {
-            getLog().log(Level.SEVERE, "Error getting group list.", e);
-	}
-	return null;
+	return groupList;
     }
 
     public List<String> getSupplGroups() {
-	try {
-	    return getUserMgrBean().getsupplGroups();
-        } catch (ObjectException e) {
-            getLog().log(Level.SEVERE,
-	    "Error getting supplementary group list.", e);
-	}
-	return null;
+	return supplgroups;
     }
 
     public List<String> getShells() {
-	try {
-	    return getUserMgrBean().getshells();
-        } catch (ObjectException e) {
-            getLog().log(Level.SEVERE, "Error getting shell list.", e);
-	}
-	return null;
+        return shellList;
     }
 
     public List<String> getScopes() {
-	try {
-	    return getUserMgrBean().getscopes();
-        } catch (ObjectException e) {
-            getLog().log(Level.SEVERE, "Error getting  scopes list.", e);
-	}
-	return null;
+        return scopeList;
     }
 
     public List<String> getProfiles() {
-	try {
-	    return getUserMgrBean().getprofiles();
-        } catch (ObjectException e) {
-            getLog().log(Level.SEVERE, "Error getting profiles list.", e);
-	}
-	return null;
+        return profileList;
     }
 
     public List<String> getAuths() {
-	try {
-	    return getUserMgrBean().getauths();
-        } catch (ObjectException e) {
-            getLog().log(Level.SEVERE, "Error getting authorizations list.", e);
-	}
-	return null;
+        return authList;
     }
 
     public List<String> getRoles() {
-	try {
-	    return getUserMgrBean().getroles();
-        } catch (ObjectException e) {
-            getLog().log(Level.SEVERE, "Error getting roles list.", e);
-	}
-	return null;
-    }
-
-    public void setScope(String scope) {
-        ScopeType sType;
-	if (scope.equals(SCOPE_FILES)) {
-	    sType = ScopeType.FILES;
-	} else {
-	    sType = ScopeType.LDAP;
-	}
-
-	try {
-	    getUserMgrBean().setScope(sType);
-        } catch (Exception e) {
-            getLog().log(Level.SEVERE, "Error setting  scope.", e);
-	}
+        return roleList;
     }
 
     public UserImpl getDefaultUser() {
-	try {
-	    User defUser = getUserMgrBean().getdefaultUser();
-	    return new UserImpl(
+	UserImpl defaultUser = new UserImpl(
 		"", 0L, defUser.getGroupID(),
 		"", "", defUser.getDefaultShell(),
 		0, 0, 0, 0,
 		"", "", "", "", "", "",
 		"", "", "", "", "", "",
 		null, null, null, null, null, null);
-	} catch (ObjectException e) {
-	    getLog().log(Level.SEVERE, "Error getting default user.", e);
-	}
 
-	return null;
+        return defaultUser;
     }
 
     public void initUsers(String scopeStr,
-    		String typeStr, String matchStr) {
+    		String typeStr, String matchStr)
+		throws ActionFailedException {
 	int count = 0;
 	String statusStr;
 	String listTitle;
 
-	this.scopeStr = scopeStr;
-	this.typeStr = typeStr;
-	this.matchStr = matchStr;
 
-	setScope(scopeStr);
 
 	statusStr = Finder.getString("usermgr.status.scope") +
 	    " " + scopeStr;
@@ -489,15 +407,33 @@
 	    listTitle = Finder.getString("usermgr.list.title.role");
 	}
 
-	setFilter(uType, matchStr);
-	List<User> users = getUsers();
 
 	removeAllChildren();
 	try {
+	    UserMgrMXBean bean = getUserMgrBean();
+
+	    // Set scope only if the scope changed
+	    if (scopeStr.equals(this.scopeStr) == false) {
+		ScopeType sType;
+		if (scopeStr.equals(SCOPE_FILES)) {
+		    sType = ScopeType.FILES;
+		} else {
+		    sType = ScopeType.LDAP;
+		}
+		bean.selectScope(sType);
+		this.scopeStr = scopeStr;
+	    }
+
+	    setFilter(uType, matchStr);
+	    this.typeStr = typeStr;
+	    this.matchStr = matchStr;
+
+	    List<User> users = getUsers();
+
 	    boolean uTypeSet = false;
+
 	    for (User user : users) {
 		String username = user.getUsername();
-		UserMgrMXBean bean = getUserMgrBean();
 		if (uTypeSet == false) {
 		    uType = bean.getUserType(username);
 		    uTypeSet = true;
@@ -508,8 +444,19 @@
 		addChildren(umo);
 	    }
 
-	} catch (ObjectException e) {
-	    getLog().log(Level.SEVERE, "Error creating user list.", e);
+	    // Get Assignable Lists
+	    scopeList = bean.getscopes();
+	    groupList = bean.getgroups();
+	    shellList = bean.getshells();
+	    authList = bean.getauths();
+	    profileList = bean.getprofiles();
+	    roleList = bean.getroles();
+	    supplgroups = bean.getsupplGroups();
+	    defUser = bean.getdefaultUser();
+
+	} catch (Exception e) {
+	    String msg = Finder.getString("usermgr.error.system");
+	    throw new ActionFailedException(msg);
 	} finally {
 	    setStatusText(statusStr);
 	    if (mc != null) {
@@ -518,6 +465,28 @@
         }
     }
 
+    /*
+     * Solaris provides 3 levels of password change:
+     *  1. Can change any password
+     *  2. Can only set initial password
+     *  3. Cannot change any password
+     */
+    public boolean canChangePassword(UserManagedObject umo) {
+	String statusStr =  defUser.getAccountStatus();
+
+	if (statusStr.equals(PASSWORD)) {
+	    return true;
+	} else if (statusStr.equals(LOCKED)) {
+            return false;
+	} else if (statusStr.equals(NOTACTIVATED) && (umo == null ||
+		umo.getAccountStatus().equals(UNKNOWN) ||
+		umo.getAccountStatus().equals(NOTACTIVATED))) {
+	    return true;
+	}
+
+        return false;
+    }
+
     public boolean isTypeRole() {
         return (uType == UserType.ROLE ? true : false);
     }
@@ -539,11 +508,32 @@
         return (matchStr);
     }
 
+    /*
+     * Connection Listener interfaces
+     */
+
+    /*
+     * If a role assumption or user change occurs because
+     * of permission/auth failure, initialize the users list
+     */
+    public void connectionChanged(ConnectionEvent ce) {
+	try {
+	    initUsers(scopeStr, typeStr, matchStr);
+        } catch (Exception e) {
+            getLog().log(Level.SEVERE, "Error setting filter.", e);
+	}
+    }
+
+    public void connectionFailed(ConnectionEvent ce) {
+	setStatusText(Finder.getString("usermgr.error.connfailed"));
+    }
+
     //
     // Private methods
     //
 
     private List<User> getUsers() {
+
 	List<User> users = null;
 	try {
 	    users = getUserMgrBean().getusers();
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrUtils.java	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrUtils.java	Thu May 31 08:41:19 2012 -0700
@@ -75,7 +75,7 @@
     public static void validateUserDesc(String userdesc)
 	throws ActionFailedException {
 	// Ensure that the user description, if specified, is valid.
-	if (!isValidUserDesc(userdesc)) {
+	if (userdesc == null || !isValidUserDesc(userdesc)) {
 	    throw new ActionFailedException(
 		Finder.getString("usermgr.error.userdesc.bad"));
 	}
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-admrights.html	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-admrights.html	Thu May 31 08:41:19 2012 -0700
@@ -42,7 +42,7 @@
 granted to the current user.</p>
 
 <p>To assign a right, or multiple rights, to a user, select the
-right (or rights) from the Available Rights list, then click Addr. The granted right
+right (or rights) from the Available Rights list, then click Add. The granted right
 is displayed in the Granted Rights list.</p>
 
 <p>The assignment of rights have an order precedence. Use the Move Up and
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-advtab.html	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-advtab.html	Thu May 31 08:41:19 2012 -0700
@@ -4,28 +4,30 @@
  <html lang="en-US">
 
 <!--
- Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+CDDL HEADER START
 
- CDDL HEADER START
+The contents of this file are subject to the terms of the
+Common Development and Distribution License (the "License").
+You may not use this file except in compliance with the License.
 
-  The contents of this file are subject to the terms of the
-  Common Development and Distribution License (the "License").
-  You may not use this file except in compliance with the License.
- 
-  You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-  or http://www.opensolaris.org/os/licensing.
-  See the License for the specific language governing permissions
-  and limitations under the License.
- 
-  When distributing Covered Code, include this CDDL HEADER in each
-  file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-  If applicable, add the following below this CDDL HEADER, with the
-  fields enclosed by brackets "[]" replaced with your own identifying
-  information: Portions Copyright [yyyy] [name of copyright owner]
+You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+or http://www.opensolaris.org/os/licensing.
+See the License for the specific language governing permissions
+and limitations under the License.
 
- CDDL HEADER END
+When distributing Covered Code, include this CDDL HEADER in each
+file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+If applicable, add the following below this CDDL HEADER, with the
+fields enclosed by brackets "[]" replaced with your own identifying
+information: Portions Copyright [yyyy] [name of copyright owner]
+
+CDDL HEADER END
+
 -->
 
+<!--
+Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+-->
 <head>
 <!-- GenHTML revision 25226-->
 
@@ -38,10 +40,6 @@
 <p>You can use the Advanced Settings... dialog to assign additional security attributes to
 a user or role, for example, rights profiles, roles, and authorizations.</p>
 
-<p>To administer advanced settings for a <b>new</b> user or role, click the Advanced
-Settings... button in the New User... dialog, which opens the Advanced Settings panel
-for the new user or role.</p>
-
 <p>To administer advanced attributes for an <b>existing</b> user or role, select the user
 or role in the main User Manager panel, then click the Advanced Settings... button,
 which opens the Advanced Settings panel for the current user or role. The
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-moduser.html	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-moduser.html	Thu May 31 08:41:19 2012 -0700
@@ -4,26 +4,29 @@
  <html lang="en-US">
 
 <!--
- Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+CDDL HEADER START
 
- CDDL HEADER START
+The contents of this file are subject to the terms of the
+Common Development and Distribution License (the "License").
+You may not use this file except in compliance with the License.
+
+You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+or http://www.opensolaris.org/os/licensing.
+See the License for the specific language governing permissions
+and limitations under the License.
 
-  The contents of this file are subject to the terms of the
-  Common Development and Distribution License (the "License").
-  You may not use this file except in compliance with the License.
- 
-  You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-  or http://www.opensolaris.org/os/licensing.
-  See the License for the specific language governing permissions
-  and limitations under the License.
- 
-  When distributing Covered Code, include this CDDL HEADER in each
-  file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-  If applicable, add the following below this CDDL HEADER, with the
-  fields enclosed by brackets "[]" replaced with your own identifying
-  information: Portions Copyright [yyyy] [name of copyright owner]
+When distributing Covered Code, include this CDDL HEADER in each
+file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+If applicable, add the following below this CDDL HEADER, with the
+fields enclosed by brackets "[]" replaced with your own identifying
+information: Portions Copyright [yyyy] [name of copyright owner]
 
- CDDL HEADER END
+CDDL HEADER END
+
+-->
+
+<!--
+Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 -->
 
 <head>
@@ -43,7 +46,7 @@
 <p>After selecting the user, the right side of the panel is populated
 with the user's information. In this dialog you can modify any or all
 the information for a user or role. To save the changes, click Apply.
-As with the New User... dialog, click the Advanced Settings... button to modify additional security
+Click the Advanced Settings... button to modify additional security
 attributes for the user or role. See <a href="usermgr-advtab.html">Advanced Settings</a>.</p>
 
 <p>Clicking OK saves the changes and closes the User Manager panel. Click Cancel
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usrmgr-admrole.html	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usrmgr-admrole.html	Thu May 31 08:41:19 2012 -0700
@@ -50,7 +50,7 @@
 <p>To assign a role, or multiple roles, to a user, select the
 role (or roles) from the Available Roles list, then click Add. The role is
 displayed in the Assigned Roles list. To remove a role from the Assigned
-Roles list, select the group, then click Remove. Clicking the Add All or the
+Roles list, select the role, then click Remove. Clicking the Add All or the
 Remove All button adds or removes all of the roles that are assigned to
 the current user.</p>
 
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/resources/Resources.properties	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/resources/Resources.properties	Thu May 31 08:41:19 2012 -0700
@@ -139,4 +139,4 @@
 usermgr.error.passError = Password cannot be set
 usermgr.error.userExists = User exists
 usermgr.error.system = System Error
-
+usermgr.error.connfailed = Connection failed
--- a/components/visual-panels/usermgr/system-management-visual-panels-panel-usermgr.p5m	Wed May 30 16:11:52 2012 -0700
+++ b/components/visual-panels/usermgr/system-management-visual-panels-panel-usermgr.p5m	Thu May 31 08:41:19 2012 -0700
@@ -35,13 +35,12 @@
 
 dir path=usr
 dir path=usr/share
-#dir path=usr/share/applications
+dir path=usr/share/applications
 dir path=usr/share/vpanels
 dir path=usr/share/vpanels/app
 dir path=usr/share/vpanels/conf
 dir path=usr/share/vpanels/pixmaps
-#file path=usr/share/applications/vp-usermgr.desktop
+file path=usr/share/applications/vp-usermgr.desktop
 file path=usr/share/vpanels/app/vpanels-panels-usermgr.jar
-#file path=usr/share/vpanels/conf/usermgr.xml
+file path=usr/share/vpanels/conf/usermgr.xml
 file path=usr/share/vpanels/pixmaps/usermgr.png
-