105 Commits
Author SHA1 Message Date
Douwe Maan 00906b5bb6 Merge branch 'issue_12758' into 'master'
Implement custom notification level options

![Screen_Shot_2016-06-17_at_15.31.43](/uploads/3fc47d2f461b3e8b67bb8acaa304cf99/Screen_Shot_2016-06-17_at_15.31.43.png)

![Screenshot_from_2016-06-15_10-52-27](/uploads/88dbdd21d97e80ee772fe08fa0c9b393/Screenshot_from_2016-06-15_10-52-27.png)

part of #12758 

See merge request !4389
2016-06-17 23:28:22 +00:00
Robert Speicher d9d149244a Merge branch 'disable-saml-account-unlink' into 'master'
Disable the unlink feature for SAML connected accounts (social login).

This disables the ability to manually unlink your SAML account, if you have one connected. In certain scenarios, the only allowed login mechanism can be SAML, and if you unlink your account you will be locked out of the system (configuration dependent).

Fixes #18613

See merge request !4662
2016-06-17 19:27:51 +00:00
Felipe Artur e5aa902860 Merge master into issue_12758 2016-06-17 14:29:11 -03:00
Felipe Artur f82ab42d05 Re-use notifications dropdown on user profile 2016-06-16 23:34:21 -03:00
Timothy Andrew 7ee0898a9e Implement @DouweM's feedback.
- Extract a duplicated `redirect_to`
- Fix a typo: "token", not "certificate"
- Have the "Expires at" datepicker be attached to a text field, not inline
- Have both private tokens and personal access tokens verified in a
  single "authenticate_from_private_token" method, both in the
  application and API. Move relevant logic to
  `User#find_by_personal_access_token`
- Remove unnecessary constants relating to API auth. We don't need a
  separate constant for personal access tokens since the param is the
  same as for private tokens.
2016-06-16 08:24:13 +05:30
Patricio Cano 34bf165147 Disable the unlink feature for SAML connected accounts (social login). 2016-06-14 18:28:17 -05:00
Timothy Andrew d0bcba1105 Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-06-14 09:06:53 +05:30
Felipe Artur 39ead205de Remove notification level fild from users, improve migrations and specs 2016-06-10 11:49:30 -03:00
Felipe Artur 8f6d43e0fe Remove notification level from user model 2016-06-10 10:58:13 -03:00
Timothy Andrew 1779d68bfe Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-06-09 14:40:14 +05:30
Timothy Andrew 1f5ecf916e Implement @jschatz1's comments.
- No hardcoded colors in any SCSS file except `variables.scss`
- Don't allow choosing a date in the past
- Use the same table as in the "Applications" tab
- The button should say "Create Personal Access Token"
- Float the revoke button to the right of the table cell
- Change the revocation message to be more explicit.
- Date shouldn't look selected on page load
- Don't use a panel for the created token
    - Use a normal flash for "Your new personal access token has been created"
    - Show the input (with the token) below it full width.
    - Put the "Make sure you save it - you won't be able to access it again." message near the input
- Have the created token's input highlight all on single click
2016-06-09 14:08:49 +05:30
Timothy Andrew 128549f10b Implement U2F registration.
- Move the `TwoFactorAuthsController`'s `new` action to `show`, since
  the page is not used to create a single "two factor auth" anymore. We
  can have a single 2FA authenticator app, along with any number of U2F
  devices, in any combination, so the page will be accessed after the
  first "two factor auth" is created.
- Add the `u2f` javascript library, which provides an API to the
  browser's U2F implementation.
- Add tests for the JS components
2016-06-06 12:50:31 +05:30
Timothy Andrew ae0d8222af Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-06-03 09:31:16 +05:30
Timothy Andrew ffe111c1e2 Display appropriate errors when personal access token creation/revocation fails. 2016-06-03 09:23:16 +05:30
Timothy Andrew 4d50d8a6e3 Only show a personal access token right after its creation. 2016-06-02 11:06:38 +05:30
Timothy Andrew c75aea5e4d Fix minor issues with the personal access tokens implementation.
- Use the `:personal_access_token` param root instead of
  `personal_access_token_params`, because we aren't using the
  `personal_access_token` param for authentication anymore (we're using
  `private_token` instead).
- Use `build` to instantiate a `PersonalAccessToken`
- Use better-formatted dates
2016-06-01 14:31:16 +05:30
Dmitriy Zaporozhets 253a017b01 Merge branch 'meinac/gitlab-ce-change_deprecated_render_usage'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-05-18 12:48:23 -05:00
Timothy Andrew fc4bce755d Make fixes based on @vsizov's comments on MR !3749 2016-04-28 22:28:36 +05:30
Timothy Andrew 17f2fc10e6 Change the root param while creating personal access tokens.
- Can't use `personal_access_token` anymore, because the contents
  of that param are assumed to be a token string, and authenticated
  against.
