You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by pr...@apache.org on 2016/05/16 12:34:36 UTC

svn commit: r1744041 - in /ofbiz/trunk/specialpurpose/webpos: template/ForgotPassword.ftl template/GetSecurityQuestion.ftl template/Login.ftl webapp/webpos/WEB-INF/controller.xml widget/CommonScreens.xml

Author: pranayp
Date: Mon May 16 12:34:36 2016
New Revision: 1744041

URL: http://svn.apache.org/viewvc?rev=1744041&view=rev
Log:
[OFBIZ-7042]  Fixed "Forgot your password" process for Web POS. On clicking "Forgot your password" link from Web POS login page, system was navigating to blank page.

Thanks Amardeep Singh Jhajj for reporting the issue and providing patch for the same.

Added:
    ofbiz/trunk/specialpurpose/webpos/template/ForgotPassword.ftl
    ofbiz/trunk/specialpurpose/webpos/template/GetSecurityQuestion.ftl
Modified:
    ofbiz/trunk/specialpurpose/webpos/template/Login.ftl
    ofbiz/trunk/specialpurpose/webpos/webapp/webpos/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/webpos/widget/CommonScreens.xml

Added: ofbiz/trunk/specialpurpose/webpos/template/ForgotPassword.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/template/ForgotPassword.ftl?rev=1744041&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/webpos/template/ForgotPassword.ftl (added)
+++ ofbiz/trunk/specialpurpose/webpos/template/ForgotPassword.ftl Mon May 16 12:34:36 2016
@@ -0,0 +1,47 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<center>
+  <div class="screenlet login-screenlet">
+    <div class="screenlet-title-bar">
+      <h3>${uiLabelMap.CommonForgotYourPassword}?</h3>
+    </div>
+    <div class="screenlet-body">
+      <form method="post" action="<@o...@ofbizUrl>" name="getSecurityQuestion">
+        <table class="basic-table" cellspacing="0">
+          <tr>
+            <td class="label">${uiLabelMap.CommonUsername}</td>
+            <td><input class="required" type="text" size="20" name="USERNAME" value="<#if requestParameters.USERNAME?has_content>${requestParameters.USERNAME}<#elseif autoUserLogin?has_content>${autoUserLogin.userLoginId}</#if>"/></td>
+          </tr>
+          <tr>
+            <td colspan="2" align="center">
+              <input type="submit" class="smallSubmit" value="${uiLabelMap.CommonContinue}"/>
+            </td>
+          </tr>
+          <tr>
+            <td colspan="2" align="center">
+              <a href='<@o...@ofbizUrl>' class="buttontext">${uiLabelMap.CommonGoBack}</a>
+            </td>
+          </tr>
+        </table>
+        <input type="hidden" name="JavaScriptEnabled" value="N"/>
+      </form>
+    </div>
+  </div>
+</center>

Added: ofbiz/trunk/specialpurpose/webpos/template/GetSecurityQuestion.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/template/GetSecurityQuestion.ftl?rev=1744041&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/webpos/template/GetSecurityQuestion.ftl (added)
+++ ofbiz/trunk/specialpurpose/webpos/template/GetSecurityQuestion.ftl Mon May 16 12:34:36 2016
@@ -0,0 +1,77 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<center>
+  <div class="screenlet login-screenlet">
+    <div class="screenlet-title-bar">
+      <#if securityQuestion?has_content>
+        <h3>${uiLabelMap.AnswerSecurityQuestion}</h3>
+      <#else>
+        <h3>${uiLabelMap.CommonForgotYourPassword}</h3>
+      </#if>
+    </div>
+    <div class="screenlet-body">
+      <form method="post" action="<@o...@ofbizUrl>" name="forgotpassword">
+        <table class="basic-table" cellspacing="0">
+          <#if userLoginId?has_content>
+            <#if securityQuestion?has_content>
+              <tr>
+                <td class="label">${uiLabelMap.SecurityQuestion}</td>
+                <td>
+                   ${securityQuestion.description!}
+                   <input type="hidden" name="securityQuestion" value="${securityQuestion.enumId!}" />
+                   <input type="hidden" name="USERNAME" value="${userLoginId!}" />
+                </td>
+              </tr>
+              <tr>
+                <td class="label">${uiLabelMap.SecurityAnswer}</td>
+                <td>
+                  <input type="text" name="securityAnswer" class="" value="" />&nbsp;
+                </td>
+              </tr>
+            <#else>
+              <tr>
+                <td class="label">${uiLabelMap.CommonUsername}</td>
+                <td><input type="text" size="20" name="USERNAME" value="<#if requestParameters.USERNAME?has_content>${requestParameters.USERNAME}<#elseif autoUserLogin?has_content>${autoUserLogin.userLoginId}</#if>" /></td>
+              </tr>
+            </#if>
+            <tr>
+              <td colspan="2" align="center">
+                <input type="submit" name="GET_PASSWORD_HINT" class="smallSubmit" value="${uiLabelMap.CommonGetPasswordHint}" />&nbsp;
+                <input type="submit" name="EMAIL_PASSWORD" class="smallSubmit" value="${uiLabelMap.CommonEmailPassword}" />
+              </td>
+            </tr>
+          <#else>
+            <tr>
+              <td colspan="2" align="center">
+                ${uiLabelMap.PartyUserLoginMissingError}
+              </td>
+            </tr>
+          </#if>
+          <tr>
+            <td colspan="2" align="center">
+              <a href='#' class="buttontext" onclick="window.history.back();">${uiLabelMap.CommonGoBack}</a>
+            </td>
+          </tr>
+        </table>
+        <input type="hidden" name="JavaScriptEnabled" value="N" />
+      </form>
+    </div>
+  </div>
+</center>
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/webpos/template/Login.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/template/Login.ftl?rev=1744041&r1=1744040&r2=1744041&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/webpos/template/Login.ftl (original)
+++ ofbiz/trunk/specialpurpose/webpos/template/Login.ftl Mon May 16 12:34:36 2016
@@ -66,7 +66,7 @@ under the License.
         </table>
         <input type="hidden" name="JavaScriptEnabled" value="N"/>
         <br/>
