summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-13 18:46:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-13 18:46:29 +0000
commitf30462595e83f512cd5f29246a4542773595a224 (patch)
tree56eb7ce08ea5a8c6e0c21806e067c8c652e652b9 /app/controllers
parent3186130966cea85d842faf5c038006f8fb40bb61 (diff)
downloadredmine-f30462595e83f512cd5f29246a4542773595a224.tar.gz
redmine-f30462595e83f512cd5f29246a4542773595a224.zip
Optional Regex delimiters to truncate incoming emails (#5864).
git-svn-id: http://svn.redmine.org/redmine/trunk@16065 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/settings_controller.rb31
1 files changed, 18 insertions, 13 deletions
diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb
index 6b7e51874..7ef7e9945 100644
--- a/app/controllers/settings_controller.rb
+++ b/app/controllers/settings_controller.rb
@@ -34,24 +34,29 @@ class SettingsController < ApplicationController
def edit
@notifiables = Redmine::Notifiable.all
if request.post?
- if Setting.set_all_from_params(params[:settings])
+ errors = Setting.set_all_from_params(params[:settings])
+ if errors.blank?
flash[:notice] = l(:notice_successful_update)
+ redirect_to settings_path(:tab => params[:tab])
+ return
+ else
+ @setting_errors = errors
+ # render the edit form with error messages
end
- redirect_to settings_path(:tab => params[:tab])
- else
- @options = {}
- user_format = User::USER_FORMATS.collect{|key, value| [key, value[:setting_order]]}.sort{|a, b| a[1] <=> b[1]}
- @options[:user_format] = user_format.collect{|f| [User.current.name(f[0]), f[0].to_s]}
- @deliveries = ActionMailer::Base.perform_deliveries
+ end
- @guessed_host_and_path = request.host_with_port.dup
- @guessed_host_and_path << ('/'+ Redmine::Utils.relative_url_root.gsub(%r{^\/}, '')) unless Redmine::Utils.relative_url_root.blank?
+ @options = {}
+ user_format = User::USER_FORMATS.collect{|key, value| [key, value[:setting_order]]}.sort{|a, b| a[1] <=> b[1]}
+ @options[:user_format] = user_format.collect{|f| [User.current.name(f[0]), f[0].to_s]}
+ @deliveries = ActionMailer::Base.perform_deliveries
- @commit_update_keywords = Setting.commit_update_keywords.dup
- @commit_update_keywords = [{}] unless @commit_update_keywords.is_a?(Array) && @commit_update_keywords.any?
+ @guessed_host_and_path = request.host_with_port.dup
+ @guessed_host_and_path << ('/'+ Redmine::Utils.relative_url_root.gsub(%r{^\/}, '')) unless Redmine::Utils.relative_url_root.blank?
- Redmine::Themes.rescan
- end
+ @commit_update_keywords = Setting.commit_update_keywords.dup
+ @commit_update_keywords = [{}] unless @commit_update_keywords.is_a?(Array) && @commit_update_keywords.any?
+
+ Redmine::Themes.rescan
end
def plugin