Commit Graph

289 Commits

Author SHA1 Message Date
Toshi MARUYAMA
5f2b2c9436 code layout clean up app/models/user.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@19297 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-11-25 16:47:31 +00:00
Toshi MARUYAMA
d9435cf2f6 cleanup: rubocop: fix Layout/AlignArguments in app/models/user.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18939 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-11-08 01:37:04 +00:00
Go MAEDA
b1f1108606 Option to filter after my bookmarked projects (#32302, #29482, #31355).
Patch by Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@18842 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-10-23 01:20:07 +00:00
Toshi MARUYAMA
fd7675adf2 code cleanup: rubocop: fix Lint/IneffectiveAccessModifier in app/models/user.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18779 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-10-19 13:33:32 +00:00
Go MAEDA
35e6a532f5 Force passwords to contain specified character classes (#4221).
Patch by Takenori TAKAKI.


git-svn-id: http://svn.redmine.org/redmine/trunk@18411 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-08-29 01:35:09 +00:00
Go MAEDA
331dcfbadc Code cleanup: RuboCop: Fix Style/RedundantReturn in app/models/user.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18394 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-08-25 16:15:36 +00:00
Jean-Philippe Lang
001853ef79 Groups are incorrect when grouping by date without user timezone set.
git-svn-id: http://svn.redmine.org/redmine/trunk@18264 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-06-20 06:23:48 +00:00
Go MAEDA
4082069c75 Update copyright year.
git-svn-id: http://svn.redmine.org/redmine/trunk@18198 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-05-25 07:36:06 +00:00
Go MAEDA
bd5977d97e Support frozen_string_literal in app/**/*.rb (#26561).
Contributed by Pavel Rosický.


git-svn-id: http://svn.redmine.org/redmine/trunk@17987 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-03-17 13:36:03 +00:00
Go MAEDA
5861160ffc Add "frozen_string_literal: false" for all files (#26561).
This will be changed to true in the future.


git-svn-id: http://svn.redmine.org/redmine/trunk@17947 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-03-15 01:32:57 +00:00
Jean-Philippe Lang
0c78056a69 Send emails asynchronously (#26791).
Custom async_* delivery methods are removed in favor of ActiveJob (Async by default).

git-svn-id: http://svn.redmine.org/redmine/trunk@17588 e93f8b46-1217-0410-a6f0-8f06a7374b81
2018-10-10 17:13:09 +00:00
Go MAEDA
e159928e6b Use find_by instead of where.first to remove unnecessary sorting (#26747).
Patch by  Yuichi HARADA.


git-svn-id: http://svn.redmine.org/redmine/trunk@17586 e93f8b46-1217-0410-a6f0-8f06a7374b81
2018-10-06 16:03:26 +00:00
Jean-Philippe Lang
438d2f65fd Update User#last_login_on only once per minute and user to reduce DB lock contention on users table (#28952).
Patch by Holger Just.

git-svn-id: http://svn.redmine.org/redmine/trunk@17403 e93f8b46-1217-0410-a6f0-8f06a7374b81
2018-06-17 14:51:24 +00:00
Go MAEDA
b4d3715dc0 Include locked members in filters (#15201).
Patch by Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@17371 e93f8b46-1217-0410-a6f0-8f06a7374b81
2018-06-09 08:07:08 +00:00
Go MAEDA
43d9bea7c5 /users API accepts boolean strings for generate_password field (#28686).
Patch by Gregor Schmidt.


git-svn-id: http://svn.redmine.org/redmine/trunk@17327 e93f8b46-1217-0410-a6f0-8f06a7374b81
2018-05-06 08:31:23 +00:00
Go MAEDA
a4931262d0 Strip whitespace from login on login page (#22532).
Patch by Artur Borisovich and Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@17113 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-12-13 13:58:32 +00:00
Jean-Philippe Lang
d74f0bfd5c Merged rails-5.1 branch (#23630).
git-svn-id: http://svn.redmine.org/redmine/trunk@16859 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-07-23 11:26:04 +00:00
Jean-Philippe Lang
92ca57e938 Fixed User#project_ids_by_role when first called within chained scopes (#26376).
git-svn-id: http://svn.redmine.org/redmine/trunk@16767 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-07-08 12:15:10 +00:00
Jean-Philippe Lang
7fd04e1f8d Update copyright.
git-svn-id: http://svn.redmine.org/redmine/trunk@16685 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-06-25 08:40:31 +00:00
Jean-Philippe Lang
58dc4455cb AR uniq deprecated in Rails 5.
git-svn-id: http://svn.redmine.org/redmine/trunk@16598 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-06-03 08:07:47 +00:00
Toshi MARUYAMA
e45e29eb96 remove trailing white-space from app/models/user.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@16544 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-04-25 17:04:41 +00:00
Jean-Philippe Lang
b9ee00a8c8 Adds methods to User model to handle tokens.
git-svn-id: http://svn.redmine.org/redmine/trunk@16474 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-04-04 17:15:07 +00:00
Jean-Philippe Lang
1ab58b6aa5 Adds a User.admin scope (#25416).
git-svn-id: http://svn.redmine.org/redmine/trunk@16449 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-04-03 06:49:06 +00:00
Jean-Philippe Lang
eef5023886 Don't destructively insert builtin_role into roles (#23519).
git-svn-id: http://svn.redmine.org/redmine/trunk@16155 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-01-07 11:41:59 +00:00
Jean-Philippe Lang
34a933a580 Reset #roles on reload (#23519).
git-svn-id: http://svn.redmine.org/redmine/trunk@16154 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-01-07 11:40:48 +00:00
Jean-Philippe Lang
3deb70d4aa Don't preload projects and roles on Principal#memberships association (#23519).
Patch by Ondřej Ezr.

git-svn-id: http://svn.redmine.org/redmine/trunk@16153 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-01-07 11:40:09 +00:00
Jean-Philippe Lang
98f8a17851 Speeds up Project.allowed_to_condition for users who belong to hundreds of projects.
git-svn-id: http://svn.redmine.org/redmine/trunk@16124 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-01-03 20:53:57 +00:00
Toshi MARUYAMA
7fb2beebc1 remove training white space from app/models/user.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@16075 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-12-14 12:06:30 +00:00
Jean-Philippe Lang
3e86a2ab52 Use .unscoped when querying and creating builtin objects (#24156).
Patch by Holger Just.

git-svn-id: http://svn.redmine.org/redmine/trunk@16049 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-12-03 08:57:01 +00:00
Jean-Philippe Lang
7b3f2b51c0 Add length validations for string fields (#24283).
Patch by Felix Schäfer.

git-svn-id: http://svn.redmine.org/redmine/trunk@15989 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-11-19 11:13:41 +00:00
Jean-Philippe Lang
c55dd52b07 Handle admin and login with safe_attributes.
git-svn-id: http://svn.redmine.org/redmine/trunk@15663 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-07-14 11:56:39 +00:00
Jean-Philippe Lang
26c5459de7 Don't pass conditions to #delete_all.
git-svn-id: http://svn.redmine.org/redmine/trunk@15662 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-07-14 11:21:16 +00:00
Jean-Philippe Lang
d2f7e31951 Use .distinct instead of .uniq.
git-svn-id: http://svn.redmine.org/redmine/trunk@15654 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-07-14 07:15:13 +00:00
Jean-Philippe Lang
f2a5804f4e Simplify User#today (#22320).
Patch by Jens Kraemer.

git-svn-id: http://svn.redmine.org/redmine/trunk@15383 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-05-07 11:06:22 +00:00
Jean-Philippe Lang
ed50d42210 Replace Date.today with User.current.today (#22320).
Depending on the offset between a user's configured timezone and the server
timezone, Date.today may be more or less often wrong from the user's
perspective, leading to things like issues marked as overdue too early or too
late, or yesterday / tomorrow being displayed / selected where 'today' is
intended.

A test case illustrating the problem with Issue#overdue? is included

Patch by Jens Kraemer.

git-svn-id: http://svn.redmine.org/redmine/trunk@15379 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-05-07 10:42:22 +00:00
Jean-Philippe Lang
97a647c1e5 Validate status of users and groups.
git-svn-id: http://svn.redmine.org/redmine/trunk@15320 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-04-11 17:51:16 +00:00
Jean-Philippe Lang
46a4151f09 Send a single email to admins like other notifications (#21421).
git-svn-id: http://svn.redmine.org/redmine/trunk@15266 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-03-20 07:23:33 +00:00
Jean-Philippe Lang
4aef2735c8 Send a security notification when users gain or loose admin (#21421).
Patch by Jan Schulz-Hofen.

git-svn-id: http://svn.redmine.org/redmine/trunk@15265 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-03-20 07:09:20 +00:00
Jean-Philippe Lang
cda9c63d9c Updates copyright for 2016.
git-svn-id: http://svn.redmine.org/redmine/trunk@15238 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-03-13 10:30:10 +00:00
Jean-Philippe Lang
5d70fce6ce Security notifications when password or email adress is changed (#21421).
Patch by Jan Schulz-Hofen.

git-svn-id: http://svn.redmine.org/redmine/trunk@15145 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-02-05 07:33:24 +00:00
Jean-Philippe Lang
7005de51c5 Additional option for USER_FORMAT, #{lastname}#{firstname} without any sperator (#3551).
Patch by Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@15133 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-01-30 15:25:11 +00:00
Jean-Philippe Lang
97751b3d84 Performance in User#roles_for_project (#21582).
Patch by by Ondřej Ezr.

git-svn-id: http://svn.redmine.org/redmine/trunk@15060 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-01-16 07:50:20 +00:00
Jean-Philippe Lang
4cd22dcc55 Keep track of valid user sessions (#21058).
git-svn-id: http://svn.redmine.org/redmine/trunk@14735 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-10-24 10:15:22 +00:00
Jean-Philippe Lang
11bce09825 Typo "coma" (#20551).
Patch by budo kaiman.

git-svn-id: http://svn.redmine.org/redmine/trunk@14712 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-10-20 18:26:28 +00:00
Jean-Philippe Lang
141c83bdc7 WARNING: Can't mass-assign protected attributes for User (#20490).
git-svn-id: http://svn.redmine.org/redmine/trunk@14550 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-09-12 11:11:40 +00:00
Jean-Philippe Lang
ba61b13008 Prevent roles loading on each call to User#managed_roles for admins.
git-svn-id: http://svn.redmine.org/redmine/trunk@14328 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-06-17 18:36:38 +00:00
Jean-Philippe Lang
ed9f00178c Ability to limit member management to certain roles (#19707).
git-svn-id: http://svn.redmine.org/redmine/trunk@14293 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-05-31 07:16:23 +00:00
Jean-Philippe Lang
b688214ce0 Column 'address' in where clause may be ambiguous (#19485).
git-svn-id: http://svn.redmine.org/redmine/trunk@14284 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-05-30 08:23:03 +00:00
Jean-Philippe Lang
6659aad3ef Adds a role setting that viewing all or own time entries (#8929).
git-svn-id: http://svn.redmine.org/redmine/trunk@14275 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-05-30 07:40:57 +00:00
Jean-Philippe Lang
738ecf1365 Test broken by r14265 (#19458).
git-svn-id: http://svn.redmine.org/redmine/trunk@14266 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-05-10 12:57:16 +00:00