Commit Graph
283 Commits
Author SHA1 Message Date
Adrian Crum 7b84188235 First pass at removing cached DOM tree code from EntityConfigUtil.java. I converted some of the code to use the new thread-safe models. I also fixed some concurrency problems in related classes by replacing DCL with java.util.concurrent classes. I discovered the new multi-threaded component loader was creating duplicate resources, so these changes fix that.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490541 13f79535-47bb-0310-9956-ffa450edef68
2013-06-07 08:39:44 +00:00
Adrian Crum e0ccd44b0f Small improvement to the Performance Metrics feature - sort by name the list of metrics.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1484150 13f79535-47bb-0310-9956-ffa450edef68
2013-05-18 17:31:45 +00:00
Adrian Crum 9bd42ec3a2 Reverted revision 1483822.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1484134 13f79535-47bb-0310-9956-ffa450edef68
2013-05-18 16:12:50 +00:00
Jacques Le Roux 929a06dfd5 Improves the Metrics stats by adding a new column used only by requests. It's quite useful to measure the real (not smoothed) durations of events in notably *chained* requests.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1483822 13f79535-47bb-0310-9956-ffa450edef68
2013-05-17 14:21:02 +00:00
Hans Bakker e72c65e187 add an optional timeout parameter to the ftp service
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482177 13f79535-47bb-0310-9956-ffa450edef68
2013-05-14 02:53:33 +00:00
Jacques Le Roux d75ab35079 A patch from Carsten Schinzer for "LoginServices.userLogin add info to fail message" https://issues.apache.org/jira/browse/OFBIZ-5137
The LoginServices only specify that a user was not found, but it is of interest which user was not found.
I added that to the log message in the error case.





