Commit Graph
27737 Commits
Author SHA1 Message Date
Jacques Le Roux caded9e937 Fixed: Hyperlink title under form widget doesn't support character encoding for special characters (OFBIZ-12026)
When we use any title with special characters for hyperlink tag, it shows broken
string on UI, eg:
<hyperlink description="${uiLabelMap.CommonImportExport}"  target="ImportExport">
should render a button with the title "Import/Export. But it shows as
Import&#x2f;Export

jleroux: I have noticed that the same happens with special French characters.
So it's a general issue.
The title (description in code) is HTML encoded and that does not work for
special characters. I simply used a string encoder.

Thanks: Pradeep Choudhary for report, Sourabh Jain for a possible but not
general solution at OFBIZ-12023, ie using target-type="plain"
2020-12-11 13:40:53 +01:00
Jacques Le Roux 06e56ed7e9 Improved: Invoice import is not visible from UI and not working (OFBIZ-12089)
While working on OFBIZ-12080 I found an upload feature that allows to import
invoices but it's not visible from UI and not working.
Moreover the export feature was missing a parameters as the import.

It has been introduced by Hans Bakker with
https://svn.apache.org/repos/asf/ofbiz/trunk@1502093
and I'm not sure the integration was completed.

We could remove it, but I think it can be useful and does not seem to miss much
to work fine.

Also use an uploadedFile label in ImportParty and UploadContent forms
2020-12-08 17:22:24 +01:00
James Yong 89f36f1a06 Correct spelling for μManager.
Reference: https://imagejdocu.tudor.lu/faq/general/which_file_formats_are_supported_by_imagej
2020-12-08 19:49:15 +08:00
James Yong 931716a628 Improve notes for Tomcat SSO 2020-12-08 19:37:21 +08:00
Jacques Le Roux 100810faeb Fixed: Secure the uploads (OFBIZ-12080)
Adds audio and video as supported formats
2020-12-07 19:48:36 +01:00
Jacques Le Roux fdeedf23ee Improved: Adds the HTML <input> accept Attribute in form widgets and Freemaker templates (OFBIZ-12049)
As explained at
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept
this is only an help for the users (ie not a security feature), but an
appreciable one easy to implement.

Here we start with website/WebSiteCMSContent.ftl
Also add some missing file extensions
2020-12-07 18:45:25 +01:00
Jacques Le Roux b549b9aa19 Fixed: Label issue on List Companies page (OFBIZ-12023)
Navigate to URL: 'accounting/control/ListCompanies'
Under the companies list, the 2nd column has button for account
The System is not showing proper label in French.

This issue is occurring due to the hyperlink title is not supporting character
encoding for special characters. Please track progress under OFBIZ-12026.
2020-12-07 18:45:25 +01:00
Jacques Le Roux 4481f373ca Fixed: Secure the uploads (OFBIZ-12080)
Handles audio and video formats supported by Tika.

Adds few new audio and video formats in seed data.

AFAIK there are no ways to embed a webshell in an audio or video file. So I did
not sophisticate the validation, just rely on Tika.

I have also fixed bugs in SecuredUpload: in isValidSvgFile and
isValidImageIncludingSvgFile
2020-12-07 18:45:24 +01:00
James Yong c1644940e9 Fixed: Make locale available for DateFindField and DateTimeField macros (OFBIZ-12086)
Fixed compile error in MacroFormRendererTest.java.

Thanks: Daniel and Tomek for the finding
2020-12-07 23:46:02 +08:00
Jacques Le Roux 5fa312cfb9 Fixed: Secure the uploads (OFBIZ-12080)
Improves the labels names and format comment in LayoutEvents.java

