svn commit: r1785276 - in /ofbiz/branches/release13.07/framework: common/src/org/ofbiz/common/email/NotificationServices.java webapp/src/org/ofbiz/webapp/control/RequestHandler.java webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java

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

svn commit: r1785276 - in /ofbiz/branches/release13.07/framework: common/src/org/ofbiz/common/email/NotificationServices.java webapp/src/org/ofbiz/webapp/control/RequestHandler.java webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java

jleroux@apache.org
Author: jleroux
Date: Fri Mar  3 11:59:01 2017
New Revision: 1785276

URL: http://svn.apache.org/viewvc?rev=1785276&view=rev
Log:
Reverted: Login and logout process in demo backends (Management Apps)
shows a certificate issue
(OFBIZ-9206)

I, for now, decided that I'll not handle the certificate for the old demo.
Too much troubles! So I reverts all related changes

Modified:
    ofbiz/branches/release13.07/framework/common/src/org/ofbiz/common/email/NotificationServices.java
    ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
    ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java

Modified: ofbiz/branches/release13.07/framework/common/src/org/ofbiz/common/email/NotificationServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/common/src/org/ofbiz/common/email/NotificationServices.java?rev=1785276&r1=1785275&r2=1785276&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/common/src/org/ofbiz/common/email/NotificationServices.java (original)
+++ ofbiz/branches/release13.07/framework/common/src/org/ofbiz/common/email/NotificationServices.java Fri Mar  3 11:59:01 2017
@@ -27,6 +27,8 @@ import java.net.UnknownHostException;
 import java.util.Locale;
 import java.util.Map;
 
+import javolution.util.FastMap;
+
 import org.ofbiz.base.container.ClassLoaderContainer;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilGenerics;
@@ -46,7 +48,6 @@ import org.ofbiz.service.ModelService;
 import org.ofbiz.service.ServiceUtil;
 
 import freemarker.template.TemplateException;
-import javolution.util.FastMap;
 
 /**
  * Provides generic services related to preparing and
@@ -266,7 +267,6 @@ public class NotificationServices {
             String httpPort = null;
             String httpServer = null;
             Boolean enableHttps = null;
-            Boolean dontAdd = false;
 
             try {
                 // using just the IP address of localhost if we don't have a defined server
@@ -296,10 +296,7 @@ public class NotificationServices {
 
             // fill in any missing properties with fields from the global file
             if (UtilValidate.isEmpty(httpsPort)) {
-                httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", delegator);
-                if ("8443" != httpsPort) {
-                    dontAdd = true; // Here we can't initialise the port from a request, so we assume it's set in properties or DB, we don't add the portOffset anyway
-                }
+                httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", "443", delegator);
             }
             if (UtilValidate.isEmpty(httpsServer)) {
                 httpsServer = EntityUtilProperties.getPropertyValue("url.properties", "force.https.host", localServer, delegator);
@@ -318,13 +315,9 @@ public class NotificationServices {
                 Integer httpPortValue = Integer.valueOf(httpPort);
                 httpPortValue += ClassLoaderContainer.portOffset;
                 httpPort = httpPortValue.toString();
-                if (!dontAdd) {
-                    Integer httpsPortValue = Integer.valueOf(httpsPort);
-                    if (!httpsPort.isEmpty()) {
-                        httpsPortValue += ClassLoaderContainer.portOffset;
-                    }
-                    httpsPort = httpsPortValue.toString();
-                }
+                Integer httpsPortValue = Integer.valueOf(httpsPort);
+                httpsPortValue += ClassLoaderContainer.portOffset;
+                httpsPort = httpsPortValue.toString();
             }
 
             // prepare the (non-secure) URL

Modified: ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1785276&r1=1785275&r2=1785276&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original)
+++ ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Fri Mar  3 11:59:01 2017
@@ -34,6 +34,8 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import javolution.util.FastMap;
+
 import org.ofbiz.base.container.ClassLoaderContainer;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.SSLUtil;
@@ -59,8 +61,6 @@ import org.ofbiz.webapp.view.ViewHandler
 import org.ofbiz.webapp.website.WebSiteWorker;
 import org.owasp.esapi.errors.EncodingException;
 
-import javolution.util.FastMap;
-
 /**
  * RequestHandler - Request Processor Object
  */
