From f2af30f19534c639c17fa5356ab1c18f518f2e98 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 6 Apr 2015 13:26:41 +0200 Subject: [PATCH 1/2] Skip email confirmation when set by admin or via LDAP. --- CHANGELOG | 1 + app/controllers/admin/users_controller.rb | 2 +- lib/gitlab/ldap/user.rb | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index db3e5744b0e..7d2edfbe352 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -62,6 +62,7 @@ v 7.10.0 (unreleased) - Project labels are now available over the API under the "tag_list" field (Cristian Medina) - Fixed link paths for HTTP and SSH on the admin project view (Jeremy Maziarz) - Fix and improve help rendering (Sullivan Sénéchal) + - Skip email confirmation when set by admin or via LDAP. v 7.9.2 diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 693970e5349..b4c011f213c 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -72,8 +72,8 @@ class Admin::UsersController < Admin::ApplicationController end respond_to do |format| + user.skip_reconfirmation! if user.update_attributes(user_params_with_pass) - user.confirm! format.html { redirect_to [:admin, user], notice: 'User was successfully updated.' } format.json { head :ok } else diff --git a/lib/gitlab/ldap/user.rb b/lib/gitlab/ldap/user.rb index cfa8692659d..806f43c4694 100644 --- a/lib/gitlab/ldap/user.rb +++ b/lib/gitlab/ldap/user.rb @@ -39,6 +39,7 @@ module Gitlab end def update_user_attributes + gl_user.skip_reconfirmation! gl_user.email = auth_hash.email # Build new identity only if we dont have have same one From f915a4b80fdae28492e6c630534d8b66462f670a Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 6 Apr 2015 14:02:49 +0200 Subject: [PATCH 2/2] Warn when gitlab-shell version doesn't match requirement. --- CHANGELOG | 1 + config/initializers/5_backend.rb | 7 +++++++ lib/gitlab/backend/shell.rb | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index db3e5744b0e..87675a056bd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -62,6 +62,7 @@ v 7.10.0 (unreleased) - Project labels are now available over the API under the "tag_list" field (Cristian Medina) - Fixed link paths for HTTP and SSH on the admin project view (Jeremy Maziarz) - Fix and improve help rendering (Sullivan Sénéchal) + - Warn when gitlab-shell version doesn't match requirement. v 7.9.2 diff --git a/config/initializers/5_backend.rb b/config/initializers/5_backend.rb index 7c2e7f39000..80d641d73a3 100644 --- a/config/initializers/5_backend.rb +++ b/config/initializers/5_backend.rb @@ -6,3 +6,10 @@ require Rails.root.join("lib", "gitlab", "backend", "shell") # GitLab shell adapter require Rails.root.join("lib", "gitlab", "backend", "shell_adapter") + +required_version = Gitlab::VersionInfo.parse(Gitlab::Shell.version_required) +current_version = Gitlab::VersionInfo.parse(Gitlab::Shell.new.version) + +unless current_version.valid? && required_version <= current_version + warn "WARNING: This version of GitLab depends on gitlab-shell #{required_version}, but you're running #{current_version}. Please update gitlab-shell." +end diff --git a/lib/gitlab/backend/shell.rb b/lib/gitlab/backend/shell.rb index aabc7f1e69a..530f9d93de4 100644 --- a/lib/gitlab/backend/shell.rb +++ b/lib/gitlab/backend/shell.rb @@ -240,7 +240,7 @@ module Gitlab gitlab_shell_version_file = "#{gitlab_shell_path}/VERSION" if File.readable?(gitlab_shell_version_file) - File.read(gitlab_shell_version_file) + File.read(gitlab_shell_version_file).chomp end end