I backport to ease later works...
2020-12-06 11:16:44 +01:00
Jacques Le Roux a0e8a23a18 Fixed: Secure the uploads (OFBIZ-12080)
validateUploadedFile() fixes another case reported in August by Harshit
2020-12-06 10:20:57 +01:00
James Yong e405d35c08 Improved: Move page-specific script links to html template (OFBIZ-11799)
Use importLibrary js function to load locale-specific datepicker js.
Corrected locale naming in macro to use '.locale'.
Tested page at /ordermgr/control/findreturn and /ordermgr/control/orderentry.
2020-12-05 23:23:04 +08:00
James Yong 76a940ab43 Improved: Make locale available for DateFindField and DateTimeField macros (OFBIZ-12086)
DateFindField and DateTimeField macros need to find locale-specific javascript library files.
2020-12-05 23:13:55 +08:00
James Yong cfabbc9b74 Fixed: jquery.ui.datepicker-en.js does not exist (OFBIZ-12071)
Fixed for Jquery DatePicker
2020-12-05 19:24:09 +08:00
Jacques Le Roux ce6829aa72 Fixed: Secure the uploads (OFBIZ-12080)
org.apache.xmlgraphics:batik:1.13 does not include batik-svg-dom it's in
batik:batik-svg-dom:1.6-1.

It's also in org.eclipse.birt.runtime:viewservlets:4.5.0 that's why it worked
only with plugins
2020-12-02 09:53:23 +01:00
Jacques Le Roux 73fcf30493 Improved: update tasks.checkstyleMain.maxErrors from 280 to 286
Something else than OFBIZ-12080 changed in code and I have no time to check what
2020-12-01 10:26:47 +01:00
Jacques Le Roux e73616caf1 Fixed: Secure the uploads (OFBIZ-12080)
2020/08/10 the OFBiz security team received a security report by Harshit Shukla
<harshit.shukz@gmail.com>, roughly it was (quoting part of it to simplify):

<<I have identified a Remote Code Execution (RCE) Vulnerability. The reason
behind this RCE is lack of file extension check at
catalog/control/UploadCategoryImage?productCategoryId=CATALOG1_BEST_SELL&pload_file_type=category>>

Using this post-auth RCE in OFBiz demos, Harshit was able to get some AWS
credentials by uploading a webshell (based on [0]).
By security, it was then decided by the Infra and OFBiz security teams to shut
down the demos.

After discussing the elements reported with Mark J Cox (VP of ASF security team)
we in common decided that no CVE was necessary.
2020-12-01 10:16:04 +01:00
holivier 5781f08ff6 Documented:migrated Wiki How to Create the main Company in Party Manager to user-manual (OFBIZ-12065)
Add section Parties Processes and as first process How To Create Main Company
2020-11-30 12:07:57 +01:00
Jacques Le Roux 976cef7fa0 Fixed: Label issue on List Companies page (OFBIZ-12023)
Navigate to URL: 'accounting/control/ListCompanies'
Under the companies list, the last column has button for import export.
The System is not showing proper label.

This issue is occurring due to the hyperlink title is not supporting character
encoding for special characters. Please track progress under OFBIZ-12026.

