Commit Graph

386 Commits

Author SHA1 Message Date
Rémy Coutable 3f73b6bee0
Don't set the notification_email when only unconfirmed_email is changed
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-05-22 12:47:20 +02:00
🙈 jacopo beschi 🙉 01275667e3 Resolve "Opening Project with invite but without accepting leads to 404 error page" 2018-05-17 09:19:47 +00:00
Kamil Trzciński 60b14e5296 Merge branch 'jprovazn-remote-upload-destroy' into 'master'
Delete remote uploads

Closes #45425

See merge request gitlab-org/gitlab-ce!18698
2018-05-16 20:29:21 +00:00
Dylan Griffith c3f9d80a6e Rename User#ci_authorized_runners -> ci_owned_runners 2018-05-16 10:52:28 +02:00
Dylan Griffith 846f73b53b Allow group runners to be viewed/edited in API 2018-05-16 10:52:28 +02:00
Jan Provaznik 7da3b2cdd0 Delete remote uploads
ObjectStore uploader requires presence of associated `uploads` record
when deleting the upload file (through the carrierwave's after_commit
hook) because we keep info whether file is LOCAL or REMOTE in `upload`
object.

For this reason we can not destroy uploads as "dependent: :destroy" hook
because these would be deleted too soon. Instead we rely on
carrierwave's hook to destroy `uploads` in after_commit hook.

But in before_destroy hook we still have to delete not-mounted uploads
(which don't use carrierwave's destroy hook). This has to be done in
before_Destroy instead of after_commit because `FileUpload` requires
existence of model's object on destroy action.

This is not ideal state of things, in a next step we should investigate
how to unify model dependencies so we can use same workflow for all
uploads.

