(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/trunk@1851350 13f79535-47bb-0310-9956-ffa450edef68
(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/trunk@1851247 13f79535-47bb-0310-9956-ffa450edef68
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/trunk@1851200 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10760)
This fixes an engine declaration mistake introduced in OFBIZ-9111,
removes an unused service which should have been deleted in OFBIZ-8722
and removes unused services which should have been deleted in
OFBIZ-10146.
Thanks Mathieu Lirzin for reporting and providing the patches.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1851158 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10689)
After I changed the method name from ObjectType::simpleTypeConvert to
ObjectType::simpleTypeOrObjectConvert, Shikha Jaiswal noticed that I missed
the groovy files.
Checking further I found that I also missed the simple-methods.xsd and
ObjectTypeTests.java (though this last one was no really a problem)
Thanks: Shikha Jaiswal
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1851156 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10747)
In case if the factor is not available then use 'UomConversion' entity.
Thanks Amit Gadaley for reporting the issue and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1851137 13f79535-47bb-0310-9956-ffa450edef68
(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/trunk@1851074 13f79535-47bb-0310-9956-ffa450edef68
(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/trunk@1851068 13f79535-47bb-0310-9956-ffa450edef68
(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/trunk@1850694 13f79535-47bb-0310-9956-ffa450edef68
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/trunk@1850685 13f79535-47bb-0310-9956-ffa450edef68
slash inside its name
(OFBIZ-10766)
When you set a mountpoint which contains a slash inside its name
(ie not only a slash as a trailer, which is possible), as it's needed with
OFBIZ-10765, OFBiz tries to create a cookie with a slash in its name and
that's impossible
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850530 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10691)
Unecessary ‘this’ has been removed and the javadoc has been
expanded. The visibility of the class has been reduced to package
only. The ‘conditionList’ field has been renamed to ‘conditions’ and
the subclasses has been adapted.
Thanks Mathieu for the contribution
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850385 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10691)
Remove useless ‘this’ and useless imports. An ‘isNullField’ private
method has been addded to factorize the check of null field.
Additionally the 120 characters per line limit has been enforced.
Thanks Mathieu for the contribution
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850384 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10691)
This class is now final. The ‘getConditionListSize’ and
‘getConditionIterator’ methods has been inlined instead of overidding
them from ‘EntityConditionListBase’. The Javadoc has been expanded.
Thanks Mathieu for the contribution
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850377 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10691)
‘EntityConditionFunction’ was representing an expression containing a
unary prefix condition operator or in other words a one argument
predicate. Actually, there exists only one meaningful implementation
for this kind of operators in the SQL language which is the NOT·
predicate. Having a ‘EntityNotCondition’ class allows us to have
simpler semantics while achieving the same completeness in term of SQL·
support.
The ‘EntityConditionVisitor’ and its documentation has been adapted to
the new class hierarchy.
Thanks Mathieu for the contribution
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850376 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10691)
This is done in the spirit of favouring abstraction over
implementation. To achieve that the following change has been made:
* The useless ‘EntityCondition#eval’ methods has been removed
* The ‘PriceServices#calculatePurchasePrice’ method has been fixed to
refer to ‘EntityCondition#makeCondition’ instead of
‘EntityExpr#makeCondition’.
Additionally, the genericity of the ‘makeCondition’ methods has been
improved to allow having a hierarchy of class between the
‘EntityCondition’ type and the subtypes.
Exceptionally a ‘serialVersionUID’ has been used instead of
suppressing the 'serial' warning for the ‘EntityCondition’ interface
to satisfy both Eclipse and OpenJDK linting features which disagree on
the validity of using the ‘@SuppressWarnings’ annotation in the case
of interfaces extending ‘Serializable’.
Thanks Mathieu for the contribution
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850373 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10691)
This is removing an abuse of inheritance for code reuse which was·
breaking Liskov substitution principle. This has been achieved with
the following changes:
* The ‘Serializable’ interface which was implemented by
‘EntityConditionBase’ is now implemented directly by the·
‘EntityCondition’, ‘EntityConditionValue’, and ‘EntityOperator’
classes.
* ‘emptyList’ and ‘_emptyMap’ useless static members has been removed
and ‘emptyAliases’ has been move down to the ‘EntityConditionValue’
subclass.
* The ‘castBoolean’ method has been removed due to the automatic
boxing/unboxing of boolean and Boolean values which make it useless.
* ‘equals’ and ‘hashCode’ pseudo abstract methods (meaning methods
throwing an unsupported operation exception) has been moved down to
the ‘EntityCondition’ and ‘EntityConditionValue’ sub classes.
‘Objects#equals’ and ‘Objects#hashCode’ standard methods has been
used in the EntityCondition class hierarchy instead.
* The ‘getColName’ methods has been moved down to the·
‘EntityConditionValue’ class which is the unique class using those
methods.
* The remaining static methods ‘getField’ and ‘addValue’ has been
moved to a new ‘EntityConditionUtils’ class. The unused override of
‘addValue’ has been removed which allowed us to make this method
static.
Thanks Mathieu for the contribution
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850372 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10763)
The use of an overridden abstract method for isEncrypted is a bit overkill and
could be replaced by a simple equality check
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850253 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10449)
various improvements:
* Inheriting from HttpFilter instead of implementing Filter
* Using streams when getting the allowed paths
No functional change
Thanks to Mathieu Lirzin for this refactoring
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850171 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10689)
Actually this is a firts step that simply renames
ObjectType::simpleTypeConvert to
ObjectType::simpleTypeOrObjectConvert
and improves the simpleTypeOrObjectConvert Javadoc
Thanks: Pierre Smits for report, Deepak Dixit for discussion
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850027 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10756)
Fixes CVE-2018-17200
We currently use the UnsupportedClassConverter method in UtilXml class.
When the 1.5 version of XStream will be available another way to handle this
kind of things will be available and used by default. It's already possible to
use the same with the 1.4 version of XStream with its setupDefaultSecurity method.
So this replaces the UnsupportedClassConverter in UtilXml class by
XStream::setupDefaultSecurity method.
It's an improvement but better to backport it as much as possible
The UtilXmlTests class and its use is removed and the UnsupportedClassConverter
method deprecated (no use OOTB)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850015 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10725)
Improved boolean returns with a single statement, replacing if blocks with the explicit boolean return.
Improves code in methods:
isPrimaryKey() of GenericEntity
hasNext() and hasPrevious() of EntityListIterator
isValueActive() of EntityUtil
Additional change:
Improved return for getStartIndexFromViewIndex() method in EntityUtil. Instead of using if-else block, a ternary operator is used for improving readability.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849741 13f79535-47bb-0310-9956-ffa450edef68
EntityQuery
(OFBIZ-9890)
queryList() and queryFirst() both call internal private query() method.
This method calls delegator.findList if a normal Entity/ViewEntity is used
(not a DVE).
DVE has no option to include a having condition and so must opt to use
queryIterator(). Even queryCount() can use a having condition.
Thanks: Rupert Howell and Gareth Carter for report, Prakhar Kumar for discussion
and Gareth Carter for the fix
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849693 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10728)
Improved boolean returns with single statement, replacing if blocks with explicit boolean return.
Improves code in isGiftCard().
Thanks Suraj Khurana for the review.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849673 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-10712)
We have checkAuth method in service dispatcher class, this method performs multiple auth related check.
if all checks passed it call the modelService.makeValid method to prepare service context (line#960) but this code executed only when service definition has a permission service call.
If service does not have any permission service call then it does not call the modelService.makeValid and this may cause the service validation issue unknown parameter found.
Ideally modelService.makeValid should call irrespective to permission service check.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849193 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10722)
When we have more than one form, in a screen, that use a date-find field,
the second date-find picker is not working.
To reproduce, you can add a new form with a date-find and call it below
FindInvoices in FindInvoices screen
Then load page [https://localhost:8443/accounting/control/findInvoices] .
You should see that there is no picker on the second date-find
The patch adds an id that allow renderDateFindField macro script to work for
both fields
Thanks: Leila Mekika
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849165 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10711)
Due to r1848673 for "Fix or Silence various warnings" (OFBIZ-10701)
a try-with-resources was used but the Object passed in context (an
EntityListIterator) should not be close there. It's reused in
FindGeneric.groovy:107 by a performFind service defined in the
dynamicAutoEntityFieldListForm String.
Thanks: Deepak Dixit for report.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848954 13f79535-47bb-0310-9956-ffa450edef68