You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by nm...@apache.org on 2019/09/27 19:26:26 UTC

svn commit: r1867648 - in /ofbiz/ofbiz-plugins/branches/release18.12/ecommerce: template/customer/ChangePassword.ftl template/customer/ViewProfile.ftl webapp/ecommerce/WEB-INF/controller.xml widget/CustomerScreens.xml

Author: nmalin
Date: Fri Sep 27 19:26:26 2019
New Revision: 1867648

URL: http://svn.apache.org/viewvc?rev=1867648&view=rev
Log:
Improved: Any ecommerce user has the ability to reset anothers password (including admin) via "Forget Your Password"
(OFBIZ-4361)

Update ecommerce plugin to use the forget passord process with jwtToken :
  * Add jwtToken managment on update password page
  * Change changepassword to passwordChange on controller for align with common-controller


Modified:
    ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/template/customer/ChangePassword.ftl
    ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/template/customer/ViewProfile.ftl
    ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
    ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/widget/CustomerScreens.xml

Modified: ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/template/customer/ChangePassword.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/template/customer/ChangePassword.ftl?rev=1867648&r1=1867647&r2=1867648&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/template/customer/ChangePassword.ftl (original)
+++ ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/template/customer/ChangePassword.ftl Fri Sep 27 19:26:26 2019
@@ -26,12 +26,16 @@ under the License.
     ${uiLabelMap.CommonSave}
     </a>
     <form id="changepasswordform" method="post" action="<@o...@ofbizUrl>">
+        <#if !parameters.TOKEN?has_content>
           <label class="mt-4 asteriskInput" for="currentPassword">${uiLabelMap.PartyOldPassword}</label>
           <div class="row">
             <div class="col-sm-6">
               <input type="password" class="form-control" name="currentPassword" autocomplete="off" id="currentPassword"/>
             </div>
           </div>
+        <#else>
+          <input type="hidden" name="TOKEN" value="${parameters.TOKEN}"/>
+        </#if>
           <label  class="required" for="newPassword">${uiLabelMap.PartyNewPassword}</label>
           <div class="row">
             <div class="col-sm-6">

Modified: ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/template/customer/ViewProfile.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/template/customer/ViewProfile.ftl?rev=1867648&r1=1867647&r2=1867648&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/template/customer/ViewProfile.ftl (original)
+++ ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/template/customer/ViewProfile.ftl Fri Sep 27 19:26:26 2019
@@ -379,7 +379,7 @@ under the License.
         <strong>${uiLabelMap.CommonUsername} &amp; ${uiLabelMap.CommonPassword}</strong>
       </div>
       <div class="col-lg-9 text-right">
-        <a href="<@o...@ofbizUrl>">${uiLabelMap.PartyChangePassword}</a>
+        <a href="<@o...@ofbizUrl>">${uiLabelMap.PartyChangePassword}</a>
       </div>
     </div>
   </div>

Modified: ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/webapp/ecommerce/WEB-INF/controller.xml?rev=1867648&r1=1867647&r2=1867648&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/webapp/ecommerce/WEB-INF/controller.xml (original)
+++ ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/webapp/ecommerce/WEB-INF/controller.xml Fri Sep 27 19:26:26 2019
@@ -1138,16 +1138,16 @@ under the License.
         <response name="error" type="view" value="viewprofile"/>
     </request-map>
 
-    <request-map uri="changepassword">
+    <request-map uri="passwordChange">
         <security https="true" auth="true"/>
-        <response name="success" type="view" value="changepassword"/>
+        <response name="success" type="view" value="passwordChange"/>
     </request-map>
 
     <request-map uri="updatePassword">
         <security https="true" auth="true"/>
         <event type="simple" path="component://securityext/minilang/login/LoginSimpleEvents.xml" invoke="updatePassword"/>
-        <response name="success" type="view" value="changepassword"/>
-        <response name="error" type="view" value="changepassword"/>
+        <response name="success" type="view" value="passwordChange"/>
+        <response name="error" type="view" value="passwordChange"/>
     </request-map>
 
     <request-map uri="forgotpassword">
@@ -1927,7 +1927,7 @@ under the License.
     <view-map name="editcreditcard" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#editcreditcard"/>
     <view-map name="editeftaccount" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#editeftaccount"/>
     <view-map name="editgiftcard" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#editgiftcard"/>
-    <view-map name="changepassword" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#changepassword"/>
+    <view-map name="passwordChange" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#passwordChange"/>
     <view-map name="editperson" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#editperson"/>
     <view-map name="giftcardbalance" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#giftcardbalance"/>
     <view-map name="giftcardlink" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#giftcardlink"/>

Modified: ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/widget/CustomerScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/widget/CustomerScreens.xml?rev=1867648&r1=1867647&r2=1867648&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/widget/CustomerScreens.xml (original)
+++ ofbiz/ofbiz-plugins/branches/release18.12/ecommerce/widget/CustomerScreens.xml Fri Sep 27 19:26:26 2019
@@ -122,7 +122,7 @@ under the License.
         </section>
     </screen>
 
-    <screen name="changepassword">
+    <screen name="passwordChange">
         <section>
             <actions>
                 <set field="titleProperty" value="PageTitleChangePassword"/>