Author: jacopoc
Date: Fri May 11 19:36:50 2012 New Revision: 1337345 URL: http://svn.apache.org/viewvc?rev=1337345&view=rev Log: Applied fix from trunk for revision: 1337202 === Completed migration to new captcha event implemented by Scott; removed old artifacts; removed tempfiles webapp that was causing the error reported in OFBIZ-4856 Removed: ofbiz/branches/release11.04/specialpurpose/myportal/widget/reloadCaptchaCode.ftl ofbiz/branches/release11.04/specialpurpose/myportal/widget/reloadCaptchaImage.ftl Modified: ofbiz/branches/release11.04/ (props changed) ofbiz/branches/release11.04/framework/images/ofbiz-component.xml ofbiz/branches/release11.04/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml ofbiz/branches/release11.04/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml ofbiz/branches/release11.04/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml ofbiz/branches/release11.04/specialpurpose/myportal/widget/CommonScreens.xml ofbiz/branches/release11.04/specialpurpose/myportal/widget/RegisterPerson.ftl Propchange: ofbiz/branches/release11.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1337202 Modified: ofbiz/branches/release11.04/framework/images/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/images/ofbiz-component.xml?rev=1337345&r1=1337344&r2=1337345&view=diff ============================================================================== --- ofbiz/branches/release11.04/framework/images/ofbiz-component.xml (original) +++ ofbiz/branches/release11.04/framework/images/ofbiz-component.xml Fri May 11 19:36:50 2012 @@ -28,11 +28,5 @@ under the License. location="webapp/images" mount-point="/images" app-bar-display="false"/> - <webapp name="tempfiles" - title="temporary files" - server="default-server" - location="../../runtime/tempfiles" - mount-point="/tempfiles" - app-bar-display="false"/> </ofbiz-component> Modified: ofbiz/branches/release11.04/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml?rev=1337345&r1=1337344&r2=1337345&view=diff ============================================================================== --- ofbiz/branches/release11.04/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml (original) +++ ofbiz/branches/release11.04/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml Fri May 11 19:36:50 2012 @@ -1943,15 +1943,6 @@ under the License. <response name="success" type="none"/> </request-map> - <request-map uri="reloadCaptchaImage"> - <security https="true" auth="false"/> - <response name="success" type="view" value="reloadCaptchaImage"/> - </request-map> - <request-map uri="reloadCaptchaCode"> - <security https="true" auth="false"/> - <response name="success" type="view" value="reloadCaptchaCode"/> - </request-map> - <!-- End of Request Mappings --> <!-- View Mappings --> @@ -2101,8 +2092,5 @@ under the License. <!-- Contact List --> <view-map name="ContactListOptOut" type="screen" page="component://marketing/widget/ContactListScreens.xml#OptOutResponse"/> - <!-- Captcha --> - <view-map name="reloadCaptchaImage" type="screen" page="component://myportal/widget/CommonScreens.xml#reloadCaptchaImage"/> - <view-map name="reloadCaptchaCode" type="screen" page="component://myportal/widget/CommonScreens.xml#reloadCaptchaCode"/> <!-- End of View Mappings --> </site-conf> Modified: ofbiz/branches/release11.04/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml?rev=1337345&r1=1337344&r2=1337345&view=diff ============================================================================== --- ofbiz/branches/release11.04/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml (original) +++ ofbiz/branches/release11.04/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml Fri May 11 19:36:50 2012 @@ -46,10 +46,10 @@ under the License. <now-timestamp field="nowStamp"/> <call-object-method obj-field="parameters.PASSWORD" method-name="toLowerCase" ret-field="parameters.PASSWORD"/> <call-object-method obj-field="parameters.CONFIRM_PASSWORD" method-name="toLowerCase" ret-field="parameters.CONFIRM_PASSWORD"/> - <call-object-method obj-field="parameters.captcha" method-name="toLowerCase" ret-field="parameters.captcha"/> - <call-object-method obj-field="parameters.captchaCode" method-name="toLowerCase" ret-field="parameters.captchaCode"/> + <call-object-method obj-field="parameters.captcha" method-name="toLowerCase" ret-field="submittedCaptcha"/> + <script>groovy: context.actualCaptcha = request.getSession().getAttribute("_CAPTCHA_CODE_")?.toLowerCase()</script> <if-compare field="parameters.PASSWORD" value="${parameters.CONFIRM_PASSWORD}" operator="equals"> - <if-compare field="parameters.captcha" value="${parameters.captchaCode}" operator="equals"> + <if-compare-field operator="equals" field="submittedCaptcha" to-field="actualCaptcha"> <!-- Create user login and Person --> <find-by-primary-key entity-name="UserLogin" map="userLoginContext" value-field="existingUserLogin"/> @@ -131,7 +131,7 @@ under the License. <else> <property-to-field field="errorMessage" resource="MyPortalUiLabels" property="MyPortalCaptchaMissingError"/><field-to-list field="errorMessage" list="error_list"/> </else> - </if-compare> + </if-compare-field> <else> <property-to-field field="errorMessage" resource="PartyUiLabels" property="PartyPasswordMatchError"/><field-to-list field="errorMessage" list="error_list"/> </else> Modified: ofbiz/branches/release11.04/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml?rev=1337345&r1=1337344&r2=1337345&view=diff ============================================================================== --- ofbiz/branches/release11.04/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml (original) +++ ofbiz/branches/release11.04/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml Fri May 11 19:36:50 2012 @@ -47,13 +47,12 @@ <response name="error" type="view" value="newRegisterLogin"/> <response name="resultPage" type="view" value="newRegisterLogin"/> </request-map> - <request-map uri="reloadCaptchaImage"> - <security https="true" auth="false"/> - <response name="success" type="view" value="reloadCaptchaImage"/> - </request-map> - <request-map uri="reloadCaptchaCode"> + + <!-- Captcha: Image request, the captcha code is stored in the session using _CAPTCHA_CODE_ as the key --> + <request-map uri="captcha.jpg"> <security https="true" auth="false"/> - <response name="success" type="view" value="reloadCaptchaCode"/> + <event type="java" path="org.ofbiz.common.CommonEvents" invoke="getCaptcha"/> + <response name="success" type="none"/> </request-map> <request-map uri="LookupUserLoginAndPartyDetails"> @@ -64,8 +63,6 @@ <view-map name="main" type="screen" page="component://common/widget/PortalPageScreens.xml#showPortalPage"/> <view-map name="login" type="screen" page="component://myportal/widget/CommonScreens.xml#login"/> <view-map name="newRegisterLogin" type="screen" page="component://myportal/widget/CommonScreens.xml#newRegisterLogin"/> - <view-map name="reloadCaptchaImage" type="screen" page="component://myportal/widget/CommonScreens.xml#reloadCaptchaImage"/> - <view-map name="reloadCaptchaCode" type="screen" page="component://myportal/widget/CommonScreens.xml#reloadCaptchaCode"/> <view-map name="LookupUserLoginAndPartyDetails" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupUserLoginAndPartyDetails"/> Modified: ofbiz/branches/release11.04/specialpurpose/myportal/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/specialpurpose/myportal/widget/CommonScreens.xml?rev=1337345&r1=1337344&r2=1337345&view=diff ============================================================================== --- ofbiz/branches/release11.04/specialpurpose/myportal/widget/CommonScreens.xml (original) +++ ofbiz/branches/release11.04/specialpurpose/myportal/widget/CommonScreens.xml Fri May 11 19:36:50 2012 @@ -199,27 +199,6 @@ under the License. </section> </screen> - <screen name="reloadCaptchaImage"> - <section> - <actions> - <property-map resource="MyPortalUiLabels" map-name="uiLabelMap" global="true"/> - </actions> - <widgets> - <platform-specific><html><html-template location="component://myportal/widget/reloadCaptchaImage.ftl"/></html></platform-specific> - </widgets> - </section> - </screen> - - <screen name="reloadCaptchaCode"> - <section> - <actions> - <property-map resource="MyPortalUiLabels" map-name="uiLabelMap" global="true"/> - </actions> - <widgets> - <platform-specific><html><html-template location="component://myportal/widget/reloadCaptchaCode.ftl"/></html></platform-specific> - </widgets> - </section> - </screen> <screen name="CommonOpportunityDecorator"> <section> <actions> Modified: ofbiz/branches/release11.04/specialpurpose/myportal/widget/RegisterPerson.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/specialpurpose/myportal/widget/RegisterPerson.ftl?rev=1337345&r1=1337344&r2=1337345&view=diff ============================================================================== --- ofbiz/branches/release11.04/specialpurpose/myportal/widget/RegisterPerson.ftl (original) +++ ofbiz/branches/release11.04/specialpurpose/myportal/widget/RegisterPerson.ftl Fri May 11 19:36:50 2012 @@ -22,7 +22,6 @@ under the License. <form name="RegisterPerson" onsubmit="javascript:submitFormDisableSubmits(this)" class="basic-form" id="RegisterPerson" action="/myportal/control/createRegister" method="post"> <input type="hidden" value="${webSiteId}" name="webSiteId"/> <input type="hidden" name="reload"/> - <div id="captchaCode"><input type="hidden" value="${parameters.ID_KEY}" name="captchaCode"/></div> <div id="_G0_" class="fieldgroup"><div class="fieldgroup-title-bar"><table><tbody><tr><td class="collapse"> </td><td> </td></tr></tbody></table></div><div class="fieldgroup-body" id="_G0__body"> <table cellspacing="0" class="basic-table"> <tbody> @@ -97,36 +96,27 @@ under the License. </tr> <tr> <td class="label"> Code Captcha </td> - <td > - <div id="captchaImage"><img src="${parameters.captchaFileName}" alt="" /></div> - </td> + <td><div><img id="captchaImage" src="<@ofbizUrl>captcha.jpg?unique=${nowTimestamp.getTime()}</@ofbizUrl>" alt="" /></div></td> </tr> <script type="text/javascript" language="JavaScript"> - function reloadCaptcha(){ - var submitToUri = "<@ofbizUrl>reloadCaptchaImage</@ofbizUrl>"; - $.post(submitToUri, null, - function(data){ - document.getElementById("captchaImage").innerHTML = data; - }); - reloadCaptchaCode(); - } - function reloadCaptchaCode(){ - var submitToUri = "<@ofbizUrl>reloadCaptchaCode</@ofbizUrl>"; - $.post(submitToUri, null, - function(data){ - document.getElementById("captchaCode").innerHTML = data; - }); - } - function submitNewCustForm(){ - var nform = document.newuserform; - nform.captcha.value = document.captchaform.captcha.value; - nform.submit(); - } + <!-- + function reloadCaptcha() { + var captchaUri = "<@ofbizUrl>captcha.jpg?unique=_PLACEHOLDER_</@ofbizUrl>"; + var unique = Date.now(); + captchaUri = captchaUri.replace("_PLACEHOLDER_", unique); + document.getElementById("captchaImage").src = captchaUri; + } + function submitNewCustForm(){ + var nform = document.newuserform; + nform.captcha.value = document.captchaform.captcha.value; + nform.submit(); + } + //--> </script> <tr> <td class="label"> </td> <td> - <a href="javascript:reloadCaptcha();">reload image</a> + <a href="javascript:reloadCaptcha();">${uiLabelMap.CommonReloadCaptchaCode}</a> </td> </tr> <tr> |
Free forum by Nabble | Edit this page |