2016-04-28 22:28:36 +05:30
Timothy Andrew fb2da6795c Add an "Inactive Personal Access Tokens" section.
- Show the count for each section in parens
- Remove the `revoked?` check, because everything in the
  active section is guaranteed to not be revoked.
2016-04-28 22:28:36 +05:30
Timothy Andrew 41b4e119e9 Add an entry for Personal Access Tokens in the sidebar. 2016-04-28 22:28:36 +05:30
Timothy Andrew e5cf527f27 Allow expiration of personal access tokens. 2016-04-28 22:28:36 +05:30
Timothy Andrew 6d76f14f54 Allow revoking personal access tokens. 2016-04-28 22:28:36 +05:30
Timothy Andrew 3a60903874 Allow creating Personal Access Tokens through the website. 2016-04-28 22:28:36 +05:30
Rémy Coutable a434ffd3b3 Make /profile/keys/new redirects to /profile/keys for back-compat
Report: https://github.com/gitlabhq/gitlabhq/issues/10138

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-15 09:45:58 +02:00
Dmitriy Zaporozhets 26631f9981 Change how notification settings in profile are rendered and updated
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-30 10:44:20 +02:00
Dmitriy Zaporozhets f8f68d6b8c Fix few bugs related to recent notifications refactoring
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-30 10:44:20 +02:00
Dmitriy Zaporozhets 359157c097 Introduce NotificationSetting to user interface
* visiting project will create notification setting if missing
* change notification setting per project even without membership
* use notification settings instead of membership on profile page

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-30 10:44:20 +02:00
Mehmet Emin İNAÇ 6a0ea605e8 Change deprecated usage of rendering without response body
`render nothing: true` has been deprecated.
For more information see [pr](https://github.com/rails/rails/pull/20336)
2016-03-16 03:16:25 +02:00
Robert Speicher 1b10724e08 Don't abuse the flash store for displaying SSH Key form errors 2016-03-03 16:13:59 -05:00
Robert Speicher 01b89ee8f1 Remove Profile::KeysController#new action 2016-03-03 16:13:59 -05:00
Phil HughesandRobert Speicher 1d4418bc5f Fixed failing ssh key tests 2016-03-03 16:13:55 -05:00
Phil HughesandRobert Speicher 1efe105415 SSH keys settings
Closes #13860
2016-03-03 16:13:55 -05:00
Robert Speicher b0ec9529e2 Don't show any "2FA required" message if it's not actually required
Prior, if the user had enabled and then disabled 2FA, they would be
shown a "You must enable Two-factor Authentication for your account."
message when going back to re-activate it, even if 2FA enforcement was
disabled.
2016-02-29 13:58:36 -05:00
Robert Speicher fcab1345da Update wording for 2FA requirement notice 2016-01-23 17:56:18 -08:00
Gabriel Mazetto 1249289f89 Fixed codestyle and added 2FA documentation 2015-12-24 19:01:30 -02:00
Gabriel Mazetto b61a5bc20c specs for forced two-factor authentication and grace period
simplified code and fixed stuffs
2015-12-24 19:01:30 -02:00
Gabriel Mazetto 31fb2b7702 Grace period support for TFA 2015-12-24 19:01:30 -02:00
Gabriel Mazetto 33964469b3 WIP require two factor authentication 2015-12-24 19:00:18 -02:00
Stan Hu 9bfc531ec6 Redirect to a default path if HTTP_REFERER is not set
Safari 9.0 does not yet honor the HTML5 `origin-when-cross-origin` mode,
and it's possible load balancers/proxies strip the HTTP_REFERER from
the request header. In these cases, default to some default path.

Closes #3122

Closes https://github.com/gitlabhq/gitlabhq/issues/9731
2015-10-20 07:45:48 -07:00
Peter Göbel e2c5d08e7e added user preference to change layout width 2015-10-05 17:22:47 +02:00
Robert Speicher 259851c0d6 Bump devise-two-factor to 2.0.0
Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2605

See https://github.com/tinfoil/devise-two-factor/pull/43
2015-09-19 21:16:18 -04:00
Dmitriy Zaporozhets 5f34759ecb Allow user to specify content he wants to see on project page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-13 18:24:15 +02: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 b6318297fc Use User#two_factor_enabled instead of otp_required_for_login 2015-06-19 15:14:37 -04:00
Robert Speicher ad049a8e52 Prefix 2FA issuer with the GitLab host (e.g., 'dev.gitlab.org') 2015-06-16 13:08:29 -04:00
Robert Speicher 1562f017b6 Spec the failure cases for PreferencesController#update 2015-06-13 17:59:12 -04:00
Robert Speicher 2bc4fd2d04 Add dashboard attribute to User model 2015-06-13 17:59:11 -04:00
Robert Speicher 0c0c31ff34 Move the "Design" templates and logic to Preferences 2015-06-13 17:58:16 -04:00
Robert Speicher 821fc4b034 Add Profiles::PreferencesController 2015-06-13 17:58:15 -04:00