git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470391 13f79535-47bb-0310-9956-ffa450edef68
2013-04-22 06:11:49 +00:00
Jacques Le Roux 44b77bdd07 A patch from Leon for "Some enhancement to password change." https://issues.apache.org/jira/browse/OFBIZ-5176
1. Make "password must be different from last passwords" function work. (--// FIXME: switching to salt-based hashing breaks this history lookup below)
2. When there's error occurs, return "requirePasswordChange" instead of "error". Then, "password change" form will not be redirected to "login" form if there's any kind of "error".
3. Fix one "deprecated" findByAnd call.
4. Return the "error" message instead of "event" message when password expires.
5. Chinese translation for "password expiration alert" and "password expired" message.

jleroux: I only reviewed (no tests) but seems good to me


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470127 13f79535-47bb-0310-9956-ffa450edef68
2013-04-20 09:00:44 +00:00
Jacques Le Roux 524aee52f9 A slightly modified patch from Sumit Pandit for "Enforce user to reset his password in a pre-defined regular interval of time." https://issues.apache.org/jira/browse/OFBIZ-5009
Reference requirement for the feature: http://markmail.org/message/sihxekwk6655t5gh#query:+page:1+mid:bcw2vva2hjxhsodq+state:results

For a user account in system, we can set password age for an additional security.
Proposed system will start suggesting to user to reset his password few days before password expiration. Then Once password expired, system will enforce him to reset his password before processing further.
Following will be control points and would be part of system configuration- 
* *Control Points -*
** Admin can enable/disable the reset password functionality.
*** -It will control by a flag in propriety file where admin can enable/disable it by setting true/false.
** Number of days in which password will expired.
*** - It will defined in propriety file so that admin can control it.
** Number of days before when password expiration alert display at user's screen.
*** - It will defined in propriety file so that admin can control it.

* *How should it processed -*
** After user logged-in, display password expiration notification message to user if his password will expire in comming days.
** After user logged-in, display change password screen, when password is expired. i.e. The difference in days since last time password updated is exceed to number of days specified in system policies. Enforce user to reset his password.

* *What will be the out-put -*
** Password is about to expire : : alert message after login.
** Password is expired : Password-Expired-Alert : alert message with reset password screen.

Following is implementation plan -

    security.properties : Provide configuration for following control points :
        Enabling / Disabling of the functionality.
        Maximum number of days within user has to change the password.
        Number of days back to password expire date, when user start getting password expiration alerts.

    Data model
        Entity name : UserLoginPasswordHistory : Existing entity.

    Business logic
        Create UserLoginPasswordHistory record when a new user is created (if configured).
        Expire and then Create UserLoginPasswordHistory record when user update existing password.
        Everytime, when user login check for password expiration. If password expired then display change password screen to user. And if password not yet expired but it is close to expire display alert message to user about its expiration.

jleroux: I just changed 
from 
if (reqToChangePwdInDays != 0) {
tp
if (reqToChangePwdInDays > 0) {

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1465185 13f79535-47bb-0310-9956-ffa450edef68
2013-04-06 04:54:14 +00:00
Paul Foxworthy efd5104e1d Fix spelling of successful and some other words
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1460654 13f79535-47bb-0310-9956-ffa450edef68
2013-03-25 13:33:09 +00:00
Paul Foxworthy 0079816733 Undid r1460637, should be two separate commits
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1460647 13f79535-47bb-0310-9956-ffa450edef68
2013-03-25 13:14:10 +00:00
Paul Foxworthy 4882b2b62d Add grams to Product Shipment Uom labels (Jira OFBIZ-5154)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1460637 13f79535-47bb-0310-9956-ffa450edef68
2013-03-25 12:46:16 +00:00
Adrian Crum 008501055f Bug fix in FtpServices.java - close resources in finally block. Also made logging more consistent.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1453793 13f79535-47bb-0310-9956-ffa450edef68
2013-03-07 12:02:39 +00:00
Adrian Crum cc8d5e42fd Code formatting in FtpServices.java - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1453770 13f79535-47bb-0310-9956-ffa450edef68
2013-03-07 10:57:39 +00:00
Jacques Le Roux d4b121aece Removes the instance of the static utility class
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1422099 13f79535-47bb-0310-9956-ffa450edef68
2012-12-14 21:26:46 +00:00
Jacques Le Roux fbfd7246de Adrian remarked there was no need to use class fields
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1421738 13f79535-47bb-0310-9956-ffa450edef68
2012-12-14 08:53:09 +00:00
Jacques Le Roux b7192d8409 At Adrian and Adam's request, allow to use cache here, use default constructor
Also refactored things a bit: 
* uses getPropertyAsBoolean
* set default property values

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1421651 13f79535-47bb-0310-9956-ffa450edef68
2012-12-14 03:27:40 +00:00
Jacques Le Roux 03a62ac947 A slightly modified patch from Sumit Pandit for "Additional Validation for Password : Make password pattern driven" https://issues.apache.org/jira/browse/OFBIZ-4958
Provides an additional validation for password  with following capability to the system:

Admin can enable/disable pattern based password capability of system. Configuration will reside in security.property file.
 To enable : security.login.password.pattern.enable=true
 To disable: security.login.password.pattern.enable=false

Admin is flexible to provide his pattern string by making pattern more/less restrictive as per system requirement. Configuration will reside in security.property file.
 Example: security.login.password.pattern=^.*(?=. {5,})(?=.[a-zA-Z])(?=.[!@#$%^&*]).*$

Admin can provide custom error message string which will display to end user if wrong password is entered. Configuration will reside in security.properity file.

jleroux: I quickly handled the error message localisation for the OOTB case. It's more complicated when the pattern gets complex...


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1418996 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 14:59:52 +00:00
Scott Gray 0af4184d61 Remove a bunch of unnecessary casts
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1418650 13f79535-47bb-0310-9956-ffa450edef68
2012-12-08 12:06:01 +00:00
Scott Gray f180a447c7 Remove redundant implements declarations where the interface is already implemented by the base class
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1418649 13f79535-47bb-0310-9956-ffa450edef68
2012-12-08 12:04:37 +00:00
Jacopo Cappellato f6244c689f Trivial fixes for some typos in Java comments.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1416451 13f79535-47bb-0310-9956-ffa450edef68
2012-12-03 11:15:44 +00:00
Sascha Rodekamp a567174540 - Upgrade Timepicker to version 1.0.5
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1399128 13f79535-47bb-0310-9956-ffa450edef68
2012-10-17 07:01:03 +00:00
Jacques Le Roux 8e6e049ad5 A patch from Varun Bhansaly "Email configuration - mail.smtp.starttls.enable ignored" https://issues.apache.org/jira/browse/OFBIZ-4943
The email configuration setting mail.smtp.starttls.enable is ignored by the system.
I encountered this while configuring OFBiz an email server which had TLS enabled.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1395104 13f79535-47bb-0310-9956-ffa450edef68
2012-10-06 16:18:09 +00:00
Erwan de Ferrieres d8a1e145ea A patch from Leon - OFBIZ-5025 - jquery validator localization looks for messages_cn.js for locale zh_CN and _tw for zh_TW
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1381146 13f79535-47bb-0310-9956-ffa450edef68
2012-09-05 11:17:02 +00:00
Jacopo Cappellato 2bff493b7a Removed a few useless/incorrect references to the ServiceDispatcher class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364615 13f79535-47bb-0310-9956-ffa450edef68
2012-07-23 12:51:12 +00:00
Adrian Crum 2a0058a04b New feature - performance metrics. Basic code and services.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1361722 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 16:07:59 +00:00
Adrian Crum a17298a06e Removed unused "authz" security code - https://issues.apache.org/jira/browse/OFBIZ-4839.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1360283 13f79535-47bb-0310-9956-ffa450edef68
2012-07-11 16:34:26 +00:00
Jacopo Cappellato 1555db10e1 Set cache flag for findByAnd method calls in PreferenceServices; improved logic to avoid to run the same query twice when user is not passed.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1347442 13f79535-47bb-0310-9956-ffa450edef68
2012-06-07 07:36:47 +00:00
Jacopo Cappellato 9fe920a3f7 Improved code that manages the cache:
* removed unnecessary synchronization
* protected the UtilCache object (static field) by making it private and final
* replaced non atomic containsKey+put+get with get + putIfAbsentAndGet
* replaced containsKey + null check + get with get + null check



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343692 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 12:10:54 +00:00
Adam Heath 83d37a796b DEPRECATION: framework: GenericValue.getRelated/getRelatedCache variants replaced with a single getRelated variant that takes a boolean useCache parameter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343509 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:17:17 +00:00
Adam Heath 1aa422773b DEPRECATION: framework: getRelatedOne variants replaced with a getRelatedOne variant that takes a boolean useCache parameter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343478 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:11:19 +00:00
Jacques Le Roux 0157ddcbda 2 missing ASL2 headers, while at it...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1341399 13f79535-47bb-0310-9956-ffa450edef68
2012-05-22 10:57:13 +00:00
Jacopo Cappellato 4b1ed290e1 Completed refactoring/cleanup of captcha implementation that now supports screens with more than one captcha in them.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338700 13f79535-47bb-0310-9956-ffa450edef68
2012-05-15 13:31:15 +00:00
Adam Heath 9e5f405a4d DEPRECATION: framework: findByAnd variants replaced with findByAnd that takes a boolean useCache parameter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338403 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 20:59:54 +00:00
Adam Heath 64a9662c25 DEPRECATION: framework: findByPrimaryKey variants replaced with findOne
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1337662 13f79535-47bb-0310-9956-ffa450edef68
2012-05-12 21:17:55 +00:00
Scott Gray 7f0893f8cd Deprecated org.ofbiz.common.Captcha
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1337058 13f79535-47bb-0310-9956-ffa450edef68
2012-05-11 08:23:10 +00:00
Scott Gray 20047d5fe3 Copied the captcha image generator into a single event that streams the image to the response for a direct request rather than trying to store it during screen rendering to be served up later.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1337057 13f79535-47bb-0310-9956-ffa450edef68
2012-05-11 08:23:02 +00:00
Ashish Vijaywargiya e0971b304c Applied similar fix as we did on trunk r1300463.
On production systems you can't suppress Debug.log( message by the use of debug.properties file. It is always good to use Debug.* statements that are having log level setup in debug.properties file. The real problem comes with Debug.log( statement when you are printing any list or map object that contains so many records(or data) in it. Here I am changing all the occurrence of Debug.log( with Debug.logInfo(, Debug.logError( or Debug.logWarning( so that we can have better control of Debug.* statements on production system. :-)

Bad use of Debug statement. On production system you will get false alarm that you are having error in code base although the resultant statement is only giving additional information instead of error message.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335927 13f79535-47bb-0310-9956-ffa450edef68
2012-05-09 05:28:17 +00:00
Jacopo Cappellato 5b528efa2d First pass in fixing the buggy code for captcha support; this is a first pass (the next one will probably be to save the image in the session rather than in the file system); the main problems fixed are related to concurrent access: the class was not thread safe and this, especially in servers with high traffic, could cause a series of issues like:
* captcha images created and then lost
* captcha images created in the wrong location (for example out of the OFBiz folder)
* the folder runtime/tempfiles/captcha could be locked



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335047 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 14:46:07 +00:00
Jacques Le Roux 80af13f2c1 Non functional changes. Removes useless exceptions catches.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334576 13f79535-47bb-0310-9956-ffa450edef68
2012-05-06 09:06:39 +00:00
Adam Heath 33101dbaa2 FEATURE/DEPRECATION: Deprecate HashCrypt.cryptPassword; previously,
it would call String.getBytes(), without specifying an encoding.  That
meant that the platform default encoding would be used, which might
change between different installs(if someone changed an environment
variable, for instance).  Now, there are explicit variants to be called.

When creating a new value, use cryptValueUTF8.  If, for some reason,
calling code is doing it's own comparison, it must continue to use
cryptValueBytes(password.getBytes()).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334170 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 20:42:26 +00:00
Adam Heath b767ef1868 OPTIMIZE: Remove cryptPassword(String, String); it is not nescessary to
go thru a deprecation cycle for this, as this method was only recently
added, and has never been officially released.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333664 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:20:24 +00:00
Jacques Le Roux 986c1ae6ac A patch from Daniel Riquelme "Enable NOT-IN operator to performFind" https://issues.apache.org/jira/browse/OFBIZ-4815
This patch will enable NOT-IN operator to the performFind service.
Only two lines of the file framework/common/src/org/ofbiz/common/FindServices.java were modified to enable de NOT-IN operator.
An use case is provided to test

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328637 13f79535-47bb-0310-9956-ffa450edef68
2012-04-21 11:38:14 +00:00
Jacques Le Roux 567080a8e3 Fixes a NPE introduced at r1328122
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328226 13f79535-47bb-0310-9956-ffa450edef68
2012-04-20 06:59:06 +00:00
Jacques Le Roux 5e5f0e27a5 This introduces a mean to hide a service result in log (when the service is longer than 50 ms and Debug.timingOn() or > 200 ms and Debug.infoOn(), see ServiceDispatcher.java, just above line 600)
A hideResultInLog service attribute is added. If set to true the service result will be hidden from possible exposition in ServiceDispatcher.runSync() 
This is convenient when used for sending a password to an user (the password must be legible in the sent mail). 
I'm sure a lot of you would want to have no logs at all in production. But by experience I know that we need to log info in logs even in production. Especially when the system is quickly moving ahead...
So this is a sure mean to hide any password in logs, being current or backuped somewhere on the servers disks...


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328122 13f79535-47bb-0310-9956-ffa450edef68
2012-04-19 21:41:39 +00:00
Adam Heath f092508550 FEATURE: Make use of new HashCrypt cryptPassword functionality.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327741 13f79535-47bb-0310-9956-ffa450edef68
2012-04-18 23:49:22 +00:00
Adam Heath 3cea0258d0 OPTIMIZE: Refactored LoginServices.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327737 13f79535-47bb-0310-9956-ffa450edef68
2012-04-18 23:48:58 +00:00
Adrian Crum 48ac918030 Made the ScriptHelperImpl createServiceMap method behave more like mini-language. Error messages are saved in the result Map.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300965 13f79535-47bb-0310-9956-ffa450edef68
2012-03-15 12:58:46 +00:00
Adrian Crum ded0847a65 Simplified ContextHelper.java code by adding auto-creation of some commonly-used bindings.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300954 13f79535-47bb-0310-9956-ffa450edef68
2012-03-15 12:26:50 +00:00
Adrian Crum 762466f309 Fix type-unsafe casts in ContextHelper.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300889 13f79535-47bb-0310-9956-ffa450edef68
2012-03-15 10:37:38 +00:00
Hans Bakker 0372daa663 OFBIZ-4638: make ofbiz run with openjdk7,6. Contribution of Chattree
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1299985 13f79535-47bb-0310-9956-ffa450edef68
2012-03-13 06:50:41 +00:00