Commit Graph
145 Commits
Author SHA1 Message Date
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 SpeicherandDmitriy Zaporozhets 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
Robert Speicher 2bc4fd2d04 Add dashboard attribute to User model 2015-06-13 17:59:11 -04:00
Robert Speicher 844d72716e Add Gitlab::Themes module; remove Gitlab::Theme
Now we can simply loop through all themes, among other things.

This also removes the `dark_theme` / `light_theme` classes and the
`theme_type` helper, since they weren't used anywhere.
2015-06-13 17:58:16 -04:00
Robert Speicher 47251b85e0 ensure_length_of -> validate_length_of 2015-06-10 01:31:26 -04:00
Dmitriy Zaporozhets b9219469f7 Merge branch 'make-namespaces-api-available-to-all-users' into 'master'
Make namespace API available to all users

### What does this MR do?

This MR makes it possible for a user to query namespaces to which he/she has access. Also, it adds documentation for the existing API.

### Why was this MR needed?

Even though the `groups` API exists, it might still be useful to have an endpoint that tells the namespace type (e.g. `user` vs. `group`), especially if a user has access to a number of different projects.

### What are the relevant issue numbers?

Closes https://github.com/gitlabhq/gitlabhq/issues/9328

See merge request !708
2015-06-04 15:59:17 +00:00
Stan Hu 67992b9be6 Make namespace API available to all users
Closes https://github.com/gitlabhq/gitlabhq/issues/9328
2015-05-28 11:39:12 -07:00
Dmitriy Zaporozhets 499154518a You can not remove user if he/she is an only owner of group
To prevent loose of group data you need to transfer or remove group
first before you can remove user

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-05-28 12:00:02 +02:00
Robert Speicher 8773f339a3 Minor model spec cleanups
Snippet model was missing project association
2015-05-26 15:48:30 -04:00
Robert Speicher c0faf91ff2 Add to_reference for models that support references
Now there is a single source of information for which attribute a model
uses to be referenced, and its special character.
2015-05-26 15:48:30 -04:00
Robert Speicher 661d09a22b Re-annotate User model 2015-05-09 17:32:24 -04:00
Stan Hu a3157626f1 Re-annotate models 2015-05-03 13:38:27 -07:00
Stan Hu eb4f1eb5f5 Add application setting to restrict user signups to e-mail domains
This feature was requested long ago:

http://feedback.gitlab.com/forums/176466-general/suggestions/4118466-ability-to-register-only-from-ceratain-domains

This MR is based off !253 but changed to use application settings and use wildcard strings
to give more flexibility in pattern matching. Regexps seemed overkill and easy to get wrong.

Only restrict e-mail addresses upon creation
2015-05-02 09:36:52 -07:00
Douwe Maan 3f7531d6f2 Move User.cleanup_username to Namespace.cleanup_path. 2015-03-27 11:09:29 +01:00
Dmitriy Zaporozhets 66c61f023b Re-annotate models 2015-03-04 14:14:00 -08:00
Douwe Maan 804a2488cf Fix and test User#contributed_projects_ids. 2015-02-27 10:49:47 +01:00
Douwe Maan 161d15541a Prevent autogenerated OAuth username to clash with existing namespace. 2015-02-13 12:39:11 +01:00
Dmitriy Zaporozhets 529188e478 Merge branch 'master' of github.com:gitlabhq/gitlabhq 2015-02-12 16:47:52 -08:00
Douwe Maan 6685661b54 Clean username acquired from OAuth/LDAP.
Fixes #1967.
2015-02-12 21:05:27 +01:00
Jeroen van Baarsen 0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00