Commit Graph
180 Commits
Author SHA1 Message Date
Cédric Krier 3d8abb5059 Use SQL query to remove old login attempt
This is more efficient if there are a huge number of old login attempt because
it avoid to fetch the ids and to have loop over them to delete.

issue5377
review24901002
2016-03-16 22:10:37 +01:00
Cédric Krier 687a51a30c Limit the login size in LoginAttempt
The login data comes from an unauthenticated user so it could be very large and
thus fill the database. But indeed we don't need to have the full login to get
the LoginAttempt benefit, just the 1024 starting char is enough.

issue5381
review17901002
2016-03-14 19:33:40 +01:00
Nicolas Évrard 2fef479575 Follow PEP-0249 for Transaction and backends
issue4949
review19781002
2016-03-03 21:51:57 +01:00
Cédric Krier 29129855ec Add support for Python 3
issue3211
review7311002
2016-02-07 16:46:16 +01:00
Cédric Krier 0574e90f5b Remove foreign-key on create_uid and write_uid
Instead prevent delete of any user to keep logging information.

issue4925
review24301002
2015-09-04 11:52:53 +02:00
Cédric Krier 44dc331ced Use Constraint instance in ModelSQL._sql_constraints
issue4814
review15491002
2015-06-22 16:57:06 +02:00
Cédric Krier dc42797cb8 Use explicit comparison to Boolean in SQL queries
issue4810
review13251002
2015-06-22 16:22:44 +02:00
Cédric Krier 52ff97b165 Rename ir.module.module* into ir.module*
issue4764
review7171002
2015-05-28 21:02:01 +02:00
Cédric Krier 10d896fa77 Fix search_rec_name for negative operator
In case of negative operator, each subclause must be composed with 'AND'.

issue4559
review7071002
2015-04-05 23:34:38 +02:00
David Harper 0c9012f3b7 change Ok to OK
issue4290
review7011002
2015-03-10 18:17:32 +01:00
Cédric Krier 36555242de Use root user to compute user's sessions
There is an access rule on ir.session so user can only see his own session.
So it needs to use the root user to compute for others.

issue4558
review10201002
2015-02-14 18:32:56 +01:00
Cédric Krier b1fe2ea538 Don't set default value for user language
issue4400
review12791002
2014-12-11 22:21:38 +01:00
Cédric Krier c144f8c349 Fix most flake8 errors
review8771002
2014-12-02 12:54:01 +01:00
Cédric Krier 5ce5fb79d3 Use literal_eval instead of safe_eval whenever possible
CVE-2014-6633
issue4155
review10521002
2014-09-29 17:29:25 +02:00
Cédric Krier a2c8111f26 Use context to check model and field access
* Model and Field access checked only if _check_access is set
* Add check_access to RPC
* Add check_access to Wizard and Report

issue4081
review8481002
2014-09-17 21:43:53 +02:00
Cédric Krier e0b995abbe Refactore configuration to allow easy extention
issue3627
review7401002
2014-09-03 23:32:01 +02:00
Sergi Almacellas Abellana fd7c510ce4 Add grouped_slice helper and use it.
issue3516
review10301002
2014-07-17 18:53:05 +02:00
Cédric Krier 84cc132dcc Remove domain for user field converted to selection
review4891003
2014-04-07 18:14:37 +02:00
Cédric Krier c6c0ca4da7 Use bcrypt to hash password if possible
If bcrypt is not available, it fallbacks to sha1 but it will use bcrypt to hash
new password if available.
The storage uses a simple hashing scheme which eases to add new hashing method
and doesn't rely anymore on the specific Sha field but on Function field.

Thanks to Vishesh Yadav

review1039002
2014-02-24 19:48:03 +01:00
Cédric Krier f52fe8e45f Use a sequence of records, values in write
issue3499
review1641003
2013-12-19 14:44:01 +01:00
Nicolas Évrard e8bdcd5550 Set the context's user when fetching user preferences
The call to _get_preferences makes some processing based on the user of the
context.

In order for those computations to return the right value the context must be
set when instanciating the user.

