Mailinglist Archive: yast-commit (2113 mails)

< Previous Next >
[yast-commit] <rest-service> master : rename systemtimes to systemtime as it is singular controller
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Tue, 29 Sep 2009 17:05:56 +0200
  • Message-id: <E1MseHc-0001FH-T2@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 08c3c26ca4f4a8b8f0308304bc5b8f00d342e8c4
Author: Josef Reidinger <jreidinger@xxxxxxx>
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@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages