diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-09 10:52:30 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-09 10:52:30 +0000 |
commit | 6267a6b9995744fc5ccab7a89c27a27e61b9cb7b (patch) | |
tree | b069f361d9d4ca7fcd34c642a53af237c7edb197 | |
parent | 9562f028594c6d61834d48f75f8379b0de2ba8ae (diff) | |
parent | 44458f3ca2d142a7d6088d627382f9dab5698f40 (diff) | |
download | gitlab-ce-6267a6b9995744fc5ccab7a89c27a27e61b9cb7b.tar.gz |
Merge branch 'ldap-remember-me' into 'master'
Add "Remember me" checkbox to LDAP signin form.
Addresses internal issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2127.
See merge request !772
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/controllers/omniauth_callbacks_controller.rb | 2 | ||||
-rw-r--r-- | app/views/devise/sessions/_new_ldap.html.haml | 5 |
3 files changed, 7 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG index 624dd3a5c48..4857682d027 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 7.12.0 (unreleased) - Fix timeout when rendering file with thousands of lines. + - Add "Remember me" checkbox to LDAP signin form. - Don't notify users mentioned in code blocks or blockquotes. - Omit link to generate labels if user does not have access to create them (Stan Hu) - Show warning when a comment will add 10 or more people to the discussion. diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index a767815b311..765adaf2128 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -24,7 +24,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController @user = Gitlab::LDAP::User.new(oauth) @user.save if @user.changed? # will also save new users gl_user = @user.gl_user - gl_user.remember_me = true if @user.persisted? + gl_user.remember_me = params[:remember_me] if @user.persisted? # Do additional LDAP checks for the user filter and EE features if @user.allowed? diff --git a/app/views/devise/sessions/_new_ldap.html.haml b/app/views/devise/sessions/_new_ldap.html.haml index 812e22373a7..6ec741e4882 100644 --- a/app/views/devise/sessions/_new_ldap.html.haml +++ b/app/views/devise/sessions/_new_ldap.html.haml @@ -1,4 +1,9 @@ = form_tag(user_omniauth_callback_path(server['provider_name']), id: 'new_ldap_user' ) do = text_field_tag :username, nil, {class: "form-control top", placeholder: "#{server['label']} Login", autofocus: "autofocus"} = password_field_tag :password, nil, {class: "form-control bottom", placeholder: "Password"} + - if devise_mapping.rememberable? + .remember-me.checkbox + %label{for: "remember_me"} + = check_box_tag :remember_me, '1', false, id: 'remember_me' + %span Remember me = button_tag "#{server['label']} Sign in", class: "btn-save btn" |