|
Author: buscob
Date: Sat Dec 4 14:58:18 2010 New Revision: 1042196 URL: http://svn.apache.org/viewvc?rev=1042196&view=rev Log: https://issues.apache.org/jira/browse/OFBIZ-4037 Moved the feature that allows a new user to register for an account from MyPortal to the framework so that it is available in any application. It has also been slightly reworked (code cleaning and internationalization). Two flags in general.properties allows to configure if the register function must be enabled or not and if the captcha function should be used. The captcha function needs to be improved because at the moment the code is contained in an hidden field so that it is very easy for a computer to bypass it. A possible fix for this could be to put the MD5 coding of the captcha code in the hidden field. Then the event that checks the code should compare the MD5 codes. Added: ofbiz/trunk/framework/common/script/org/ofbiz/common/RegisterEvents.xml ofbiz/trunk/framework/common/webcommon/registerPerson.ftl ofbiz/trunk/framework/common/webcommon/reloadCaptchaCode.ftl ofbiz/trunk/framework/common/webcommon/reloadCaptchaImage.ftl ofbiz/trunk/framework/common/widget/RegisterScreens.xml Removed: ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml ofbiz/trunk/specialpurpose/myportal/widget/RegisterPerson.ftl ofbiz/trunk/specialpurpose/myportal/widget/login.ftl ofbiz/trunk/specialpurpose/myportal/widget/reloadCaptchaCode.ftl ofbiz/trunk/specialpurpose/myportal/widget/reloadCaptchaImage.ftl Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml ofbiz/trunk/framework/common/config/general.properties ofbiz/trunk/framework/common/webcommon/WEB-INF/common-controller.xml ofbiz/trunk/framework/common/webcommon/forgotPassword.ftl ofbiz/trunk/framework/common/webcommon/login.ftl ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=1042196&r1=1042195&r2=1042196&view=diff ============================================================================== --- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original) +++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Sat Dec 4 14:58:18 2010 @@ -1108,6 +1108,14 @@ <value xml:lang="zh">æ æ³æ¾å°</value> <value xml:lang="zh_TW">ç¡æ³æ¾å°</value> </property> + <property key="CommonCaptchaMissingError"> + <value xml:lang="en">Verify code captcha is missing or wrong</value> + <value xml:lang="fr">Vérifier le code captcha, il est absent ou erroné</value> + <value xml:lang="it">Verifica il codice captcha, è mancante o errato</value> + <value xml:lang="th">รหัสà¸à¸±à¸§à¹à¸¥à¸à¸à¸µà¹à¸à¹à¸²à¸à¸à¸£à¸à¸à¸¡à¸µà¸à¹à¸à¸à¸´à¸à¸à¸¥à¸²à¸</value> + <value xml:lang="zh">缺å°éªè¯ç æéªè¯ç é误</value> + <value xml:lang="zh_TW">æ²æé©èç¢¼ææ¯é¯èª¤</value> + </property> <property key="CommonChange"> <value xml:lang="ar">تغÙÙØ±</value> <value xml:lang="de">Verändern</value> @@ -2861,6 +2869,25 @@ <value xml:lang="zh">第ä¸ä¸ª</value> <value xml:lang="zh_TW">第ä¸å</value> </property> + <property key="CommonFirstName"> + <value xml:lang="cs">Jméno</value> + <value xml:lang="de">Vorname</value> + <value xml:lang="en">First name</value> + <value xml:lang="en_GB">Forename</value> + <value xml:lang="es">Nombre</value> + <value xml:lang="fr">Prénom</value> + <value xml:lang="hi_IN">पहला नाम</value> + <value xml:lang="it">Nome</value> + <value xml:lang="ja">First name</value> + <value xml:lang="nl">Voornaam</value> + <value xml:lang="pt_BR">Nome</value> + <value xml:lang="pt_PT">Primeiro Nome</value> + <value xml:lang="ro">Nume </value> + <value xml:lang="ru">ÐмÑ</value> + <value xml:lang="th">à¸à¸·à¹à¸</value> + <value xml:lang="zh">åå</value> + <value xml:lang="zh_TW">åå</value> + </property> <property key="CommonFollowingErrorsOccurred"> <value xml:lang="ar">Ø§ÙØ£Ø®Ø·Ø§Ø¡ Ø§ÙØªØ§ÙÙØ© ØØ¯Ø«Øª</value> <value xml:lang="de">Folgende Fehler sind aufgetreten</value> @@ -3863,6 +3890,25 @@ <value xml:lang="zh">æè¿ç</value> <value xml:lang="zh_TW">æè¿ç</value> </property> + <property key="CommonLastName"> + <value xml:lang="cs">PÅÃjmenÃ</value> + <value xml:lang="de">Nachname</value> + <value xml:lang="en">Last name</value> + <value xml:lang="en_GB">Surname</value> + <value xml:lang="es">Apellidos</value> + <value xml:lang="fr">Nom</value> + <value xml:lang="hi_IN">ठनà¥à¤¤ नाम</value> + <value xml:lang="it">Cognome</value> + <value xml:lang="ja">Last name</value> + <value xml:lang="nl">Familienaam</value> + <value xml:lang="pt_BR">Segundo nome</value> + <value xml:lang="pt_PT">Apelido</value> + <value xml:lang="ro">Nume de Familie</value> + <value xml:lang="ru">ФамилиÑ</value> + <value xml:lang="th">à¸à¸²à¸¡à¸ªà¸à¸¸à¸¥</value> + <value xml:lang="zh">å§æ°</value> + <value xml:lang="zh_TW">å§æ°</value> + </property> <property key="CommonLastSytemNotes"> <value xml:lang="en">Last system notes</value> <value xml:lang="fr">Dernières tâches affectées</value> @@ -4369,6 +4415,21 @@ <value xml:lang="zh_CN">æ¹æ³</value> <value xml:lang="zh_TW">æ¹æ³</value> </property> + <property key="CommonMiddleName"> + <value xml:lang="de">Zweiter Vorname</value> + <value xml:lang="en">Middle Name</value> + <value xml:lang="es">Segundo nombre</value> + <value xml:lang="fr">Nom intermédiaire</value> + <value xml:lang="hi_IN">मधà¥à¤¯ नाम</value> + <value xml:lang="it">Nome centrale</value> + <value xml:lang="nl">Tussenvoegsel</value> + <value xml:lang="pt_BR">Nome do meio</value> + <value xml:lang="ro">Nume Central</value> + <value xml:lang="ru">ÐÑÑеÑÑво</value> + <value xml:lang="th">à¸à¸·à¹à¸à¸à¸¥à¸²à¸</value> + <value xml:lang="zh">ä¸é´å</value> + <value xml:lang="zh_TW">ä¸éå</value> + </property> <property key="CommonMilliSecond"> <value xml:lang="de">Millisekunde</value> <value xml:lang="en">Millisecond</value> @@ -4718,6 +4779,13 @@ <value xml:lang="en">New Portal Page</value> <value xml:lang="it">Nuova pagina portale</value> </property> + <property key="CommonNewRegistration"> + <value xml:lang="en">New Registration </value> + <value xml:lang="fr">Nouvel enregistrement</value> + <value xml:lang="it">Nuovo utente</value> + <value xml:lang="th">ลà¸à¸à¸°à¹à¸à¸µà¸¢à¸ </value> + <value xml:lang="zh">æ°æ³¨å</value> + </property> <property key="CommonNewSelection"> <value xml:lang="ar">Ø¥Ø®ØªÙØ§Ø± Ø¬Ø¯ÙØ¯</value> <value xml:lang="de">Neue Auswahl</value> @@ -5601,6 +5669,10 @@ <value xml:lang="zh">请修æ¹ä½ çå¯ç </value> <value xml:lang="zh_TW">è«ä¿®æ¹ä½ çå¯ç¢¼</value> </property> + <property key="CommonPasswordVerify"> + <value xml:lang="en">Confirm Password</value> + <value xml:lang="it">Conferma password</value> + </property> <property key="CommonPaymentMethodType"> <value xml:lang="ar">ÙÙØ¹ طرÙÙØ© Ø§ÙØªØ³Ø¯Ùد</value> <value xml:lang="de">Zahlungsmethode Typ</value> @@ -6314,6 +6386,13 @@ <value xml:lang="zh_CN">å·æ°</value> <value xml:lang="zh_TW">æ´æ°</value> </property> + <property key="CommonRegisterComplete"> + <value xml:lang="en">Register of new person is complete...Please </value> + <value xml:lang="fr">L'enregistrement de la nouvelle personne est complet...SVP</value> + <value xml:lang="it">Creazione nuovo utente completata...prego </value> + <value xml:lang="th">à¸à¸²à¸£à¸¥à¸à¸à¸°à¹à¸à¸µà¸¢à¸à¹à¸«à¸¡à¹à¸ªà¸³à¸«à¸£à¸±à¸à¸à¸¸à¸à¸à¸¥à¹à¸à¹à¸à¸³à¸à¸²à¸£à¹à¸ªà¸£à¹à¸à¸ªà¸´à¹à¸à¸ªà¸¡à¸à¸¹à¸£à¸à¹à¹à¸¥à¹à¸§...สามารà¸à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸à¹à¸à¹ </value> + <value xml:lang="zh">宿æ°äººå注å...请</value> + </property> <property key="CommonRegistered"> <value xml:lang="ar">٠ستخد٠٠سجÙ</value> <value xml:lang="cs">Registrovaný uživatel</value> @@ -6370,6 +6449,11 @@ <value xml:lang="zh">åå¸çæ¬</value> <value xml:lang="zh_TW">ç¼ä½çæ¬</value> </property> + <property key="CommonReloadImage"> + <value xml:lang="en">reload image</value> + <value xml:lang="it">Ricarica immagine</value> + <value xml:lang="zh">å·æ°å¾ç</value> + </property> <property key="CommonRemove"> <value xml:lang="ar">ÙØ²Ø¹</value> <value xml:lang="cs">Odstranit</value> @@ -8602,6 +8686,13 @@ <value xml:lang="zh_CN">å¼</value> <value xml:lang="zh_TW">æ¸å¼</value> </property> + <property key="CommonVerifyCaptcha"> + <value xml:lang="en">Verify code</value> + <value xml:lang="fr">Vérifier le code captcha</value> + <value xml:lang="it">Verifica codice</value> + <value xml:lang="th">à¹à¸ªà¹à¸£à¸«à¸±à¸ªà¸à¸²à¸¡à¸£à¸¹à¸</value> + <value xml:lang="zh">éªè¯éªè¯ç </value> + </property> <property key="CommonView"> <value xml:lang="ar">Ù Ø´ÙØ¯</value> <value xml:lang="cs">Náhled</value> @@ -8886,6 +8977,10 @@ <value xml:lang="zh_CN">åªé</value> <value xml:lang="zh_TW">åªé</value> </property> + <property key="CommonWhyRegister"> + <value xml:lang="en">Why would you like to register?</value> + <value xml:lang="it">Perche' desideri registrarti?</value> + </property> <property key="CommonWidth"> <value xml:lang="ar">Ø§ÙØ¹Ø±Ø¶</value> <value xml:lang="de">Breite</value> Modified: ofbiz/trunk/framework/common/config/general.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/general.properties?rev=1042196&r1=1042195&r2=1042196&view=diff ============================================================================== --- ofbiz/trunk/framework/common/config/general.properties (original) +++ ofbiz/trunk/framework/common/config/general.properties Sat Dec 4 14:58:18 2010 @@ -130,3 +130,8 @@ http.localhost=ABQIAAAAtt0d8djaYFkk8N5LJ # -- Y if you want to display the multi-tenant textbox in the login page multitenant=N + +# -- Y if you want new users be allowed to register online +login.newRegistration.allow=Y +# -- Y if you want that a captcha image check field is used when registering new users +login.newRegistration.useCaptcha=Y Added: ofbiz/trunk/framework/common/script/org/ofbiz/common/RegisterEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/script/org/ofbiz/common/RegisterEvents.xml?rev=1042196&view=auto ============================================================================== --- ofbiz/trunk/framework/common/script/org/ofbiz/common/RegisterEvents.xml (added) +++ ofbiz/trunk/framework/common/script/org/ofbiz/common/RegisterEvents.xml Sat Dec 4 14:58:18 2010 @@ -0,0 +1,168 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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. +--> + +<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd"> + + <simple-method method-name="createRegister" short-description="Create person when new register" login-required="false"> + <property-to-field resource="general" property="login.newRegistration.useCaptcha" field="useCaptcha"/> + <call-bsh><![CDATA[ + org.ofbiz.common.Captcha.getCodeCaptcha(request,response); + ]]></call-bsh> + + <if-empty field="parameters.firstName"> + <property-to-field field="errorMessage" resource="MyPortalUiLabels" property="MyPortalFirstNameMissing"/> + <field-to-list field="errorMessage" list="error_list"/> + </if-empty> + <if-empty field="parameters.lastName"> + <property-to-field field="errorMessage" resource="MyPortalUiLabels" property="MyPortalLastNameMissing"/> + <field-to-list field="errorMessage" list="error_list"/> + </if-empty> + <if-empty field="parameters.USERNAME"> + <property-to-field field="errorMessage" resource="PartyUiLabels" property="PartyUserNameMissing"/> + <field-to-list field="errorMessage" list="error_list"/> + </if-empty> + <if-empty field="parameters.PASSWORD"> + <property-to-field field="errorMessage" resource="PartyUiLabels" property="PartyPasswordMissing"/> + <field-to-list field="errorMessage" list="error_list"/> + </if-empty> + <if-empty field="parameters.USER_EMAIL"> + <property-to-field field="errorMessage" resource="PartyUiLabels" property="PartyEmailAddressMissing"/> + <field-to-list field="errorMessage" list="error_list"/> + </if-empty> + <check-errors error-list-name="error_list" error-code="resultPage"/> + + <!-- set parameter of person to personContext Map --> + <set field="personContext.salutation" from-field="parameters.salutation"/> + <set field="personContext.firstName" from-field="parameters.firstName"/> + <set field="personContext.middleName" from-field="parameters.middleName"/> + <set field="personContext.lastName" from-field="parameters.lastName"/> + <set field="personContext.comments" from-field="parameters.comments"/> + + <!-- set parameter of userLogin to userLoginContext Map --> + <set field="userLoginContext.userLoginId" from-field="parameters.USERNAME"/> + + <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"/> + + <if-compare field="parameters.PASSWORD" value="${parameters.CONFIRM_PASSWORD}" operator="equals"> + + <set field="captchaPassed" value="Y"/> + <if-compare field="useCaptcha" value="Y" operator="equals"> + <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"/> + <if-compare field="parameters.captcha" value="${parameters.captchaCode}" operator="not-equals"> + <set field="captchaPassed" value="N"/> + </if-compare> + </if-compare> + + <if-compare field="captchaPassed" value="Y" operator="equals"> + <!-- Create user login and Person --> + <find-by-primary-key entity-name="UserLogin" map="userLoginContext" value-field="existingUserLogin"/> + <if-empty field="existingUserLogin"> + <set field="userLoginContext.currentPassword" from-field="parameters.PASSWORD"/> + <set field="userLoginContext.currentPasswordVerify" from-field="parameters.CONFIRM_PASSWORD"/> + <set-service-fields map="personContext" service-name="createPersonAndUserLogin" to-map="personUserLoginContext"/> + <set-service-fields map="userLoginContext" service-name="createPersonAndUserLogin" to-map="personUserLoginContext"/> + <call-service service-name="createPersonAndUserLogin" in-map-name="personUserLoginContext"> + <result-to-field result-name="partyId" field="partyId"/> + <result-to-field field="createdUserLogin" result-name="newUserLogin"/> + </call-service> + <set-current-user-login value-field="createdUserLogin"/> + <else> + <property-to-field field="errorMessage" resource="PartyUiLabels" property="PartyUserNameInUse"/> + <field-to-list field="errorMessage" list="error_list"/> + <check-errors error-list-name="error_list" error-code="resultPage"/> + </else> + </if-empty> + + <!-- create the PartyDataSource entry to track where this info came from... --> + <make-value entity-name="PartyDataSource" value-field="partyDataSource"/> + <set value="MY_PORTAL" field="partyDataSource.dataSourceId"/> + <set from-field="nowStamp" field="partyDataSource.fromDate"/> + <set value="Y" field="partyDataSource.isCreate"/> + <set from-field="partyId" field="partyDataSource.partyId"/> + <session-to-field field="visit"/> + <set from-field="visit.visitId" field="partyDataSource.visitId"/> + <create-value value-field="partyDataSource"/> + + <!-- Create E-mail address --> + <set field="emailContext.emailAddress" from-field="parameters.USER_EMAIL"/> + <call-service service-name="createPartyEmailAddress" in-map-name="emailContext"> + <result-to-field result-name="contactMechId" field="emailPurposeContext.contactMechId"/> + </call-service> + <set from-field="partyId" field="emailPurposeContext.partyId"/> + <set value="PRIMARY_EMAIL" field="emailPurposeContext.contactMechPurposeTypeId"/> + <call-service service-name="createPartyContactMechPurpose" in-map-name="emailPurposeContext"/> + + <!-- Send e-mail to new create user --> + <entity-one entity-name="WebSite" value-field="webSite"/> + <set field="storeEmailLookup.emailTemplateSettingId" value="PARTY_REGISTER"/> + <find-by-primary-key map="storeEmailLookup" entity-name="EmailTemplateSetting" value-field="storeEmail"/> + <if-not-empty field="storeEmail"> + <get-related-one value-field="createdUserLogin" relation-name="Person" to-value-field="person"/> + <set field="bodyParameters.person" from-field="person"/> + <set field="emailParams.bodyParameters" from-field="bodyParameters"/> + <set field="emailParams.sendTo" from-field="emailContext.emailAddress"/> + <set field="emailParams.subject" from-field="storeEmail.subject"/> + <set field="emailParams.sendFrom" from-field="storeEmail.fromAddress"/> + <set field="emailParams.sendCc" from-field="storeEmail.ccAddress"/> + <set field="emailParams.sendBcc" from-field="storeEmail.bccAddress"/> + <set field="emailParams.contentType" from-field="storeEmail.contentType"/> + <set field="emailParams.bodyScreenUri" from-field="storeEmail.bodyScreenLocation"/> + <set field="emailParams.webSiteId" from-field="webSite.webSiteId"/> + <set field="emailParams.emailType" from-field="storeEmail.emailType"/> + <call-service service-name="sendMailFromScreen" in-map-name="emailParams"/> + <else> + <log level="error" message="Email template ${storeEmailLookup.emailTemplateSettingId} not found in entity EmailTemplateSetting, no confirmation email sent"></log> + </else> + </if-not-empty> + + <!-- Create Customer Request to show new registration--> + <set field="custRequest.custRequestTypeId" value="RF_SUPPORT"/> + <set field="custRequest.fromPartyId" from-field="partyId"/> + <set field="custRequest.custRequestName" value="New user account created by registration"/> + <set field="custRequest.productStoreId" from-field="webSite.productStoreId"/> + <set field="custRequest.statusId" value="CRQ_SUBMITTED"/> + <call-service service-name="createCustRequest" in-map-name="custRequest"> + <result-to-field result-name="custRequestId"/> + </call-service> + <set field="custRequestItem.custRequestId" from-field="custRequestId"/> + <set field="custRequestItem.story" from-field="parameters.whyWouldYouLikeToRegister"/> + <call-service service-name="createCustRequestItem" in-map-name="custRequestItem"/> + <!-- set field to request --> + <field-to-request field="partyId" request-name="partyId"/> + <field-to-request field="emailPurposeContext.contactMechId" request-name="contactMechId"/> + <return response-code="resultPage"/> + <else> + <property-to-field field="errorMessage" resource="PartyUiLabels" property="PartyPasswordMatchError"/> + <field-to-list field="errorMessage" list="error_list"/> + </else> + </if-compare> + <else> + <property-to-field field="errorMessage" resource="CommonUiLabels" property="CommonCaptchaMissingError"/> + <field-to-list field="errorMessage" list="error_list"/> + </else> + </if-compare> + <check-errors error-list-name="error_list" error-code="resultPage"/> + <call-class-method class-name="org.ofbiz.common.Captcha" method-name="deleteFile"/> + </simple-method> +</simple-methods> Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/common-controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/common-controller.xml?rev=1042196&r1=1042195&r2=1042196&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/WEB-INF/common-controller.xml (original) +++ ofbiz/trunk/framework/common/webcommon/WEB-INF/common-controller.xml Sat Dec 4 14:58:18 2010 @@ -95,6 +95,25 @@ under the License. <response name="success" type="view" value="forgotPassword"/> <response name="error" type="view" value="forgotPassword"/> </request-map> + <request-map uri="newRegisterLogin"> + <security https="true" auth="false"/> + <event type="java" invoke="getCodeCaptcha" path="org.ofbiz.common.Captcha"/> + <response name="success" type="view" value="newRegisterLogin"/> + </request-map> + <request-map uri="createRegister"> + <security https="true" auth="false"/> + <event type="simple" invoke="createRegister" path="component://common/script/org/ofbiz/common/RegisterEvents.xml"/> + <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"> + <security https="true" auth="false"/> + <response name="success" type="view" value="reloadCaptchaCode"/> + </request-map> <request-map uri="view"> <security https="false" auth="false"/> <response name="success" type="request" value="main"/> @@ -234,6 +253,9 @@ under the License. <view-map name="login" type="screen" page="component://common/widget/CommonScreens.xml#login"/> <view-map name="requirePasswordChange" type="screen" page="component://common/widget/CommonScreens.xml#requirePasswordChange"/> <view-map name="forgotPassword" type="screen" page="component://common/widget/CommonScreens.xml#forgotPassword"/> + <view-map name="newRegisterLogin" type="screen" page="component://common/widget/RegisterScreens.xml#newRegisterLogin"/> + <view-map name="reloadCaptchaImage" type="screen" page="component://common/widget/RegisterScreens.xml#reloadCaptchaImage"/> + <view-map name="reloadCaptchaCode" type="screen" page="component://common/widget/RegisterScreens.xml#reloadCaptchaCode"/> <view-map name="EventMessages" type="screen" page="component://common/widget/CommonScreens.xml#EventMessages"/> <view-map name="ListLocales" type="screen" page="component://common/widget/LookupScreens.xml#ListLocales"/> Modified: ofbiz/trunk/framework/common/webcommon/forgotPassword.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/forgotPassword.ftl?rev=1042196&r1=1042195&r2=1042196&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/forgotPassword.ftl (original) +++ ofbiz/trunk/framework/common/webcommon/forgotPassword.ftl Sat Dec 4 14:58:18 2010 @@ -31,11 +31,11 @@ under the License. </tr> <tr> <td colspan="2" align="center"> - <input type="submit" name="GET_PASSWORD_HINT" class="smallSubmit" value="${uiLabelMap.CommonGetPasswordHint}"/> <input type="submit" name="EMAIL_PASSWORD" class="smallSubmit" value="${uiLabelMap.CommonEmailPassword}"/> + <input type="submit" name="GET_PASSWORD_HINT" value="${uiLabelMap.CommonGetPasswordHint}"/> <input type="submit" name="EMAIL_PASSWORD" value="${uiLabelMap.CommonEmailPassword}"/> </td> </tr> </table> - <a href='<@ofbizUrl>authview</@ofbizUrl>' class="button">${uiLabelMap.CommonGoBack}</a> + <a href='<@ofbizUrl>authview</@ofbizUrl>' class="buttontext">${uiLabelMap.CommonGoBack}</a> <input type="hidden" name="JavaScriptEnabled" value="N"/> </form> </div> Modified: ofbiz/trunk/framework/common/webcommon/login.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/login.ftl?rev=1042196&r1=1042195&r2=1042196&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/login.ftl (original) +++ ofbiz/trunk/framework/common/webcommon/login.ftl Sat Dec 4 14:58:18 2010 @@ -19,6 +19,7 @@ under the License. <#if requestAttributes.uiLabelMap?exists><#assign uiLabelMap = requestAttributes.uiLabelMap></#if> <#assign useMultitenant = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("general.properties", "multitenant")> +<#assign allowNewRegistration = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("general.properties", "login.newRegistration.allow")> <#assign username = requestParameters.USERNAME?default((sessionAttributes.autoUserLogin.userLoginId)?default(""))> <#if username != ""> @@ -26,7 +27,6 @@ under the License. <#else> <#assign focusName = true> </#if> -<center> <div class="screenlet login-screenlet"> <div class="screenlet-title-bar"> <h3>${uiLabelMap.CommonRegistered}</h3> @@ -59,12 +59,16 @@ under the License. </tr> </table> <input type="hidden" name="JavaScriptEnabled" value="N"/> - <br /> - <a href="<@ofbizUrl>forgotPassword</@ofbizUrl>">${uiLabelMap.CommonForgotYourPassword}?</a> + <br/> + <center> + <a href="<@ofbizUrl>forgotPassword</@ofbizUrl>">${uiLabelMap.CommonForgotYourPassword}?</a> + <#if ("Y" == allowNewRegistration)> + <a href="<@ofbizUrl>newRegisterLogin</@ofbizUrl>">${uiLabelMap.CommonNewRegistration}</a> + </#if> + </center> </form> </div> </div> -</center> <script language="JavaScript" type="text/javascript"> document.loginform.JavaScriptEnabled.value = "Y"; Added: ofbiz/trunk/framework/common/webcommon/registerPerson.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/registerPerson.ftl?rev=1042196&view=auto ============================================================================== --- ofbiz/trunk/framework/common/webcommon/registerPerson.ftl (added) +++ ofbiz/trunk/framework/common/webcommon/registerPerson.ftl Sat Dec 4 14:58:18 2010 @@ -0,0 +1,131 @@ +<#-- +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. +--> +<#assign useCaptcha = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("general.properties", "login.newRegistration.useCaptcha")> + +<script type="text/javascript" language="JavaScript"> <!-- + dojo.require("dojo.widget.*"); + dojo.require("dojo.event.*"); + dojo.require("dojo.io.*"); + + function reloadCaptcha(){ + var submitToUri = "<@ofbizUrl>reloadCaptchaImage</@ofbizUrl>"; + dojo.io.bind({url: submitToUri, + load: function(type, data, evt){ + if(type == "load"){ + document.getElementById("captchaImage").innerHTML = data; + reloadCaptchaCode(); + } + },mimetype: "text/html"}); + } + function reloadCaptchaCode(){ + var submitToUri = "<@ofbizUrl>reloadCaptchaCode</@ofbizUrl>"; + dojo.io.bind({url: submitToUri, + load: function(type, data, evt){ + if(type == "load"){ + document.getElementById("captchaCode").innerHTML = data; + } + },mimetype: "text/html"}); + } +//--></script> + +<form name="RegisterPerson" onsubmit="javascript:submitFormDisableSubmits(this)" class="basic-form" id="RegisterPerson" action="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> + <table cellspacing="0" class="basic-table"> + <tbody> + <tr> + <td class="label">${uiLabelMap.CommonWhyRegister}</td> + <td> + <textarea id="RegisterPerson_whyWouldYouLikeToRegister" rows="5" cols="60" class="class="no-required"" name="whyWouldYouLikeToRegister">${requestParameters.whyWouldYouLikeToRegister?if_exists}</textarea> + </td> + </tr> + <tr> + <td class="label">Salutation</td> + <td class="no-required"> + <input type="text" id="RegisterPerson_salutation" maxlength="60" size="40" name="salutation" value="${requestParameters.salutation?if_exists}"/> + </td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonFirstName}</td> + <td> + <input type="text" id="RegisterPerson_firstName" maxlength="60" size="40" class="required" name="firstName" value="${requestParameters.firstName?if_exists}"/> + <span class="tooltip">${uiLabelMap.CommonRequired}</span> + </td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonMiddleName}</td> + <td class="no-required"> + <input type="text" id="RegisterPerson_middleName" maxlength="60" size="40" name="middleName" value="${requestParameters.middleName?if_exists}"/> + </td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonLastName}</td> + <td> + <input type="text" id="RegisterPerson_lastName" maxlength="60" size="40" class="required" name="lastName" value="${requestParameters.lastName?if_exists}"/> + <span class="tooltip">${uiLabelMap.CommonRequired}</span> + </td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonEmail}</td> + <td> + <input type="text" id="RegisterPerson_USER_EMAIL" maxlength="250" size="60" class="required" name="USER_EMAIL" value="${requestParameters.USER_EMAIL?if_exists}"/> + <span class="tooltip">${uiLabelMap.CommonRequired}</span> + </td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonUsername}</td> + <td> + <input type="text" id="RegisterPerson_USERNAME" maxlength="250" size="30" class="required" name="USERNAME" value="${requestParameters.USERNAME?if_exists}"/> + <span class="tooltip">${uiLabelMap.CommonRequired}</span> + </td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonPassword}</td> + <td> + <input type="password" id="RegisterPerson_PASSWORD" maxlength="250" size="15" name="PASSWORD" class="required" value="${requestParameters.PASSWORD?if_exists}"/> + <span class="tooltip">${uiLabelMap.CommonRequired}</span> + </td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonPasswordVerify}</td> + <td> + <input type="password" id="RegisterPerson_CONFIRM_PASSWORD" maxlength="250" size="15" name="CONFIRM_PASSWORD" class="required" value="${requestParameters.CONFIRM_PASSWORD?if_exists}"/> + <span class="tooltip">${uiLabelMap.CommonRequired}</span> + </td> + </tr> + <#if ("Y" == useCaptcha)> + <tr class="captcha"> + <td class="label">${uiLabelMap.CommonVerifyCaptcha}</td> + <td> + <span id="captchaImage"><img src="${parameters.captchaFileName}" alt="" /></span> + <input type="text" id="RegisterPerson_captcha" maxlength="30" size="23" class="required" name="captcha"/> + <div><a href="javascript:reloadCaptcha();" class="buttontext refresh">${uiLabelMap.CommonReloadImage}</a></div> + </td> + </tr> + </#if> + <tr> + <td></td> + <td> + <input type="submit" value="Save" name="submitButton"/> + </td> + </tr> + </tbody> + </table> +</form> \ No newline at end of file Added: ofbiz/trunk/framework/common/webcommon/reloadCaptchaCode.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/reloadCaptchaCode.ftl?rev=1042196&view=auto ============================================================================== --- ofbiz/trunk/framework/common/webcommon/reloadCaptchaCode.ftl (added) +++ ofbiz/trunk/framework/common/webcommon/reloadCaptchaCode.ftl Sat Dec 4 14:58:18 2010 @@ -0,0 +1,22 @@ +<#-- +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. +--> + +<#assign idkey = Static["org.ofbiz.common.Captcha"].ID_KEY> + +<input type="hidden" value="${idkey?if_exists}" name="captchaCode"/> \ No newline at end of file Added: ofbiz/trunk/framework/common/webcommon/reloadCaptchaImage.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/reloadCaptchaImage.ftl?rev=1042196&view=auto ============================================================================== --- ofbiz/trunk/framework/common/webcommon/reloadCaptchaImage.ftl (added) +++ ofbiz/trunk/framework/common/webcommon/reloadCaptchaImage.ftl Sat Dec 4 14:58:18 2010 @@ -0,0 +1,23 @@ +<#-- +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. +--> + +<#assign fileName = Static["org.ofbiz.common.Captcha"].getCodeCaptcha(request,response)> +<#assign fileName = Static["org.ofbiz.common.Captcha"].CAPTCHA_FILE_NAME> + +<img src="<@ofbizContentUrl>/tempfiles/captcha/${fileName?if_exists}</@ofbizContentUrl>" alt="" /> Added: ofbiz/trunk/framework/common/widget/RegisterScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/RegisterScreens.xml?rev=1042196&view=auto ============================================================================== --- ofbiz/trunk/framework/common/widget/RegisterScreens.xml (added) +++ ofbiz/trunk/framework/common/widget/RegisterScreens.xml Sat Dec 4 14:58:18 2010 @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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. +--> + +<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd"> + + <!--New Register Person--> + <screen name="newRegisterLogin"> + <section> + <actions> + <set field="layoutSettings.javaScripts[]" value="/images/dojo/dojo.js" global="true"/> + </actions> + <widgets> + <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <section> + <condition> + <not><if-empty field="parameters.partyId"/></not> + </condition> + <actions> + <set field="partyId" from-field="parameters.partyId"/> + </actions> + <widgets> + <label style="h1" text="${uiLabelMap.CommonRegisterComplete}"/> + <link target="main" style="buttontext" text="${uiLabelMap.CommonBeLogged}"/> + <horizontal-separator/> + <screenlet title="${uiLabelMap.PartyPersonalInformation}"> + <include-form name="ViewPartyPerson" location="component://party/widget/partymgr/PartyForms.xml"/> + </screenlet> + </widgets> + <fail-widgets> + <screenlet title="${uiLabelMap.CommonNewRegistration}"> + <section> + <actions> + <set field="fileName" from-field="parameters.fileName"/> + <set field="idKey" from-field="parameters.ID_KEY"/> + </actions> + <widgets> + <platform-specific> + <html><html-template location="component://common/webcommon/registerPerson.ftl"/></html> + </platform-specific> + </widgets> + </section> + </screenlet> + </fail-widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + + <screen name="reloadCaptchaImage"> + <section> + <actions> + <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> + </actions> + <widgets> + <platform-specific><html><html-template location="component://common/webcommon/reloadCaptchaImage.ftl"/></html></platform-specific> + </widgets> + </section> + </screen> + + <screen name="reloadCaptchaCode"> + <section> + <actions> + <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> + </actions> + <widgets> + <platform-specific><html><html-template location="component://common/webcommon/reloadCaptchaCode.ftl"/></html></platform-specific> + </widgets> + </section> + </screen> +</screens> Modified: ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml?rev=1042196&r1=1042195&r2=1042196&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml (original) +++ ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml Sat Dec 4 14:58:18 2010 @@ -36,25 +36,6 @@ <security https="true" auth="true"/> <response name="success" type="request" value="showPortalPage"/> </request-map> - <request-map uri="newRegisterLogin"> - <security https="true" auth="false"/> - <event type="java" invoke="getCodeCaptcha" path="org.ofbiz.common.Captcha"/> - <response name="success" type="view" value="newRegisterLogin"/> - </request-map> - <request-map uri="createRegister"> - <security https="true" auth="false"/> - <event type="simple" invoke="createRegister" path="component://myportal/script/org/ofbiz/myportal/Events.xml"/> - <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"> - <security https="true" auth="false"/> - <response name="success" type="view" value="reloadCaptchaCode"/> - </request-map> <request-map uri="LookupUserLoginAndPartyDetails"> <security https="true" auth="true"/> @@ -62,10 +43,6 @@ </request-map> <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/trunk/specialpurpose/myportal/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml?rev=1042196&r1=1042195&r2=1042196&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml (original) +++ ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml Sat Dec 4 14:58:18 2010 @@ -120,65 +120,6 @@ under the License. </section> </screen> - <screen name="login"> - <section> - <widgets> - <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="body"> - <platform-specific> - <html><html-template location="component://myportal/widget/login.ftl"/></html> - </platform-specific> - </decorator-section> - </decorator-screen> - </widgets> - </section> - </screen> - - <!--New Register Person--> - <screen name="newRegisterLogin"> - <section> - <actions> - <set field="layoutSettings.javaScripts[]" value="/images/dojo/dojo.js" global="true"/> - </actions> - <widgets> - <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="body"> - <section> - <condition> - <not><if-empty field="parameters.partyId"/></not> - </condition> - <actions> - <set field="partyId" from-field="parameters.partyId"/> - </actions> - <widgets> - <label style="h2" text="${uiLabelMap.MyPortalRegisterComplete}"/><link target="main" style="h2" text="${uiLabelMap.CommonBeLogged}"/> - <screenlet title="${uiLabelMap.PartyPersonalInformation}"> - <include-form name="ViewPartyPerson" location="component://party/widget/partymgr/PartyForms.xml"/> - </screenlet> - </widgets> - <fail-widgets> - <screenlet title="${uiLabelMap.MyPortalNewRegistration}"> - <section> - <actions> - <set field="fileName" from-field="parameters.fileName"/> - <set field="idKey" from-field="parameters.ID_KEY"/> - </actions> - <widgets> - <!--<include-form name="RegisterPerson" location="component://myportal/widget/MyPortalForms.xml"/> --> - <platform-specific> - <html><html-template location="component://myportal/widget/RegisterPerson.ftl"/></html> - </platform-specific> - </widgets> - </section> - </screenlet> - </fail-widgets> - </section> - </decorator-section> - </decorator-screen> - </widgets> - </section> - </screen> - <screen name="CommonRequestDecorator"> <section> <widgets> @@ -202,27 +143,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> |
| Free forum by Nabble | Edit this page |
