A modified patch from Pierre Smits for "Remove superfluous .properties extension from EntityUtilProperties requests" https://issues.apache.org/jira/browse/OFBIZ-6719
Currently many EntityUtilProperties requests have the .properties extension in the parameters for the resource, but this is not needed as it is stripped later on. jleroux: I found 5 others, replaced also git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1713985 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -545,7 +545,7 @@ public class LoginWorker {
|
||||
if (userLogin != null && "Y".equals(userLogin.getString("requirePasswordChange"))) {
|
||||
return "requirePasswordChange";
|
||||
}
|
||||
String autoChangePassword = EntityUtilProperties.getPropertyValue("security.properties", "user.auto.change.password.enable", "false", delegator);
|
||||
String autoChangePassword = EntityUtilProperties.getPropertyValue("security", "user.auto.change.password.enable", "false", delegator);
|
||||
if ("true".equalsIgnoreCase(autoChangePassword)) {
|
||||
if ("requirePasswordChange".equals(autoChangePassword(request, response))) {
|
||||
return "requirePasswordChange";
|
||||
@@ -735,7 +735,7 @@ public class LoginWorker {
|
||||
Delegator delegator = (Delegator) request.getAttribute("delegator");
|
||||
HttpSession session = request.getSession();
|
||||
GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
|
||||
String domain = EntityUtilProperties.getPropertyValue("url.properties", "cookie.domain", delegator);
|
||||
String domain = EntityUtilProperties.getPropertyValue("url", "cookie.domain", delegator);
|
||||
if (userLogin != null) {
|
||||
Cookie autoLoginCookie = new Cookie(getAutoLoginCookieName(request), userLogin.getString("userLoginId"));
|
||||
autoLoginCookie.setMaxAge(60 * 60 * 24 * 365);
|
||||
@@ -870,7 +870,7 @@ public class LoginWorker {
|
||||
// preprocessor method to login a user from a HTTP request header (configured in security.properties)
|
||||
public static String checkRequestHeaderLogin(HttpServletRequest request, HttpServletResponse response) {
|
||||
Delegator delegator = (Delegator) request.getAttribute("delegator");
|
||||
String httpHeader = EntityUtilProperties.getPropertyValue("security.properties", "security.login.http.header", null, delegator);
|
||||
String httpHeader = EntityUtilProperties.getPropertyValue("security", "security.login.http.header", null, delegator);
|
||||
|
||||
// make sure the header field is set in security.properties; if not, then this is disabled and just return
|
||||
if (UtilValidate.isNotEmpty(httpHeader)) {
|
||||
@@ -918,7 +918,7 @@ public class LoginWorker {
|
||||
// preprocessor method to login a user w/ client certificate see security.properties to configure the pattern of CN
|
||||
public static String check509CertLogin(HttpServletRequest request, HttpServletResponse response) {
|
||||
Delegator delegator = (Delegator) request.getAttribute("delegator");
|
||||
boolean doCheck = "true".equalsIgnoreCase(EntityUtilProperties.getPropertyValue("security.properties", "security.login.cert.allow", "true", delegator));
|
||||
boolean doCheck = "true".equalsIgnoreCase(EntityUtilProperties.getPropertyValue("security", "security.login.cert.allow", "true", delegator));
|
||||
if (doCheck) {
|
||||
HttpSession session = request.getSession();
|
||||
GenericValue currentUserLogin = (GenericValue) session.getAttribute("userLogin");
|
||||
@@ -929,7 +929,7 @@ public class LoginWorker {
|
||||
}
|
||||
}
|
||||
|
||||
String cnPattern = EntityUtilProperties.getPropertyValue("security.properties", "security.login.cert.pattern", "(.*)", delegator);
|
||||
String cnPattern = EntityUtilProperties.getPropertyValue("security", "security.login.cert.pattern", "(.*)", delegator);
|
||||
Pattern pattern = Pattern.compile(cnPattern);
|
||||
//Debug.logInfo("CN Pattern: " + cnPattern, module);
|
||||
|
||||
@@ -1067,7 +1067,7 @@ public class LoginWorker {
|
||||
}
|
||||
|
||||
public static boolean isFlaggedLoggedOut(GenericValue userLogin, Delegator delegator) {
|
||||
if ("true".equalsIgnoreCase(EntityUtilProperties.getPropertyValue("security.properties", "login.disable.global.logout", delegator))) {
|
||||
if ("true".equalsIgnoreCase(EntityUtilProperties.getPropertyValue("security", "login.disable.global.logout", delegator))) {
|
||||
return false;
|
||||
}
|
||||
if (userLogin == null || userLogin.get("userLoginId") == null) {
|
||||
@@ -1175,8 +1175,8 @@ public class LoginWorker {
|
||||
Delegator delegator = (Delegator) request.getAttribute("delegator");
|
||||
String userName = request.getParameter("USERNAME");
|
||||
Timestamp now = UtilDateTime.nowTimestamp();
|
||||
Integer reqToChangePwdInDays = Integer.valueOf(EntityUtilProperties.getPropertyValue("security.properties", "user.change.password.days", "0", delegator));
|
||||
Integer passwordNoticePeriod = Integer.valueOf(EntityUtilProperties.getPropertyValue("security.properties", "user.change.password.notification.days", "0", delegator));
|
||||
Integer reqToChangePwdInDays = Integer.valueOf(EntityUtilProperties.getPropertyValue("security", "user.change.password.days", "0", delegator));
|
||||
Integer passwordNoticePeriod = Integer.valueOf(EntityUtilProperties.getPropertyValue("security", "user.change.password.notification.days", "0", delegator));
|
||||
if (reqToChangePwdInDays > 0) {
|
||||
List<GenericValue> passwordHistories = null;
|
||||
try {
|
||||
|
||||
@@ -279,7 +279,7 @@ public class RequestHandler {
|
||||
}
|
||||
}
|
||||
if (enableHttps == null) {
|
||||
enableHttps = EntityUtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y", delegator);
|
||||
enableHttps = EntityUtilProperties.propertyValueEqualsIgnoreCase("url", "port.https.enabled", "Y", delegator);
|
||||
}
|
||||
|
||||
if (Boolean.FALSE.equals(enableHttps)) {
|
||||
@@ -396,7 +396,7 @@ public class RequestHandler {
|
||||
if (protectView != null) {
|
||||
overrideViewUri = protectView;
|
||||
} else {
|
||||
overrideViewUri = EntityUtilProperties.getPropertyValue("security.properties", "default.error.response.view", delegator);
|
||||
overrideViewUri = EntityUtilProperties.getPropertyValue("security", "default.error.response.view", delegator);
|
||||
overrideViewUri = overrideViewUri.replace("view:", "");
|
||||
if ("none:".equals(overrideViewUri)) {
|
||||
interruptRequest = true;
|
||||
@@ -1025,11 +1025,11 @@ public class RequestHandler {
|
||||
@Deprecated
|
||||
public static String getDefaultServerRootUrl(HttpServletRequest request, boolean secure) {
|
||||
Delegator delegator = (Delegator) request.getAttribute("delegator");
|
||||
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);
|
||||
boolean useHttps = EntityUtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y", delegator);
|
||||
String httpsPort = EntityUtilProperties.getPropertyValue("url", "port.https", "443", delegator);
|
||||
String httpsServer = EntityUtilProperties.getPropertyValue("url", "force.https.host", delegator);
|
||||
String httpPort = EntityUtilProperties.getPropertyValue("url", "port.http", "80", delegator);
|
||||
String httpServer = EntityUtilProperties.getPropertyValue("url", "force.http.host", delegator);
|
||||
boolean useHttps = EntityUtilProperties.propertyValueEqualsIgnoreCase("url", "port.https.enabled", "Y", delegator);
|
||||
|
||||
if (Start.getInstance().getConfig().portOffset != 0) {
|
||||
Integer httpPortValue = Integer.valueOf(httpPort);
|
||||
|
||||
@@ -132,7 +132,7 @@ public class ServiceEventHandler implements EventHandler {
|
||||
Map<String, Object> multiPartMap = new HashMap<String, Object>();
|
||||
if (isMultiPart) {
|
||||
// get the http upload configuration
|
||||
String maxSizeStr = EntityUtilProperties.getPropertyValue("general.properties", "http.upload.max.size", "-1", dctx.getDelegator());
|
||||
String maxSizeStr = EntityUtilProperties.getPropertyValue("general", "http.upload.max.size", "-1", dctx.getDelegator());
|
||||
long maxUploadSize = -1;
|
||||
try {
|
||||
maxUploadSize = Long.parseLong(maxSizeStr);
|
||||
@@ -142,7 +142,7 @@ public class ServiceEventHandler implements EventHandler {
|
||||
}
|
||||
// get the http size threshold configuration - files bigger than this will be
|
||||
// temporarly stored on disk during upload
|
||||
String sizeThresholdStr = EntityUtilProperties.getPropertyValue("general.properties", "http.upload.max.sizethreshold", "10240", dctx.getDelegator());
|
||||
String sizeThresholdStr = EntityUtilProperties.getPropertyValue("general", "http.upload.max.sizethreshold", "10240", dctx.getDelegator());
|
||||
int sizeThreshold = 10240; // 10K
|
||||
try {
|
||||
sizeThreshold = Integer.parseInt(sizeThresholdStr);
|
||||
@@ -151,7 +151,7 @@ public class ServiceEventHandler implements EventHandler {
|
||||
sizeThreshold = -1;
|
||||
}
|
||||
// directory used to temporarily store files that are larger than the configured size threshold
|
||||
String tmpUploadRepository = EntityUtilProperties.getPropertyValue("general.properties", "http.upload.tmprepository", "runtime/tmp", dctx.getDelegator());
|
||||
String tmpUploadRepository = EntityUtilProperties.getPropertyValue("general", "http.upload.tmprepository", "runtime/tmp", dctx.getDelegator());
|
||||
String encoding = request.getCharacterEncoding();
|
||||
// check for multipart content types which may have uploaded items
|
||||
|
||||
@@ -410,7 +410,7 @@ public class ServiceEventHandler implements EventHandler {
|
||||
Debug.logError("=============== " + errMsg + "; In session [" + session.getId() + "]; Note that this can be changed using the service.http.parameters.require.encrypted property in the url.properties file", module);
|
||||
|
||||
// the default here is true, so anything but N/n is true
|
||||
boolean requireEncryptedServiceWebParameters = !EntityUtilProperties.propertyValueEqualsIgnoreCase("url.properties", "service.http.parameters.require.encrypted", "N", delegator);
|
||||
boolean requireEncryptedServiceWebParameters = !EntityUtilProperties.propertyValueEqualsIgnoreCase("url", "service.http.parameters.require.encrypted", "N", delegator);
|
||||
|
||||
// NOTE: this forces service call event parameters to be in the body and not in the URL! can be issues with existing links, like Delete links or whatever, and those need to be changed to forms!
|
||||
if (requireEncryptedServiceWebParameters) {
|
||||
|
||||
@@ -137,9 +137,9 @@ public class OfbizCurrencyTransform implements TemplateTransformModel {
|
||||
Delegator delegator = (Delegator) request.getAttribute("delegator");
|
||||
// Get rounding from SystemProperty
|
||||
if (UtilValidate.isNotEmpty(delegator)) {
|
||||
scaleEnabled = EntityUtilProperties.getPropertyValue("general.properties", "currency.scale.enabled", "N", delegator);
|
||||
scaleEnabled = EntityUtilProperties.getPropertyValue("general", "currency.scale.enabled", "N", delegator);
|
||||
if (UtilValidate.isEmpty(roundingNumber)) {
|
||||
String roundingString = EntityUtilProperties.getPropertyValue("general.properties", "currency.rounding.default", "10", delegator);
|
||||
String roundingString = EntityUtilProperties.getPropertyValue("general", "currency.rounding.default", "10", delegator);
|
||||
if (UtilValidate.isInteger(roundingString)) roundingNumber = Integer.parseInt(roundingString);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,11 +152,11 @@ public final class WebSiteProperties {
|
||||
private final boolean enableHttps;
|
||||
|
||||
private WebSiteProperties(Delegator delegator) {
|
||||
this.httpPort = EntityUtilProperties.getPropertyValue("url.properties", "port.http", delegator);
|
||||
this.httpHost = EntityUtilProperties.getPropertyValue("url.properties", "force.http.host", delegator);
|
||||
this.httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", delegator);
|
||||
this.httpsHost = EntityUtilProperties.getPropertyValue("url.properties", "force.https.host", delegator);
|
||||
this.enableHttps = EntityUtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y", delegator);
|
||||
this.httpPort = EntityUtilProperties.getPropertyValue("url", "port.http", delegator);
|
||||
this.httpHost = EntityUtilProperties.getPropertyValue("url", "force.http.host", delegator);
|
||||
this.httpsPort = EntityUtilProperties.getPropertyValue("url", "port.https", delegator);
|
||||
this.httpsHost = EntityUtilProperties.getPropertyValue("url", "force.https.host", delegator);
|
||||
this.enableHttps = EntityUtilProperties.propertyValueEqualsIgnoreCase("url", "port.https.enabled", "Y", delegator);
|
||||
}
|
||||
|
||||
private WebSiteProperties(String httpPort, String httpHost, String httpsPort, String httpsHost, boolean enableHttps) {
|
||||
|
||||
Reference in New Issue
Block a user