components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/AddUserAction.java
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/AddUserAction.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/AddUserAction.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.usermgr.client.swing;
@@ -30,6 +30,7 @@
import java.util.List;
import javax.swing.*;
import javax.swing.text.JTextComponent;
+import com.oracle.solaris.rad.client.ADRUinteger;
import com.oracle.solaris.vp.panel.common.action.*;
import com.oracle.solaris.vp.panel.common.control.*;
import com.oracle.solaris.vp.panel.swing.action.AddManagedObjectAction;
@@ -52,7 +53,7 @@
<UserManagedObject, AddUserAction.Data, UserManagedObject> {
private UserManagedObject umo = null;
- private UserImpl user = null;
+ private User user = null;
//
// Inner classes
@@ -76,10 +77,10 @@
public MutableProperty<String> groupProperty = new StringProperty();
public MutableProperty<String> homeProperty = new StringProperty();
public MutableProperty<String> shellProperty = new StringProperty();
- public MutableProperty<char[]> passProperty =
- new BasicMutableProperty<char[]>();
- public MutableProperty<char[]> passConfirmProperty =
- new BasicMutableProperty<char[]>();
+ public MutableProperty<String> passProperty =
+ new BasicMutableProperty<String>();
+ public MutableProperty<String> passConfirmProperty =
+ new BasicMutableProperty<String>();
private JOptionPane pane;
private JDialog dialog;
@@ -102,7 +103,7 @@
title);
}
- private JPanel createForm() {
+ private JPanel createForm() {
ActionListener listener =
new ActionListener() {
@Override
@@ -210,7 +211,7 @@
for (Group g : descriptor.getGroups()) {
groupCombo.addItem(g.getGroupName());
- if (user.getGroupID() == g.getGroupID()) {
+ if (user.getGroupID().equals(g.getGroupID())) {
groupCombo.setSelectedItem(g.getGroupName());
}
}
@@ -265,13 +266,13 @@
gbc.gridx = GridBagConstraints.RELATIVE;
form.add(shellCombo, gbc);
- // Password
+ // Password
actString = new ActionString("usermgr.basic.label.pass");
JLabel passLabel = new JLabel(actString.getString());
passLabel.setDisplayedMnemonic(actString.getMnemonic());
- JPasswordField passField = new JPasswordField(width);
- passField.addActionListener(listener);
+ JPasswordField passField = new JPasswordField(width);
+ passField.addActionListener(listener);
new PasswordFieldPropertySynchronizer(passProperty, passField, false);
// Connect the label to the field
@@ -377,11 +378,9 @@
@Override
public UserManagedObject workBusy(List<UserManagedObject> selection,
- Data uData) throws ActionFailedException,
- ActionAbortedException,
+ Data uData) throws ActionFailedException, ActionAbortedException,
ActionUnauthorizedException {
-
UserMgrPanelDescriptor descriptor = control.getPanelDescriptor();
String username = uData.nameProperty.getValue();
@@ -394,8 +393,8 @@
String shell = uData.shellProperty.getValue();
String homedir = uData.homeProperty.getValue();
- char[] password = uData.passProperty.getValue();
- char[] password2 = uData.passConfirmProperty.getValue();
+ String password = uData.passProperty.getValue();
+ String password2 = uData.passConfirmProperty.getValue();
UserMgrUtils.validatePassword(true, password, password2);
UserMgrUtils.clearPassword(password2);
@@ -403,7 +402,7 @@
user.setUsername(username);
if (uData.uidProperty.isChanged()) {
long uid = uData.uidProperty.getValue();
- user.setUserID(uid);
+ user.setUserID(new ADRUinteger(uid));
}
user.setDescription(description);