Commit Graph

163 Commits

Author SHA1 Message Date
Zeger-Jan van de Weg dccf8a9fc8 Add tests on Awardables and Award Emoji 2016-05-10 12:03:13 +02:00
Zeger-Jan van de Weg 2c6207135e Allow temp-oauth-email as notification email 2016-03-31 19:59:19 +02:00
Zeger-Jan van de Weg 59064aeeef Merge branch 'master' into 4009-external-users 2016-03-15 19:16:16 +01:00
Rémy Coutable 1714883107 Revert "Merge branch 'avatar-cropping' into 'master' "
This reverts commit 01160fc061, reversing
changes made to 4bff9daf8b.
2016-03-15 14:55:40 +01:00
Zeger-Jan van de Weg 76eeb316df Create an external users tab on Admin user list
Also incorporates the review into this, mainly spec changes.
2016-03-13 19:10:33 +01:00
Zeger-Jan van de Weg 42fcd3881f External Users
The user has the rights of a public user execpt it can never create a project,
 group, or team. Also it cant view internal projects.
2016-03-13 19:08:04 +01:00
Yorick Peterse 0ab9571ad7 Fixed a few spec typos 2016-03-11 15:25:23 -05:00
Yorick Peterse 800aa29695 Use ILIKE/LIKE for searching users 2016-03-11 15:25:21 -05:00
Douwe Maan ad9137a785 Merge branch 'rs-avatar-validation' into 'master'
Only validate avatar cropping values when avatar is present AND changed

Closes #13905

See merge request !3018
2016-03-01 16:03:38 +00:00
Robert Speicher 58a8d6e9ba Only validate avatar cropping values when avatar is present AND changed
Closes #13905
2016-02-29 17:19:53 -05:00
Robert Speicher 3334c3fc70 Reset `otp_grace_period_started_at` after disabling 2FA
Prior, if the user enabled 2FA, then disabled it and came back some time
after the grace period expired, they would be forced to enable 2FA
immediately.
2016-02-29 13:56:40 -05:00
Robert Speicher 93e6282657 Add `:with_avatar` trait to User factory 2016-02-24 13:50:03 -05:00
Douglas Barbosa Alexandre 3d52e139b1 Rename Tasks to Todos 2016-02-20 12:39:27 -02:00
Douglas Barbosa Alexandre 41d8f5649e Add task model 2016-02-20 12:10:26 -02:00
Rémy Coutable b34963bc12 Validate email addresses using Devise.email_regexp
Also:
- Get rid of legacy :strict_mode
- Get rid of custom :email validator
- Add some shared examples to spec emails validation
2016-02-09 18:15:35 +01:00
Douglas Barbosa Alexandre e38a1fc83e Fix typo on User model 2016-02-02 11:25:44 -02:00
Gabriel Mazetto bc7ef8e5b7 Add ldap_blocked as new state to users state machine 2016-01-08 16:26:04 -02:00
Stan Hu 79c0e7212a Annotate models 2016-01-06 13:09:55 +00:00
Robert Speicher fd178c1e7d Prevent duplicate "username has already been taken" validation message
Closes #201 - two-year-old bug, woo! 💥 🎉
2016-01-02 20:03:28 -05:00
Robert Speicher 9570495e75 Merge branch 'add_email_unlock' into 'master'
Allow account unlock via email

We see a lot of users get confused about what it means when your account gets
locked. Many try to reset their password and are still faced with a lockout.
With this change, users receive an email that allows them to unlock their
account immediately. The previous behavior where the account is auto-unlocked
after a time also still works.

See merge request !2049
2015-12-21 17:53:20 +00:00
Gabriel Mazetto b5291f9599 Fixed Rubocop offenses 2015-12-15 00:53:52 -02:00
Drew Blessing be41d84fb0 Allow account unlock via email 2015-12-14 15:35:02 -06:00
Douwe Maan 1e8d703a85 Tag model specs 2015-12-09 10:50:51 +01:00
Stan Hu 9dbc768db8 Update annotations 2015-12-08 21:00:01 -08:00
Robert Speicher 9321d382bd Add custom NamespaceValidator 2015-12-07 16:57:26 -05:00
Yorick Peterse e116a356b8 Refactor User#authorized_groups/projects
These methods no longer include public groups/projects (that don't
belong to the actual user) as this is handled by the various finder
classes now. This also removes the need for passing extra arguments.

Note that memoizing was removed _explicitly_. For whatever reason doing
so messes up the users controller to a point where it claims a certain
user does _not_ have access to certain groups/projects when it does have
access. Existing code shouldn't be affected as these methods are only
called in ways that they'd run queries anyway (e.g. a combination of
"any?" and "each" which would run 2 queries regardless of memoizing).
2015-11-18 13:05:45 +01:00
Yorick Peterse 5fcd9986b8 Refactor getting user groups/projects/contributions
This new setup no longer loads any IDs into memory using "pluck",
instead using SQL UNIONs to merge the various datasets together. This
results in greatly improved query performance as well as a reduction of
memory usage.