Related to #45425
2018-05-16 08:58:07 +02:00
Douglas Barbosa Alexandre 8e51c481b6
Does not log failed sign-in attempts when database is in read-only mode 2018-05-14 20:23:40 -03:00
Bob Van Landuyt f7f13f9db0 Block access to API & git when terms are enforced
When terms are enforced, but the user has not accepted the terms
access to the API & git is rejected with a message directing the user
to the web app to accept the terms.
2018-05-10 17:02:27 +02:00
Lin Jen-Shin ab286656b2 Resolve "Namespace factory is problematic" 2018-04-23 15:48:26 +00:00
Dylan Griffith 0e78c2e9c9 Allow group owner to enable runners from subgroups (#41981) 2018-04-09 10:46:42 +10:00
Andreas Brandl 29b0a90c20 Cache personal projects count.
Closes #37462.
2018-04-06 12:27:20 +02:00
Douwe Maan 7de250fb81
Ensure internal users (ghost, support bot) get assigned a namespace 2018-04-05 11:14:32 +02:00
blackst0ne 3d3b46f344 [Rails5] Rename `sort` methods to `sort_by_attribute` 2018-04-04 09:19:47 +00:00
Sean McGivern 869b7b31cf Merge branch 'dm-deploy-keys-default-user' into 'master'
Ensure hooks run when a deploy key without a user pushes

Closes #44317

See merge request gitlab-org/gitlab-ce!18057
2018-03-29 09:30:10 +00:00
Douwe Maan 9311519721 Don’t delete deploy key when user who created it is deleted 2018-03-28 18:54:31 +02:00
Bob Van Landuyt ce69419a60 Remove permanent redirects
Removes permanent redirects, this means that redirects will only be
possible as long as the old route isn't taken by a new project/group.
2018-03-28 14:12:08 +02:00
Fabian Schneider 839589fde3 Change avatar error message to include allowed file formats 2018-03-22 19:01:43 +01:00
Andreas Brandl 7d2859e98b Leverage user_contributed_projects to find recent events.
Closes #40525.
2018-03-07 14:36:25 +01:00
Andreas Brandl 39011be53d Extract method User#authorizations_for_projects. 2018-03-02 18:23:03 +01:00
Stan Hu 46e6a9f8a0 Don't attempt to update user tracked fields if database is in read-only
With Geo, attempting to view an endpoint with a user could result in an
Error 500 since Devise attempts to update the last sign-in IP and other
details.

Closes gitlab-org/gitlab-ee#4972
2018-02-17 21:30:29 -08:00
Peter Lauck eddf4c0f6c Strip whitespace from username/login value for user lookup
As per the discussion with @psimyn, this change does not affect the frontend, so user input will not be validated on the signin screen.

Instead, the value sent to the backend has leading and trailing whitespace stripped before looking up the user with find_by.

Closes #42637
2018-02-13 02:21:51 -05:00
Douwe Maan bbb3e58bc7 Merge branch 'feature/oidc-groups-claim' into 'master'
Add groups to OpenID Connect claims

See merge request gitlab-org/gitlab-ce!16929
2018-02-08 14:26:18 +00:00
Hassan Zamani 583ef9458c
Add groups to OpenID Connect claims 2018-02-08 13:22:41 +01:00
Douwe Maan a03d29da1d Validate User username only on Namespace, and bubble up appropriately 2018-02-06 12:09:03 -06:00
Douwe Maan 75144b1e03 Validate path uniqueness only on Route, and bubble up appropriately 2018-02-06 12:06:38 -06:00
Douwe Maan 8d69436c90 Validate user namespace before saving so that errors persist on model 2018-02-06 12:06:05 -06:00
Rémy Coutable 9483cbab26 Merge branch '26468-fix-admin-recent-sign-in' into 'master'
Using correct column for sorting users by Recent Sign-in

Closes #26468

See merge request gitlab-org/gitlab-ce!13852
2018-02-06 09:18:42 +00:00
Mayra Cabrera 68a419c879 31885 - Ability to transfer a single group to another group 2018-02-06 00:10:58 +00:00
Poornima cca13d1e40 Using correct column for sorting users by Recent Sign-in
Removing last_sign_in_at in specs
2018-02-05 23:05:54 +05:30
Andreas Brandl d07addbf6e Add foreign keys to todos table.
Fixes #32282.
2018-02-05 16:16:57 +01:00
Mario de la Ossa eaada9d706 use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00:00
Nick Thomas 93ea3234df
Use the DatabaseCleaner 'deletion' strategy instead of 'truncation' 2018-01-24 17:25:55 +00:00
Mark Fletcher 580fa6becf Yield no results for blank searches on User name, username and email
Given no search term, the `search` and `search_with_secondary_emails` methods will yield an empty result set
2018-01-21 17:24:50 +00:00
Dmitriy Zaporozhets c85c0ccc8d
Merge branch 'mdelaossa/gitlab-ce-31995-project-limit-default-fix'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-01-04 19:35:14 +02:00
Francisco Javier López 2665aea627 Fix user membership destroy relation 2018-01-02 15:06:44 +00:00
Mario de la Ossa 75cf5f5b54
User#projects_limit remove DB default and added NOT NULL constraint
This change is required because otherwise if a user is created with a
value for `projects_limit` that matches the DB default, it gets
overwritten by `current_application_settings.default_projects_limit`. By
removing the default we once again can allow a user to be created with a
limit of 10 projects without the risk that it'll change to 10000
2017-12-30 14:33:49 -06:00
blackst0ne 27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
Robert Speicher 32ff813d3d Add BlocksJsonSerialization model concern and include it in User 2017-12-19 15:45:07 -06:00
Douwe Maan 8c0aa7d4a7 Merge branch 'bvl-10-2-email-disclosure' into 'security-10-2'
(10.2) Avoid partial partial email adresses for matching

See merge request gitlab/gitlabhq!2232

(cherry picked from commit 081aa1e91a777c9acb31be4a1e76b3dd7032fa9a)

There are unresolved conflicts in app/models/user.rb.

fa85a3fd Don't allow searching for partial user emails
2017-12-08 13:47:18 -08:00
Mayra Cabrera 562fb460b8 Allow git pull/push on project redirects 2017-12-08 17:42:43 +00:00
Mike Greiling 2c569be63b Resolve "Display member role per project" 2017-12-07 09:11:41 +00:00
Markus Koller 257fd57134 Allow password authentication to be disabled entirely 2017-11-23 13:16:14 +00:00
Yorick Peterse 3e561736b2
Cache the number of user SSH keys
By caching the number of personal SSH keys we reduce the number of
queries necessary on pages such as ProjectsController#show (which can
end up querying this data multiple times).

The cache is refreshed/flushed whenever an SSH key is added, removed, or
when a user is removed.
2017-11-16 14:59:38 +01:00
Bob Van Landuyt 022d8420ec Include child projects a user can manage in namespace dropdowns
These dropdown options are used for creating and transfering projects.
2017-11-14 16:57:41 +01:00
Douwe Maan 2fbbba9a29 Always return full avatar URL for private/internal groups/projects when asset host is set 2017-11-09 15:40:41 +00:00
Yorick Peterse 44be82dd18
Refactor User.find_by_any_email
By using SQL::Union we can return a proper ActiveRecord::Relation,
making it possible to select the columns we're interested in (instead of
all of them).
2017-11-07 22:28:52 +01:00
Douwe Maan 634a152760 Make sure group and project creation is blocked for new users that are external by default 2017-11-06 15:19:15 +01:00
Winnie Hellmann 6f1a4ba457 Add system hooks user_rename and group_rename 2017-11-03 11:26:52 +00:00
Douwe Maan 294fa6fcdc Remove authentication using user.private_token 2017-11-02 11:39:02 +01:00
Jacopo 0ce6785851 Replaces `tag: true` into `:tag` in the specs
Replaces all the explicit include metadata syntax in the specs (tag:
true) into the implicit one (:tag).
Added a cop to prevent future errors and handle autocorrection.
2017-10-07 13:57:54 +02:00