Commit Graph
1432 Commits
Author SHA1 Message Date
Jacques Le Roux 92e56e4078 A patch from Gareth Carter for "some files set viewIndex to 1 by default rather than 0" https://issues.apache.org/jira/browse/OFBIZ-6705
Implements a PagedList object (stores list of data items, resultset size, viewSize, viewIndex, lowIndex (called startIndex) and highIndex (called endIndex), also a utils class that returns the PagedList object based on a EntityListIterator, viewSize and viewIndex. 
And implements a queryPagedList method in EntityQuery, used as an example in findOrders service Java implementation

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1738900 13f79535-47bb-0310-9956-ffa450edef68
2016-04-13 07:29:11 +00:00
Jacques Le Roux 2001f1091a For "Replace OFBiz HttpClient by org.apache.commons.httpclient.HttpClient" - https://issues.apache.org/jira/browse/OFBIZ-4430
Since commons.httpclient.HttpClient is now deprecated/not-maintained an vulnerable I prefer to simply put a warning at the top of the class. So people can pick what they prefer and is handy for their problem at than

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1737695 13f79535-47bb-0310-9956-ffa450edef68
2016-04-04 14:49:44 +00:00
Shi Jinghai 6910aacd54 OFBIZ-6755 Update the passport component to use httpclient/core-4.4.1 instead of commons-httpclient-3.1
1. Remove commons-httpclient-3.1.jar from passport component.
2. Use httpclient 4.4.1 in base/lib instead.
3. Remove randomString methods, use RandomStringUtils.randomAlphanumeric instead.
4. Move getAllowAllHttpClient to UtilHttp.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1735021 13f79535-47bb-0310-9956-ffa450edef68
2016-03-15 06:06:33 +00:00
Deepak Dixit 94eefdcb72 OFBIZ-6278: Merged changes done at 1675464, 1675465 and 1675466 from OFBIZ-6275 branch to trunk.
Log:
==========================================================
- Make use of ResourceLoader.readXmlRootElement, which is
non-caching; this fixes a deprecation warning.
- Use ResourceLoader.readXmlRootElement, which is a
non-caching version.  This fixes a deprecation warning.
- Provide method variants (readXml{Document,RootElement}) that contain the body of the deprecated methods (getXml{Document,RootElement}).
==========================================================


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1731399 13f79535-47bb-0310-9956-ffa450edef68
2016-02-20 13:16:03 +00:00
Deepak Dixit c8add13c70 OFBIZ-6279: Migrated changes from r1675462 to Trunk.
Log:
============================================================
UtilDateTime implements deprecated methods, so add the
@Deprecated tag to stop javac from producing a warning.
============================================================

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1731385 13f79535-47bb-0310-9956-ffa450edef68
2016-02-20 12:11:01 +00:00
Deepak Dixit 51cb141c5e OFBIZ-6277: Merge changes from r1675521 to Trunk:
Log:
============================================================
new Configuration() is deprecated; instead, the desired
freemarker version should be passed in.  To make it easier to control
the version centrally, add a helper method on FreeMarkerWorker that
wraps the instantiation of the Configuration object.
============================================================


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1731380 13f79535-47bb-0310-9956-ffa450edef68
2016-02-20 12:01:23 +00:00
Jacopo Cappellato f16d1f0717 OFBIZ-6568 With the implementation of @BaseScript annotations (introduced with Groovy 2.3.0) something was broken in the CompilerConfiguration.setScriptBaseClass method and an error is thrown when our scripts are executed; the workaround is to execute at startup a script containing the @BaseScript annotation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1729809 13f79535-47bb-0310-9956-ffa450edef68
2016-02-11 11:24:51 +00:00
Jacques Le Roux e4a0586ff2 Gets rid of the session-cookie-accepted feature - https://issues.apache.org/jira/browse/OFBIZ-6871
Since OFBIZ-6867 is now done, it will no longer be used OOTB and anyway should not be needed because we should preferably always use sessionIds in cookies and newer have sessionsIds in URLs.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1728121 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 14:10:08 +00:00
Jacques Le Roux 7524cd299c Fixed a bug introduced w/ r1714652 (not sure on this one but better safe than sorry)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1714691 13f79535-47bb-0310-9956-ffa450edef68
2015-11-16 22:00:52 +00:00
Jacques Le Roux d16b6da338 Fixed a bug introduced w/ r1714652
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1714689 13f79535-47bb-0310-9956-ffa450edef68
2015-11-16 21:56:56 +00:00
Jacques Le Roux 1b8b15b45d Fixed a bug introduced w/ r1714652
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1714688 13f79535-47bb-0310-9956-ffa450edef68
2015-11-16 21:54:10 +00:00
Jacques Le Roux fbca214fca Fixed a bug introduced w/ r1714652
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1714686 13f79535-47bb-0310-9956-ffa450edef68
2015-11-16 21:52:16 +00:00
Jacques Le Roux b32ea9f89f No functional change, completes r1713985: removes superfluous .properties extension from UtilProperties requests (and yes I checked UspsServicesTests ;))
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1714652 13f79535-47bb-0310-9956-ffa450edef68
2015-11-16 19:02:25 +00:00
Jacques Le Roux 8ae051720e Non functional changes
Removes useless commented out code in UtilCodec.java
Replaces a tab by spaces in ContextFilter.java
Removes useless line and replaces tabs by spaces in OFBizSolrContextFilter.java (annoying in compare)



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1713991 13f79535-47bb-0310-9956-ffa450edef68
2015-11-12 09:34:56 +00:00
Jacques Le Roux 0bd172fafc Completes r1709882 for <<Possible static XSS issue with Content>> https://issues.apache.org/jira/browse/OFBIZ-6669
As explained in OFBIZ-6669 last comments, contrary to what I did in ContentWorker class, when I before did the work on *ContentWrapper classes I did not use the sanitizer but only an encoder (either HTML or URL).
Because I wrongly supposed that only plain text was used there and certainly my lazy mind thought it was easier because of the URL encoderType to also handle.