The old setup was in particular problematic when requesting the
authorized projects _including_ public/internal projects as this would
result in roughly 65000 project IDs being loaded into memory. These IDs
would in turn be passed to other queries.
2015-11-18 13:05:45 +01:00
Dmitriy Zaporozhets a237999f00
Annotate models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-13 19:22:46 +01:00
Yorick Peterse a2f8f9ad3d Fixed User sorting specs
The descriptions were not accurate and one particular spec seemingly
expected the wrong User row to be returned.
2015-11-03 11:56:04 +01:00
Douwe Maan 93522e59ec Merge branch 'rs-throttle-reset' into 'master'
Throttle "Forgot your password?" emails

Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2611

See merge request !1476
2015-10-02 14:37:07 +00:00
Robert Speicher d40dd5cfe3 Conform to spec guidelines that only exist in my head
[ci skip]
2015-10-02 00:14:47 -04:00
Robert Speicher ad7ad8745a Add User#recently_sent_password_reset? 2015-10-01 21:41:56 -04:00
Rémy Coutable ea72d53ec0 Streamline the "Report button"
This simplifies the "Report button" to not use open a dropdown and
adds a tooltip on this button.
This also removes an extra spec and adds missing specs.
2015-09-29 21:47:01 +02:00
Rémy Coutable 5f95a5e070 Disable the "Report abuse" button if a user has already been reported 2015-09-29 21:11:51 +02:00
Robert Speicher 69723d2002 Devise 3.5.x deprecates `confirm!` in favor of `confirm` 2015-09-19 21:15:13 -04:00
Stan Hu d7812a95cf Re-annotate models 2015-09-06 07:48:48 -07:00
Stan Hu 98eb89be5d Only show recent push event if the branch still exists or a recent merge request has not been created
Closes #2277
2015-08-20 01:38:15 -07:00
Stan Hu 0c1ccda43f Add "Confirm user" button in user admin page
Closes #2116
Closes https://github.com/gitlabhq/gitlabhq/issues/9502
2015-08-05 00:35:53 -07:00
Atsushi Ishida f33898ecfb Re-annotate models 2015-08-03 01:52:54 +09:00
Robert Speicher 5ce6d18681 Add User.find_by_username! 2015-07-23 17:16:39 -04:00
Robert Speicher 22724418d3 Add User#disable_two_factor!
This method encapsulates all the logic for disabling 2FA on a specific
User model.
2015-07-10 16:18:30 -04:00
Robert Speicher e9b65a3e05 Only look up Commit authors/committers by email
- Removes looking up authors/committers by name
- Renames `User.find_for_commit` to `User.find_by_any_email`
2015-06-23 18:07:15 -04:00
Dmitriy Zaporozhets f189c36d8d Merge branch 'rs-dev-issue-2414' into 'master'
Allow Admin to filter users by 2FA status

> ![Screen_Shot_2015-06-19_at_4.38.12_PM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/deba7f2a6b8d1548c1d1ac401e0e35a1/Screen_Shot_2015-06-19_at_4.38.12_PM.png)

Closes internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2414

See merge request !852
2015-06-23 08:48:22 +00:00
Robert Speicher dcfce8b198 Use alias_attribute to define User#two_factor_enabled 2015-06-22 21:14:07 -04:00
Robert Speicher 5a9ede4721 Update mock and stub syntax for specs 2015-06-22 12:13:46 +02:00
Dmitriy Zaporozhets 29b6d465a7 Merge branch 'rs-dev-issue-2355' into 'master'
MergeRequest#show performance improvements

This is a first pass on improving the performance of the `MergeRequests#show` page. Notable changes:

- The "Commits" tab is loaded lazily, so the initial page load should be much faster for MRs with many commits.
- Relative timestamps via `timeago` are only initialized once per load instead of `O(n^2)`. This greatly improves frontend rendering times for a large number of commits.
- Refactored `User.find_for_commit` to use a single ARel-generated SQL query instead of the old method which resulted in one query, and could result in up to three.

See merge request !838
2015-06-22 09:48:49 +00:00
Robert Speicher d3ff8c1a95 Make default value for otp_required_for_login false instead of null 2015-06-20 19:40:48 -04:00
Robert Speicher 516b4c1248 Allow Admin to filter users by 2FA status 2015-06-19 16:35:53 -04:00
Robert Speicher 6c8f0fe906 Add convenience methods to User for getting and setting 2FA status 2015-06-19 14:59:42 -04:00
Robert Speicher 7e31a369f5 Spec and refactor User.find_for_commit
Now it executes a single query instead of a possible three at the cost
of some scary-looking ARel calls.
2015-06-17 16:37:11 -04:00