You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2023/08/09 07:15:36 UTC

[syncope] branch master updated (051c5658e7 -> 0d4dd15eaf)

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git


    from 051c5658e7 Upgrading Swagger UI
     new 85c5325e82 Supporting mustChangePassword for User templates
     new 0d4dd15eaf Reverting docker-maven-plugin upgrade because of https://github.com/fabric8io/docker-maven-plugin/issues/1698

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../client/console/wizards/any/UserDetails.java    | 32 ++++++++++++----------
 .../client/console/wizards/any/UserDetails.html    |  4 +++
 .../provisioning/java/utils/TemplateUtils.java     |  8 ++++++
 pom.xml                                            |  2 +-
 4 files changed, 31 insertions(+), 15 deletions(-)


[syncope] 01/02: Supporting mustChangePassword for User templates

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 85c5325e82d9da54964f262e1e71e9b03d1063e6
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Wed Aug 9 09:10:26 2023 +0200

    Supporting mustChangePassword for User templates
---
 .../client/console/wizards/any/UserDetails.java    | 32 ++++++++++++----------
 .../client/console/wizards/any/UserDetails.html    |  4 +++
 .../provisioning/java/utils/TemplateUtils.java     |  8 ++++++
 3 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java
index 018373b106..aa5db4488b 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java
@@ -22,6 +22,7 @@ import java.util.List;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.client.ui.commons.Constants;
 import org.apache.syncope.client.ui.commons.ajax.markup.html.LabelInfo;
+import org.apache.syncope.client.ui.commons.markup.html.form.AjaxCheckBoxPanel;
 import org.apache.syncope.client.ui.commons.markup.html.form.AjaxTextFieldPanel;
 import org.apache.syncope.client.ui.commons.wicket.markup.html.bootstrap.tabs.Accordion;
 import org.apache.syncope.client.ui.commons.wizards.any.PasswordPanel;
@@ -43,25 +44,22 @@ public class UserDetails extends Details<UserTO> {
 
     private static final long serialVersionUID = 6592027822510220463L;
 
-    private static final String PASSWORD_CONTENT_PATH = "body:content";
-
-    protected final AjaxTextFieldPanel username;
-
-    protected final UserTO userTO;
-
     public UserDetails(
             final UserWrapper wrapper,
             final boolean templateMode,
             final boolean includeStatusPanel,
             final boolean showPasswordManagement,
             final PageReference pageRef) {
+
         super(wrapper, templateMode, includeStatusPanel, pageRef);
 
-        userTO = wrapper.getInnerObject();
+        UserTO userTO = wrapper.getInnerObject();
+
         // ------------------------
         // Username
         // ------------------------
-        username = new AjaxTextFieldPanel(Constants.USERNAME_FIELD_NAME, Constants.USERNAME_FIELD_NAME,
+        AjaxTextFieldPanel username = new AjaxTextFieldPanel(
+                Constants.USERNAME_FIELD_NAME, Constants.USERNAME_FIELD_NAME,
                 new PropertyModel<>(userTO, Constants.USERNAME_FIELD_NAME), false);
 
         if (wrapper.getPreviousUserTO() != null && StringUtils.compare(
@@ -78,6 +76,15 @@ public class UserDetails extends Details<UserTO> {
         add(username);
         // ------------------------
 
+        // ------------------------
+        // mustChangePassword
+        // ------------------------
+        AjaxCheckBoxPanel mustChangePassword = new AjaxCheckBoxPanel(
+                "mustChangePassword", "mustChangePassword", new PropertyModel<>(userTO, "mustChangePassword"));
+
+        add(mustChangePassword.setOutputMarkupPlaceholderTag(true).setVisible(templateMode));
+        // ------------------------
+
         // ------------------------
         // Password
         // ------------------------
@@ -107,7 +114,7 @@ public class UserDetails extends Details<UserTO> {
                     @Override
                     public void onClick(final AjaxRequestTarget target) {
                         model.setObject(model.getObject() == 0 ? -1 : 0);
-                        Component passwordPanel = getParent().get(PASSWORD_CONTENT_PATH);
+                        Component passwordPanel = getParent().get("body:content");
                         passwordPanel.setEnabled(model.getObject() >= 0);
                         target.add(passwordPanel);
                     }
@@ -118,7 +125,7 @@ public class UserDetails extends Details<UserTO> {
         accordion.setOutputMarkupId(true);
         accordion.setVisible(showPasswordManagement);
         add(accordion);
-        // ------------------------        
+        // ------------------------
     }
 
     @Override
@@ -130,10 +137,7 @@ public class UserDetails extends Details<UserTO> {
 
         private static final long serialVersionUID = -8198836979773590078L;
 
-        public EditUserPasswordPanel(
-                final String id,
-                final UserWrapper wrapper,
-                final boolean templateMode) {
+        public EditUserPasswordPanel(final String id, final UserWrapper wrapper, final boolean templateMode) {
             super(id);
             setOutputMarkupId(true);
             add(new Label("warning", new ResourceModel("password.change.warning")));
diff --git a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/wizards/any/UserDetails.html b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/wizards/any/UserDetails.html
index 3812011b93..cf9dcc7703 100644
--- a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/wizards/any/UserDetails.html
+++ b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/wizards/any/UserDetails.html
@@ -22,6 +22,10 @@ under the License.
       <span wicket:id="username"/>
     </div>
 
+    <div class="form-group">
+      <span wicket:id="mustChangePassword"/>
+    </div>
+
     <div wicket:id="accordionPanel"></div>
   </wicket:extend>
 </html>
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/utils/TemplateUtils.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/utils/TemplateUtils.java
index 7d063de1f8..28f0bb3ea3 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/utils/TemplateUtils.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/utils/TemplateUtils.java
@@ -176,6 +176,14 @@ public class TemplateUtils {
                 }
             }
 
+            if (((UserTO) template).isMustChangePassword()) {
+                if (realmMember instanceof UserTO) {
+                    ((UserTO) realmMember).setMustChangePassword(true);
+                } else if (realmMember instanceof UserCR) {
+                    ((UserCR) realmMember).setMustChangePassword(true);
+                }
+            }
+
             fillRelationships((GroupableRelatableTO) realmMember, ((GroupableRelatableTO) template));
             fillMemberships((GroupableRelatableTO) realmMember, ((GroupableRelatableTO) template));
 


[syncope] 02/02: Reverting docker-maven-plugin upgrade because of https://github.com/fabric8io/docker-maven-plugin/issues/1698

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 0d4dd15eaf8fdfe190cf0099e9ae973380f4c74f
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Wed Aug 9 09:09:56 2023 +0200

    Reverting docker-maven-plugin upgrade because of https://github.com/fabric8io/docker-maven-plugin/issues/1698
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 77e130488f..a3d6ec1679 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1583,7 +1583,7 @@ under the License.
         <plugin>
           <groupId>io.fabric8</groupId>
           <artifactId>docker-maven-plugin</artifactId>
-          <version>0.43.2</version>
+          <version>0.43.0</version>
         </plugin>
 
         <plugin>