Open GoogleCodeExporter opened 9 years ago
I've come up with a solution to this, it seems the form data loading has
changed and the GuestRegistrationServlet has not been updated to continue.
Below is the svn diff to fix it. (also included some java 6 type warning fixes)
Index: src/password/pwm/http/PwmRequest.java
===================================================================
--- src/password/pwm/http/PwmRequest.java (revision 765)
+++ src/password/pwm/http/PwmRequest.java (working copy)
@@ -569,9 +569,9 @@
final boolean readOnly,
final boolean showPasswordFields
) {
- final LinkedHashMap<FormConfiguration,String> formDataMapValue =
formDataMap == null
+ final LinkedHashMap<FormConfiguration,String> formDataMapValue = (
formDataMap == null )
? new LinkedHashMap<FormConfiguration,String>()
- : new LinkedHashMap<>(formDataMap);
+ : new LinkedHashMap<FormConfiguration,String>(formDataMap);
this.setAttribute(PwmConstants.REQUEST_ATTR.FormConfiguration, new ArrayList<>(formConfiguration));
this.setAttribute(PwmConstants.REQUEST_ATTR.FormData, formDataMapValue);
Index: src/password/pwm/http/servlet/GuestRegistrationServlet.java
===================================================================
--- src/password/pwm/http/servlet/GuestRegistrationServlet.java (revision 765)
+++ src/password/pwm/http/servlet/GuestRegistrationServlet.java (working copy)
@@ -287,7 +287,7 @@
final FormMap formProps = guBean.getFormValues();
try {
final List<FormConfiguration> guestUpdateForm = config.readSettingAsForm(PwmSetting.GUEST_UPDATE_FORM);
- final Set<String> involvedAttrs = new HashSet<>();
+ final Set<String> involvedAttrs = new HashSet<String>();
for (final FormConfiguration formItem : guestUpdateForm) {
if (!formItem.getName().equalsIgnoreCase(HTTP_PARAM_EXPIRATION_DATE)) {
involvedAttrs.add(formItem.getName());
@@ -296,7 +296,7 @@
final UserDataReader userDataReader = LdapUserDataReader.selfProxiedReader(pwmApplication, pwmSession,
theGuest);
final Map<String,String> userAttrValues = userDataReader.readStringAttributes(involvedAttrs);
- if (origAdminOnly && adminDnAttribute != null &&
adminDnAttribute.length() > 0) {
+ if (origAdminOnly && (adminDnAttribute != null) &&
adminDnAttribute.length() > 0) {
final String origAdminDn = userAttrValues.get(adminDnAttribute);
if (origAdminDn != null && origAdminDn.length() > 0) {
if (!pwmSession.getUserInfoBean().getUserIdentity().getUserDN().equalsIgnoreCase(origAdminDn)) {
@@ -315,16 +315,19 @@
}
}
+ final Map<FormConfiguration, String> formData = new
HashMap<FormConfiguration, String>();
for (final FormConfiguration formItem : guestUpdateForm) {
final String key = formItem.getName();
final String value = userAttrValues.get(key);
if (value != null) {
formProps.put(key, value);
+ formData.put(formItem, value);
}
}
guBean.setUpdateUserIdentity(theGuest);
+ pwmRequest.addFormInfoToRequestAttr(guestUpdateForm, formData,
false, false);
pwmRequest.forwardToJsp(PwmConstants.JSP_URL.GUEST_UPDATE);
return;
} catch (ChaiOperationException e) {
Original comment by will.d...@gmail.com
on 29 Mar 2015 at 11:49
Original issue reported on code.google.com by
will.d...@gmail.com
on 27 Mar 2015 at 4:05