svn commit: r1862466 - in /ofbiz: ofbiz-framework/trunk/applications/party/config/PartyUiLabels.xml ofbiz-plugins/trunk/ecommerce/minilang/customer/CustomerEvents.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1862466 - in /ofbiz: ofbiz-framework/trunk/applications/party/config/PartyUiLabels.xml ofbiz-plugins/trunk/ecommerce/minilang/customer/CustomerEvents.xml

jleroux@apache.org
Author: jleroux
Date: Wed Jul  3 13:30:28 2019
New Revision: 1862466

URL: http://svn.apache.org/viewvc?rev=1862466&view=rev
Log:
Fixed: Error message is displayed when user having space in username logs
in at ecommerce
(OFBIZ-10671)

Steps to regenerate:
 # Open URL: [https://demo-trunk.ofbiz.apache.org/ecommerce/control/main]
 # Click on register in header section
 # Provide all the mandatory information but provide a user name such that is
    contains a space (like: Walter White or Jesse Pinkman)
 # Click on save button

Actual: When user clicks on save button then he is redirected to main page of
ecommerce and an error message is displayed.
Similarly when user with space in username tries to login, error message is
displayed.

Praven: Added standard regex for username allowed alphabets, numbers, and _-
jleroux: actually "-" was  missing in the regepx definition.

Thanks: Arpit Mor for report and Praveen Sharma for the fix

Modified:
    ofbiz/ofbiz-framework/trunk/applications/party/config/PartyUiLabels.xml
    ofbiz/ofbiz-plugins/trunk/ecommerce/minilang/customer/CustomerEvents.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/party/config/PartyUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/party/config/PartyUiLabels.xml?rev=1862466&r1=1862465&r2=1862466&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/party/config/PartyUiLabels.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/party/config/PartyUiLabels.xml Wed Jul  3 13:30:28 2019
@@ -14060,4 +14060,25 @@
         <value xml:lang="zh">找不到邮政编码</value>
         <value xml:lang="zh-TW">找不到郵遞區號</value>
     </property>
+    <property key="NotValidUserName">
+        <value xml:lang="ar">يمكن أن يحتوي اسم المستخدم على حروف أبجدية وأرقام و _-</value>
+        <value xml:lang="cs">Uživatelské jméno může obsahovat pouze abecedy, číslice a _-</value>
+        <value xml:lang="de">Der Benutzername darf nur Buchstaben, Zahlen und _- enthalten.</value>
+        <value xml:lang="en">Username can only have alphabets, numeric and _-</value>
+        <value xml:lang="en-GB">Username can only have alphabets, numeric and _-</value>
+        <value xml:lang="es">El nombre de usuario solo puede tener alfabetos, numéricos y _-</value>
+        <value xml:lang="fr">Le nom d'utilisateur ne peut contenir que des alphabets, des chiffres et des caractères _-</value>
+        <value xml:lang="hi-IN">‍ उपयोगकर्ता नाम में केवल अक्षर, संख्यात्मक और _- हो सकते हैं</value>
+        <value xml:lang="it">Il nome utente può contenere solo alfabeti, numeri e _-</value>
+        <value xml:lang="ja">ユーザー名には、アルファベット、数字、および_-しか使用できません。</value>
+        <value xml:lang="nl">Gebruikersnaam kan alleen alfabetten, numeriek en _- bevatten</value>
+        <value xml:lang="pt-BR">O nome de usuário só pode ter alfabetos, numéricos e _</value>
+        <value xml:lang="pt-PT">O nome de usuário só pode ter alfabetos, numéricos e _</value>
+        <value xml:lang="ro">Numele de utilizator poate avea numai alfabete, numere numerice și _</value>
+        <value xml:lang="ru">Имя пользователя может содержать только буквы, цифры и _-</value>
+        <value xml:lang="th">ชื่อผู้ใช้จะต้องมีตัวอักษรตัวเลขและ _- เท่านั้น</value>
+        <value xml:lang="vi">Tên người dùng chỉ có thể có bảng chữ cái, số và _-</value>
+        <value xml:lang="zh">用户名只能有字母,数字和_-</value>
+        <value xml:lang="zh-TW">用戶名只能有字母,數字和_-</value>
+    </property>
 </resource>
\ No newline at end of file

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/minilang/customer/CustomerEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/minilang/customer/CustomerEvents.xml?rev=1862466&r1=1862465&r2=1862466&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/minilang/customer/CustomerEvents.xml (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/minilang/customer/CustomerEvents.xml Wed Jul  3 13:30:28 2019
@@ -168,6 +168,20 @@ under the License.
                 </if-compare>
             </else>
         </if-compare>
+        <if-compare operator="not-equals" field="parameters.UNUSEEMAIL" value="on">
+            <if>
+                <condition>
+                    <not>
+                        <if-regexp field="parameters.USERNAME" expr="^[a-zA-Z0-9_-]+$"></if-regexp>
+                    </not>
+                </condition>
+                <then>
+                    <add-error>
+                        <fail-property resource="PartyUiLabels" property="NotValidUserName"/>
+                    </add-error>
+                </then>
+            </if>
+        </if-compare>
 
         <!-- Create the Home Phone -->
         <if-not-empty field="parameters.CUSTOMER_HOME_CONTACT">