issue3068
review1711002
2013-12-10 12:01:30 +01:00
Nicolas Évrard 90324479f2 Backed out changeset a0dfdb90681e 2013-12-10 11:52:37 +01:00
Nicolas Évrard 55c58abdf5 Set the context's user when fetching user preferences
review1711002
2013-12-10 11:34:04 +01:00
Cédric Krier 2b2001f1ca Force UTC as timezone
issue3444
review1411002
2013-11-15 02:26:58 +01:00
Albert Cervera i Areny 34b420304e Add missing cache invalidations in res.group and res.user.
issue3447
review1381002
2013-10-28 21:38:14 +01:00
Cédric Krier 75e02ba2de User.get_preferences must return a copy
preferences is stored in the cache but as it is a mutable object, we must
return a copy to prevent cache corruption.

issue3442
review1351002
2013-10-27 19:27:19 +01:00
Cédric Krier fc6c6cfdda Migration to python-sql
* Use python-sql
* Add convert_domain method on Fields
* Add sql_format and sql_type methods on Fields
* Allow to return a full domain for Function.searcher
* Replace static backend by dynamic get method
* Replace order_field by order_<field name> method

review1001002
2013-09-06 22:32:37 +02:00
Albert Cervera i Areny ff16377e0a Fix crash in login with incorrect password by renaming delete to remove
issue3346
review1044002
2013-08-30 07:46:45 +02:00
Cédric Krier c084d90205 Improve brute force attack protection
- Always sleep on login
- Use session timeout as limit to count fail attempt
- Sleep also for unknown login

review852002
2013-05-11 18:13:36 +02:00
Cédric Krier d9dd0cf368 LoginAttempt.count must return an integer not a tuple
issue3096
2013-03-26 14:18:12 +01:00
Nicolas Évrard 549fb4fa88 Split the User class in order to prevent locking the table
issue2906
review625002
2013-03-23 19:18:03 +01:00
Cédric Krier f74b525a4d Fix Warning.check to use instance for delete
issue3065
review715002
2013-03-15 00:52:16 +01:00
Cédric Krier 5e01f5c068 Fix flake8 2013-02-27 22:50:31 +01:00
Pierre-Louis Bonicoli e7ee28a15b 'Configure users' wizard: clean state after saving
issue2973
review657003
2013-02-18 00:40:02 +01:00
Albert Cervera i Areny 30b1403cdc Use a list of dictionaries in create().
issue2358
review266002
2013-01-06 22:18:13 +01:00
Cédric Krier 8548615b32 Fix wrong cache name for User._get_login 2012-12-27 22:27:57 +01:00
Cédric Krier 5fc611575c Factorize selection validation
review603002
2012-12-13 19:18:37 +01:00
Cédric Krier eb820df535 Use globale cache also for Many2One and Reference fields
review590007
2012-12-10 16:15:24 +01:00
Cédric Krier 936dcca53a Store default language in database
review592004
2012-11-23 17:59:04 +01:00
Nicolas Évrard 85ef891ffd remove use of sha module 2012-11-08 16:57:58 +01:00
Cédric Krier 0fe1b93864 Active Record 2012-09-24 22:16:53 +02:00
Cédric Krier 62c8de1c6c Add missing ids in super call of UserAction.write 2012-09-20 23:31:29 +02:00
Cédric Krier 7bdb8a319b Fix domain concatenation between list and tuple 2012-09-20 23:31:04 +02:00
Cédric Krier 02176f79cc Rename User.connections into User.sessions and manage timeout
review469004
2012-08-23 23:24:19 +02:00
Cédric Krier ee3be37a36 Fix pep8 and pyflakes 2012-04-01 23:08:15 +02:00
Cédric Krier e7b1f97390 Replace wrong usage of False by None
issue2512
2012-03-27 10:41:40 +02:00
Cédric Krier dc7fe589b8 default_active must return a boolean 2012-03-24 09:19:05 +01:00
Nicolas Évrard 584d516067 Integer, Numeric and Float allow None as value
NULL value is None and not False

issue2022
review237004
2012-03-23 17:52:36 +01:00
Cédric Krier b85b94e2e7 Improve login time
- Replace action by a list of actions
- Add pyson_menu to prevent client to read it
- Prevent admin user to run configuration wizard if nothing to do

review277001
2012-03-16 11:28:10 +01:00
Cédric Krier 5379734306 Improve performance of preference view
review276001
2012-03-16 10:32:57 +01:00