svn commit: r744727 [2/2] - in /ofbiz/trunk: ./ applications/content/ applications/content/entitydef/ applications/content/servicedef/ applications/content/src/org/ofbiz/content/data/ applications/content/src/org/ofbiz/content/email/ applications/party...

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

svn commit: r744727 [2/2] - in /ofbiz/trunk: ./ applications/content/ applications/content/entitydef/ applications/content/servicedef/ applications/content/src/org/ofbiz/content/data/ applications/content/src/org/ofbiz/content/email/ applications/party...

jonesde
Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java?rev=744727&r1=744726&r2=744727&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java Sun Feb 15 19:34:49 2009
@@ -32,7 +32,6 @@
 import org.ofbiz.base.crypto.HashCrypt;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilDateTime;
-import static org.ofbiz.base.util.UtilGenerics.checkMap;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
@@ -43,7 +42,6 @@
 import org.ofbiz.entity.condition.EntityFunction;
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.model.ModelEntity;
-import org.ofbiz.entity.serialize.XmlSerializer;
 import org.ofbiz.entity.transaction.GenericTransactionException;
 import org.ofbiz.entity.transaction.TransactionUtil;
 import org.ofbiz.entity.util.EntityFindOptions;
@@ -52,6 +50,7 @@
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.ModelService;
 import org.ofbiz.service.ServiceUtil;
+import org.ofbiz.webapp.control.LoginWorker;
 
 /**
  * <b>Title:</b> Login Services
@@ -198,7 +197,7 @@
 
                             if (!isServiceAuth) {
                                 // get the UserLoginSession if this is not a service auth
-                                Map userLoginSessionMap = getUserLoginSession(userLogin);
+                                Map userLoginSessionMap = LoginWorker.getUserLoginSession(userLogin);
                                 GenericValue userLoginSession = null;
 
                                 // return the UserLoginSession Map
@@ -900,24 +899,4 @@
         
         return hashType;
     }
-
-    public static Map<String, Object> getUserLoginSession(GenericValue userLogin) {
-        GenericDelegator delegator = userLogin.getDelegator();
-        GenericValue userLoginSession;
-        Map<String, Object> userLoginSessionMap = null;
-        try {
-            userLoginSession = userLogin.getRelatedOne("UserLoginSession");
-            if (userLoginSession != null) {
-                Object deserObj = XmlSerializer.deserialize(userLoginSession.getString("sessionData"), delegator);
-                //don't check, just cast, if it fails it will get caught and reported below; if (deserObj instanceof Map)
-                userLoginSessionMap = checkMap(deserObj, String.class, Object.class);
-            }
-        } catch (GenericEntityException ge) {
-            Debug.logWarning(ge, "Cannot get UserLoginSession for UserLogin ID: " +
-                    userLogin.getString("userLoginId"), module);
-        } catch (Exception e) {
-            Debug.logWarning(e, "Problems deserializing UserLoginSession", module);
-        }
-        return userLoginSessionMap;
-    }
 }

Modified: ofbiz/trunk/framework/webapp/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/build.xml?rev=744727&r1=744726&r2=744727&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/build.xml (original)
+++ ofbiz/trunk/framework/webapp/build.xml Sun Feb 15 19:34:49 2009
@@ -43,7 +43,6 @@
         <fileset dir="../service/lib" includes="*.jar"/>
         <fileset dir="../service/build/lib" includes="*.jar"/>
         <fileset dir="../minilang/build/lib" includes="*.jar"/>
-        <fileset dir="../common/build/lib" includes="*.jar"/>
     </path>
 
     <patternset id="src.exc.set">

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java?rev=744727&r1=744726&r2=744727&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java Sun Feb 15 19:34:49 2009
@@ -49,7 +49,6 @@
 import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.StringUtil.StringWrapper;
-import org.ofbiz.common.login.LoginServices;
 import org.ofbiz.entity.GenericDelegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
@@ -57,6 +56,7 @@
 import org.ofbiz.entity.condition.EntityConditionList;
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.model.ModelEntity;
+import org.ofbiz.entity.serialize.XmlSerializer;
 import org.ofbiz.entity.transaction.GenericTransactionException;
 import org.ofbiz.entity.transaction.TransactionUtil;
 import org.ofbiz.security.Security;
@@ -634,7 +634,7 @@
                     userLogin.store();
 
                     // login the user
-                    Map<String, Object> ulSessionMap = LoginServices.getUserLoginSession(userLogin);
+                    Map<String, Object> ulSessionMap = LoginWorker.getUserLoginSession(userLogin);
                     return doMainLogin(request, response, userLogin, ulSessionMap); // doing the main login
                 }
             }
@@ -748,7 +748,7 @@
                                         userLogin.store();
 
                                         // login the user
-                                        Map<String, Object> ulSessionMap = LoginServices.getUserLoginSession(userLogin);
+                                        Map<String, Object> ulSessionMap = LoginWorker.getUserLoginSession(userLogin);
                                         return doMainLogin(request, response, userLogin, ulSessionMap); // doing the main login
                                     }
                                 }
@@ -872,4 +872,24 @@
 
         return true;
     }
+
+    public static Map<String, Object> getUserLoginSession(GenericValue userLogin) {
+        GenericDelegator delegator = userLogin.getDelegator();
+        GenericValue userLoginSession;
+        Map<String, Object> userLoginSessionMap = null;
+        try {
+            userLoginSession = userLogin.getRelatedOne("UserLoginSession");
+            if (userLoginSession != null) {
+                Object deserObj = XmlSerializer.deserialize(userLoginSession.getString("sessionData"), delegator);
+                //don't check, just cast, if it fails it will get caught and reported below; if (deserObj instanceof Map)
+                userLoginSessionMap = checkMap(deserObj, String.class, Object.class);
+            }
+        } catch (GenericEntityException ge) {
+            Debug.logWarning(ge, "Cannot get UserLoginSession for UserLogin ID: " +
+                    userLogin.getString("userLoginId"), module);
+        } catch (Exception e) {
+            Debug.logWarning(e, "Problems deserializing UserLoginSession", module);
+        }
+        return userLoginSessionMap;
+    }
 }