Author SHA1 Message Date
Jacques Le Roux 00896e73bc Fixed: Announce 17.12.09 EOL (OFBIZ-12479)
Includes:
[SECURITY] CVE-2021-44228: Apache Log4j2 (OFBIZ-12449)
[SECURITY] CVE-2021-45105: Apache Log4j2 (OFBIZ-12470)
[SECURITY] Update TIka because of Apache Log4j2 vulnerability (OFBIZ-12474)
[SECURITY] CVE-2021-44832: Apache Log4j2 (OFBIZ-12475)
2022-01-06 14:19:06 +01:00
Jacques Le Roux fb6b508d56 Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
Comment out the XMLRPC tests. This alone should allow Buildbot 3.2 to run the
integration tests.

Conflict handled by hand
2021-12-16 08:07:08 +01:00
Mathieu Lirzin bdf94f31a1 Fixed: All local XML schema files are now present in classpath, Backport form trunk
(OFBIZ-11132) (OFBIZ-12437)

Previously there was some warnings about missing “.xsd” files that
‘UtilXml#resolveEntity’ failed to find in classpath.  This has been
fixed by declaring all “dtd” directories inside components as resources.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862346 13f79535-47bb-0310-9956-ffa450edef68
2021-12-12 15:40:17 +01:00
Wiebke Pätzold c5d262aeab Fixed: Builds fail due to unauthorized access to
repo.spring.io/plugins-release (OFBIZ-12351)

Replaces repository syndication by rometools
2021-12-06 11:45:06 +01:00
Jacques Le Roux 208d44e0a3 Fixed: Builds fail due to unauthorized access to repo.spring.io/plugins-release (OFBIZ-12351)
The old demo crashed. I guess this should be OK, let's try...
2021-12-06 09:54:09 +01:00
rohitkouandRohit Koushal e3691d1b21 Fixed: CVE-2021-37608 vulnerability bypass (OFBIZ-12307) (#352)
Fixed the Additional image uploading issue which got somehow missed in service addAdditionalViewForProduct.

Co-authored-by: Rohit Koushal <rohit.koushal39@gmail.com>
2021-11-23 10:40:26 +01:00
Jacques Le Roux dfb702cd9c Fixed: In LookupProduct some categories don't show, only blank lines (OFBIZ-12368)
For now only description is shown. OOTB some categories have no description
We can easily fix that by showing more info. I suggest to add categoryName and
productCategoryId. That should be enough. There are then no blank lines since
productCategoryId always show.

This is anyway customisable by users
2021-11-09 10:05:38 +01:00
Jacques Le Roux 39db98a535 Fixed: RAINBOWSTONE_SAPHIR does not show right on old demo.
I'm unable to test that locally because I get an error with com.sun.syndication
even when using jcenter and 0.9.0. It works on demo I guess because ASF is
authorised.

Anyway, manually turning to Flat Grey on demo works, so here a patch to do that.
2021-11-09 07:53:43 +01:00
Jacques Le Roux 2aca1121ee Fixed: [SECURITY] CVE-2021-42340 Apache Tomcat DoS (OFBIZ-12337)
Upgrades to Apache Tomcat 9.0.54
2021-10-14 19:31:08 +02:00
Jacques Le Roux 7de28070a3 Improved: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
Prevents an useless inevitable warning by commenting out
RequestWrapper::getParameterNames and with it all the unused methods in
RequestWrapper class

Also better comments CacheFilter::doFilter by giving its real and only goal:
<<to prevent a post-auth security issue described in OFBIZ-12332>>
2021-10-11 09:44:45 +02:00
Jacques Le Roux c859c6f636 Fixed: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
When I removed service-permission-tests, I forgot to remove associated
load-data-service-permission-tests :/
2021-10-10 17:28:29 +02:00
Jacques Le Roux d960b2b0ca Improved: Refactor methods signature to reduce the number of params they use (OFBIZ-12335)
Fixes a typo about filterConfiguration in CacheFilter.java
2021-10-10 13:36:30 +02:00
Jacques Le Roux 1c93a26ccc Fixed: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
Removes service-permission-tests accidentally added while handling conflicts by
hand
2021-10-10 13:25:24 +02:00
Jacques Le Roux 006ce17647 Fixed: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
In previous commit, in CacheFilter::doFilter, I checked "xmlrpc"  when it was
actually "/control/xmlrpc"
2021-10-10 12:19:35 +02:00
Jacques Le Roux b6257b720b Fixed: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
This definitely solves all issues by introducing a CacheFilter and
RequestWrapper classes inspired by several works found on the Net.
Also moves the change introduced before in ContextFilter to CacheFilter.

The basic problem is that you only can use once
ServletRequest::getInputStream or the ServletRequest::getReader
Also not both, even once, ie they can be seen as same from this POV.

The integration tests all pass.

Also replace the checked String "</serializable>" by "</serializable" as, like
reported by Jie Zhu, the former could be bypassed by using "</serializable >"

Thanks: Jie Zhu for report

# Conflicts handled by hand
  CacheFilter.java
  RequestWrapper.java
2021-10-10 08:14:57 +02:00
Jacques Le Roux fb49563744 Fixed: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
This definitely solves all issues by introducing a CacheFilter and
RequestWrapper classes inspired by several works found on the Net.
Also moves the change introduced before in ContextFilter to CacheFilter.

The basic problem is that you only can use once
ServletRequest::getInputStream or the ServletRequest::getReader
Also not both, even once, ie they can be seen as same from this POV.

The integration tests all pass.

Also replace the checked String "</serializable>" by "</serializable" as, like
reported by Jie Zhu, the former could be bypassed by using "</serializable >"

Thanks: Jie Zhu for report

Conflicts: ContextFilter.java handled by hand
2021-10-09 20:00:50 +02:00
Jacques Le Roux 7db83d6a53 Improved: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
Temporarily comments out XMLRPC tests.

I'll work on a definitive solution ASAP

Conflicts handled by hand: framework/service/testdef/servicetests.xml
2021-10-09 08:01:46 +02:00
Jacques Le Roux 8e8ef4c9dc Fixed: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
Fixes the "eternal" (for R17 and R18 ;) bug about MODULE (trunk) vs module
2021-10-08 19:35:00 +02:00
Jacques Le Roux 15c209a475 Fixed: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
As reported by Jie Zhu:
<<The latest version of the OFBiz framework (17.12.08) is affected by an
XMLRPC Remote Code Execution Vulnerability.
This vulnerability is caused by incomplete patch repair of cve-2020-9496.>>

Actually this is not an OFBiz bug (so not related to CVE-2020-9496)
but an old XMLRPC bug (Archiva was(/is?)) also affected:
https://nvd.nist.gov/vuln/detail/CVE-2016-5003

Unfortunately XMLRPC is no longer maintained, so it's OFBiz responsibility to
fix this bug.

As the code that secures serialisation in OFBiz is not reached by this bug, the
solution is to secure it at the ContextFilter class level (ie before it reaches
secured serialisation in OFBiz source).

Thanks: Jie Zhu for report and help.
2021-10-08 19:15:21 +02:00
Jacques Le Roux c79321c479 Fixed: Edit record in product promotion, "Promotion Last Modified Date" is invalid, but don't notice to user (OFBIZ-12046)
As Lalit reported it's not really a bug. But an annoying service transformation
of updateProductPromo to entity-auto (I checked using R15.12). Note that
createProductPromo is not affected

I'm not sure other update services using entity-auto are not affected

Thanks: Do Nhu Vy for report, Lalit Dashora  for initial analysis
2021-10-02 13:58:36 +02:00
Gil Portenseigne d02386d2d1 Improved: Create a deny list to reject webshell tokens (OFBIZ-12324)
Improve readability using stream api
Fix deniedWebShellTokens property where some blank space where removed
and '// python' comment was inlined.
2021-09-22 15:08:41 +02:00
Jacques Le Roux 364f4264b0 Improved: Create a deny list to reject webshell tokens (OFBIZ-12324)
Extracts the list of words used in SecuredUpload::isValidText in a
deniedWebShellTokens property in security.properties
2021-09-20 18:15:16 +02:00
Jacques Le Roux 72e2eacef8 Fixed: Groovy Program sandbox bypass (OFBIZ-12305)
This much increases the current security by creating SecuredUpload::isValidText
and call it from ProgramExport.groovy

This said I agree with thiscodecc that a better solution would be to use a
Groovy sandbox, and not only in ProgramExport.groovy.

I had a quick glance at a such solution. Unfortunately as Cédric Champeau reports
at https://melix.github.io/blog/2015/03/sandboxing.html and unlike thiscodecc
suggest there are no "mature solutions on the market".

Nevertheless I'll have a deeper look at an OFBiz specific Groovy sandbox
solution.

Somehow related: I'll also soon extract the list of words used in
SecuredUpload::isValidText in a deniedWebShellWords property in security.properties

Thanks: thiscodecc for report

Conflicts handled by hand
  framework/webtools/groovyScripts/entity/ProgramExport.groovy
2021-09-17 18:49:27 +02:00
Jacques Le Roux 0a49e0addd Fixed: CVE-2021-37608 vulnerability bypass (OFBIZ-12307)
Fixes a number of issues I spotted while working on OFBIZ-12305 in relation with
OFBIZ-12055

The last change I made for OFBIZ-12305 was incomplete, the files could not be
checked by SecuredUpload because they did not exist! This concerns
ImageManagementServices, DataServices, FrameImage and ProductServices classes.
I used Files::createTempFile to fix that.

Also fixes a bug in SecuredUpload where I reversed the check on
fileToCheck.length in Windows case. I also added a comment, Windows 10 now
allows more length (need an OS parameter change though)

Finally, creates public SecuredUpload::isValidText to be used in OFBIZ-12305

Conflicts handled by hand
  DataServices.java
2021-09-17 11:42:06 +02:00
Jacques Le Roux 95ec51ecd1 Fixed: Found a new XXE (XML External Entity Injection) vulnerability in EntityImport (OFBIZ-12304)
Fixes a typo issue
2021-09-13 10:11:02 +02:00
Jacques Le Roux 123f30eb6b Fixed: Found a new XXE (XML External Entity Injection) vulnerability in EntityImport (OFBIZ-12304)
The XXE vulnerability can read arbitrary files on the server.

Thanks: thiscodecc for reporting this security issue (post-auth)
2021-09-13 08:44:43 +02:00
Jacques Le Roux a28316b70d Fixed: Found a new XXE (XML External Entity Injection) vulnerability in EntityImport (OFBIZ-12304)
The XXE vulnerability can read arbitrary files on the server.

Thanks: thiscodecc for reporting this security issue (post-auth)
2021-09-13 08:16:49 +02:00
Jacques Le Roux 7e00617828 Fixed: Found a new XXE (XML External Entity Injection) vulnerability in ArtifactInfo (OFBIZ-12306)
The XXE vulnerability can read arbitrary files on the server.

Thanks: thiscodecc for reporting this security issue (post-auth)
2021-09-13 08:16:47 +02:00
Jacques Le Roux 1b907b06e8 Fixed: CVE-2021-37608 vulnerability bypass (OFBIZ-12307)
Safer completing solution as recommended by weinull orz <weinull@outlook.com>
Previous commit was OK, but better be safe than sorry ;)