@@ -942,12 +942,7 @@ public class RequestHandler {
 
     public static String getDefaultServerRootUrl(HttpServletRequest request, boolean secure) {
         Delegator delegator = (Delegator) request.getAttribute("delegator");
-        Boolean dontAdd = false;
-        String httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", delegator);
-        if (httpsPort.isEmpty() ) {
-            httpsPort = String.valueOf(request.getServerPort());
-            dontAdd = true; // We take the port from the request, don't add the portOffset
-        }
+        String httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", "443", delegator);
         String httpsServer = EntityUtilProperties.getPropertyValue("url.properties", "force.https.host", delegator);
         String httpPort = EntityUtilProperties.getPropertyValue("url.properties", "port.http", "80", delegator);
         String httpServer = EntityUtilProperties.getPropertyValue("url.properties", "force.http.host", delegator);
@@ -957,13 +952,9 @@ public class RequestHandler {
             Integer httpPortValue = Integer.valueOf(httpPort);
             httpPortValue += ClassLoaderContainer.portOffset;
             httpPort = httpPortValue.toString();
-            if (!dontAdd) {
-                Integer httpsPortValue = Integer.valueOf(httpsPort);
-                if (!httpsPort.isEmpty()) {
-                    httpsPortValue += ClassLoaderContainer.portOffset;
-                }
-                httpsPort = httpsPortValue.toString();
-            }
+            Integer httpsPortValue = Integer.valueOf(httpsPort);
+            httpsPortValue += ClassLoaderContainer.portOffset;
+            httpsPort = httpsPortValue.toString();
         }
         
         StringBuilder newURL = new StringBuilder();
@@ -1073,7 +1064,6 @@ public class RequestHandler {
         String httpPort = null;
         String httpServer = null;
         Boolean enableHttps = null;
-        Boolean dontAdd = false;
 
         // load the properties from the website entity
         GenericValue webSite;
@@ -1094,11 +1084,7 @@ public class RequestHandler {
 
         // fill in any missing properties with fields from the global file
         if (UtilValidate.isEmpty(httpsPort)) {
-            httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", delegator);
-            if (httpsPort.isEmpty() ) {
-                httpsPort = String.valueOf(request.getServerPort());
-                dontAdd = true; // We take the port from the request, don't add the portOffset
-            }
+            httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", "443", delegator);
         }
         if (UtilValidate.isEmpty(httpsServer)) {
             httpsServer = EntityUtilProperties.getPropertyValue("url.properties", "force.https.host", delegator);
@@ -1117,13 +1103,9 @@ public class RequestHandler {
             Integer httpPortValue = Integer.valueOf(httpPort);
             httpPortValue += ClassLoaderContainer.portOffset;
             httpPort = httpPortValue.toString();
-            if (!dontAdd) {
-                Integer httpsPortValue = Integer.valueOf(httpsPort);
-                if (!httpsPort.isEmpty()) {
-                    httpsPortValue += ClassLoaderContainer.portOffset;
-                }
-                httpsPort = httpsPortValue.toString();
-            }
+            Integer httpsPortValue = Integer.valueOf(httpsPort);
+            httpsPortValue += ClassLoaderContainer.portOffset;
+            httpsPort = httpsPortValue.toString();
         }
         
         // create the path the the control servlet

Modified: ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java?rev=1785276&r1=1785275&r2=1785276&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java (original)
+++ ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java Fri Mar  3 11:59:01 2017
@@ -104,7 +104,6 @@ public class OfbizUrlTransform implement
                     BeanModel res = (BeanModel) env.getVariable("response");
                     Object prefix = env.getVariable("urlPrefix");
                     if (UtilValidate.isNotEmpty(webSiteId)) {
-                        Boolean dontAdd = false;
                         HttpServletRequest request = (HttpServletRequest) req.getWrappedObject();
                         Delegator delegator = (Delegator) request.getAttribute("delegator");
                         String httpsPort = null;
@@ -128,11 +127,7 @@ public class OfbizUrlTransform implement
                         }
                         // fill in any missing properties with fields from the global file
                         if (UtilValidate.isEmpty(httpsPort)) {
-                            httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", delegator);
-                            if (httpsPort.isEmpty() ) {
-                                httpsPort = String.valueOf(request.getServerPort());
-                                dontAdd = true; // We take the port from the request, don't add the portOffset
-                            }
+                            httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", "443", delegator);
                         }
                         if (UtilValidate.isEmpty(httpsServer)) {
                             httpsServer = EntityUtilProperties.getPropertyValue("url.properties", "force.https.host", delegator);
@@ -151,14 +146,11 @@ public class OfbizUrlTransform implement
                             Integer httpPortValue = Integer.valueOf(httpPort);
                             httpPortValue += ClassLoaderContainer.portOffset;
                             httpPort = httpPortValue.toString();
-                            if (!dontAdd) {
-                                Integer httpsPortValue = Integer.valueOf(httpsPort);
-                                if (!httpsPort.isEmpty()) {
-                                    httpsPortValue += ClassLoaderContainer.portOffset;
-                                }
-                                httpsPort = httpsPortValue.toString();
-                            }
+                            Integer httpsPortValue = Integer.valueOf(httpsPort);
+                            httpsPortValue += ClassLoaderContainer.portOffset;
+                            httpsPort = httpsPortValue.toString();
                         }
+
                         if (secure && enableHttps) {
                             String server = httpsServer;
                             if (UtilValidate.isEmpty(server)) {