When the encoderType is HTML, we now use the sanitizer in *ContentWrapper classes, and ContentWorker.java has also been adapted. 
For that I enhanced the UtilCodec class. The sanitizer is only used when HTML is requested, else the sanitize() method simply calls the encode() method.

I removed the content.sanitize property in content.properties and added a sanitizer.permissive.policy property in the new owasp.properties (in base config) with some explanations. This allows for more configuration.

I changed the line 85 in productsummary.ftl to use an HTML content wrapper, same in minilastviewedcategories.ftl. 
To be totally complete, we should change *lines like* in productsummary.ftl line 85 to use an HTML content wrapper.
Not easy to spot but anyway those not done will simply not totally show well, without any security impacts.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1713634 13f79535-47bb-0310-9956-ffa450edef68
2015-11-10 13:40:22 +00:00
Jacques Le Roux 81dc18d40c A rearranged patch from Gareth Carter for "Update SimpleContentViewHandler to return mime type on file extension and use inline for content-disposition" https://issues.apache.org/jira/browse/OFBIZ-6702
SimpleContentViewHandler will return mime type 'text/html' for all DataResource values without a specified mimeTypeId. Changing to DataResourceWorker.getMimeType will allow determining the mimeTypeId by file extension 
Fixing the mime type will allow the browsers to display content inline if UtilHttp is updated aswell. All unknown extensions will be set to octet-stream causing the browser to prompt for download

jleroux: after some discussions, this finally uses a content-disposition-type property in requestHandler.properties to allow more flexibility for users (see UtilHttp.setContentDisposition() method). Beware "inline" is less secure. For this reason, Gareth forced the "dangerous" text/html mime type to application/octet-stream in SimpleContentViewHandler class. This to prevent possible static XSS attacks. See the Jira issue for more details.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1712835 13f79535-47bb-0310-9956-ffa450edef68
2015-11-05 17:47:00 +00:00
Jacques Le Roux aa9129deb3 These changes accidentally slipped in with r1712347, reverting
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1712366 13f79535-47bb-0310-9956-ffa450edef68
2015-11-03 18:41:04 +00:00
Jacques Le Roux 40bc757dea An updated and modified patch from Bob Morley for "ProductStore did not allow the default timezone to be set" https://issues.apache.org/jira/browse/OFBIZ-2813
The ProductStore has the defaultLocaleString and the defaultCurrencyUomId but does not have a defaultTimeZoneString.  What happens when a store is selected (from e-commerce or the POS) is that it will look to the user for a lastTimeZone and if that is not set, it would simply revert to the TimeZone.getDefault() (so the timezone based on the server).

The trouble we had was that you may have an application server that is running in a completely different timezone than what is desired for the store.

jleroux: see comments in the Jira issue for the modifications I did

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1712347 13f79535-47bb-0310-9956-ffa450edef68
2015-11-03 16:53:30 +00:00
Michael Brohl 82b7386e3d Applied patch for OFBIZ-6621: MapContext.entrySet() slows down when ByteBuffer objects are in the context.
Introduces a private inner class ListSet representing a Set backed by a List instead of the HashSet implementation.

