##// END OF EJS Templates
Use .skip_before_action instead of .skip_before_filter....
Use .skip_before_action instead of .skip_before_filter. git-svn-id: http://svn.redmine.org/redmine/trunk@15656 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r15273:ee82a55602a2
r15274:2457f5914d90
Show More
settings_controller.rb
73 lines | 2.5 KiB | text/x-ruby | RubyLexer
/ app / controllers / settings_controller.rb
Toshi MARUYAMA
remove trailing white-spaces from settings controller source....
r5707 # Redmine - project management software
Jean-Philippe Lang
Updates copyright for 2016....
r14856 # Copyright (C) 2006-2016 Jean-Philippe Lang
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
Jean-Philippe Lang
Host setting should contain the path prefix (Redmine base URL) to properly generate links in emails that are sent offline (#2122)....
r1987 #
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
Jean-Philippe Lang
Host setting should contain the path prefix (Redmine base URL) to properly generate links in emails that are sent offline (#2122)....
r1987 #
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class SettingsController < ApplicationController
Jean-Philippe Lang
Adds an admin layout that displays the admin menu in the sidebar....
r3062 layout 'admin'
Jean-Philippe Lang
Fixes admin menu display....
r8559 menu_item :plugins, :only => :plugin
Toshi MARUYAMA
remove trailing white-spaces from settings controller source....
r5707
Jean-Philippe Lang
Adds helpers for query columns selection....
r11221 helper :queries
Jean-Philippe Lang
Use .before_action instead of .before_filter....
r15273 before_action :require_admin
Jean-Philippe Lang
Host setting should contain the path prefix (Redmine base URL) to properly generate links in emails that are sent offline (#2122)....
r1987
Jean-Philippe Lang
Require password re-entry for sensitive actions (#19851)....
r13951 require_sudo_mode :index, :edit, :plugin
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 def index
edit
render :action => 'edit'
end
def edit
Eric Davis
Refactor the hardcoded event actions (notifiables) to use a class...
r4106 @notifiables = Redmine::Notifiable.all
Jean-Philippe Lang
Admin settings screen split to tabs....
r1033 if request.post? && params[:settings] && params[:settings].is_a?(Hash)
Jean-Philippe Lang
Send a notification when security settings are changed (#21421)....
r14766 Setting.set_all_from_params(params[:settings])
Jean-Philippe Lang
Admin settings screen split to tabs....
r1033 flash[:notice] = l(:notice_successful_update)
Jean-Philippe Lang
Use named routes in controllers....
r10754 redirect_to settings_path(:tab => params[:tab])
Toshi MARUYAMA
Fix potential Execution After Redirect bugs....
r5491 else
@options = {}
Toshi MARUYAMA
pin user format order at setting panel (#10937)...
r10331 user_format = User::USER_FORMATS.collect{|key, value| [key, value[:setting_order]]}.sort{|a, b| a[1] <=> b[1]}
Toshi MARUYAMA
code cleanup r10542 changes (#10937)...
r10333 @options[:user_format] = user_format.collect{|f| [User.current.name(f[0]), f[0].to_s]}
Toshi MARUYAMA
Fix potential Execution After Redirect bugs....
r5491 @deliveries = ActionMailer::Base.perform_deliveries
Jean-Philippe Lang
Host setting should contain the path prefix (Redmine base URL) to properly generate links in emails that are sent offline (#2122)....
r1987
Toshi MARUYAMA
Fix potential Execution After Redirect bugs....
r5491 @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?
Toshi MARUYAMA
remove trailing white-spaces from settings controller source....
r5707
Jean-Philippe Lang
Support for multiple issue update keywords/rules in commit messages (#4911)....
r11967 @commit_update_keywords = Setting.commit_update_keywords.dup
Jean-Philippe Lang
Fixed that non array commit_update_keywords raises an error (#7590)....
r11986 @commit_update_keywords = [{}] unless @commit_update_keywords.is_a?(Array) && @commit_update_keywords.any?
Jean-Philippe Lang
Support for multiple issue update keywords/rules in commit messages (#4911)....
r11967
Toshi MARUYAMA
Fix potential Execution After Redirect bugs....
r5491 Redmine::Themes.rescan
end
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 end
Jean-Philippe Lang
Host setting should contain the path prefix (Redmine base URL) to properly generate links in emails that are sent offline (#2122)....
r1987
Jean-Philippe Lang
Basic plugin support....
r741 def plugin
Jean-Philippe Lang
Adds .find and .all Plugin class methods....
r2037 @plugin = Redmine::Plugin.find(params[:id])
Jean-Philippe Lang
Fix 500 error for requests to the settings path for non-configurable plugins (#12911)....
r10986 unless @plugin.configurable?
render_404
return
end
Jean-Philippe Lang
Basic plugin support....
r741 if request.post?
Jean-Philippe Lang
Adds tests for plugin settings editing....
r7919 Setting.send "plugin_#{@plugin.id}=", params[:settings]
Jean-Philippe Lang
Basic plugin support....
r741 flash[:notice] = l(:notice_successful_update)
Jean-Philippe Lang
Code cleanup: implement Plugin#to_param for generating routes....
r10766 redirect_to plugin_settings_path(@plugin)
Toshi MARUYAMA
Fix potential Execution After Redirect bugs....
r5491 else
@partial = @plugin.settings[:partial]
Jean-Philippe Lang
Adds tests for plugin settings editing....
r7919 @settings = Setting.send "plugin_#{@plugin.id}"
Jean-Philippe Lang
Basic plugin support....
r741 end
Jean-Philippe Lang
Adds .find and .all Plugin class methods....
r2037 rescue Redmine::PluginNotFound
render_404
Jean-Philippe Lang
Basic plugin support....
r741 end
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 end