-        <a href="<@o...@ofbizUrl>">${uiLabelMap.CommonForgotYourPassword}?</a>
+        <a href="<@o...@ofbizUrl>">${uiLabelMap.CommonForgotYourPassword}?</a>
       </form>
     </div>
   </div>
@@ -79,4 +79,4 @@ under the License.
   <#else>
     document.loginform.PASSWORD.focus();
   </#if>
-</script>
\ No newline at end of file
+</script>

Modified: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/WEB-INF/controller.xml?rev=1744041&r1=1744040&r2=1744041&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/WEB-INF/controller.xml Mon May 16 12:34:36 2016
@@ -461,6 +461,20 @@
         <response name="success" type="request" value="json"/>
         <response name="error" type="request" value="json"/>
     </request-map>
+    <request-map uri="ForgotPassword_step1">
+        <security https="true" auth="false"/>
+        <response name="success" type="view" value="ForgotPassword_step1"/>
+    </request-map>
+    <request-map uri="ForgotPassword_step2">
+        <security auth="false" https="true"></security>
+        <response name="success" type="view" value="ForgotPassword_step2" />
+    </request-map>
+    <request-map uri="ForgotPassword_step3">
+        <security https="true" auth="false"/>
+         <event type="java" path="org.ofbiz.securityext.login.LoginEvents" invoke="forgotPassword"/>
+        <response name="success" type="view" value="Login"/>
+        <response name="error" type="view" value="ForgotPassword_step2"/>
+    </request-map>
     <!-- end of Ajax requests -->
     
     <!-- View Mappings -->
@@ -485,5 +499,7 @@
     <view-map name="SearchSalesRepsList" type="screen" page="component://webpos/widget/SearchScreens.xml#SearchSalesRepsList"/>
     <view-map name="SideDeepCategory" type="screen" page="component://webpos/widget/CatalogScreens.xml#SideDeepCategory"/>
     <view-map name="CategoryDetail" type="screen" page="component://webpos/widget/CatalogScreens.xml#CategoryDetail"/>
+    <view-map name="ForgotPassword_step1" type="screen" page="component://webpos/widget/CommonScreens.xml#ForgotPassword_step1"/>
+    <view-map name="ForgotPassword_step2" type="screen" page="component://webpos/widget/CommonScreens.xml#ForgotPassword_step2"/>
     <!-- End of View Mappings -->
 </site-conf>
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/webpos/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/widget/CommonScreens.xml?rev=1744041&r1=1744040&r2=1744041&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/webpos/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/webpos/widget/CommonScreens.xml Mon May 16 12:34:36 2016
@@ -267,4 +267,40 @@ under the License.
             </widgets>
         </section>
     </screen>
+    <screen name="ForgotPassword_step1">
+        <section>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <platform-specific>
+                            <html><html-template location="component://webpos/template/ForgotPassword.ftl"/></html>
+                        </platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="ForgotPassword_step2">
+        <section>
+            <actions>
+                <set field="userLoginId" from-field="parameters.USERNAME"/>
+                <entity-and entity-name="UserLoginSecurityQuestion" list="securityQuestions">
+                    <field-map field-name="userLoginId" />
+                </entity-and>
+                <set field="questionEnumId" from-field="securityQuestions[0].questionEnumId" />
+                <entity-one entity-name="Enumeration" value-field="securityQuestion">
+                    <field-map field-name="enumId" from-field="questionEnumId"/>
+                </entity-one>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <platform-specific>
+                            <html><html-template location="component://webpos/template/GetSecurityQuestion.ftl"/></html>
+                        </platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>