فهرست منبع

fix issue with ldap profile data not loading

Jason Rivard 7 سال پیش
والد
کامیت
4b7aa4e910

+ 2 - 51
server/src/main/java/password/pwm/http/bean/UpdateProfileBean.java

@@ -23,6 +23,7 @@
 package password.pwm.http.bean;
 
 import com.google.gson.annotations.SerializedName;
+import lombok.Data;
 import password.pwm.bean.TokenVerificationProgress;
 import password.pwm.config.option.SessionBeanMode;
 
@@ -33,7 +34,7 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;
 
-
+@Data
 public class UpdateProfileBean extends PwmSessionBean
 {
 
@@ -60,62 +61,12 @@ public class UpdateProfileBean extends PwmSessionBean
         return Type.AUTHENTICATED;
     }
 
-    public boolean isAgreementPassed( )
-    {
-        return agreementPassed;
-    }
-
-    public void setAgreementPassed( final boolean agreementPassed )
-    {
-        this.agreementPassed = agreementPassed;
-    }
-
-    public boolean isFormLdapLoaded( )
-    {
-        return formLdapLoaded;
-    }
-
-    public void setFormLdapLoaded( final boolean formLdapLoaded )
-    {
-        this.formLdapLoaded = formLdapLoaded;
-    }
-
-    public Map<String, String> getFormData( )
-    {
-        return formData;
-    }
-
-    public boolean isConfirmationPassed( )
-    {
-        return confirmationPassed;
-    }
-
-    public void setConfirmationPassed( final boolean confirmationPassed )
-    {
-        this.confirmationPassed = confirmationPassed;
-    }
-
-    public boolean isFormSubmitted( )
-    {
-        return formSubmitted;
-    }
-
-    public void setFormSubmitted( final boolean formSubmitted )
-    {
-        this.formSubmitted = formSubmitted;
-    }
-
     @Override
     public Set<SessionBeanMode> supportedModes( )
     {
         return Collections.unmodifiableSet( new HashSet<>( Arrays.asList( SessionBeanMode.LOCAL, SessionBeanMode.CRYPTCOOKIE ) ) );
     }
 
-    public TokenVerificationProgress getTokenVerificationProgress( )
-    {
-        return tokenVerificationProgress;
-    }
-
     public void clearTokenVerificationProgress( )
     {
         tokenVerificationProgress = new TokenVerificationProgress();

+ 4 - 4
server/src/main/java/password/pwm/http/servlet/UpdateProfileServlet.java

@@ -149,7 +149,7 @@ public class UpdateProfileServlet extends ControlledPwmServlet
     ProcessStatus handleEnterCodeRequest(
             final PwmRequest pwmRequest
     )
-            throws PwmUnrecoverableException, IOException, ServletException, ChaiUnavailableException
+            throws PwmUnrecoverableException
     {
         final PwmApplication pwmApplication = pwmRequest.getPwmApplication();
         final UpdateProfileBean updateProfileBean = getBean( pwmRequest );
@@ -298,7 +298,7 @@ public class UpdateProfileServlet extends ControlledPwmServlet
     ProcessStatus handleUpdateProfileRequest(
             final PwmRequest pwmRequest
     )
-            throws PwmUnrecoverableException, ChaiUnavailableException, IOException, ServletException
+            throws PwmUnrecoverableException, ChaiUnavailableException
     {
         final UpdateProfileBean updateProfileBean = getBean( pwmRequest );
         final UpdateAttributesProfile updateAttributesProfile = getProfile( pwmRequest );
@@ -319,7 +319,7 @@ public class UpdateProfileServlet extends ControlledPwmServlet
     }
 
     protected void nextStep( final PwmRequest pwmRequest )
-            throws IOException, ServletException, PwmUnrecoverableException, ChaiUnavailableException
+            throws IOException, ServletException, PwmUnrecoverableException
     {
         final PwmApplication pwmApplication = pwmRequest.getPwmApplication();
         final UpdateProfileBean updateProfileBean = getBean( pwmRequest );
@@ -331,7 +331,7 @@ public class UpdateProfileServlet extends ControlledPwmServlet
                 pwmSession.getSessionStateBean().getLocale()
         );
 
-        if ( updateProfileAgreementText != null && updateProfileAgreementText.length() > 0 )
+        if ( !StringUtil.isEmpty( updateProfileAgreementText ) )
         {
             if ( !updateProfileBean.isAgreementPassed() )
             {

+ 1 - 1
server/src/main/java/password/pwm/util/form/FormUtility.java

@@ -523,7 +523,7 @@ public class FormUtility
         {
             for ( final FormConfiguration formConfiguration : formFields )
             {
-                if ( formConfiguration.getSource() == FormConfiguration.Source.ldap )
+                if ( formConfiguration.getSource() == FormConfiguration.Source.ldap || formConfiguration.getSource() == null )
                 {
                     final String attribute = formConfiguration.getName();
                     if ( formConfiguration.isMultivalue() )