use of com.sun.web.ui.view.html.CCPassword in project OpenAM by OpenRock.
the class ServerEditViewBeanBase method getAttributeValues.
protected Map<String, String> getAttributeValues() {
Map<String, String> map = new HashMap<String, String>();
for (String uiName : activePropertyNames) {
View view = getChild(uiName);
String value;
if (view instanceof CCEditableList) {
CCEditableList list = (CCEditableList) view;
list.restoreStateData();
// Create a comma delimited String from the items in the OptionList for storage.
value = StringUtils.join(getValues(list.getModel().getOptionList()), ",");
} else {
value = (String) getDisplayFieldValue(uiName);
}
String propertyName = getActualPropertyName(uiName);
if (view instanceof CCCheckBox) {
value = (value.equals("true")) ? ServerPropertyValidator.getTrueValue(propertyName) : ServerPropertyValidator.getFalseValue(propertyName);
}
if (view instanceof CCPassword) {
// encrypt and include in the map of attribute values to save
if (!AMPropertySheetModel.passwordRandom.equals(value)) {
value = AccessController.doPrivileged(new EncodeAction(value));
map.put(propertyName, value);
}
} else {
map.put(propertyName, value);
}
}
return map;
}
use of com.sun.web.ui.view.html.CCPassword in project OpenAM by OpenRock.
the class UMChangeUserPasswordViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
UMChangeUserPasswordModel model = (UMChangeUserPasswordModel) getModel();
String userId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
if (userId == null) {
userId = model.getUserName();
}
String loggedinUser = model.getUserName();
//is same as logged in user
if (model.isOldPasswordRequired() && LDAPUtils.rdnValueFromDn(userId).equalsIgnoreCase(LDAPUtils.rdnValueFromDn(loggedinUser))) {
oldapicall = false;
} else {
CCPassword pwdtag = (CCPassword) getChild(ATTR_OLD_PASSWORD);
pwdtag.setDisabled(true);
oldapicall = true;
}
String[] arg = { AMFormatUtils.getIdentityDisplayName(model, userId) };
ptModel.setPageTitleText(MessageFormat.format(model.getLocalizedString("page.title.user.change.password"), (Object[]) arg));
}
Aggregations