Thanks Gareth Carter for spotting this and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1703954 13f79535-47bb-0310-9956-ffa450edef68
2015-09-19 08:43:40 +00:00
Jacques Le Roux f98543b1ff A patch from Gaudin Pierre for "error in isValidEan util" https://issues.apache.org/jira/browse/OFBIZ-6624
There is an error in isValidEan util. It should be 12 and not 13 in the methods charAt and calcChecksum  because they start at 0.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1703586 13f79535-47bb-0310-9956-ffa450edef68
2015-09-17 12:05:19 +00:00
Adrian Crum 6066e4e42f Make primitive initialization explicit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1700864 13f79535-47bb-0310-9956-ffa450edef68
2015-09-02 18:43:41 +00:00
Adrian Crum 26198405b9 Added a FIXME comment. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1698406 13f79535-47bb-0310-9956-ffa450edef68
2015-08-28 20:26:01 +00:00
Jacques Le Roux 067df90ae1 After r1695126, I found that most of the Java files have svn:eol-style=native. So only 116 Java files were missing svn:eol-style=native. I guess those have been added by committers who are not using the OFBiz svn config file on their machines. So rather than removing svn:eol-style=native, this commits add the property to the files which miss it. Here 116+89=205 files have their svn:eol-style property changed to native.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1695129 13f79535-47bb-0310-9956-ffa450edef68
2015-08-10 16:33:23 +00:00
Jacques Le Roux dca48b0893 Reverts r1044202. No functional change.
This reverts svn:eol-style=native on Java files which were forced by r1044202n, 89 Java files are concerned. This commit hopefully makes things more consistent. 
It's indeed hard to see the impact of this change before it's committed. I'll check once done, I already found 116 Java files w/o svn:eol-style=native but there are 1231 Java files at all, so not sure how most are set...


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1695126 13f79535-47bb-0310-9956-ffa450edef68
2015-08-10 16:15:37 +00:00
Deepak Dixit cc7d7333c1 (OFBIZ-6562) Used getCombinedMap instead of getParameterMap while preparing param map for string-map-prefix. Now string-map-prefix will work fine in case of ajax call as well.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1693393 13f79535-47bb-0310-9956-ffa450edef68
2015-07-30 08:07:20 +00:00
Jacques Le Roux 1d9f55c71f A patch from Francis Douet for "streamContentToBrowser fails when the file name contains a comma, only with Chrome." https://issues.apache.org/jira/browse/OFBIZ-6554
streamContentToBrowser fails when the file name contains a comma, happens only with Google Chrome.
Can easily be reproduced for example by uploading the Logo Image URL of the default organization in the party manager, that includes a comma of course.
Fixed in my patch by wrapping the file name in quotes.
Error on the browser console:
GET https://localhost:8443/content/control/stream?contentId=10020 net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION

