Author: mor
Date: Mon Sep  1 23:32:31 2008
New Revision: 691119

URL: http://svn.apache.org/viewvc?rev=691119&view=rev
Log:
Used usePrimaryEmailUsername on ProductStore to determine whether to use email 
for userLoginId or not. Thanks David for suggestion

Modified:
    
ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml

Modified: 
ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml?rev=691119&r1=691118&r2=691119&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
 (original)
+++ 
ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
 Mon Sep  1 23:32:31 2008
@@ -1489,12 +1489,17 @@
     <simple-method method-name="updateCustomerProfile" 
short-description="Update a customer profile">
         <set field="partyId" from-field="userLogin.partyId"/>
         <call-simple-method method-name="createUpdatePerson"/>
+        <if-compare field="productStore.usePrimaryEmailUsername" 
operator="equals" value="Y">
+            <set field="parameters.userLoginId" 
from-field="parameters.emailAddress"/>
+            <call-simple-method method-name="setUserLoginFromEmail"/>
+        </if-compare>
         <call-simple-method method-name="createUpdateUserLogin"/>
         <call-simple-method method-name="createUpdateEmailAddress"/>
     </simple-method>
 
     <simple-method method-name="setUserLoginFromEmail" short-description="Set 
userloginId from email. If user edit email address then set it as a new 
userLoginId and disabled date to far in the future for existing userLoginId">
         <if-compare field="parameters.userLoginId" operator="not-equals" 
value="userLogin.userLoginId">
+            <set field="loggedInUser" from-field="userLogin"/> 
             <set-service-fields service-name="updateUserLoginId" 
map-name="parameters" to-map-name="serviceContext"/>
             <set field="serviceContext.userLogin" from-field="userLogin"/>
             <call-service service-name="updateUserLoginId" 
in-map-name="serviceContext">
@@ -1525,15 +1530,4 @@
             <store-value value-name="loggedInUser"/>
         </if-compare>
     </simple-method>
-
-    <simple-method method-name="updateProfileAndUserLoginFromEmail" 
short-description="Update a customer profile and userloginId from email">
-        <set field="partyId" from-field="userLogin.partyId"/>
-        <set field="parameters.userLoginId" 
from-field="parameters.emailAddress"/>
-        <set field="loggedInUser" from-field="userLogin"/>
-        <call-simple-method method-name="createUpdatePerson"/>
-        <call-simple-method method-name="setUserLoginFromEmail"/>
-        <call-simple-method method-name="createUpdateUserLogin"/>
-        <call-simple-method method-name="createUpdateEmailAddress"/>
-    </simple-method>
-
 </simple-methods>
\ No newline at end of file

Modified: 
ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml?rev=691119&r1=691118&r2=691119&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml 
(original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml 
Mon Sep  1 23:32:31 2008
@@ -1719,8 +1719,6 @@
     <request-map uri="updateCustomerProfile">
         <security https="true" auth="true"/>
         <event type="simple" 
path="org/ofbiz/ecommerce/customer/CustomerEvents.xml" 
invoke="updateCustomerProfile"/>
-        <!-- Use following event only if email address will be used as 
userLoginId. Updating email address will set it as new userLoginId and disable 
existing userLoginId -->
-        <!--event type="simple" 
path="org/ofbiz/ecommerce/customer/CustomerEvents.xml" 
invoke="updateProfileAndUserLoginFromEmail"/-->
         <response name="success" type="view" value="viewprofile"/>
         <response name="error" type="view" value="EditProfile"/>
     </request-map>


Reply via email to