Commit Graph
10189 Commits
Author SHA1 Message Date
James Yong 767390ad89 Improved: Apply multi-block attr to each application (OFBIZ-11706)
1. Bug Fix
2. Disable multi-block until function is stabilized.
2020-05-23 14:08:35 +08:00
holivier 205914a1be Improved: just remove trailing space 2020-05-22 11:47:55 +02:00
James Yong e675f0a79f Improved: Apply multi-block attr to each application (OFBIZ-11706)
1. Fix missing Boundary Comment at beginning
2. Apply multi-block attr
2020-05-22 00:54:20 +08:00
Jacques Le Roux 32a71c9af4 Improved: Clean how HTTP vs HTTPS is handled
(OFBIZ-11717)

No functional changes, just better comments
2020-05-20 13:01:36 +02:00
Jacques Le Roux 4bdfb54ffb Fixed: Apache OFBiz unsafe deserialization of XMLRPC arguments (CVE-2020-9496)
(OFBIZ-11716)

Because the 2 xmlrpc related requets in webtools (xmlrpc and ping) are not using
authentication they are vulnerable to unsafe deserialization.

thanks: Alvaro Munoz <pwntester@github.com> from the GitHub Security Lab team
2020-05-19 15:58:06 +02:00
Pawan Verma 3b7e63744c Improved: Expansion of form widget field disabled atrribute with xsd improvement (#141)
(OFBIZ-10432)

1. Added disabled attribute support in ModelFormField with xs:boolean type
2. Removed specific field level disabled attribute support for CheckField and TextField
3. Modified existing usage of disabled attribute as per new implementation.

Thanks: Rishi for the report and Taher, Gil and Jacques for the feedback
2020-05-19 17:37:24 +05:30
Pawan Verma ba463ab9bc Fixed: Issue with redirect queryParameters when the user is logged out
(OFBIZ-11714)

In OFBIZ-10539, We missed removing the line which was adding parameters into the map as Ritesh suggested a good way to handle parameters. I've removed that redundant line of code and attaching a patch for the same.
2020-05-19 17:21:11 +05:30
Jacques Le Roux d640a711d1 Improved: Prevent FreeMarker Template Injection (SSTI)
(OFBIZ-11709)

Better style with line not too long
2020-05-18 22:52:30 +02:00
Jacques Le Roux 09baa5537e Improved: Prevent FreeMarker Template Injection (SSTI)
(OFBIZ-11709)

Previous code compiled but SAFER_RESOLVER is not a class but a field, better KISS
2020-05-18 14:39:25 +02:00
Jacques Le Roux a6e8b05135 Improved: Prevent FreeMarker Template Injection (SSTI)
(OFBIZ-11709)

Some people may want to use another TemplateClassResolver than SAFER_RESOLVER
This creates a new templateClassResolver security property and uses it in
FreeMarkerWorker::makeConfiguration by default
2020-05-18 12:06:28 +02:00
James Yong e3e12ee487 Improved: No need to specify externalKeyParam in ofbizUrl calls (OFBIZ-11711)
Let ofbizUrl macro generates externalLoginKey when needed.

Thanks: Jacques for review
2020-05-17 20:37:48 +08:00
Pierre Smits 6e4fd2968a Improved: descriptions of temporal expression records (OFBIZ-11584) (#64)
* Improved: descriptions of temporal expression records

(OFBIZ-11584)

* Improved: descriptions of temporal expression records

(OFBIZ-11584)
2020-05-17 10:28:15 +02:00
Jacques Le Roux e46c29962b Fixed: Prevent FreeMarker Template Injection (SSTI)
(OFBIZ-11709)

Since Freemarker 2.3.17 a known solution to these issues is to register a
TemplateClassResolver in Freemarker configuration in order to limit which
TemplateModels can be instantiated in the templates. The predefined resolver
SAFER_RESOLVER doesn't allow to instantiate the Execute class[4].

So the solution is to add the line
    newConfig.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER);
in FreeMarkerWorker.java
2020-05-16 20:51:12 +02:00
Jacques Le Roux ccabbd8e4e Fixed: Have a service that runs periodically to generate CustomTimePeriod records
(OFBIZ-10905)

Fixes the loading sequence of CommonScheduledServicesDemoData.xml now
ScheduledServicesDemoData.xml in service component
2020-05-16 13:25:17 +02:00
James Yong 47e6b9cad6 Improved: Apply multi-block attr to each application (OFBIZ-11706)
Fix regresssion
2020-05-16 17:51:34 +08:00
Pierre Smits 50857f1505 Implemented: Have a service to periodically create PeriodRecords (OFBIZ-10905) (#133)
* Implemented: Have a service that runs periodically to create CustomTimePeriod records

(OFBIZ-10905)

added: service createFuturePeriod
added: function createFuturePeriod called by createFuturePeriod
added: SystemProperty records called by createFuturePeriod function
added: JobSandbox record to schedule createFuturePeriod service
added: ref to CommonScheduledServicesDemoData.xml in component.xml

* Implemented: Have a service that runs periodically to create CustomTimePeriod records

(OFBIZ-10905)

improved: description

* Implemented: Have a service that runs periodically to create CustomTimePeriod records

(OFBIZ-10905)

improved: groovy code aligning to code formats
2020-05-16 11:03:13 +02:00
James Yong 591b0442c7 Improved: Apply multi-block attr to each application (OFBIZ-11706)
For Webtools, Themes.
2020-05-15 21:25:12 +08:00
James Yong d94beee1b6 Improved: Apply multi-block attr to each application (OFBIZ-11706)
For Party application.
Also fixed bug where external script tag is incorrectly handled
when extracting internal script tag from freemarker template.
2020-05-15 15:43:31 +08:00
James Yong 60c78d24be Improved: <script-template> widget tag (OFBIZ-11686)
Removed script-template tag.
Use multi-block=true on html-template tag instead.
2020-05-15 11:16:15 +08:00
holivier 4f5e6f9f06 Improved: <script-template> widget tag
(OFBIZ-11686)

Correction in javadoc, <script is not authorize in javadoc because it
can introduce some javascript in javadoc, and so generate an error in
javadoc build.
Replace <script-template/> by "script-template"
2020-05-14 09:38:23 +02:00
James Yong 803f7fa060 Improved: <script-template> widget tag (OFBIZ-11686)
The new tag allows us to render a freemarker template containing javascript,
as external script in html instead of inline script.
This helps to reduce CSP errors.
2020-05-13 20:19:05 +08:00
Suraj Khurana ba04eda31a Improved: Converted CustomTimePeriod related services from simple to entity-auto
(OFBIZ-11689)
Thanks Pierre for reporting.
2020-05-13 10:25:15 +02:00
Pawan Verma 8bd7b9b6f9 Fixed: Theme files loading taking longer time
(OFBIZ-11665)

Thanks: Pierre and Jacques for the review.
2020-05-10 14:17:13 +05:30
Pawan Verma de07647bfe Improved: Improve logging for services run on global-commit/global-rollback
(OFBIZ-11667)

Thanks: Jacques and Suraj for the review.
2020-05-10 14:06:38 +05:30
Pawan Verma 12ef22228d Improved: Add support for Limit and offset in EntityQuery
(OFBIZ-11670)

Thanks: Jacques and Suraj for the review.
2020-05-10 14:03:55 +05:30
Pawan Verma e925e5f1df Fixed: Issue with opening a page via bookmark when the user is logged out
(OFBIZ-10539)

Thanks: Ritesh Kumar for report and the patch and Girish for the review.
2020-05-05 14:56:25 +05:30
Pierre Smits eea0198835 Improved: Currency Data for China
(OFBIZ-11629)

improved description
2020-05-04 17:33:52 +02:00
Jacques Le Roux fde21d0b10 reverted: CLONE - Use only HTTPS in OFBiz
(OFBIZ-11643)

Reverted, this needs more work
2020-05-04 13:21:03 +02:00
Jacques Le Roux a8c5c84cec Fixed: CLONE - Use only HTTPS in OFBiz
(OFBIZ-11643)

When doing OFBIZ-6849 I forgot to take care of the https attribute of the
security element used in controllers.

It's not used anymore since we used HTTPS everywhere but in request listed in
http.request-map.list property of url.properties. It's even enforced by HSTS for
requests that are not listed in this property.

This removes the https attribute and removes its usage in in controllers.
2020-05-04 13:10:17 +02:00
Jacques Le Roux 3f60efb343 Improved: Improve ObjectInputStream class
(OFBIZ-10837)

While working on OFBIZ-11633 I crossed an issue in R18 (not in trunk) where
objects from org.apache.commons.fileupload (namely DiskFileItem and
FileItemHeadersImpl) are not serializable.

While at it I decided to handle at the SafeObjectInputStream level
the "fileItems" case I already crossed with, OFBIZ-11534, in RequestHandler

It has an inconvenient in R18 (not in trunk) where ObjectInputStream can't
handle a null class (of course) and so return a benign exception in log (only).

I believe it's better to handle these specific cases at the lower possible
level in all supported branches.
2020-05-02 12:34:56 +02:00
Jacques Le Roux 1efaa73ebb Fixed: PartyProfileContent.js does not work
(OFBIZ-11633)
When you upload a content from the party profile page you don't see a progress
bar. The PartyProfileContent.js is loaded but for some reason is unused or wrong

Mohammad Kathawala mentionned that it was removed with OFBIZ-9299
It was also broken with OFBIZ-11402

Thanks: Mohammad for the track
2020-05-02 09:31:54 +02:00
Pawan Verma ffe9c46cf0 Improved: Used utility provided by OFBizTestCase class for userLogin instead of fetching from DB test cases also removed unused fetching of userLogin in some cases
(OFBIZ-11618)
2020-04-30 22:00:04 +05:30
Suraj Khurana f637e3c5fe Improved: Converted all EntitySyncInclude services from simple to entity-auto (#84)
* Improved: Converted all EntitySyncInclude services from simple to entity-auto
(OFBIZ-11613)
2020-04-30 13:14:26 +05:30
Pawan Verma 1b3d3bdf4e Improved: Added support for EntityQuery methods in OFBiz integration tests.
(OFBIZ-11247)

Thanks: Jacques for the review.
2020-04-29 15:28:42 +05:30
Jacques Le Roux 61e5435b30 Fixed: "entity/list" request is not handled well
(OFBIZ-11593)

The "entity/list" request has been put in with OFBIZ-11007. It's used to call
the entitymaint view and so is a demo/didactic duplicate of entitymaint request.
It's only used in FindGeneric screen (look for WebtoolsBackToEntityList label).
It's problematic because since the CSRF token defense was put in you can no
longer filter the entities from the entities list screen, even when the default
NoCsrfDefenseStrategy is used. It works if you use the entitymaint request
instead.

2020-01-19 I proposed in OFBIZ-11306 a solution for such cases.
It was not used because 2020-02-14 I thought it was no longer needed.
It was necessary for this case and implemented with commit e487122.

But as, Rohit Koushal reported, it breaks some functionalities like adding
address/update address during Quick Finalize Order. The issue can also be
reproduced in ecommerce when trying the same while checking out, or quick
checking out, an order.

More generally the error is of this kind:
|27.0.0.1-8009-exec-3 |ControlServlet                |E| Error in request handler:
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
  at java.util.LinkedList.checkElementIndex(LinkedList.java:555) ~[?:1.8.0_252]
  at java.util.LinkedList.get(LinkedList.java:476) ~[?:1.8.0_252]
  at org.apache.ofbiz.webapp.control.RequestHandler.getRequestUri(RequestHandler.java:837) ~[main/:?]

and happens with URLs like
updateCheckoutOptions/editcontactmech?DONE_PAGE=checkoutoptions&contactMechId=9015
or
updateCheckoutOptions/editcontactmech?preContactMechTypeId=POSTAL_ADDRESS&
contactMechPurposeTypeId=SHIPPING_LOCATION&DONE_PAGE=checkoutoptions

So I decided to revert the concerned part of commit e487122 and to rather use
entitymaint instead of "entity/list" request.
2020-04-29 08:29:33 +02:00
Pawan Verma 1e05f0c72d Incorrect column alias in EntitySQLProcessor for sql query working with mysql
(OFBIZ-11573)

More details: Method getColumnLabel returns the designated column's suggested title for use in printouts and displays. Method getColumnName returns the designated column's name.

Thanks: Suraj and Jacques for the review.
2020-04-28 10:54:57 +05:30
Jacques Le Roux ec23f8b61f Fixed: Compound-widget not works with condition
(OFBIZ-11606)

Fixes "<**:condition" not well managed and generating an error

Changes all the getNodeName() by getLocalName() in the ModelX****Condition.java

Thanks: Olivier
2020-04-27 17:43:38 +02:00
Jacques Le Roux d7c42e3b8c Fixed: Compound-widget not works with condition
(OFBIZ-11606)

rootElement is not correct for a compound file, it's necessary to do a
UtilXml.firstChildElement(rootElement, "forms"); to be correct.
It's done for screen, form but not for grid !

So correction is now added the correct read of rootElement.

Thanks: Olivier
2020-04-27 14:31:31 +02:00
Jacques Le Roux e8e9db5b1a Improved: Prevent recurring errors block due to generateTokenForNonAjax
(OFBIZ-11609)

Fixes check style. I removed a space after a cast. That's how I wrote it so
far and that was wrong. BTW I did not invent it, our code is riddled of it:/

https://www.oracle.com/technetwork/java/javase/documentation/codeconventions-141388.html
2020-04-27 14:29:14 +02:00
Jacques Le Roux faf2827e67 Improved: Prevent recurring errors block due to generateTokenForNonAjax
(OFBIZ-11609)

Fixes the if(test): toString() is not the same than getCanonicalName()

Also while at it, in case of exception, uses NoCsrfDefenseStrategy as default
2020-04-27 12:36:17 +02:00
Jacques Le Roux cdb40c3d31 Improved: Prevent recurring errors block due to generateTokenForNonAjax
(OFBIZ-11609)

Fixes check style issues
2020-04-26 14:21:59 +02:00
Jacques Le Roux 1ff79ec566 Improved: Prevent recurring errors block due to generateTokenForNonAjax
(OFBIZ-)

After the VM demos crash yesterday, I had a look at the log of trunk demo and
found a lot of recurring errors block due to CsrfUtil::generateTokenForNonAjax.

It's not a big deal but it's annoying to have such useless errors cluttering the
logs
2020-04-26 12:38:05 +02:00
Jacques Le Roux 5428a73399 Improved: Increase the size of http.upload.max.sizethreshold
(OFBIZ-11598)

The http.upload.max.sizethreshold size is curently sets to 10240 (10KB) and that
seems small nowadays to me. We could use 1MB.

Also moves mail.spam.name in its mail block

Thanks: Pawan for review
2020-04-26 10:13:09 +02:00
ravilodhiandRavi Lodhi ae70318fc8 Improved: Added support to consider non-default transaction timeout for Groovy and Simple event handlers.(OFBIZ-11607) (#77)
* Improved: Added support to consider non-default transaction timeout for Groovy and Simple event handlers.(OFBIZ-11607)

* Revert "Improved: Added support to consider non-default transaction timeout for Groovy and Simple event handlers.(OFBIZ-11607)"

This reverts commit 934eaa4539.

* Improved: Added support to consider non-default transaction timeout for Groovy and Simple event handlers.(OFBIZ-11607)

Co-authored-by: Ravi Lodhi <lodhiravi1@gmail.com>
2020-04-26 09:17:30 +02:00
Jacques Le Roux df52f733b3 Improved: Update build.gradle to the latest dependencies
(OFBIZ-11603)

Checkstyle is a game where you can't never win.
And the result (formatting) is sometimes ugly, it's a pain!
2020-04-21 17:31:27 +02:00
Jacques Le Roux ef097c7a9a Improved: Update build.gradle to the latest dependencies
(OFBIZ-11603)

Replaces deprecated calls
2020-04-21 15:49:00 +02:00
Jacques Le Roux a721ba7557 Documented: fixes wrong indentations 2020-04-20 18:57:58 +02:00
Jacques Le Roux d0144d96e1 Improved: Increase the size of http.upload.max.sizethreshold
(OFBIZ-11598)

That's rather refactoring to avoid to have the size hardcoded in several places
Next: ask if it's OK for everyone to increase the size
2020-04-19 15:41:10 +02:00
Jacques Le Roux 6d3d8f73c2 Fixed: Error in uploading very large files, ie >2MB
(OFBIZ-11534)

This was not supposed to be committed, actually (wrong) part of OFBIZ-11597
2020-04-16 16:02:20 +02:00
Jacques Le Roux 4725ae68d8 Fixed: Error in uploading very large files, ie >2MB
(OFBIZ-11534)

There is an issue in uploading large files, I am able to upload files up to 2 GB
successfully but getting an error when trying to upload a file larger than 2GB.

Example -
1. Go to party profile -
https://demo-trunk.ofbiz.apache.org/partymgr/control/viewprofile?partyId=admin
2. Try to create a party content with a file larger than 2 GB
3. Error on console

jleroux:
For a 2GB+ file you need to set Xmx to more than the double of the file size,
eg: gradlew ofbiz -PjvmArgs="-Xms1024M -Xmx5048M"

You then get another small issue (only in log) when redirecting to send the
partyId parameter.

This is because, DiskFileItem is a temporary Object with a null value contained
in "fileItems" attribute. It can't be detected by UtilMisc::makeMapSerializable
and that makes "fileItems" not serializable. So it must be removed from
reqAttrMap.

Thanks: Chandan Khandelwal for report, Michael for suggesting a very large file
to upload
2020-04-16 15:46:09 +02:00