jleroux: at 1935.1 section of http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html I read this example << Content-Disposition: attachment; filename="fname.ext">> So Francis's solution is the right one

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1690086 13f79535-47bb-0310-9956-ffa450edef68
2015-07-09 12:30:22 +00:00
Jacopo Cappellato eb6d01b066 New implementation of the two-way cryptographic services of OFBiz based on Apache Shiro:
* two-way encryption is now delegated to Apache Shiro, with stronger initialization vectors
* the mechanism is backward compatible
* new tools to update the encryption of private keys, useful to upgrade older versions of OFBiz and most of all to replace old keys with new ones (this is critical to implement stronger security practices as requested by PCI) 
* unit tests



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1684608 13f79535-47bb-0310-9956-ffa450edef68
2015-06-10 09:01:30 +00:00
Adrian Crum a73c51bb49 Fix a thread-safety issue. Trivial unit test changes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1684216 13f79535-47bb-0310-9956-ffa450edef68
2015-06-08 16:12:30 +00:00
Jacques Le Roux af9ccf0c17 A patch from Taher Alkhateeb "Upgrade OFBiz to Java JDK 8" https://issues.apache.org/jira/browse/OFBIZ-6458
1st step: fixes a test which was not passing 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1684042 13f79535-47bb-0310-9956-ffa450edef68
2015-06-07 16:03:04 +00:00
Adrian Crum 240ba74d82 Replace ClassCastException with type check - https://issues.apache.org/jira/browse/OFBIZ-6291.
Ignoring a thrown ClassCastException is a common pattern in the project (one I have used myself), but it should be avoided in the future because it makes debugging difficult, plus it creates objects unnecessarily.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1680058 13f79535-47bb-0310-9956-ffa450edef68
2015-05-18 17:18:54 +00:00
Adrian Crum a84272b1ba Trivial code cleanup in ObjectType.java - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1677386 13f79535-47bb-0310-9956-ffa450edef68
2015-05-03 11:25:08 +00:00
Adrian Crum ebf03ea721 Some work on ComponentContainer.java:
1. Improved thread safety
2. Optimization
3. Code cleanup
4. Use String constant instead of hard-coded value


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676985 13f79535-47bb-0310-9956-ffa450edef68
2015-04-30 13:46:46 +00:00
Adrian Crum d82005c958 Use String constant instead of hard-coded value.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676975 13f79535-47bb-0310-9956-ffa450edef68
2015-04-30 12:42:17 +00:00
Adrian Crum ec9d5d5416 Small fixup for my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676974 13f79535-47bb-0310-9956-ffa450edef68
2015-04-30 12:41:26 +00:00
Adrian Crum ef710ed02f Some work on ComponentLoaderConfig.java:
1. Thread safety
2. Optimization
3. Code cleanup
4. Improved error handling

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676970 13f79535-47bb-0310-9956-ffa450edef68
2015-04-30 12:12:17 +00:00
Adrian Crum c2de699ca6 Fixed some bugs in startup code (https://issues.apache.org/jira/browse/OFBIZ-6268):
1. Class path loading was ignoring component settings, so class paths for disabled components were being loaded.
2. Configuration files were parsed twice.
3. Potential problem with unloading a loader that failed loading.

I was unable to test Cobertura because the necessary class (org.ofbiz.base.config.CoberturaInstrumenter) isn't being compiled for some reason.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676746 13f79535-47bb-0310-9956-ffa450edef68
2015-04-29 13:52:27 +00:00
Adrian Crum cd4f6cdbb3 Fixed a bug in UtilMisc.java where the List returned by the availableLocales() method included an empty Locale - causing errors in FreeMarker templates.
https://issues.apache.org/jira/browse/OFBIZ-6309

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676674 13f79535-47bb-0310-9956-ffa450edef68
2015-04-29 06:10:01 +00:00
Nicolas Malin 5f6c13b369 correct String conversion to Set on StringUtil that not respect the field order, thanks to Francis Douet to raise it on the issue (OFBIZ-6299 Field order is not correct in the auto-complete for look-ups.)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1675998 13f79535-47bb-0310-9956-ffa450edef68
2015-04-25 07:00:42 +00:00
Adrian Crum a2fc70daff A small change to the behavior of the UtilProperties.createProperties() method: if the file is not found, return null instead of throwing an exception.
https://issues.apache.org/jira/browse/OFBIZ-6261

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1674453 13f79535-47bb-0310-9956-ffa450edef68
2015-04-18 08:30:03 +00:00
Adrian Crum a1bb4ff6bc Fix warnings in trunk in Java source code - https://issues.apache.org/jira/browse/OFBIZ-6217.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1674064 13f79535-47bb-0310-9956-ffa450edef68
2015-04-16 13:05:55 +00:00
Adrian Crum f315f0d5be Fix warnings in trunk in Java source code - https://issues.apache.org/jira/browse/OFBIZ-6217.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1669537 13f79535-47bb-0310-9956-ffa450edef68
2015-03-27 10:04:14 +00:00
Deepak Dixit bdba71d230 OFBIZ-6183: Update ComponentConfig code to allow empty mount point, as if need to mount website on root then mount-point should be "" instead of "/".
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1668236 13f79535-47bb-0310-9956-ffa450edef68
2015-03-21 11:14:55 +00:00
Jacopo Cappellato f69e599355 Upgrade to latest bug fix release of Freemarker: 2.3.22
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1666949 13f79535-47bb-0310-9956-ffa450edef68
2015-03-16 10:31:13 +00:00
Jacopo Cappellato 34beacd425 Relaxing default behavior of canonicalization in order to allow mixed and multiple encodings: with this change, in these cases, instead of throwing an error it will simply log a worning message.
This should fix, at least as a temporary solution, the recent issues happening after the upgrade to the new ESAPI.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1659224 13f79535-47bb-0310-9956-ffa450edef68
2015-02-12 11:17:46 +00:00
Adrian Crum 14e3b15252 Some small fixups for some of my previous commits.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1650347 13f79535-47bb-0310-9956-ffa450edef68
2015-01-08 17:53:59 +00:00
Adrian Crum 7c9aa8e489 Some optimizations for URL lookups.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649979 13f79535-47bb-0310-9956-ffa450edef68
2015-01-07 00:24:28 +00:00
Adrian Crum b85eb53598 Removed an unused method from UtilURL.java, added some JavaDocs.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649971 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 23:22:56 +00:00
Adrian Crum 1df97ce20c Fixed a bug in FlexibleLocation.java where the optional locationresolvers.properties file was not being loaded due to static initializer recursion.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649934 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 20:21:28 +00:00
Adrian Crum c201d5f6f3 Small change to Debug.java - to avoid static initializer recursion.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649933 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 20:19:56 +00:00
Adrian Crum 38c358671f A new method for UtilProperties.java - to be used in upcoming changes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649931 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 20:18:43 +00:00