Thanks: Lalit Dashora for report, sourabh jain for patch, Daniel Watford for test
2020-11-30 12:02:21 +01:00
Girish Vasmatkar 577326221e Fixed: Updated checksum and modified path of the files as input to shasum command(OFBIZ-12066). 2020-11-30 16:17:57 +05:30
Saurabh Dixit d28978def4 Fixed: Single product tile is displayed on one row in product search. (OFBIZ-12045) (#245)
Cause: Wrong use of bootstrap grid classes.
Fix: Used row class as a parent to col-* class while rendering the products.
2020-11-30 11:14:06 +01:00
Nicolas Malin 2ddde9fb6b Fixed: OrderId with null value on refresh init base
(OFBIZ-12076)

After a fresh data base init with only seed, if you create your company without order prefix, your orderId sequence will be generate with 'null' string where the order prefix should be have :

> null10001, null10002, ...

This come from the groovy migration of service 'getNextOrderId' where productStore.orderNumberPrefix is loaded on the sequence without control if is empty or not
2020-11-30 09:48:41 +01:00
Nicolas Malin 8a51586c63 Fixed: service createCommunicationEventWithoutPermission failed to store a communication
(OFBIZ-12074)

When you call the service createCommunicationEventWithoutPermission to create a anonymous communication or from a user without party permission, the service failed due to missing permission.

With the minilang to groovy conversion the userLogin system it's not loaded before call the main service createCommunicationEvent
2020-11-30 09:40:04 +01:00
Nicolas Malin 12162a2a9c Fixed: Create a blog article failed to link each contents
(OFBIZ-12075)

When you create a blog article with screen https://localhost:8443/content/control/EditBlogArticle?blogContentId=${blogId} by default you can create an article with a summary, an image and a long text.

After the creation all content related to this article was created by impossible to display this article correctly. The problem come from the contentAssoc of each relation where the mapKey isn't populate.

The root come from the conversion to entity-auto for the service createContent, where some seca are present and use some field to create some relation with attribute not present on a content (like the field mapKey)

To correct this I the simple way is to authorize these fields, and think for the future how do better.
2020-11-30 09:17:21 +01:00
James Yong a3fbb66479 Improved: Move page-specific script links to html template (OFBIZ-11799)
Use importLibrary js function to load time-related js and css for date time picker.
Tested page at /ordermgr/control/findreturn and /ordermgr/control/orderentry
2020-11-30 10:29:08 +08:00
Jacques Le Roux 5d6e9dc9d1 Fixed: Edit button(s) are shown for shipments received or shipped (OFBIZ-11788)
When a shipment has been received (purchase) or shipped (sales), the shipment
process should be concluded. And thus the shipment should not be editable anymore.

Thanks: Pierre Smits for report, Ankit Joshi for patch
2020-11-29 20:45:01 +01:00
Nicolas Malin 816068335c Improved: Improve makeRangeCondition in file EntityDateFilterCondition.java
(OFBIZ-12051)

When we have a value with both from and thrudate greater than given range

Thanks to Leila Mekika for this improvement
2020-11-29 19:21:23 +01:00
James Yong 283752fd26 Fixed: jquery.ui.datepicker-en.js does not exist (OFBIZ-12071)
Default language file specified for DateTime doesn't exist in the project i.e.
/common/js/jquery/ui/i18n/jquery.ui.datepicker-en.js

Changed to /common/js/jquery/plugins/datetimepicker/i18n/jquery-ui-timepicker-en.js
2020-11-28 21:26:47 +08:00
Girish Vasmatkar dcd85b3d33 Fixed: Used correct syntax to conctenate bash variable and string such that wgent command runs properly.(OFBIZ-12066) 2020-11-28 14:59:56 +05:30
Deepak Dixit 9cf1d78555 Improved: Update IND Geo data as per 2020-11-24 notification (#240)
- Deletion of Union territory IN-DD, IN-DN;
- Addition of Union territory IN-DH;
- Correction of spelling for IN-AR, IN-BR, IN-CH, IN-CT, IN-DH, IN-GJ, IN-HP, IN-HR, IN-JH, IN-JK, IN-KA, IN-LA, IN-MH, IN-ML, IN-NL, IN-RJ, IN-TG, IN-TN, IN-UT;
2020-11-28 12:24:39 +05:30
James Yong bc5b0d595c Improved: Load language js for date.js only when required (OFBIZ-12064)
Tested on
1) date time field at /ordermgr/control/orderentry and
2) date find field at /ordermgr/control/findreturn
2020-11-27 21:51:35 +08:00
Jacques Le Roux 19ef23a3e2 Reverted: Replace java.io.File::renameTo by java.nio.file.Files::move (OFBIZ-12063)
This reverts commit 1be480b68c.

Actually the problem was due to another WIP where 2 streams were not closed
2020-11-27 11:52:54 +01:00
Jacques Le Roux f81bd88525 Reverted: Replace java.io.File::renameTo by java.nio.file.Files::move (OFBIZ-12063)
This reverts commit 2c86f9a8c0.

