From 8ee4d5084df530b32218f8854570c417ce67386e Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 12 Mar 2018 04:31:04 +0000 Subject: [PATCH] Deletion of an LDAP authentication mode may fail silently (#28000). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17232 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/auth_sources_controller.rb | 2 ++ config/locales/en.yml | 1 + test/functional/auth_sources_controller_test.rb | 1 + 3 files changed, 4 insertions(+) diff --git a/app/controllers/auth_sources_controller.rb b/app/controllers/auth_sources_controller.rb index dcbba3687..ed0b415e5 100644 --- a/app/controllers/auth_sources_controller.rb +++ b/app/controllers/auth_sources_controller.rb @@ -68,6 +68,8 @@ class AuthSourcesController < ApplicationController unless @auth_source.users.exists? @auth_source.destroy flash[:notice] = l(:notice_successful_delete) + else + flash[:error] = l(:error_can_not_delete_auth_source) end redirect_to auth_sources_path end diff --git a/config/locales/en.yml b/config/locales/en.yml index 018235a3d..38808a23a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -221,6 +221,7 @@ en: error_cannot_reassign_time_entries_to_an_issue_about_to_be_deleted: "Spent time cannot be reassigned to an issue that is about to be deleted" warning_fields_cleared_on_bulk_edit: "Changes will result in the automatic deletion of values from one or more fields on the selected objects" error_exceeds_maximum_hours_per_day: "Cannot log more than %{max_hours} hours on the same day (%{logged_hours} hours have already been logged)" + error_can_not_delete_auth_source: "This authentication mode is in use and cannot be deleted." mail_subject_lost_password: "Your %{value} password" mail_body_lost_password: 'To change your password, click on the following link:' diff --git a/test/functional/auth_sources_controller_test.rb b/test/functional/auth_sources_controller_test.rb index e6bfcf54c..adc6c1a22 100644 --- a/test/functional/auth_sources_controller_test.rb +++ b/test/functional/auth_sources_controller_test.rb @@ -159,6 +159,7 @@ class AuthSourcesControllerTest < Redmine::ControllerTest :id => 1 } assert_redirected_to '/auth_sources' + assert_equal 'This authentication mode is in use and cannot be deleted.', flash[:error] end end -- 2.39.5