called directly.
(OFBIZ-11199)
I suppose this issue is similar to OFBIZ-11152. So I'm handling it the same.
It's not an end to the underneath issue but at least it can reassure user about
things being handled...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866855 13f79535-47bb-0310-9956-ffa450edef68
(including admin) via "Forget Your Password"
(OFBIZ-4361)
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/trunk@1866478 13f79535-47bb-0310-9956-ffa450edef68
(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/trunk@1866259 13f79535-47bb-0310-9956-ffa450edef68
called directly.
(OFBIZ-11152)
Gives an advice to reassure users about the seriousness of the issue
This issue can be easily reproduced by going to example/control/FormWidgetExamples
Other backend components are less concerned but it happens sometimes in them too.
It's quite hard to understand what's happening.
This is a sequel of OFBIZ-10895
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866255 13f79535-47bb-0310-9956-ffa450edef68
in log
(OFBIZ-11154)
An error appears in log due to the nested request that can not be resolved
properly.
We should not worry about nested requests, they continue to work, and we should
simply not show an error message from RequestHandler in case of nested request.
Thanks: Initialy spotted by Benjamin Jugl in OFBIZ-9379
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865902 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11161)
the "dtd" directories are already present as resources distributed
inside OFBiz jar, so there is no need to augment the classpath to find
the XML schema inside those directories.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865796 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-7532)
To display a number we had different possibilities :
* on ftl use the template <@ofbizAmount and <@ofbizCurrency
* by java call a function UtilFormatOut.formatAmount, UtilFormatOut.formatPrice, UtilFormatOut.formatQuantity, etc..
* by form widget, use <display type=accounting-number for accounting but nothing for other
To simplify and homogenize all, I implemented a number type purpose :
* default: display a number by default, use when no purpose is present
* quantity: display a number as a quantity
* amount: display a number as an amount (like price without currency)
* spelled: litteral displaying for a number (use on <@ofbizAmount ftl only before)
* percentage: display a number as a percentage
* accounting: diplay a number for accounting specific
Each purpose can be associate to a number for displaying it :
* on ftl <@ofbizNumber number=value format=purpose/>
* on java UtilFormatOut.formatNumber(value, purpose, delegator, locale)
* on form widget <display type=number format=purpose/>
The format use by a purpose is define on framework/common/config/number.properties with the template
.displaying.format = ##0.00
With this, you can surchage a configuration, create your own purpose or surchage only one through entity SystemProperty.
Concerning the backware compatibility:
* For the ftl the template <@ofbizAmount is now a link to '<@ofbizNumber format=amount'
* For java all previous function call UtilFormatOut.formatNumber with the matching purpose
* For form xml accounting-number is managed as an exection
Last point, display a currency is different that a number, so I didn't refactoring some code for this case (only move properties from general to number for centralize de configuration on the same file)
Thanks Charles Steltzlen to start the refactoring
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1864832 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11138)
Use ‘LocalDateTime’ instead of ‘Calendar’ and
‘HttpServletRequest#getParameterMap’ instead of
‘HttpServletRequest#getParameterNames’.
The tests and callers has been adapted to remove the ‘locale’ arguments which
made sense only for ‘Calendar’.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863439 13f79535-47bb-0310-9956-ffa450edef68
It is better to avoid using obsolete ‘Enumeration’ class when possible
so the calls to ‘HttpServletRequest#getParameterNames’ has been
replaced by ‘HttpServletRequest#getParameterMap’.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863404 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11130)
This Factorizes their implementation which was copy-pasted. The remaining
issue concerning the undesirable re-implementation of ‘resolveURI’ has been
explained in a comment.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862315 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11129)
Avoid some boiler-plate when retrieving the request handler inside a
servlet context.
--this line, and those below, will be ignored--
M applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java
M applications/order/src/main/java/org/apache/ofbiz/order/task/TaskEvents.java
M applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/SeoTransform.java
M applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/UrlRegexpTransform.java
M applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java
M framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
M framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/CoreEvents.java
M framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizUrlTransform.java
M framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java
M framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlTreeRenderer.java
M framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
M framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java
M framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
M framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroTreeRenderer.java
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862295 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11129)
Avoid unecessary casts by using ‘ServletRequest#getServletContext’
instead of ‘ServletRequest#getAttribute’. This method is available
since Servlet specification 3.0.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862294 13f79535-47bb-0310-9956-ffa450edef68
(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/trunk@1859972 13f79535-47bb-0310-9956-ffa450edef68
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/trunk@1859800 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10939)
The ‘@Override’ annotation helps readers understand that the method at
hand is overriding a super class or implementing an interface.
Additionally it allows the compiler to check if the methods annotated
with ‘@Override’ are actually implementing an abstract method.
Using that annotation makes ‘@see foo.bar.ParentClass#myMethod’
comments useless, so those they have been removed for the newly
annotated methods.
Thanks Jacques Le Roux and Swapnil M Mane for acknowledging the commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858295 13f79535-47bb-0310-9956-ffa450edef68
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/trunk@1858180 13f79535-47bb-0310-9956-ffa450edef68
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/trunk@1858092 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10937)
Since Java 1.7, when defining generic types it is unnecessary to
redefine those types in the constructor when it is done in the
declared type.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857906 13f79535-47bb-0310-9956-ffa450edef68
(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/trunk@1857099 13f79535-47bb-0310-9956-ffa450edef68
(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
The comparator argument of this method was always ‘null’. Use
‘java.util.TreeMap()’ constructor in the inlined function which is
equivalent to passing ‘null’ to ‘java.util.TreeMap(Comparator)’.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854432 13f79535-47bb-0310-9956-ffa450edef68
(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/trunk@1852882 13f79535-47bb-0310-9956-ffa450edef68