Actually the problem was due to another WIP where 2 streams were not closed
2020-11-27 11:50:27 +01:00
Jacques Le Roux 2c86f9a8c0 Fixed: Replace java.io.File::renameTo by java.nio.file.Files::move (OFBIZ-12063)
On Windows in EditProductContent.groovy neither file.renameTo(), Files.move()
nor FileUtils.moveFile works. Copy and delete works.
2020-11-27 10:20:57 +01:00
Jacques Le Roux 1be480b68c Fixed: Replace java.io.File::renameTo by java.nio.file.Files::move (OFBIZ-12063)
This is a bug because the behaviour is not assured on Windows for instance. So
it's impossible to correctly develop and test.

As explained at
https://docs.oracle.com/javase/8/docs/api/java/io/File.html#renameTo-java.io.File-

<<Many aspects of the behavior of this method are inherently platform-dependent:
The rename operation might not be able to move a file from one filesystem to
another, it might not be atomic, and it might not succeed if a file with the
destination abstract pathname already exists. The return value should always be
checked to make sure that the rename operation was successful.
Note that the Files class defines the move method to move or rename a file in a
platform independent manner.>>

So the expression
  file.renameTo(file1)
used in 5 Application Product Groovy scripts can be easily replaced by
  Path source = file.toPath()
  Files.move(source, source.resolveSibling(filenameToUse))
that is working on all platforms as explained at
https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#
move-java.nio.file.Path-java.nio.file.Path-java.nio.file.CopyOption...-
2020-11-24 18:39:12 +01:00
Jacques Le Roux 8a9e1522ce Fixed: .sh missing in <<Unix-like OS: ./gradle/init-gradle-wrapper>>
My bad :/

Thanks: Tuck Seng Phoon
2020-11-20 17:36:11 +01:00
Jacques Le Roux b445e17407 Fixed: Issue in ServiceDemoData.xml due to an error with MX_FED_HOLIDAYS
LoadAll was failing:
2020-11-18 21:08:45 +01:00
holivier 1ddf7f5a41 Documented: User Manual : change the level of <Core Business Application> from 2 to 1 (OFBIZ-11036) 2020-11-18 17:25:36 +01:00
holivier fa11e7ddc7 Documented: add simple remark about Glossary and move keyboard shortcuts and using icons in Text formatting 2020-11-18 17:24:33 +01:00
holivier c2c1eae612 Documented: migrated Wiki Glossary to glossary asciidoc files (OFBIZ-12060)
- Accounting Glossary,
  - declare it as glossary
  - re-order existing items
  - add a comment at beginning about importance of order items
  - correction for some ID: change space to _
  - add some items coming from wiki glossary
- Facility
  - add glossary directly in facility.adoc
- Human Resource Glossary
  - re-order existing items
  - add a comment at beginning about importance of order items
  - move some items to Party Glossary or global Glossary
- HR appendix: add link to wiki OFBiz related book for Data Model Reference Book
- Add Party Glossary and included it in party.adoc
  - add some items coming from wiki glossary and HR glossary
- General Glossary
  - add a comment at beginning about importance of order items
  - add some items coming from wiki glossary and HR glossary
2020-11-18 17:19:39 +01:00
Jacques Le Roux 2480c52c6a Improved: Comment out HideUtilityClassConstructor in checkstyle.xml (OFBIZ-12061)
Currently Checkstyle returns 222 occurrences of the message
"Utility classes should not have a public or default constructor."

This is due to https://checkstyle.sourceforge.io/config_design.html#HideUtilityClassConstructor
I don't think we need to follow the "prevents calls from subclass" suggestion there.

I rather suggest to comment out the related class in checkstyle.xml:

    ie <!-- <module name="HideUtilityClassConstructor"/> -->

Then should remain only 280 errors and hopefully most will be easy to fix.
At least they will be easier to spot...

Note: I'm working on something else, so I will change
tasks.checkstyleMain.maxErrors from 502 to 280 later...

