After some small study, it seem there is a problem because login request not
require authentication
I have tried to add a test to check if current request is login and only if it's
not to remove PREVIOUS_REQUEST Session Attribute, it seem better with this
modification.
Thanks: Olivier for the patch and Michael for suggesting to parameterize using
a property. I simply used EntityUtilProperties.getPropertyValue instead of
UtilProperties.getPropertyValue
Conflicts: handled by hand
framework/security/config/security.properties
pages (OFBIZ-12047)
Added removal of the _PREVIOUS_REQUEST_ attribute when requesting
non-authenticated sites and moved targetRequestUri handling to a
accommodate this change
(OFBIZ-7327)
Use a data URL rather than a regular URL for company logos when a
logo has been specified as a Party Content item. This works around the
problem of Apache FOP failing to retrieve content from HTTPS URLs.
Thanks: Deepak Dixit for the review and suggestions
This error appears after trying to upload a file to party content:
2020-11-06 07:48:22,488 |jsse-nio-8443-exec-7 |RequestHandler |I|
Sending redirect to:
[https://localhost:8443/partymgr/control/viewprofile?partyId=admin].
2020-11-06 07:48:29,288 |jsse-nio-8443-exec-7 |UtilObject |E|
null
java.io.NotSerializableException: org.apache.commons.fileupload.disk.DiskFileItem
# Conflicts handled by hand
# framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java
# framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
Adds an explanation about what to do when using own domain.
Some users don't look into the log so it's better to set also the exception
message in order for them to have it right at 1st glance.
Conflicts handled in webapp/control/RequestHandler.java
(OFBIZ-10837)
While working on OFBIZ-11633 I crossed an issue in R18 (not in trunk) where
objects from org.apache.commons.fileupload (namely DiskFileItem and
FileItemHeadersImpl) are not serializable.
While at it I decided to handle at the SafeObjectInputStream level
the "fileItems" case I already crossed with, OFBIZ-11534, in RequestHandler
It has an inconvenient in R18 (not in trunk) where ObjectInputStream can't
handle a null class (of course) and so return a benign exception in log (only).
I believe it's better to handle these specific cases at the lower possible
level in all supported branches.
(OFBIZ-11534)
There is an issue in uploading large files, I am able to upload files up to 2 GB
successfully but getting an error when trying to upload a file larger than 2GB.
Example -
1. Go to party profile -
https://demo-trunk.ofbiz.apache.org/partymgr/control/viewprofile?partyId=admin
2. Try to create a party content with a file larger than 2 GB
3. Error on console
jleroux:
For a 2GB+ file you need to set Xmx to more than the double of the file size,
eg: gradlew ofbiz -PjvmArgs="-Xms1024M -Xmx5048M"
You then get another small issue (only in log) when redirecting to send the
partyId parameter.
This is because, DiskFileItem is a temporary Object with a null value contained
in "fileItems" attribute. It can't be detected by UtilMisc::makeMapSerializable
and that makes "fileItems" not serializable. So it must be removed from
reqAttrMap.
Thanks: Chandan Khandelwal for report, Michael for suggesting a very large file
to upload
(OFBIZ-11477)
According to OWASP OFBiz Web Content Caching is weak:
Independently of the cache policy defined by the web application, if caching web
application contents is allowed, the session IDs must never be cached, so it is
highly recommended to use the Cache-Control: no-cache="Set-Cookie, Set-Cookie2"
directive, to allow web clients to cache everything except the session ID
I though noticed that Set-Cookie2 is deprecated for a long time now. And we new
browsers policies it to often updated. So no need to use Set-Cookie2.
(OFBIZ-10753)
When OFBiz raise an error, the framework use a jsp page to display it.
I improved the error page generation to support also ftl template rendering and by this way extend the theme engine to support to overide it
On controler.xml we can now use :
<errorpage>/error/error.jsp</errorpage>
or
<errorpage>component://common/webcommon/error/Error.ftl</errorpage> (default configuration)
On your theme you can add your own error page :
<template>
...
<template-file widget=menu location=component://common-theme/template/macro/HtmlMenuMacroLibrary.ftl/>
+ <template-file widget=error location=component://common-theme/template/ErrorPage.ftl/>
</template>
The component://common/webcommon/error/Error.ftl contains the logic theming connection and to simplify source code, all framework old error page (error.jsp) have been removed to centralize all on this new page.
Thanks to Marine Desmarchelier for the error page design
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856175 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1868611 | jleroux | 2019-10-19 08:42:07 +0200 (sam. 19 oct. 2019) | 11 lignes
Improved: Handling tenant in XmlRpcEventHandler
(OFBIZ-10284)
The XMLRPC service does not support tenants. Even if the tenant domain is
included in the HTTP request the call does not affect the correct tenant.
The issue and fix has been discussed in in the thread
https://markmail.org/message/bz4dofrxqp6i7ove
jleroux: I was able to port the R16 patch provided by Rajesh to the trunk.
Thanks: Rajesh Kumar Mallah
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1868612 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1868298 | jleroux | 2019-10-11 18:45:16 +0200 (ven. 11 oct. 2019) | 20 lignes
Fixed: NotSerializableException after uploading images to an order
(OFBIZ-11123)
I found that using in r1866259 the same fix than Si Chen used in OFBIZ-750 was
wrong. The code just above this fix is
{code:java}
if (obj instanceof Serializable) {
reqAttrMap.put(name, obj);
}
{code}
The problem with this code is that if does not handle inner Maps which may
contain a non Serializable Object. So the solution is rather to get one level
deeper and apply the same. We can then remove the harcoded lines with
"uploadedFile" and "_REQUEST_HANDLER_" below. Then all possible cases are handled
as long as we have not inner-inner-Maps
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1868299 13f79535-47bb-0310-9956-ffa450edef68
(including admin) via 'Forget Your Password'
(OFBIZ-4361)
Trunk backport r1866478 and r1866518
Currently, any user (via ecommerce 'Forget Your Password') has the ability to
reset another users password, including 'admin' without permission.
By simply entering 'admin' and clicking 'Email Password', the following is
displayed:
The following occurred:
A new password has been created and sent to you. Please check your Email.
This now forces the user of the ERP to change their password.
It is also possible to generate a dictionary attack against ofbiz because there
is no capta code required. This is serious security risk.
I have modified the patch following comments I made in the Jira, notably
Removed unused Java variables
Removed a check in LoginEvents::forgotPassword which prevented to show error
messages
Changed fr and en SecurityExtPasswordSentToYou
+ SecurityExtThisEmailIsInResponseToYourRequestToHave labels
+ template PasswordEmail.ftl
+ loginservices.token_incorrect labels
Added fr and en SecurityExtIgnoreEmail + SecurityExtLinkOnce labels
Removed changes in general.properties
I did not remove the 2 GetSecurityQuestion.ftl files (webpos one was still in)
There is still room for improvement. I'll discuss them on the Jira and dev
ML. But this version is already strong enough to not wait that the patch is
inapplicable!
Thanks: mz4wheeler (Mike Z) for the Jira, Nicolas Malin for the patch, I guess
with some Gil's help, and all others for comments and ideas
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1867296 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1866259 | jleroux | 2019-09-02 09:32:48 +0200 (lun. 02 sept. 2019) | 10 lignes
Fixed: NotSerializableException after uploading images to an order
(OFBIZ-11123)
In a lot of services we use the ByteBuffer object to upload files.
When a such service is used with the redirect-parameter in a controller the
ByteBuffer needs to be serialized. Unfortunately ByteBuffer (in our case its
subclass HeapByteBuffer) is not serializable. So that can't work.
Fortunately no redirect-parameter concerns uploadedFile so we can safely remove
it from reqAttrMap in RequestHandler
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1866260 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1859972 | jleroux | 2019-05-25 16:08:48 +0200 (sam. 25 mai 2019) | 12 lignes
Fixed: Duplicate entries in paramWithSuffix
(OFBIZ-11056)
when using string-list-suffix attribute for service definition, invoke method
(from associated event handler) will try to parse parameters from both request
variable and rawParameterMap which was also built from request.
So we end up with duplicates in resulting list.
This behaviour seems to be introduced with OFBIZ-5048.
Thanks: Samuel Trégouët for report and fix
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1859973 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1859800 | jleroux | 2019-05-23 18:36:37 +0200 (jeu. 23 mai 2019) | 8 lignes
Fixed: Replace request-redirect w/ no redirect-param attribute by
request-redirect-noparam
(OFBIZ-9997)
Reverts all the rest from r1816180, and, after reading carefully the code used
for "request-redirect" in RequestHandler (and downward), fixes the documentation
in site-conf.xsd
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1859801 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1858180 | jleroux | 2019-04-26 10:33:30 +0200 (ven. 26 avr. 2019) | 17 lignes
Reverted: Unknown request [images]; this request does not exist or cannot be
called directly.
(OFBIZ-10895)
Partially revert r1858094, just replaces "rmaps == null" by "rmaps.isEmpty()"
As Mathieu mentioned in dev:
<<Checking for ‘null’ here is not a solution since ‘resolveURI’ contract
it to return a non-nullable collection.
This commit is only bypassing the error handling.>>
As I said in r1858094:
<<This has been somehow broken by OFBIZ-10438 but actually it was already broken
before but not for the same reason.>>
We need now to review/check how it worked in R15 where it's OK, and possibly
implements the same
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1858181 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1858092 | jleroux | 2019-04-25 10:25:30 +0200 (jeu. 25 avr. 2019) | 14 lignes
Fixed: Unknown request [images]; this request does not exist or cannot be called
directly.
(OFBIZ-10895)
This has been somehow broken by OFBIZ-10438 but actually it was already broken
before but not for the same reason. Finally r1838081 (for OFBIZ-10438) allows to
easy fix it when in previous versions (pre R18) it would need another fix.
Since it's only annoying text in log I'll let users search the solution for
pre R18 versions and will fix it only for trunk and R18.
Replaces rmaps.isEmpty() by rmaps == null as it was before R16 (R15 has not this
issue)
Also includes Eclipse automated imports sorting
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1858094 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1857099 | jleroux | 2019-04-08 11:17:55 +0200 (lun. 08 avr. 2019) | 12 lignes
Improved: Using try-with-resources with File IO Objects.
(OFBIZ-9855)
Uses try with resources for File IO objects like ObjectInputStream and other
objects. File classes have the AutoCloseable interface.
jleroux: this is only a part of the 2nd patch. The 1st patch will be committed
soon too...
All tests pass
Thanks: Pradhan Yash Sharma
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1857486 13f79535-47bb-0310-9956-ffa450edef68
===
Fixed: Error parsing JWT
(OFBIZ-10814)
Fixes incorrect retrieval of the Authorization header JWT token.
Fixes wrong API usage for the key parameter which assumed the key is
provided in BAS64 format.
Refactored the code to use helper methods for key and auth header
retrieval.
Javadoc corrections and enhancements.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1852884 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1851998 | jleroux | 2019-01-24 09:17:38 +0100 (jeu. 24 janv. 2019) | 11 lignes
Fixed: Impossible secure and autologin cookie names when mountpoint contains a
slash inside its name
(OFBIZ-10766)
Deepak Nigam reported on dev ML:
When there is one web app with the empty mount point (i.e. deployed on root),
the auto-login cookie will not work for that particular webapp due to the change
in the path of the cookie from "/" to "/" + applicationName. Because the system
will try to find the cookie at the "/" but it is actually at "/" + applicationName.
Thanks Deepak for report
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1851999 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1851350 | jleroux | 2019-01-15 14:48:33 +0100 (mar. 15 janv. 2019) | 7 lignes
Fixed: Correct behaviour of Autologin cookies
(OFBIZ-10635)
As reported by Deepak Nigam on dev ML there was a risk of NPE with userLogin w/
my last commit at r1851074
Thanks Deepak for the report and proposed fix
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1851351 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1851247 | jleroux | 2019-01-14 14:53:18 +0100 (lun. 14 janv. 2019) | 13 lignes
Fixed: User's name is displayed on ecommerce even after user logs out
(OFBIZ-10666)
On further investigation, I found that cookie path and domain are different
in the methods of creating the auto-login cookie i.e. LoginWorker.autoLoginSet()
and removing the auto-login cookie i.e. LoginWorker.autoLoginRemove().
After following changes the issue seems to be fixed:
1. Removed getMaxAge() check from the condition used in
LoginWorker.getAutoUserLoginId() method.
2. Corrected the path and domain in the method LoginWorker.autoLoginRemove().
Thanks: Deepak Nigam for discussion and fix
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1851248 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1851200 | jleroux | 2019-01-13 14:31:13 +0100 (dim. 13 janv. 2019) | 11 lignes
Reverted: Impossible secure and autologin cookie names when mountpoint contains
a slash inside its name
(OFBIZ-10766)
In my previous commit I reverted the initial change. As I said in the Jira
I had a second look and it's better to fix the problem at the root as I did
initially.
I wrote in my previous commit: "This method is used in other places where the
name should not be changed." I checked there are no issues changing slashes to
underscores in the cookies names anywhere.
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1851201 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1851074 | jleroux | 2019-01-11 17:26:13 +0100 (ven. 11 janv. 2019) | 17 lignes
Fixed: Correct behaviour of Autologin cookies
(OFBIZ-10635)
In the method to set the autoLogin cookie, LoginWorker::autoLoginSet,
system fetches the webAppInfo by using the
method ComponentConfig::getWebappInfo. In this method, serverId and
applicationName are passed as arguments.
*WebappInfo webappInfo = ComponentConfig.getWebappInfo((String)
context.getAttribute("_serverId"), UtilHttp.getApplicationName(request));*
If the mount-point of the web app is set as an empty string, then 'root'
will be used as the application name, due to which the object webAppInfo
will come null. If the webAppInfo is null then the autoLogin cookie will
not be created and added to the response object by the system.
Thanks: Aditya for report and Mathieu Lirzin for discussion
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1851075 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1851068 | jleroux | 2019-01-11 17:12:01 +0100 (ven. 11 janv. 2019) | 12 lignes
Fixed: Add session tracking mode and make cookie secure
(OFBIZ-6655)
Following "Session timeout for webapps" discussion on dev ML
https://markmail.org/message/p6fbiojjrwb2ybxd
We decided to put back the session-timeout value in web.xml files and to remove
the line
session.setMaxInactiveInterval(60*60); //in seconds
from ControlEventListener.java
Thanks: Deepak Nigam for report and Girish Vasmatkar for discussion
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1851070 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1850694 | jleroux | 2019-01-07 22:58:01 +0100 (lun. 07 janv. 2019) | 13 lignes
Fixed: Correct behaviour of Autologin cookies
(OFBIZ-10635)
Michael spotted that I used "default-server" in r1845558:
Quoting him:
It only works for webapps using "default-server". This name is configurable
in the ofbiz-component.xml and and should not be hard-coded in the code.
This fixes it
Thanks: Michael Brohl
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1850695 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1850685 | jleroux | 2019-01-07 21:37:10 +0100 (lun. 07 janv. 2019) | 8 lignes
Fixed: Impossible secure and autologin cookie names when mountpoint contains a
slash inside its name
(OFBIZ-10766)
My previous commit was wrong this one fixes it.
I made a mistake trying to generalise changing UtilHttp::getApplicationName.
This method is used in other places where the name should not be changed.
Only cookies are concerned.
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1850686 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10721)
stats related entities foreign key relation has been removed by Jacopo at r#1647271 and new group org.apache.ofbiz.stats introduced for stats related entity. Some remnants were still left in stats entities.
Removed relations of Party, ContactMech and Content from ServerHit entity.
Removed relations of Content from ServerHitBin entity.
Removed relations of UserLogin from Visitor entity.
Thanks Jacques Le Roux and Deepak Dixit for the review.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849275 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10709)
LoginWorker.autoLoginCheck does not check if the attribute "autoUserLogin" is
not already filled and executes even if it is not needed. A check on the
attribute beforehand can improve performance significantly.
Thanks: Benjamin Jugl
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848926 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10701)
In order to detect potential issues early, the linting compiler option should be
used by default and disabled with {{./gradlew -PXlint:none build}}.
Additionally it is important to reduce the number of warnings otherwise new
warnings will remain unnoticed.
The warning related to the com.googlecode.concurrentlinkedhashmap dependency
should resolves itself once we handle upgrade to Caffeine like proposed in
OFBIZ-6747.
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848673 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10330)
The Log-Level of the Message "Could not find visit value object in
session..." is changed from "warning" to "info".
Thanks Benjamin Jugl for reporting and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848467 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10666)
Steps to regenerate:
Open URL: https://demo-trunk.ofbiz.apache.org/ecommerce/control/main.
Welcome is displayed and user's name is not displayed when URL is opened.
Login at ecommerce, username will be displayed after user logs in.
Logout of ecommerce by clicking on logout. User will be logged out and login
link will be displayed in place of logout link, but the name of user is still
displayed.
Actual: Username is still displayed after user logs out
Expected: Username should not be displayed after the user logs out
Note: Similar issue also exists when the user clicks on (Not You?) link.
Thanks: Arpit Mor for detailled report, Deepak Dixit for discussion
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848398 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-5048)
If a form is of type enctype="multipart/form-data" and we are handling its
submission through Groovy Event then in the parameters Map Ofbiz does not set
the multipart input parameters from request parameters.
The same are available when multipart form submission is handled through service.
The reason being the code that sets the multipart parameters in request
attribute is only available in ServiceEventHandler.java and in
GroovyEventHandler the multipart are never set.
So I have created a method getMultiPartParameterMap in the class UtilHttp.java
and put the common logic in that method so that when getCombinedMap method is
called from the GroovEventHandler the method also call getMultiPartParameterMap
and in the ServiceEventHandler I have written a call for
getMultiPartParameterMap method.
Thanks: Vikramjit Singh for report and initial patch, Rohit Koushal for updated
and revised patch with some minor changes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1847478 13f79535-47bb-0310-9956-ffa450edef68