summaryrefslogtreecommitdiffstats
path: root/app/controllers/settings_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-01-21 11:50:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-01-21 11:50:22 +0000
commit0b4d4db131304eac84dc90b289a95db3410a2bfe (patch)
treeb5ad6934b897635e594ca089f06fe953d082ed53 /app/controllers/settings_controller.rb
parenta1b12335ab6a01ea6e7dcc1df490db16136c8c2a (diff)
downloadredmine-0b4d4db131304eac84dc90b289a95db3410a2bfe.tar.gz
redmine-0b4d4db131304eac84dc90b289a95db3410a2bfe.zip
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings
git-svn-id: http://redmine.rubyforge.org/svn/trunk@167 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/settings_controller.rb')
-rw-r--r--app/controllers/settings_controller.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb
new file mode 100644
index 000000000..229a4ab3c
--- /dev/null
+++ b/app/controllers/settings_controller.rb
@@ -0,0 +1,33 @@
+# redMine - project management software
+# Copyright (C) 2006-2007 Jean-Philippe Lang
+#
+# 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.
+#
+# 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.
+#
+# 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
+ layout 'base'
+ before_filter :require_admin
+
+ def index
+ edit
+ render :action => 'edit'
+ end
+
+ def edit
+ if request.post? and params[:settings] and params[:settings].is_a? Hash
+ params[:settings].each { |name, value| Setting[name] = value }
+ redirect_to :action => 'edit' and return
+ end
+ end
+end