Thanks: Suraj and Aditya for confirmation
2020-11-18 17:12:58 +01:00
Jacques Le Roux 17de4f6e07 Improved: Added multiple "es" and "es-MX" values. Added Mexican Federal Holidays
Fixed: Mexican States Abbreviations

In GeoData_MX.xml abbreviations of the Mexican States were wrong and
"Mexico City" state was labeled as County, which is not.

In CommonUiLabels.xml and CommonEntityLabels.xml were added some missing values
to "es" and "es-MX" languages

In ServiceDemoData.xml were added the Mexican federal holidays under the
temporal expression "MX_FED_HOLIDAYS"

Thanks: Zottacko WallyMan
2020-11-18 17:05:41 +01:00
holivier 5e6f537708 Documented: HR Doc drive by process (OFBIZ-11026)
- Re-organize sub-chapter to have a process vision of HR component
- Add hr-data-model sub-chapter
- Add hr-appendix which list some bug or WIP development
2020-11-17 14:27:08 +01:00
holivier 98631771aa Documented: Synchronize wiki page End User Documentation (OFBIZ-12059)
- Add facility.adoc with only overview
- Correction for Content Management title
- in General glossary, add link to main components
- Complete Order management overview
- Add a short overview for Party
- Ordered applications in user-manual in alphabetic order
2020-11-16 17:00:48 +01:00
Jacques Le Roux f34a0d9ff5 Fixed: Prevent arbitary file write using webtools/control/EntitySQLProcessor. (OFBIZ-12057)
Shuibo Ye <shuiboye@gmail.com> reported a possible arbitary file write using
webtools/control/EntitySQLProcessor.

    In the "SQL Command" part, I create a table and insert some strings and
    export the table to a file one sentence at a time.
    PoC: CREATE TABLE "test" (string VARCHAR(80))
    INSERT INTO "test" (string) VALUES ('<%= system.getProperty("user.dir") %>')
    call SYSCS_UTIL.SYSCS_EXPORT_TABLE(null,'test','.\framework\webtools\webapp\webtools\default.jsp',null,'*',null)

    After executing the three sentences,I successfully write the file and its url
    is https://localhost:8443/webtools/default.jsp.

I fixed it preventing execution on SYSCS_UTIL.SYSCS_EXPORT_TABLE and JSP, more
could be added if necessary
2020-11-16 14:11:13 +01:00
holivier e6dbed5fd6 fixed: spelling correction in a link to pluginsdoc document 2020-11-15 10:44:31 +01:00
holivier c21892609b Documented: Add a Global Glossary for user-documentation (OFBIZ-10303) 2020-11-14 17:12:14 +01:00
holivier ac6964e8eb Documented: OFBizDocumentationSystem migration to Asciidoc and Review (OFBIZ-11364)
Rewrite the document, add a part in documentation guidline.
Add a include for OFBizDocumentationSystem document in user manual and developer-manual.
2020-11-14 16:55:31 +01:00
Jacques Le Roux e136cb1d98 Fixed: Prevent Zip Slip vulnerability (OFBIZ-12056)
While working with FileUtil::unzipFileToFolder I noticed that it's vulnerable to
Zip slip vulnerability: https://snyk.io/research/zip-slip-vulnerability.

Fortunately OOTB code does not use FileUtil::unzipFileToFolder so I did not
create a CVE, nor reported to
https://github.com/snyk/zip-slip-vulnerability#user-content-projects-affected-and-fixed.
If you think we should please shime in...
2020-11-14 11:39:10 +01:00
Jacques Le Roux 70d3916d4f Improved: Prevent possible post-auth RCE from webtools/control/ProgramExport (OFBIZ-12055)
This was reported to the security team by Shuibo Ye <shuiboye@gmail.com>.
We did not create a CVE because it's a post-auth "vulnerability"

Thanks: Shuibo Ye
2020-11-13 09:34:49 +01:00