ref: refs/heads/eula
commit 08c3c26ca4f4a8b8f0308304bc5b8f00d342e8c4
Author: Josef Reidinger
Date: Tue Sep 29 17:05:56 2009 +0200
rename systemtimes to systemtime as it is singular controller
---
.../time/app/controllers/systemtime_controller.rb | 50 ++++++++++++++++++++
.../time/app/controllers/systemtimes_controller.rb | 50 --------------------
2 files changed, 50 insertions(+), 50 deletions(-)
diff --git a/plugins/time/app/controllers/systemtime_controller.rb b/plugins/time/app/controllers/systemtime_controller.rb
new file mode 100644
index 0000000..95b3d37
--- /dev/null
+++ b/plugins/time/app/controllers/systemtime_controller.rb
@@ -0,0 +1,50 @@
+require 'systemtime'
+
+# = Systemtime controller
+# Provides access to time settings for authentificated users.
+# Main goal is checking permissions.
+class SystemtimeController < ApplicationController
+
+ before_filter :login_required
+
+ #--------------------------------------------------------------------------------
+ #
+ # actions
+ #
+ #--------------------------------------------------------------------------------
+
+ # Sets time settings. Requires write permissions for time YaPI.
+ def update
+ yapi_perm_check "time.write"
+
+ root = params[:time]
+ if root == nil
+ raise InvalidParameters.new :timezone => "Missing"
+ end
+
+ systemtime = Systemtime.create_from_xml(root)
+ systemtime.save
+ show
+ end
+
+ # See update
+ def create
+ update
+ end
+
+ # Shows time settings. Requires read permission for time YaPI.
+ def show
+ yapi_perm_check "time.read"
+
+ systemtime = Systemtime.find
+
+ respond_to do |format|
+ format.html { render :xml => systemtime.to_xml( :root => "systemtime", :dasherize => false ) }
+ format.xml { render :xml => systemtime.to_xml( :root => "systemtime", :dasherize => false ) }
+ format.json { render :json => systemtime.to_json( :root => "systemtime", :dasherize => false ) }
+ end
+
+ end
+
+end
+
diff --git a/plugins/time/app/controllers/systemtimes_controller.rb b/plugins/time/app/controllers/systemtimes_controller.rb
deleted file mode 100644
index 0637b9c..0000000
--- a/plugins/time/app/controllers/systemtimes_controller.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'systemtime'
-
-# = Systemtime controller
-# Provides access to time settings for authentificated users.
-# Main goal is checking permissions.
-class SystemtimesController < ApplicationController
-
- before_filter :login_required
-
- #--------------------------------------------------------------------------------
- #
- # actions
- #
- #--------------------------------------------------------------------------------
-
- # Sets time settings. Requires write permissions for time YaPI.
- def update
- yapi_perm_check "time.write"
-
- root = params[:time]
- if root == nil
- raise InvalidParameters.new :timezone => "Missing"
- end
-
- systemtime = Systemtime.create_from_xml(root)
- systemtime.save
- show
- end
-
- # See update
- def create
- update
- end
-
- # Shows time settings. Requires read permission for time YaPI.
- def show
- yapi_perm_check "time.read"
-
- systemtime = Systemtime.find
-
- respond_to do |format|
- format.html { render :xml => systemtime.to_xml( :root => "systemtime", :dasherize => false ) }
- format.xml { render :xml => systemtime.to_xml( :root => "systemtime", :dasherize => false ) }
- format.json { render :json => systemtime.to_json( :root => "systemtime", :dasherize => false ) }
- end
-
- end
-
-end
-
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org