Also forgot to commit the DENIEDFILEEXTENSIONS checkstyle change last time

Thanks: weinull orz for the the right suggestion (done 2021-08-13)
2021-09-03 17:18:11 +02:00
Jacques Le Roux dfd71bf7dd Fixed: CVE-2021-37608 vulnerability bypass (OFBIZ-12307)
The fix I did is two folds:
filters extensions (thanks to Zhujie's suggestion of a list of extensions to ban)
deletes bad files at the right place (thanks to thiscodecc's report)

Thanks: thiscodecc for the security report
2021-09-03 13:48:55 +02:00
Jacques Le Roux 3e5d0b73a8 Documented: Changes the link to issue tracker (Jira) to simplify things related to security 2021-09-01 09:55:51 +02:00
Jacques Le Roux 2b17c50ce7 Fixed: SecuredUpload::isValidTextFile wrong check with uppercase (OFBIZ-12301)
In SecuredUpload::isValidTextFile a wrong check is done

Thanks: Zhujie from Ping'an Technology
2021-08-10 13:04:09 +02:00
Nicolas Malin 6271d220b6 Fixed: IndexOutOfBoundsException on Entity Import (OFBIZ-12273)
Backport e4919d16ca from trunk

Removes the localhost (and 127.0.0.1) OOTB.
Allows to use it through a "multi-property" (list) in security.properties.

Conflict handled by hand in security.properties
2021-07-29 17:58:55 +02:00
Jacques Le Roux 8d49af4005 Fixed: Wrong uploaded file checked in Image Management (OFBIZ-12297)
When I secured the uploads with OFBIZ-12080 I made a mistake and checked the
wrong uploaded file in Image Management.
2021-07-29 17:25:41 +02:00
Nicolas Malin 2f5b8d33e3 Fixed: UserLoginHistory failed the store operation with large password (OFBIZ-12287)
Backport 2aa68dc4de from trunk

When you have a user with long password (greater than 256 characters) present in OFBiz and you try to log with, OFBiz return a long error message with sensitive information due to exceeding value size to store on the field UserLoginHistory.passwordUsed.

To solve this we don't return any information on the genericValue that failed and analyze the field passwordUsed to escape the case where the password set to login is create than the database field capacity.

Thanks to Daniel Elkabes <daniel.elkabes@whitesourcesoftware.com> and Hagai Wechsler <hagai.wechsler@whitesourcesoftware.com> from white source software to raise the problem.
2021-07-28 14:42:09 +02:00
Jacques Le Roux 326e0f12a4 Improved: Adds missing ASL2 headers in Rainbow Stone less files 2021-07-27 17:02:41 +02:00
dshunter107 2dda5b7095 Update services_ledger.xml (#315) 2021-07-27 13:06:25 +02:00
Jacques Le Roux 7c3a03c16d Fixed: bug on button from catalog to party associated (OFBIZ-12289)
Problem when trying to access Party linked to Catalog.
When you click on a user associated with a catalog, the framework sends you to
party manager, but it's the currently logged in user that shows up in the
party manager, not the party that you want to see.

To reproduce, just go in the Catalog app, then on Catalogs, add a user to a
catalog, and try to access it via the button.

It comes from the fact that the parameter sent to the party manager via the
link doesn't have the right syntax.

Thanks: Gaetan Chaboussie
2021-07-23 12:56:20 +02:00
Jacques Le Roux d890ebaedc Fixed: Static initialization vectors for encryption (OFBIZ-12281)
(after discussing this on security@ofbiz.apache.org, it was decided to open a
Jira issue for that)

I've noticed that OFBiz Framework sometimes uses static initialization vectors
(IV) while creating a cipher:

https://s.apache.org/vhlbj
https://s.apache.org/nyndk

IVs should be unique and ideally unpredictable to avoid producing the same
ciphertexts for the same plaintexts.

The issues can be fixed with something like the following:

byte[] rawIV = new byte[8];
SecureRandom random = new SecureRandom();
random.nextBytes(rawIV).
IvParameterSpec iv = new IvParameterSpec(rawIV);

jleroux: this prepends the IV in order to decrypt the plaintexts. It's similar
to what has been done for the DesCrypt class. But contrary to the DesCrypt class
I did not test.

Thanks: Artem Smotrakov

Conflicts handled by hand (a lot)
ValueLinkApi.java
2021-07-23 09:29:37 +02:00
Jacques Le Roux 5a069a9991 Fixed: Static initialization vectors for encryption (OFBIZ-12281)
(after discussing this on security@ofbiz.apache.org, it was decided to open a
Jira issue for that)

I've noticed that OFBiz Framework sometimes uses static initialization vectors
(IV) while creating a cipher:

https://s.apache.org/vhlbj
https://s.apache.org/nyndk

IVs should be unique and ideally unpredictable to avoid producing the same
ciphertexts for the same plaintexts.

The issues can be fixed with something like the following:

byte[] rawIV = new byte[8];
SecureRandom random = new SecureRandom();
random.nextBytes(rawIV).
IvParameterSpec iv = new IvParameterSpec(rawIV);

jleroux: we prepend the IV in order to decrypt the plaintexts. I'll do
something similar in ValueLinkApi class ASAP

Thanks: Artem Smotrakov

Conflicts handled by hand:
framework/base/src/main/java/org/apache/ofbiz/base/crypto/DesCrypt.java
2021-07-21 11:11:54 +02:00
Jacques Le Roux 2b15c0302c Fixed: Add http to https redirect rule for ofbiz.apache.org (OFBIZ-10590)
This prevented to run the stable demo
2021-07-20 07:35:11 +02:00
Jacques Le Roux 2e88059bfc Fixed: Upgrades Tomcat from 9.0.43 to 9.0.48 (OFBIZ-12280)
Due to CVEs-2021-30037/30639/30640
2021-07-12 18:52:08 +02:00
Jacques Le Roux 123d9ed67f Fixed: Add TASK_STATUS to `status' field options in EditCalEvent form (OFBIZ-12271)
As WorkEffort entities with type as `Task' and a non-empty `Estimated Start Date'
will be included in calendar page, so TASK_STATUS should be added to EditCalEvent,
to make task status be correctly displayed and updated.

1. Go to page: https://demo-trunk.ofbiz.apache.org/workeffort/control/EditWorkEffort
2. Create a WorkEffort with Type as Task, Status as [Task] Accepted,
   and select Now for Estimated Start Date
3. Go to page: https://demo-trunk.ofbiz.apache.org/workeffort/control/calendar
4. Selected newly added task entry in calender, to show the edit form

In step 4, task status will be shown as In Planning, instead of Accepted.

Thanks: Xin Wang
2021-07-10 12:37:05 +02:00
Jacques Le Roux 0bfd33a274 Fixed: SeoConfigUtil does not maintain char-replace order (OFBIZ-12259)
Thanks: Ingo Wolfmayr for your contribution
2021-06-22 18:28:23 +02:00
Jacques Le Roux e1e7c2a4d3 Fixed: Update PDFBox to 2.0.24 because of CVE-2021-31811 & CVE-2021-31812 (OFBIZ-12256)
CVE-2021-31811: A carefully crafted PDF file can trigger an OutOfMemory-Exception
while loading the file. This issue affects Apache PDFBox version 2.0.23 and prior 2.0.x versions.

CVE-2021-31812: a carefully crafted PDF file can trigger an infinite loop while
loading the file. This issue affects Apache PDFBox version 2.0.23 and prior 2.0.x versions.
2021-06-13 09:16:16 +02:00
Jacques Le Roux f0ee921873 Fixed: Unexpected decoding of url encoded textarea data after submission (OFBIZ-12249)
When trying to add a note to WorkEffort entity, I found that URL encoded
characters are unescaped, which is not expected.

e.g.:
1. Go to page: https://demo-trunk.ofbiz.apache.org/workeffort/control/EditWorkEffortNotes?workEffortId=TASK01
2. Add a note with content: https://example.com/a%20link
3. After submission, it will turned to be: https://example.com/a link

Thanks: Xin Wang for report and exchanges until solution I provided

Conflicts:
  UtilHttp.java:
      removes unused OOTB checkURLforSpiders for simplification
      removes number of cases in setResponseBrowserDefaultSecurityHeaders
      not present in R17
2021-06-09 12:39:37 +02:00
Jacques Le Roux 725c8543e0 Fixed: XSS vulnerability for ListWorkEfforts form (OFBIZ-12254)
If `sanitizer.enable` is turned off, `ListWorkEfforts` form will be vulnerable
to XSS attack, because of incomplete escaping.

Steps to reproduce:

1. Turn off `sanitizer.enable` in owasp.properties
2. Create a WorkEffort entity with name as `<script>alert(1)</script>`
3. Go to page: http://localhost:8080/workeffort/control/FindWorkEffort
4. Search for "Work Effort Name" which contains "script"

Thanks: Xin Wang
2021-06-09 12:28:40 +02:00
Jacques Le Roux 858cd36e90 Fixed: Show WorkEffort names in FindWorkEffort page (OFBIZ-12253)
In FindWorkEffort page, "Work Effort Name" can be specified as search
option, but the result table do not show it.

It would be nice if WorkEffort names can be displayed. Actually,
'workEffortName' has already been added to the description of hyperlink
in 'workEffortId' field, but 'workEffortName' is not presented in
'fieldList', so names are failed to be shown.

Thanks: Xin Wang
2021-06-06 11:52:43 +02:00
Jacques Le Roux 3742e034a7 Fixed: Failed to update work effort child (OFBIZ-12250)
When trying to update child work effort, a SQL error is reported:
Column 'WORK_EFFORT_ID' cannot accept a NULL value.

Steps to reproduce:

1. Open : workeffort/control/ChildWorkEfforts?workEffortId=TASK01&trail=TASK01
2. Select a child work effort
3. Modify the name and click "Save"

related to OFBIZ-753, workEffortId is also duplicated in edit form, If I
comment out workEffortId field of EditWorkEffortAndAssoc, it works properly.

Thanks: Xin Wang for report and Scott for initial workaround in OFBIZ-753
2021-06-05 18:06:56 +02:00
Priya Sharma 14e581ff35 [Fixed] Possibly currency display bug in 'Find Invoices' (OFBIZ-12177) (#302)
- Since the method InvoiceWorker.getInvoiceTotal takes care of the conversion, it is redundant to convert it again on the screen, which results in mismatch of the currency and the amount.

Thanks: Suraj, Jacques, Rajadurai for the review and Andrei Stan for reporting.
2021-05-31 19:03:56 +05:30
wpaetzold 4fd4cfc05a Implemented: Missing service for updateFacilityLocationGeoPoint (#296)
(OFBIZ-12242)

Thanks: Wiebke
2021-05-19 10:04:53 +02:00
Jacques Le Roux 69ce0dffc8 Fixed: Plugin not showing in menu due to permission (OFBIZ-12233)
When creating a plugin via gradle :
./gradlew createPlugin -PpluginId=plugin-test -PpluginResourceName=PluginTest
-PwebappName=plugin-test -PbasePermission=PLUGIN_TEST

and loading all the required data and permissions, the plugin doesn't appear
in the menu.

It comes from the ComponentConfig.java file, L1229, when the permissions gets
trimmed and modified. I tried removing it locally and it fixed the problem.

Thanks: Gaetan Chaboussie
2021-05-17 12:01:09 +02:00
Jacques Le Roux 2c7a414cc2 Fixed: Error page shown when clicking on a product Id in the purchase order page (OFBIZ-12229)
There is no "basePrice" resulting from calculatePurchasePrice service calling but
a simple "price".

This was put in with d04f777 commit and OFBIZ-11955

Thanks: Woyce Batkins for report
2021-05-01 19:10:35 +02:00
Jacques Le Roux 717bd4ba43 Fixed: Secure the uploads (OFBIZ-12080)
Reopened after report of a bug (only on *nix systems) by Shrilesh Korgaonkar.
This fixes the issue

Thanks: Shrilesh Korgaonkar
2021-04-16 09:24:52 +02:00
Jacques Le Roux 564b605d55 Improved: Replace Bintray by a new place to upload the Gradle Wrapper (OFBIZ-12192)
The checksum part was missing in Windows init-gradle-wrapper.ps1 script

I have noticed 2 points:
1. We should use SHA256, not SHA1
2. The unix-like shell script in OFBiz misses checksum verification in case
shasum command is not installed. In other words, if I launch the script it would
fail with "shasum not found, the downloaded files could not be verified".
However, the file will be kept there, so the user could launch unverified jar.

Last point was reported by Vladimir Sitnikov at LEGAL-288
2021-04-10 14:10:43 +02:00
Jacques Le Roux 2ce14c8fe1 Fixed: Service calls of "createPartyContactMech" now include the needed contactMechTypeId (OFBIZ-12175) (#292)
Accidentally removed PartyServices::createRoleType
2021-04-08 13:47:47 +02:00
wpaetzold 7af07c808b Fixed: Error while deleting a Facility because of an existing (#291)
FacilityLocationGeoPoint (OFBIZ-12222)

Adds a service to delete a FacilityLocationGeoPoint
2021-04-08 11:53:12 +02:00
bjugl f089d59389 Fixed: Service calls of "createPartyContactMech" now include the needed contactMechTypeId (OFBIZ-12175) (#292)
This was broken by OFBIZ-8358 where, as well explained at OFBIZ-12175,
"createPartyContactMech Service has been changed to expect an OUT
contactMechTypeId paramter and the call on this end has not been modified."

jleroux: I fixed lines too long
File PartyServices.java
Error Description	Line
La ligne excède 150 caractères (trouvé 178).	2621
La ligne excède 150 caractères (trouvé 178).	2638
La ligne excède 150 caractères (trouvé 191).	2655

Conflicts handled by hand
2021-04-08 11:40:42 +02:00
bjugl 8ef5896077 Fixed: Service calls of "createPartyContactMech" now include the needed contactMechTypeId (OFBIZ-12175) (#292)
This was broken by OFBIZ-8358 where, as well explained at OFBIZ-12175,
"createPartyContactMech Service has been changed to expect an
OUT contactMechTypeId paramter and the call on this end has not been modified."

Conflicts handled by hand in PartyServices.java
I let the changes coming from trunk, too much to revert by hand
2021-04-08 11:28:47 +02:00
Jacques Le Roux 57183eea13 Improved: Improve ObjectInputStream denyList (OFBIZ-12221)
In SafeObjectInputStream.properties
  Renames listOfSafeObjectsForInputStream to allowList and fixes it
  Introduces a denyList

Adapts SafeObjectInputStream class to new denyList

Conflicts handled by hand
  framework/base/config/SafeObjectInputStream.properties
  framework/base/src/main/java/org/apache/ofbiz/base/util/SafeObjectInputStream.java
2021-04-07 09:19:20 +02:00
Jacques Le Roux 27adfed9f0 Improved: Improve ObjectInputStream denyList (OFBIZ-12221)
Prevents generics markup in string type names.

Conflict handled by hand
  framework/base/src/main/java/org/apache/ofbiz/base/util/SafeObjectInputStream.java
2021-04-05 17:05:32 +02:00
Jacques Le Roux 02cd3b33b0 Fixed: updates Tika because of CVE-2021-2865 2021-03-30 17:20:34 +02:00
Jacques Le Roux 1a5bca9190 Improved: Improve UtilObject class (OFBIZ-12216)
This removes the inoffensive but annoying message in log (which does not show in
trunk, see https://github.com/apache/ofbiz-framework/commit/27c9180/

Not the same as in trunk, simply handling with exception Rather than returning
null, also shorten java.rmi.server to java.rmi to block more cases
2021-03-30 12:38:36 +02:00
Aditya Sharma d75ef8212d Fixed: Form to add an employee position doesn't function properly when invoked from Humanres tree (OFBIZ-11684)
Replaced logic to ajaxify the response from EditEmplPosition with navigating user to EditEmplPosition page.
When we are getting the entire page and updating it into the DOM, it would be better if we navigate user to the page.
Issue with the current approach is current page and the EditEmplPosition page both have GlobalActions decorator all the js files in GlobalActions are loaded twice. Either we should ajaxify a section of page or we should navigate user to the EditEmplPosition page.

Thanks Pierre Smits for reporting the issue and Sebastian Berg, Michael Brohl, & Jacques Le Roux for the discussion and efforts
2021-03-30 10:59:19 +05:30
Jacques Le Roux 703a32b41f Improved: Comment out the SOAP and HTTP engines (OFBIZ-12212)
The SOAP and HTTP engines are open doors to security issues.
At https://markmail.org/message/pgtjyh23bazq4s2w I proposed to comment them out
as we did for RMI in the past.
Of cause it must be clearly documented how to use them if needed.

Here is the email content:

    After the recent fix for the CVE-2021-26295[1] we discussed with the security
    team about the opportunity need to comment out the SOAP and HTTP engines
    like we did in the past for RMI[2], this obviously for security reason.

    [1] OFBIZ-12167 "Adds a blacklist (to be
    renamed soon to denylist) in Java serialisation (CVE-2021-26295)"
    [2] OFBIZ-6942 "Comment out RMI related
    code because of the Java deserialization issue [CVE-2016-2170] "

I just put a small comment in webtools controller, it should be enough.

The tests pass
2021-03-29 13:19:49 +02:00
Jacques Le Roux 9510fc9389 Fixed: addImageForProduct fails (OFBIZ-12211)
The addImageForProduct  process is not directly uploading a file but renames it
before.So there is a hyphen, and possibly a pair or parenthesis in case of
duplicate files, added to the file name.

In this commit I have also added the possibility to use underscores and spaces
in the original filename
2021-03-29 11:09:08 +02:00
Jacques Le Roux 7fb8780c97 Fixed: Invalid Currency symbol in income statement csv export (OFBIZ-12108)
1. Navigate to URL: accounting/control/IncomeStatement?organizationPartyId=Company
2. In income statement section click on export as csv button.
3. The exported csv has correct balance but with invalid currency symbol.
4. On screen USD $ symbol is shown and in csv some other currency symbol is shown.

Thanks: Lalit Dashora for report, Praveen Sharma for the fix
2021-03-28 13:31:47 +02:00
Suraj Khurana 921db68bde Fixed: ChangeReason was not being set on OrderStatus when orderItem was marked cancelled with reason.
(OFBIZ-12210)
Thanks Lalit Dashora for reporting the issue and providing the patch.
2021-03-27 16:29:30 +05:30
Jacques Le Roux 6b1d71d91a Fixed: Secure the uploads (OFBIZ-12080)
Fixes an issue reported by 赖涵 <1044309102@qq.com>: "Any file upload and delete
in latest Apache OFBiz"

It was a simple syntax error on my side
2021-03-26 19:15:10 +01:00
Jacques Le Roux c4c3012916 Improved: Secure the uploads (OFBIZ-12080)
Improves the error message for the file name part
2021-03-24 19:12:03 +01:00
Jacques Le Roux ac1595b304 Improved: Update Freemaker to 2.3.31 in R17 and R18 (OFBIZ-12196)
That's for (low) security reason. There are no bugs in R17 and R18 but after
reading about FREEMARKER-124 at
https://freemarker.apache.org/docs/versions_2_3_30.html
I believe we should update update Freemaker to 2.3.31 in R17 and R18
2021-03-22 11:08:54 +01:00
Jacques Le Roux 15bb640a83 Fixed: Upgrade Apache PDFBox to 2.0.23 because of CVE-2021-27807 and CVE-2021-27906 (OFBIZ-12205)
Currently we don't declare any dependency on PDFBox. I guess because it's used
as a 3rd party by another lib. Fortunately it's easily done.
2021-03-21 16:38:52 +01:00
356 changed files with 1880 additions and 1142 deletions
+4 -1
View File
@@ -129,9 +129,12 @@ In case of problems visit our link:#further-reading[Further reading section].
[[security]]
== Security
If you find a security issue, please report it to: security @ ofbiz.apache.org.
* If you find a pre-auth security issue, please report it to: security @ ofbiz.apache.org.
Once proper mitigations to the security issues are complete the OFBiz team will
disclose this information to the public mailing list.
* If you find a post-auth security issue, please https://s.apache.org/dsj2p[create a bug in our issue tracker (Jira)] .
You can find more information about security in OFBiz at
https://cwiki.apache.org/confluence/display/OFBIZ/Keeping+OFBiz+secure[Keeping OFBiz secure]
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="AcctgTransType.description.AMORTIZATION">
<value xml:lang="ar">الإطفاء</value>
<value xml:lang="de">Amortisation</value>
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="AccountingCheckAccountCannotBeUpdated">
<value xml:lang="en">ERROR: Could not update Check Account.</value>
</property>
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="AccountingAccount">
<value xml:lang="ar">حساب</value>
<value xml:lang="cs">Účet</value>
+1 -1
View File
@@ -19,7 +19,7 @@
-->
<entity-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entity-eca.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entity-eca.xsd">
<!-- To maintain FinAccount.actualBalance and FinAccount.availableBalance -->
<eca entity="FinAccountTrans" operation="create-store" event="return">
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
+1 -1
View File
@@ -20,7 +20,7 @@ under the License.
<ofbiz-component name="accounting"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>
@@ -19,7 +19,7 @@ under the License.
-->
<service-group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-group.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/service-group.xsd">
<group name="createCreditCardAndAddress" send-mode="all">
<invoke name="createPostalAddress" mode="sync" result-to-context="true"/>
+1 -1
View File
@@ -19,7 +19,7 @@ under the License.
-->
<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/service-eca.xsd">
<eca service="createPaymentApplication" event="commit">
<condition field-name="invoiceId" operator="is-not-empty"/>
@@ -19,7 +19,7 @@ under the License.
-->
<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/service-eca.xsd">
<!-- On cancelling invoice reverse its Accounting Transactions -->
<eca service="cancelInvoice" event="invoke">
@@ -19,7 +19,7 @@ under the License.
-->
<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/service-eca.xsd">
<!-- this eca automatically posts the accounting transactions to GL -->
<eca service="createAcctgTransAndEntries" event="commit">
@@ -19,7 +19,7 @@ under the License.
-->
<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/service-eca.xsd">
<!-- these SECAs are for automatically creating accounting transactions based on business transactions.
They should normally be "sync" SECAs so that they happen as soon
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services - Miscellaneous</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -18,7 +18,7 @@ specific language governing permissions and limitations
under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services: Agreements </description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services: Budget</description>
<vendor>Apache OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Clear Commerce Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Cost Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services: Financial Account</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services: Fixed Asset </description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -137,7 +137,7 @@ under the License.
location="component://accounting/minilang/ledger/GeneralLedgerServices.xml" invoke="updateGlReconciliation" auth="true">
<description>Update a GlReconciliation record</description>
<permission-service service-name="basicGeneralLedgerPermissionCheck" main-action="UPDATE"/>
<auto-attributes include="pk" mode="INOUT" optional="false"/>
<auto-attributes include="pk" mode="IN" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true">
<exclude field-name="createdByUserLogin"/>
<exclude field-name="lastModifiedByUserLogin"/>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>OrbitalGateway Services</description>
<vendor></vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Payment Gateway Config Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>PayPal Services</description>
<service name="payPalSetExpressCheckout" engine="java"
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Permission Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services: Rate and related services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services: TaxAuthority and related </description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Accounting Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -23,6 +23,7 @@ import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
@@ -59,7 +60,9 @@ import javax.crypto.spec.DHPrivateKeySpec;
import javax.crypto.spec.DHPublicKeySpec;
import javax.crypto.spec.IvParameterSpec;
import org.apache.commons.codec.binary.Base64;
import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.GeneralException;
import org.apache.ofbiz.base.util.HttpClient;
import org.apache.ofbiz.base.util.HttpClientException;
import org.apache.ofbiz.base.util.StringUtil;
@@ -154,14 +157,23 @@ public class ValueLinkApi {
* @return Hex String of the encrypted pin (EAN) for transmission to ValueLink
*/
public String encryptPin(String pin) {
byte[] rawIv = new byte[8];
SecureRandom random = new SecureRandom();
random.nextBytes(rawIv);
IvParameterSpec iv = new IvParameterSpec(rawIv);
// get the Cipher
Cipher mwkCipher = this.getCipher(this.getMwkKey(), Cipher.ENCRYPT_MODE);
Cipher mwkCipher = null;
try {
mwkCipher = getCipher(this.getMwkKey(), Cipher.ENCRYPT_MODE, iv);
} catch (GeneralException e1) {
Debug.logError(e1, module);
}
// pin to bytes
byte[] pinBytes = pin.getBytes(StandardCharsets.UTF_8);
// 7 bytes of random data
byte[] random = this.getRandomBytes(7);
byte[] randomBytes = this.getRandomBytes(7);
// pin checksum
byte[] checkSum = this.getPinCheckSum(pinBytes);
@@ -169,8 +181,8 @@ public class ValueLinkApi {
// put all together
byte[] eanBlock = new byte[16];
int i;
for (i = 0; i < random.length; i++) {
eanBlock[i] = random[i];
for (i = 0; i < randomBytes.length; i++) {
eanBlock[i] = randomBytes[i];
}
eanBlock[7] = checkSum[0];
for (i = 0; i < pinBytes.length; i++) {
@@ -200,11 +212,26 @@ public class ValueLinkApi {
/**
* Decrypt an encrypted pin using the configured keys
* @param pin Hex String of the encrypted pin (EAN)
* @return Plain text String of the pin
* @return Plain text String of the pin @
*/
public String decryptPin(String pin) {
// get the Cipher
Cipher mwkCipher = this.getCipher(this.getMwkKey(), Cipher.DECRYPT_MODE);
// separate prefix with IV from the rest of encrypted data
byte[] encryptedPayload = Base64.decodeBase64(pin.getBytes());
byte[] iv = new byte[8];
byte[] encryptedBytes = new byte[encryptedPayload.length - iv.length];
// populate iv with bytes:
System.arraycopy(encryptedPayload, 0, iv, 0, iv.length);
// populate encryptedBytes with bytes:
System.arraycopy(encryptedPayload, iv.length, encryptedBytes, 0, encryptedBytes.length);
Cipher mwkCipher = null;
try {
mwkCipher = getCipher(getMwkKey(), Cipher.ENCRYPT_MODE, new IvParameterSpec(iv));
} catch (GeneralException e1) {
Debug.logError(e1, module);
}
// decrypt pin
String decryptedPinString = null;
@@ -271,7 +298,7 @@ public class ValueLinkApi {
}
/**
* Output the creation of public/private keys + KEK to the console for manual database update
* Output the creation of public/private keys + KEK to the console for manual database update @
*/
public StringBuffer outputKeyCreation(boolean kekOnly, String kekTest) {
return this.outputKeyCreation(0, kekOnly, kekTest);
@@ -340,8 +367,18 @@ public class ValueLinkApi {
byte[] loadKekBytes = loadedKek.getEncoded();
// test the KEK
Cipher cipher = this.getCipher(this.getKekKey(), Cipher.ENCRYPT_MODE);
byte[] kekTestB = { 0, 0, 0, 0, 0, 0, 0, 0 };
byte[] rawIv = new byte[8];
SecureRandom secRandom = new SecureRandom();
secRandom.nextBytes(rawIv);
IvParameterSpec iv = new IvParameterSpec(rawIv);
Cipher cipher = null;
try {
cipher = getCipher(this.getKekKey(), Cipher.ENCRYPT_MODE, iv);
} catch (GeneralException e1) {
Debug.logError(e1, module);
}
byte[] kekTestB = {0, 0, 0, 0, 0, 0, 0, 0 };
byte[] kekTestC = new byte[0];
if (kekTest != null) {
kekTestB = StringUtil.fromHexString(kekTest);
@@ -496,7 +533,7 @@ public class ValueLinkApi {
/**
* Generate a new MWK
* @return Hex String of the new encrypted MWK ready for transmission to ValueLink
* @return Hex String of the new encrypted MWK ready for transmission to ValueLink @
*/
public byte[] generateMwk() {
KeyGenerator keyGen = null;
@@ -535,7 +572,7 @@ public class ValueLinkApi {
/**
* Generate a new MWK
* @param desBytes byte array of the DES key (24 bytes)
* @return Hex String of the new encrypted MWK ready for transmission to ValueLink
* @return Hex String of the new encrypted MWK ready for transmission to ValueLink @
*/
public byte[] generateMwk(byte[] desBytes) {
if (debug) {
@@ -570,7 +607,7 @@ public class ValueLinkApi {
/**
* Generate a new MWK
* @param mwkdes3 pre-generated DES3 SecretKey
* @return Hex String of the new encrypted MWK ready for transmission to ValueLink
* @return Hex String of the new encrypted MWK ready for transmission to ValueLink @
*/
public byte[] generateMwk(SecretKey mwkdes3) {
// zeros for checksum
@@ -581,9 +618,18 @@ public class ValueLinkApi {
Random ran = new SecureRandom();
ran.nextBytes(random);
byte[] rawIv = new byte[8];
SecureRandom secRandom = new SecureRandom();
secRandom.nextBytes(rawIv);
IvParameterSpec iv = new IvParameterSpec(rawIv);
// open a cipher using the new mwk
Cipher cipher = this.getCipher(mwkdes3, Cipher.ENCRYPT_MODE);
Cipher cipher = null;
try {
cipher = getCipher(mwkdes3, Cipher.ENCRYPT_MODE, iv);
} catch (GeneralException e1) {
Debug.logError(e1, module);
}
// make the checksum - encrypted 8 bytes of 0's
byte[] encryptedZeros = new byte[0];
@@ -617,7 +663,12 @@ public class ValueLinkApi {
* @return encrypted byte array
*/
public byte[] encryptViaKek(byte[] content) {
return cryptoViaKek(content, Cipher.ENCRYPT_MODE);
try {
return cryptoViaKek(content, Cipher.ENCRYPT_MODE);
} catch (GeneralException e1) {
Debug.logError(e1, module);
}
return null;
}
/**
@@ -626,7 +677,12 @@ public class ValueLinkApi {
* @return decrypted byte array
*/
public byte[] decryptViaKek(byte[] content) {
return cryptoViaKek(content, Cipher.DECRYPT_MODE);
try {
return cryptoViaKek(content, Cipher.DECRYPT_MODE);
} catch (GeneralException e1) {
Debug.logError(e1, module);
}
return null;
}
/**
@@ -772,46 +828,50 @@ public class ValueLinkApi {
return dhParamSpec;
}
// actual kek encryption/decryption code
protected byte[] cryptoViaKek(byte[] content, int mode) {
/**
* actual kek encryption/decryption code
* @throws GeneralException
*/
protected byte[] cryptoViaKek(byte[] content, int mode) throws GeneralException {
// open a cipher using the kek for transport
Cipher cipher = this.getCipher(this.getKekKey(), mode);
byte[] dec = new byte[0];
byte[] rawIv = new byte[8];
SecureRandom random = new SecureRandom();
random.nextBytes(rawIv);
IvParameterSpec iv = new IvParameterSpec(rawIv);
// Create the Cipher - DESede/CBC/PKCS5Padding
byte[] encBytes = null;
Cipher cipher = getCipher(getKekKey(), mode, iv);
try {
dec = cipher.doFinal(content);
} catch (IllegalStateException e) {
Debug.logError(e, module);
} catch (IllegalBlockSizeException e) {
Debug.logError(e, module);
} catch (BadPaddingException e) {
encBytes = cipher.doFinal(content);
} catch (IllegalStateException | BadPaddingException | IllegalBlockSizeException e) {
Debug.logError(e, module);
}
return dec;
// Prepend iv as a prefix to use it during decryption
byte[] combinedPayload = new byte[rawIv.length + encBytes.length];
// populate payload with prefix iv and encrypted data
System.arraycopy(iv, 0, combinedPayload, 0, rawIv.length);
System.arraycopy(cipher, 0, combinedPayload, 8, encBytes.length);
return encBytes;
}
// return a cipher for a key - DESede/CBC/NoPadding IV = 0
protected Cipher getCipher(SecretKey key, int mode) {
byte[] zeros = { 0, 0, 0, 0, 0, 0, 0, 0 };
IvParameterSpec iv = new IvParameterSpec(zeros);
// return a cipher for a key - DESede/CBC/NoPadding with random IV
protected static Cipher getCipher(Key key, int mode, IvParameterSpec iv) throws GeneralException {
// create the Cipher - DESede/CBC/NoPadding
Cipher mwkCipher = null;
Cipher cipher = null;
try {
mwkCipher = Cipher.getInstance("DESede/CBC/NoPadding");
} catch (NoSuchAlgorithmException e) {
Debug.logError(e, module);
return null;
} catch (NoSuchPaddingException e) {
Debug.logError(e, module);
cipher = Cipher.getInstance("DESede/CBC/NoPadding");
} catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
throw new GeneralException(e);
}
try {
mwkCipher.init(mode, key, iv);
} catch (InvalidKeyException e) {
Debug.logError(e, "Invalid key", module);
} catch (InvalidAlgorithmParameterException e) {
Debug.logError(e, module);
cipher.init(mode, key, iv);
} catch (InvalidKeyException | InvalidAlgorithmParameterException e) {
throw new GeneralException(e);
}
return mwkCipher;
return cipher;
}
protected byte[] getPinCheckSum(byte[] pinBytes) {
@@ -20,7 +20,7 @@
<test-suite suite-name="accountingtests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/test-suite.xsd">
<test-case case-name="accounting-tests-data-load">
<entity-xml action="load" entity-xml-url="component://accounting/testdef/data/AccountingTestsData.xml"/>
@@ -20,7 +20,7 @@
<test-suite suite-name="fixedassettests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/test-suite.xsd">
<test-case case-name="fixedasset-tests">
<simple-method-test location="component://accounting/minilang/test/FixedAssetTests.xml"/>
@@ -20,7 +20,7 @@
<test-suite suite-name="invoicetests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/test-suite.xsd">
<test-case case-name="auto-invoice-tests">
<simple-method-test location="component://accounting/minilang/test/AutoInvoiceTests.xml"/>
@@ -20,7 +20,7 @@
<test-suite suite-name="paymentappltests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/test-suite.xsd">
<test-case case-name="application-tests-data-load">
<entity-xml action="load" entity-xml-url="component://accounting/testdef/data/PaymentApplicationTestsData.xml"/>
@@ -20,7 +20,7 @@
<test-suite suite-name="paymenttests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/test-suite.xsd">
<test-case case-name="auto-payment-tests">
<simple-method-test location="component://accounting/minilang/test/AutoPaymentTests.xml"/>
@@ -20,7 +20,7 @@
<test-suite suite-name="ratetests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/test-suite.xsd">
<test-case case-name="rate-tests-data-load">
<entity-xml action="load" entity-xml-url="component://accounting/testdef/data/RateTestsData.xml"/>
</test-case>
@@ -69,10 +69,8 @@ under the License.
<field-map field-name="compareDate" from-field="invoiceDate"/>
<field-map field-name="lastNameFirst" value="Y"/>
</service>
<set field="amountToApply" value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId)
.multiply(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceCurrencyConversionRate(delegator,invoiceId))}"/>
<set field="total" value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)
.multiply(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceCurrencyConversionRate(delegator,invoiceId))}"/>
<set field="amountToApply" value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId)}"/>
<set field="total" value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)}"/>
</row-actions>
<field name="invoiceId" widget-style="buttontext" sort-field="true">
@@ -891,6 +891,11 @@ under the License.
<set field="fromDate" from-field="parameters.fromDate" type="Timestamp"/>
<set field="thruDate" from-field="parameters.thruDate" type="Timestamp"/>
<set field="glFiscalTypeId" from-field="parameters.glFiscalTypeId" default-value="ACTUAL"/>
<service service-name="getPartyAccountingPreferences" result-map="result">
<field-map field-name="organizationPartyId" value="${groovy:parameters.get('ApplicationDecorator|organizationPartyId')}"/>
</service>
<set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/>
<set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/>
<script location="component://accounting/groovyScripts/reports/IncomeStatement.groovy"/>
</actions>
<widgets>
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="CommonExtCreatePublicMessage">
<value xml:lang="de">Erzeuge öffentliche Nachricht</value>
<value xml:lang="en">Create Public Message</value>
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="PageTitleEditProductCategory">
<value xml:lang="en">Edit Product Category</value>
<value xml:lang="fr">Edition de la catégorie produit</value>
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<title>Entity of an Apache OFBiz Component</title>
<description>None</description>
<version>1.0</version>
+1 -1
View File
@@ -20,7 +20,7 @@ under the License.
<ofbiz-component name="commonext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>
+1 -1
View File
@@ -19,6 +19,6 @@ under the License.
-->
<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/service-eca.xsd">
</service-eca>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Commonext Component Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
+1 -1
View File
@@ -19,7 +19,7 @@ under the License.
-->
<component-loader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/component-loader.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/component-loader.xsd">
<load-component component-location="datamodel"/>
<load-component component-location="party"/>
<load-component component-location="securityext"/>
@@ -17,7 +17,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="CharacterSet.description.ISO-8859-1">
<value xml:lang="en">ISO-8859-1</value>
<value xml:lang="es">ISO-8859-1 Inglés</value>
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="contentevents.error_getting_content_list">
<value xml:lang="en">Error getting the content list to index: ${gee}.</value>
<value xml:lang="ja">コンテンツリストの取得時にエラー。索引: ${gee}.</value>
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="CannotFindCmsform">
<value xml:lang="de">Die CMS Form kann nicht gefunden werden!</value>
<value xml:lang="en">Cannot find the cmsform!</value>
+1 -1
View File
@@ -19,7 +19,7 @@ under the License.
-->
<entity-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entity-eca.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entity-eca.xsd">
<!-- If the text in the database has changed for the data resource, we need to clear out anything depending on this cached value -->
<eca entity="ElectronicText" operation="store-remove" event="return">
+1 -1
View File
@@ -20,7 +20,7 @@ under the License.
<ofbiz-component name="content"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>
<classpath type="dir" location="dtd"/>
+1 -1
View File
@@ -19,7 +19,7 @@ under the License.
-->
<service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-mca.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/service-mca.xsd">
<mca mail-rule-name="processIncomingEmail">
<action service="storeIncomingEmail" mode="sync"/>
+1 -1
View File
@@ -19,7 +19,7 @@ under the License.
-->
<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/service-eca.xsd">
<eca service="createFile" event="in-validate">
<condition field-name="dataResource" operator="is-empty"/>
<action service="createDataResource" mode="sync"/>
+1 -1
View File
@@ -19,7 +19,7 @@
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Content Component Services</description>
<vendor>OFBiz</vendor>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Content Component Services</description>
<vendor>OFBiz</vendor>
@@ -18,7 +18,7 @@
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Content Component Content Services</description>
<vendor>OFBiz</vendor>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Content Component Services</description>
<vendor>OFBiz</vendor>
@@ -18,7 +18,7 @@
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Content Component Data Services</description>
<vendor>OFBiz</vendor>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Content Component Document Services</description>
<vendor>OFBiz</vendor>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Content Component Output Services</description>
<vendor>OFBiz</vendor>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Content Component Services</description>
<vendor>OFBiz</vendor>
@@ -18,7 +18,7 @@
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Content Component WebSite Services</description>
<vendor>OFBiz</vendor>
@@ -39,12 +39,12 @@ import org.apache.ofbiz.service.DispatchContext;
import org.apache.ofbiz.service.LocalDispatcher;
import org.apache.ofbiz.service.ServiceUtil;
import com.sun.syndication.feed.synd.SyndContent;
import com.sun.syndication.feed.synd.SyndContentImpl;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndEntryImpl;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.feed.synd.SyndFeedImpl;
import com.rometools.rome.feed.synd.SyndContent;
import com.rometools.rome.feed.synd.SyndContentImpl;
import com.rometools.rome.feed.synd.SyndEntry;
import com.rometools.rome.feed.synd.SyndEntryImpl;
import com.rometools.rome.feed.synd.SyndFeed;
import com.rometools.rome.feed.synd.SyndFeedImpl;
/**
* BlogRssServices
@@ -27,6 +27,10 @@ import java.io.RandomAccessFile;
import java.io.StringWriter;
import java.io.Writer;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.HashMap;
@@ -38,7 +42,6 @@ import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.GeneralException;
import org.apache.ofbiz.base.util.UtilDateTime;
import org.apache.ofbiz.base.util.UtilGenerics;
import org.apache.ofbiz.base.util.UtilIO;
import org.apache.ofbiz.base.util.UtilMisc;
import org.apache.ofbiz.base.util.UtilProperties;
import org.apache.ofbiz.base.util.UtilValidate;
@@ -57,8 +60,8 @@ import org.apache.ofbiz.service.ServiceUtil;
*/
public class DataServices {
public static final String module = DataServices.class.getName();
public static final String resource = "ContentUiLabels";
private static final String MODULE = DataServices.class.getName();
private static final String RESOURCE = "ContentUiLabels";
public static Map<String, Object> clearAssociatedRenderCache(DispatchContext dctx, Map<String, Object> context) {
Delegator delegator = dctx.getDelegator();
@@ -67,8 +70,9 @@ public class DataServices {
try {
DataResourceWorker.clearAssociatedRenderCache(delegator, dataResourceId);
} catch (GeneralException e) {
Debug.logError(e, "Unable to clear associated render cache with dataResourceId=" + dataResourceId, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentClearAssociatedRenderCacheError", UtilMisc.toMap("dataResourceId", dataResourceId), locale));
Debug.logError(e, "Unable to clear associated render cache with dataResourceId=" + dataResourceId, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentClearAssociatedRenderCacheError",
UtilMisc.toMap("dataResourceId", dataResourceId), locale));
}
return ServiceUtil.returnSuccess();
}
@@ -129,7 +133,7 @@ public class DataServices {
dataResourceId = delegator.getNextSeqId("DataResource");
}
if (Debug.infoOn()) {
Debug.logInfo("in createDataResourceMethod, dataResourceId:" + dataResourceId, module);
Debug.logInfo("in createDataResourceMethod, dataResourceId:" + dataResourceId, MODULE);
}
GenericValue dataResource = delegator.makeValue("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId));
dataResource.setNonPKFields(context);
@@ -140,9 +144,10 @@ public class DataServices {
// get first statusId for content out of the statusItem table if not provided
if (UtilValidate.isEmpty(dataResource.get("statusId"))) {
try {
GenericValue statusItem = EntityQuery.use(delegator).from("StatusItem").where("statusTypeId", "CONTENT_STATUS").orderBy("sequenceId").queryFirst();
GenericValue statusItem = EntityQuery.use(delegator).from("StatusItem").where("statusTypeId", "CONTENT_STATUS")
.orderBy("sequenceId").queryFirst();
if (statusItem != null) {
dataResource.put("statusId", statusItem.get("statusId"));
dataResource.put("statusId", statusItem.get("statusId"));
}
} catch (GenericEntityException e) {
return ServiceUtil.returnError(e.getMessage());
@@ -173,7 +178,8 @@ public class DataServices {
String dataResourceId = (String) context.get("dataResourceId");
String textData = (String) context.get("textData");
if (UtilValidate.isNotEmpty(textData)) {
GenericValue electronicText = delegator.makeValue("ElectronicText", UtilMisc.toMap("dataResourceId", dataResourceId, "textData", textData));
GenericValue electronicText = delegator.makeValue("ElectronicText",
UtilMisc.toMap("dataResourceId", dataResourceId, "textData", textData));
try {
electronicText.create();
} catch (GenericEntityException e) {
@@ -210,18 +216,19 @@ public class DataServices {
// extended validation for binary/character data
if (UtilValidate.isNotEmpty(textData) && binData != null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentCannotProcessBothCharacterAndBinaryFile", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentCannotProcessBothCharacterAndBinaryFile", locale));
}
// obtain a reference to the file
File file = null;
if (UtilValidate.isEmpty(objectInfo)) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentUnableObtainReferenceToFile", UtilMisc.toMap("objectInfo", ""), locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentUnableObtainReferenceToFile",
UtilMisc.toMap("objectInfo", ""), locale));
}
if (UtilValidate.isEmpty(dataResourceTypeId) || "LOCAL_FILE".equals(dataResourceTypeId) || "LOCAL_FILE_BIN".equals(dataResourceTypeId)) {
file = new File(objectInfo);
if (!file.isAbsolute()) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentLocalFileDoesNotPointToAbsoluteLocation", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentLocalFileDoesNotPointToAbsoluteLocation", locale));
}
} else if ("OFBIZ_FILE".equals(dataResourceTypeId) || "OFBIZ_FILE_BIN".equals(dataResourceTypeId)) {
prefix = System.getProperty("ofbiz.home");
@@ -232,7 +239,7 @@ public class DataServices {
} else if ("CONTEXT_FILE".equals(dataResourceTypeId) || "CONTEXT_FILE_BIN".equals(dataResourceTypeId)) {
prefix = (String) context.get("rootDir");
if (UtilValidate.isEmpty(prefix)) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentCannotFindContextFileWithEmptyContextRoot", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentCannotFindContextFileWithEmptyContextRoot", locale));
}
if (objectInfo.indexOf('/') != 0 && prefix.lastIndexOf('/') != (prefix.length() - 1)) {
sep = "/";
@@ -240,43 +247,49 @@ public class DataServices {
file = new File(prefix + sep + objectInfo);
}
if (file == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentUnableObtainReferenceToFile", UtilMisc.toMap("objectInfo", objectInfo), locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentUnableObtainReferenceToFile",
UtilMisc.toMap("objectInfo", objectInfo), locale));
}
// write the data to the file
if (UtilValidate.isNotEmpty(textData)) {
try (
OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(file), UtilIO.getUtf8());
) {
try (OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8);) {
out.write(textData);
if (!org.apache.ofbiz.security.SecuredUpload.isValidFile(file.getAbsolutePath(), "Text", delegator)) {
String errorMessage = UtilProperties.getMessage("SecurityUiLabels", "SupportedTextFileFormats", locale);
return ServiceUtil.returnError(errorMessage);
}
} catch (IOException | ImageReadException e) {
Debug.logWarning(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentUnableWriteCharacterDataToFile", UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
Debug.logWarning(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentUnableWriteCharacterDataToFile",
UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
}
} else if (binData != null) {
try {
RandomAccessFile out = new RandomAccessFile(file, "rw");
out.write(binData.array());
out.close();
// Check if a webshell is not uploaded
if (!org.apache.ofbiz.security.SecuredUpload.isValidFile(file.getAbsolutePath(), "All", delegator)) {
Path tempFile = Files.createTempFile(null, null);
Files.write(tempFile, binData.array(), StandardOpenOption.APPEND);
if (!org.apache.ofbiz.security.SecuredUpload.isValidFile(tempFile.toString(), "All", delegator)) {
String errorMessage = UtilProperties.getMessage("SecurityUiLabels", "SupportedFileFormatsIncludingSvg", locale);
return ServiceUtil.returnError(errorMessage);
}
Files.delete(tempFile);
RandomAccessFile out = new RandomAccessFile(file, "rw");
out.write(binData.array());
out.close();
} catch (FileNotFoundException | ImageReadException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentUnableToOpenFileForWriting", UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentUnableToOpenFileForWriting",
UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
} catch (IOException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentUnableWriteBinaryDataToFile", UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentUnableWriteBinaryDataToFile",
UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
}
} else {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFilePassed", UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentNoContentFilePassed",
UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
}
Map<String, Object> result = ServiceUtil.returnSuccess();
@@ -324,8 +337,9 @@ public class DataServices {
try {
dataResource = EntityQuery.use(delegator).from("DataResource").where("dataResourceId", dataResourceId).queryOne();
} catch (GenericEntityException e) {
Debug.logWarning(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentDataResourceNotFound", UtilMisc.toMap("parameters.dataResourceId", dataResourceId), locale));
Debug.logWarning(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentDataResourceNotFound",
UtilMisc.toMap("parameters.dataResourceId", dataResourceId), locale));
}
dataResource.setNonPKFields(context);
@@ -335,7 +349,7 @@ public class DataServices {
try {
dataResource.store();
} catch (GenericEntityException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError(e.getMessage());
}
@@ -352,8 +366,8 @@ public class DataServices {
}
/**
* Because sometimes a DataResource will exist, but no ElectronicText has been created,
* this method will create an ElectronicText if it does not exist.
* Because sometimes a DataResource will exist, but no ElectronicText has been created, this method will create an
* ElectronicText if it does not exist.
* @param dctx the dispatch context
* @param context the context
* @return update the ElectronicText
@@ -368,12 +382,12 @@ public class DataServices {
String contentId = (String) context.get("contentId");
result.put("contentId", contentId);
if (UtilValidate.isEmpty(dataResourceId)) {
Debug.logError("dataResourceId is null.", module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentDataResourceIsNull", locale));
Debug.logError("dataResourceId is null.", MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentDataResourceIsNull", locale));
}
String textData = (String) context.get("textData");
if (Debug.verboseOn()) {
Debug.logVerbose("in updateElectronicText, textData:" + textData, module);
Debug.logVerbose("in updateElectronicText, textData:" + textData, MODULE);
}
try {
electronicText = EntityQuery.use(delegator).from("ElectronicText").where("dataResourceId", dataResourceId).queryOne();
@@ -387,8 +401,8 @@ public class DataServices {
electronicText.create();
}
} catch (GenericEntityException e) {
Debug.logWarning(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentElectronicTextNotFound", locale) + " " + e.getMessage());
Debug.logWarning(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentElectronicTextNotFound", locale) + " " + e.getMessage());
}
return result;
@@ -445,53 +459,59 @@ public class DataServices {
// write the data to the file
if (UtilValidate.isNotEmpty(textData)) {
try (
OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(file),UtilIO.getUtf8());
) {
try (OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8);) {
out.write(textData);
if (!org.apache.ofbiz.security.SecuredUpload.isValidFile(file.getAbsolutePath(), "Text", delegator)) {
String errorMessage = UtilProperties.getMessage("SecurityUiLabels", "SupportedTextFileFormats", locale);
return ServiceUtil.returnError(errorMessage);
}
} catch (IOException | ImageReadException e) {
Debug.logWarning(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentUnableWriteCharacterDataToFile", UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
Debug.logWarning(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentUnableWriteCharacterDataToFile",
UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
}
} else if (binData != null) {
try {
// Check if a webshell is not uploaded
Path tempFile = Files.createTempFile(null, null);
Files.write(tempFile, binData.array(), StandardOpenOption.APPEND);
if (!org.apache.ofbiz.security.SecuredUpload.isValidFile(tempFile.toString(), "Image", delegator)) {
String errorMessage = UtilProperties.getMessage("SecurityUiLabels", "SupportedFileFormatsIncludingSvg", locale);
return ServiceUtil.returnError(errorMessage);
}
Files.delete(tempFile);
RandomAccessFile out = new RandomAccessFile(file, "rw");
out.setLength(binData.array().length);
out.write(binData.array());
out.close();
// Check if a webshell is not uploaded
if (!org.apache.ofbiz.security.SecuredUpload.isValidFile(file.getAbsolutePath(), "All", delegator)) {
String errorMessage = UtilProperties.getMessage("SecurityUiLabels", "SupportedFileFormatsIncludingSvg", locale);
return ServiceUtil.returnError(errorMessage);
}
} catch (FileNotFoundException | ImageReadException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentUnableToOpenFileForWriting", UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentUnableToOpenFileForWriting",
UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
} catch (IOException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentUnableWriteBinaryDataToFile", UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentUnableWriteBinaryDataToFile",
UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
}
} else {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFilePassed", UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "ContentNoContentFilePassed",
UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
}
} catch (IOException e) {
Debug.logWarning(e, module);
Debug.logWarning(e, MODULE);
throw new GenericServiceException(e.getMessage());
}
return result;
}
public static Map<String, Object> renderDataResourceAsText(DispatchContext dctx, Map<String, ? extends Object> context) throws GeneralException, IOException {
public static Map<String, Object> renderDataResourceAsText(DispatchContext dctx, Map<String, ? extends Object> context)
throws GeneralException, IOException {
Map<String, Object> results = new HashMap<>();
//LocalDispatcher dispatcher = dctx.getDispatcher();
Writer out = (Writer) context.get("outWriter");
Map<String, Object> templateContext = UtilGenerics.checkMap(context.get("templateContext"));
Map<String, Object> templateContext = UtilGenerics.cast(context.get("templateContext"));
//GenericValue userLogin = (GenericValue) context.get("userLogin");
String dataResourceId = (String) context.get("dataResourceId");
if (templateContext != null && UtilValidate.isEmpty(dataResourceId)) {
@@ -514,7 +534,7 @@ public class DataServices {
out.write(outWriter.toString());
results.put("textData", outWriter.toString());
} catch (IOException e) {
Debug.logError(e, "Error rendering sub-content text", module);
Debug.logError(e, "Error rendering sub-content text", MODULE);
return ServiceUtil.returnError(e.toString());
}
return results;
@@ -533,14 +553,15 @@ public class DataServices {
Delegator delegator = dctx.getDelegator();
//Locale locale = (Locale) context.get("locale");
String dataResourceId = (String) context.get("dataResourceId");
ByteBuffer byteBuffer = (ByteBuffer)context.get("imageData");
ByteBuffer byteBuffer = (ByteBuffer) context.get("imageData");
if (byteBuffer != null) {
byte[] imageBytes = byteBuffer.array();
try {
GenericValue imageDataResource = EntityQuery.use(delegator).from("ImageDataResource").where("dataResourceId", dataResourceId).queryOne();
GenericValue imageDataResource = EntityQuery.use(delegator).from("ImageDataResource")
.where("dataResourceId", dataResourceId).queryOne();
if (Debug.infoOn()) {
Debug.logInfo("imageDataResource(U):" + imageDataResource, module);
Debug.logInfo("imageBytes(U):" + Arrays.toString(imageBytes), module);
Debug.logInfo("imageDataResource(U):" + imageDataResource, MODULE);
Debug.logInfo("imageBytes(U):" + Arrays.toString(imageBytes), MODULE);
}
if (imageDataResource == null) {
return createImageMethod(dctx, context);
@@ -566,14 +587,14 @@ public class DataServices {
Map<String, Object> result = new HashMap<>();
Delegator delegator = dctx.getDelegator();
String dataResourceId = (String) context.get("dataResourceId");
ByteBuffer byteBuffer = (ByteBuffer)context.get("imageData");
ByteBuffer byteBuffer = (ByteBuffer) context.get("imageData");
if (byteBuffer != null) {
byte[] imageBytes = byteBuffer.array();
try {
GenericValue imageDataResource = delegator.makeValue("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId));
imageDataResource.setBytes("imageData", imageBytes);
if (Debug.infoOn()) {
Debug.logInfo("imageDataResource(C):" + imageDataResource, module);
Debug.logInfo("imageDataResource(C):" + imageDataResource, MODULE);
}
imageDataResource.create();
} catch (GenericEntityException e) {
@@ -597,35 +618,34 @@ public class DataServices {
return result;
}
public static Map<String, Object> createBinaryFileMethod(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException {
public static Map<String, Object> createBinaryFileMethod(DispatchContext dctx, Map<String, ? extends Object> context)
throws GenericServiceException {
Delegator delegator = dctx.getDelegator();
Map<String, Object> result = new HashMap<>();
GenericValue dataResource = (GenericValue) context.get("dataResource");
String dataResourceTypeId = (String) dataResource.get("dataResourceTypeId");
String objectInfo = (String) dataResource.get("objectInfo");
byte [] imageData = (byte []) context.get("imageData");
String rootDir = (String)context.get("rootDir");
byte[] imageData = (byte[]) context.get("imageData");
String rootDir = (String) context.get("rootDir");
Locale locale = (Locale) context.get("locale");
File file = null;
if (Debug.infoOn()) {
Debug.logInfo("in createBinaryFileMethod, dataResourceTypeId:" + dataResourceTypeId, module);
Debug.logInfo("in createBinaryFileMethod, objectInfo:" + objectInfo, module);
Debug.logInfo("in createBinaryFileMethod, rootDir:" + rootDir, module);
Debug.logInfo("in createBinaryFileMethod, dataResourceTypeId:" + dataResourceTypeId, MODULE);
Debug.logInfo("in createBinaryFileMethod, objectInfo:" + objectInfo, MODULE);
Debug.logInfo("in createBinaryFileMethod, rootDir:" + rootDir, MODULE);
}
try {
file = DataResourceWorker.getContentFile(dataResourceTypeId, objectInfo, rootDir);
} catch (FileNotFoundException | GeneralException e) {
Debug.logWarning(e, module);
Debug.logWarning(e, MODULE);
throw new GenericServiceException(e.getMessage());
}
if (Debug.infoOn()) {
Debug.logInfo("in createBinaryFileMethod, file:" + file, module);
Debug.logInfo("in createBinaryFileMethod, imageData:" + imageData.length, module);
Debug.logInfo("in createBinaryFileMethod, file:" + file, MODULE);
Debug.logInfo("in createBinaryFileMethod, imageData:" + imageData.length, MODULE);
}
if (imageData != null && imageData.length > 0) {
try (
FileOutputStream out = new FileOutputStream(file);
) {
try (FileOutputStream out = new FileOutputStream(file);) {
out.write(imageData);
// Check if a webshell is not uploaded
if (!org.apache.ofbiz.security.SecuredUpload.isValidFile(file.getAbsolutePath(), "All", delegator)) {
@@ -633,10 +653,10 @@ public class DataServices {
return ServiceUtil.returnError(errorMessage);
}
if (Debug.infoOn()) {
Debug.logInfo("in createBinaryFileMethod, length:" + file.length(), module);
Debug.logInfo("in createBinaryFileMethod, length:" + file.length(), MODULE);
}
} catch (IOException | ImageReadException e) {
Debug.logWarning(e, module);
Debug.logWarning(e, MODULE);
throw new GenericServiceException(e.getMessage());
}
}
@@ -657,38 +677,34 @@ public class DataServices {
return result;
}
public static Map<String, Object> updateBinaryFileMethod(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException {
public static Map<String, Object> updateBinaryFileMethod(DispatchContext dctx, Map<String, ? extends Object> context)
throws GenericServiceException {
Delegator delegator = dctx.getDelegator();
Map<String, Object> result = new HashMap<>();
GenericValue dataResource = (GenericValue) context.get("dataResource");
String dataResourceTypeId = (String) dataResource.get("dataResourceTypeId");
String objectInfo = (String) dataResource.get("objectInfo");
byte [] imageData = (byte []) context.get("imageData");
String rootDir = (String)context.get("rootDir");
byte[] imageData = (byte[]) context.get("imageData");
String rootDir = (String) context.get("rootDir");
Locale locale = (Locale) context.get("locale");
File file = null;
if (Debug.infoOn()) {
Debug.logInfo("in updateBinaryFileMethod, dataResourceTypeId:" + dataResourceTypeId, module);
Debug.logInfo("in updateBinaryFileMethod, objectInfo:" + objectInfo, module);
Debug.logInfo("in updateBinaryFileMethod, rootDir:" + rootDir, module);
Debug.logInfo("in updateBinaryFileMethod, dataResourceTypeId:" + dataResourceTypeId, MODULE);
Debug.logInfo("in updateBinaryFileMethod, objectInfo:" + objectInfo, MODULE);
Debug.logInfo("in updateBinaryFileMethod, rootDir:" + rootDir, MODULE);
}
try {
file = DataResourceWorker.getContentFile(dataResourceTypeId, objectInfo, rootDir);
} catch (FileNotFoundException e) {
Debug.logWarning(e, module);
} catch (FileNotFoundException | GeneralException e) {
Debug.logWarning(e, MODULE);
throw new GenericServiceException(e.getMessage());
} catch (GeneralException e2) {
Debug.logWarning(e2, module);
throw new GenericServiceException(e2.getMessage());
}
if (Debug.infoOn()) {
Debug.logInfo("in updateBinaryFileMethod, file:" + file, module);
Debug.logInfo("in updateBinaryFileMethod, imageData:" + Arrays.toString(imageData), module);
Debug.logInfo("in updateBinaryFileMethod, file:" + file, MODULE);
Debug.logInfo("in updateBinaryFileMethod, imageData:" + Arrays.toString(imageData), MODULE);
}
if (imageData != null && imageData.length > 0) {
try (
FileOutputStream out = new FileOutputStream(file);
){
try (FileOutputStream out = new FileOutputStream(file);) {
out.write(imageData);
// Check if a webshell is not uploaded
if (!org.apache.ofbiz.security.SecuredUpload.isValidFile(file.getAbsolutePath(), "All", delegator)) {
@@ -697,10 +713,10 @@ public class DataServices {
}
if (Debug.infoOn()) {
Debug.logInfo("in updateBinaryFileMethod, length:" + file.length(), module);
Debug.logInfo("in updateBinaryFileMethod, length:" + file.length(), MODULE);
}
} catch (IOException | ImageReadException e) {
Debug.logWarning(e, module);
Debug.logWarning(e, MODULE);
throw new GenericServiceException(e.getMessage());
}
}
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
@@ -18,7 +18,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
+1 -1
View File
@@ -20,7 +20,7 @@ under the License.
<ofbiz-component name="datamodel"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<resource-loader name="main" type="component"/>
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/accounting-entitymodel.xml"/>
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="EmplLeaveReasonType.description.CASUAL">
<value xml:lang="en">Casual</value>
<value xml:lang="fr">Convenance</value>
@@ -19,7 +19,7 @@
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="HumanResRequiredFieldMissingTrainingClassTypeId">
<value xml:lang="en">Required Field Missing : Training Class Type Id.</value>
</property>
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="FormFieldTitle_accountNumber">
<value xml:lang="en">Account Number</value>
<value xml:lang="de">Kontonummer</value>
+1 -1
View File
@@ -20,7 +20,7 @@ under the License.
<ofbiz-component name="humanres"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Human Resources Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Human Resources Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Humanres Services</description>
<vendor>OFBiz</vendor>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Humanres Services</description>
<vendor>OFBiz</vendor>
@@ -121,19 +121,7 @@ var rawdata = [
EmpPosition: {
label: "Add Employee Position",
action: function (NODE, TREE_OBJ) {
var dataSet = {};
dataSet = {"partyId" : NODE.attr("id")};
jQuery.ajax({
type: "GET",
url: "EditEmplPosition",
data: dataSet,
error: function(msg) {
alert("An error occurred loading content! : " + msg);
},
success: function(msg) {
jQuery('div.page-container').html(msg);
}
});
window.location.href = "EditEmplPosition?partyId=" + NODE.attr("id");
}
},
AddIntOrg: {
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="MrpEventType.description.MANUF_ORDER_RECP">
<value xml:lang="en">Manufacturing Order receipt</value>
<value xml:lang="es">Recibo de Orden de Producción</value>
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="ManufacturingCompletionDate">
<value xml:lang="en">Completion Date</value>
<value xml:lang="es">Fecha de Términación</value>
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="AddParty">
<value xml:lang="en">Add Party</value>
<value xml:lang="nl">Partij toevoegen</value>
@@ -20,7 +20,7 @@ under the License.
<ofbiz-component name="manufacturing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<resource-loader name="main" type="component"/>
<!-- place the config directory on the classpath to access configuration files -->
@@ -19,7 +19,7 @@ under the License.
-->
<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/service-eca.xsd">
<eca service="updateRequirement" event="commit">
<condition field-name="requirementTypeId" operator="equals" value="INTERNAL_REQUIREMENT"/>
<condition field-name="statusId" operator="equals" value="REQ_APPROVED"/>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Manufacturing Services - Misc</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Manufacturing Services - Bill Of Materials</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -18,7 +18,7 @@ specific language governing permissions and limitations
under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Manufacturing Services - Calendar</description>
<vendor>OFBiz</vendor>
<version>1.0</version>

Some files were not shown because too many files have changed in this diff Show More