Mailinglist Archive: yast-commit (1914 mails)

< Previous Next >
[yast-commit] <web-client> basesystem : remove private routing from security module and use irregular name security
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Mon, 24 Aug 2009 15:37:53 +0200
  • Message-id: <E1MlexX-0003ZA-L7@xxxxxxxxxxxxxxxx>
ref: refs/heads/basesystem
commit 15edacc4e1a403738c03f76ea0e7f504365388b8
Author: Josef Reidinger <jreidinger@xxxxxxx>
Date: Tue Aug 18 08:57:28 2009 +0200

remove private routing from security module and use irregular name security
---
plugins/securities/README | 7 ---
plugins/securities/Rakefile | 10 ----
.../app/controllers/securities_controller.rb | 56 --------------------
plugins/securities/app/views/securities/create.erb | 35 ------------
plugins/securities/app/views/securities/update.erb | 35 ------------
plugins/securities/config/rails_parent.rb | 15 -----
plugins/securities/config/routes.rb | 7 ---
plugins/securities/init.rb | 1 -
plugins/securities/install.rb | 1 -
plugins/securities/shortcuts.yml | 8 ---
plugins/securities/tasks/security_tasks.rake | 6 --
plugins/securities/test/security_test.rb | 8 ---
plugins/securities/test/test_helper.rb | 3 -
plugins/securities/uninstall.rb | 1 -
plugins/security/README | 7 +++
plugins/security/Rakefile | 10 ++++
.../app/controllers/security_controller.rb | 56 ++++++++++++++++++++
plugins/security/app/views/security/create.erb | 35 ++++++++++++
plugins/security/app/views/security/update.erb | 35 ++++++++++++
plugins/security/config/rails_parent.rb | 15 +++++
plugins/security/init.rb | 1 +
plugins/security/install.rb | 1 +
plugins/security/shortcuts.yml | 8 +++
plugins/security/tasks/security_tasks.rake | 6 ++
plugins/security/test/security_test.rb | 8 +++
plugins/security/test/test_helper.rb | 3 +
plugins/security/uninstall.rb | 1 +
webclient/config/initializers/inflections.rb | 6 +-
28 files changed, 189 insertions(+), 196 deletions(-)

diff --git a/plugins/securities/README b/plugins/securities/README
deleted file mode 100644
index 07b5c20..0000000
--- a/plugins/securities/README
+++ /dev/null
@@ -1,7 +0,0 @@
-Security
-=========
-
-REST interface for handling services.
-
-
-Copyright (c) 2009 Novell, released under the MIT license
diff --git a/plugins/securities/Rakefile b/plugins/securities/Rakefile
deleted file mode 100644
index ca63e76..0000000
--- a/plugins/securities/Rakefile
+++ /dev/null
@@ -1,10 +0,0 @@
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require File.join(File.dirname(__FILE__), 'config', 'rails_parent')
-require File.join(RailsParent.parent, 'config', 'boot')
-require 'tasks/rails'
-
-desc 'Default: run unit tests.'
-task :default => :test
-
diff --git a/plugins/securities/app/controllers/securities_controller.rb
b/plugins/securities/app/controllers/securities_controller.rb
deleted file mode 100644
index 50f9a76..0000000
--- a/plugins/securities/app/controllers/securities_controller.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'yast/service_resource'
-
-
-class SecuritiesController < ApplicationController
- before_filter :login_required, :prepare
-
- # Initialize GetText and Content-Type.
- init_gettext "yast_webclient_securities" # textdomain, options(:charset,
:content_type)
-
- private
-
- def prepare
- @client =
YaST::ServiceResource.proxy_for('org.opensuse.yast.system.security')
- @permissions = @client.permissions
- end
-
- public
-
- # POST /security
- # POST /security.xml
- def create
- @security = @client.find(:one, :from => '/security.xml')
-
- @firewall_after_startup = "checked" if @security.firewall_after_startup
- @firewall = "checked" if @security.firewall
- @ssh = "checked" if @security.ssh
- end
-
- # GET /security
- # GET /security.xml
- def show
- end
-
- def update
- s = @client.find()
- s.firewall_after_startup = params[:firewall_after_startup].eql?("true")
- s.firewall = params[:firewall].eql?("true")
- s.ssh = params[:ssh].eql?("true")
-
-# response = true
- begin
-# response = s.save # send to rest-service
- s.save
- rescue ActiveResource::ClientError => e
- flash[:error] = YaST::ServiceResource.error(e)
-# response = false
- end
-# flash[:notice] = _("Settings have been written.") if response
-
- # prepare for view
- @firewall_after_startup = "checked" if s.firewall_after_startup
- @firewall = "checked" if s.firewall
- @ssh = "checked" if s.ssh
- end
-end
-
diff --git a/plugins/securities/app/views/securities/create.erb
b/plugins/securities/app/views/securities/create.erb
deleted file mode 100644
index 57778f3..0000000
--- a/plugins/securities/app/views/securities/create.erb
+++ /dev/null
@@ -1,35 +0,0 @@
-<div class='plugin-icon'><img src='/icons/yast-security.png'/></div>
-<div class='plugin-content'>
-
-<h2><%=_("Security")%></h2>
-
-<% form_tag '/security/update' do %>
-
-<span>
- <label>
- <%= check_box_tag "firewall_after_startup", "true",
@firewall_after_startup,
- :disabled =>
!@xxxxxxxxxxxxxxxxxx[:write] %>
- <span><%=_("Enable Firewall Automatic Starting")%></span>
- </label>
-
- <label>
- <%= check_box_tag "firewall", "true", @firewall,
- :disabled =>
!@xxxxxxxxxxxxxxxxxx[:write] %>
- <span><%=_("Firewall enabled")%></span>
- </label>
-
- <label>
- <%= check_box_tag "ssh", "true", @ssh, :disabled =>
!@xxxxxxxxxxxxxxxxxx[:write] %>
- <span><%=_("SSH login enabled")%></span>
- </label>
-
- <span>
- <hbox>
- <%= submit_tag _("Save"), :onclick=>"Element.show('progress')",
- :disabled => !@xxxxxxxxxxxxxxxxxx[:write], :class =>
'button' -%>
- <a href="/" class="button"><%=_("Back")%></a>
- </hbox>
- </span>
-</span>
-<% end %>
-</div>
diff --git a/plugins/securities/app/views/securities/update.erb
b/plugins/securities/app/views/securities/update.erb
deleted file mode 100644
index b408dd6..0000000
--- a/plugins/securities/app/views/securities/update.erb
+++ /dev/null
@@ -1,35 +0,0 @@
-<div class='plugin-icon'><img src='/icons/yast-security.png'/></div>
-<div class='plugin-content'>
-
-<h2><%=_("Security")%></h2>
-
-<% form_tag '/security/update' do %>
-<span>
- <label>
- <%= check_box_tag "firewall_after_startup", "true",
@firewall_after_startup,
- :disabled =>
!@xxxxxxxxxxxxxxxxxx[:write] %>
- <span><%=_("Enable Firewall Automatic Starting")%></span>
- </label>
-
- <label>
- <%= check_box_tag "firewall", "true", @firewall,
- :disabled =>
!@xxxxxxxxxxxxxxxxxx[:write] %>
- <span><%=_("Firewall enabled")%></span>
- </label>
-
- <label>
- <%= check_box_tag "ssh", "true", @ssh, :disabled =>
!@xxxxxxxxxxxxxxxxxx[:write] %>
- <span><%=_("SSH login enabled")%></span>
- </label>
-
- <span>
- <hbox>
- <%= submit_tag _("Save"), :onclick=>"Element.show('progress')",
- :disabled => !@xxxxxxxxxxxxxxxxxx[:write], :class =>
'button' -%>
- <a href="/" class="button"><%=_("Back")%></a>
- </hbox>
- </span>
-</span>
-<% end %>
-
-</div>
diff --git a/plugins/securities/config/rails_parent.rb
b/plugins/securities/config/rails_parent.rb
deleted file mode 100644
index 59e7892..0000000
--- a/plugins/securities/config/rails_parent.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-class RailsParent
-
- def RailsParent.parent
- parent = ENV["RAILS_PARENT"]
- unless parent
- parent = File.expand_path(File.join('..','..','..', 'webclient'),
File.dirname(__FILE__))
- unless File.directory?( parent || "" )
- $stderr.puts "Nope: #{parent}\nPlease set RAILS_PARENT environment"
- exit 1
- end
- end
- parent
- end
-
-end
diff --git a/plugins/securities/config/routes.rb
b/plugins/securities/config/routes.rb
deleted file mode 100644
index b6ad4d3..0000000
--- a/plugins/securities/config/routes.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-ActionController::Routing::Routes.draw do |map|
- map.connect "/security", :controller => 'securities', :action => 'create'
- map.connect "/security/show", :controller => 'securities', :action => 'show'
- map.connect "/security/update", :controller => 'securities', :action =>
'update'
-
-end
-
diff --git a/plugins/securities/init.rb b/plugins/securities/init.rb
deleted file mode 100644
index 3c19a74..0000000
--- a/plugins/securities/init.rb
+++ /dev/null
@@ -1 +0,0 @@
-# Include hook code here
diff --git a/plugins/securities/install.rb b/plugins/securities/install.rb
deleted file mode 100644
index f7732d3..0000000
--- a/plugins/securities/install.rb
+++ /dev/null
@@ -1 +0,0 @@
-# Install hook code here
diff --git a/plugins/securities/shortcuts.yml b/plugins/securities/shortcuts.yml
deleted file mode 100644
index 789b4cb..0000000
--- a/plugins/securities/shortcuts.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-main:
- icon: '/icons/yast-security.png'
- url: /security
- groups: [ Security ]
- tags: [ security, access]
- title: Firewall/Ssh
- description: Setting firewall/ssh
-
diff --git a/plugins/securities/tasks/security_tasks.rake
b/plugins/securities/tasks/security_tasks.rake
deleted file mode 100644
index 1568c54..0000000
--- a/plugins/securities/tasks/security_tasks.rake
+++ /dev/null
@@ -1,6 +0,0 @@
-begin
- require 'tasks/webservice'
-rescue LoadError => e
- $stderr.puts "Install rubygem-yast2-webservice-tasks.rpm"
-end
-
diff --git a/plugins/securities/test/security_test.rb
b/plugins/securities/test/security_test.rb
deleted file mode 100644
index 7c70fae..0000000
--- a/plugins/securities/test/security_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class SecurityTest < ActiveSupport::TestCase
- # Replace this with your real tests.
- test "the truth" do
- assert true
- end
-end
diff --git a/plugins/securities/test/test_helper.rb
b/plugins/securities/test/test_helper.rb
deleted file mode 100644
index cf148b8..0000000
--- a/plugins/securities/test/test_helper.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require 'rubygems'
-require 'active_support'
-require 'active_support/test_case'
\ No newline at end of file
diff --git a/plugins/securities/uninstall.rb b/plugins/securities/uninstall.rb
deleted file mode 100644
index 9738333..0000000
--- a/plugins/securities/uninstall.rb
+++ /dev/null
@@ -1 +0,0 @@
-# Uninstall hook code here
diff --git a/plugins/security/README b/plugins/security/README
new file mode 100644
index 0000000..07b5c20
--- /dev/null
+++ b/plugins/security/README
@@ -0,0 +1,7 @@
+Security
+=========
+
+REST interface for handling services.
+
+
+Copyright (c) 2009 Novell, released under the MIT license
diff --git a/plugins/security/Rakefile b/plugins/security/Rakefile
new file mode 100644
index 0000000..ca63e76
--- /dev/null
+++ b/plugins/security/Rakefile
@@ -0,0 +1,10 @@
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+require File.join(File.dirname(__FILE__), 'config', 'rails_parent')
+require File.join(RailsParent.parent, 'config', 'boot')
+require 'tasks/rails'
+
+desc 'Default: run unit tests.'
+task :default => :test
+
diff --git a/plugins/security/app/controllers/security_controller.rb
b/plugins/security/app/controllers/security_controller.rb
new file mode 100644
index 0000000..92c63e6
--- /dev/null
+++ b/plugins/security/app/controllers/security_controller.rb
@@ -0,0 +1,56 @@
+require 'yast/service_resource'
+
+
+class SecurityController < ApplicationController
+ before_filter :login_required, :prepare
+
+ # Initialize GetText and Content-Type.
+ init_gettext "yast_webclient_securities" # textdomain, options(:charset,
:content_type)
+
+ private
+
+ def prepare
+ @client =
YaST::ServiceResource.proxy_for('org.opensuse.yast.system.security')
+ @permissions = @client.permissions
+ end
+
+ public
+
+ # POST /security
+ # POST /security.xml
+ def create
+ @security = @client.find(:one, :from => '/security.xml')
+
+ @firewall_after_startup = "checked" if @security.firewall_after_startup
+ @firewall = "checked" if @security.firewall
+ @ssh = "checked" if @security.ssh
+ end
+
+ # GET /security
+ # GET /security.xml
+ def show
+ end
+
+ def update
+ s = @client.find()
+ s.firewall_after_startup = params[:firewall_after_startup].eql?("true")
+ s.firewall = params[:firewall].eql?("true")
+ s.ssh = params[:ssh].eql?("true")
+
+# response = true
+ begin
+# response = s.save # send to rest-service
+ s.save
+ rescue ActiveResource::ClientError => e
+ flash[:error] = YaST::ServiceResource.error(e)
+# response = false
+ end
+# flash[:notice] = _("Settings have been written.") if response
+
+ # prepare for view
+ @firewall_after_startup = "checked" if s.firewall_after_startup
+ @firewall = "checked" if s.firewall
+ @ssh = "checked" if s.ssh
+ end
+end
+
diff --git a/plugins/security/app/views/security/create.erb
b/plugins/security/app/views/security/create.erb
new file mode 100644
index 0000000..57778f3
--- /dev/null
+++ b/plugins/security/app/views/security/create.erb
@@ -0,0 +1,35 @@
+<div class='plugin-icon'><img src='/icons/yast-security.png'/></div>
+<div class='plugin-content'>
+
+<h2><%=_("Security")%></h2>
+
+<% form_tag '/security/update' do %>
+
+<span>
+ <label>
+ <%= check_box_tag "firewall_after_startup", "true",
@firewall_after_startup,
+ :disabled =>
!@xxxxxxxxxxxxxxxxxx[:write] %>
+ <span><%=_("Enable Firewall Automatic Starting")%></span>
+ </label>
+
+ <label>
+ <%= check_box_tag "firewall", "true", @firewall,
+ :disabled =>
!@xxxxxxxxxxxxxxxxxx[:write] %>
+ <span><%=_("Firewall enabled")%></span>
+ </label>
+
+ <label>
+ <%= check_box_tag "ssh", "true", @ssh, :disabled =>
!@xxxxxxxxxxxxxxxxxx[:write] %>
+ <span><%=_("SSH login enabled")%></span>
+ </label>
+
+ <span>
+ <hbox>
+ <%= submit_tag _("Save"), :onclick=>"Element.show('progress')",
+ :disabled => !@xxxxxxxxxxxxxxxxxx[:write], :class =>
'button' -%>
+ <a href="/" class="button"><%=_("Back")%></a>
+ </hbox>
+ </span>
+</span>
+<% end %>
+</div>
diff --git a/plugins/security/app/views/security/update.erb
b/plugins/security/app/views/security/update.erb
new file mode 100644
index 0000000..b408dd6
--- /dev/null
+++ b/plugins/security/app/views/security/update.erb
@@ -0,0 +1,35 @@
+<div class='plugin-icon'><img src='/icons/yast-security.png'/></div>
+<div class='plugin-content'>
+
+<h2><%=_("Security")%></h2>
+
+<% form_tag '/security/update' do %>
+<span>
+ <label>
+ <%= check_box_tag "firewall_after_startup", "true",
@firewall_after_startup,
+ :disabled =>
!@xxxxxxxxxxxxxxxxxx[:write] %>
+ <span><%=_("Enable Firewall Automatic Starting")%></span>
+ </label>
+
+ <label>
+ <%= check_box_tag "firewall", "true", @firewall,
+ :disabled =>
!@xxxxxxxxxxxxxxxxxx[:write] %>
+ <span><%=_("Firewall enabled")%></span>
+ </label>
+
+ <label>
+ <%= check_box_tag "ssh", "true", @ssh, :disabled =>
!@xxxxxxxxxxxxxxxxxx[:write] %>
+ <span><%=_("SSH login enabled")%></span>
+ </label>
+
+ <span>
+ <hbox>
+ <%= submit_tag _("Save"), :onclick=>"Element.show('progress')",
+ :disabled => !@xxxxxxxxxxxxxxxxxx[:write], :class =>
'button' -%>
+ <a href="/" class="button"><%=_("Back")%></a>
+ </hbox>
+ </span>
+</span>
+<% end %>
+
+</div>
diff --git a/plugins/security/config/rails_parent.rb
b/plugins/security/config/rails_parent.rb
new file mode 100644
index 0000000..59e7892
--- /dev/null
+++ b/plugins/security/config/rails_parent.rb
@@ -0,0 +1,15 @@
+class RailsParent
+
+ def RailsParent.parent
+ parent = ENV["RAILS_PARENT"]
+ unless parent
+ parent = File.expand_path(File.join('..','..','..', 'webclient'),
File.dirname(__FILE__))
+ unless File.directory?( parent || "" )
+ $stderr.puts "Nope: #{parent}\nPlease set RAILS_PARENT environment"
+ exit 1
+ end
+ end
+ parent
+ end
+
+end
diff --git a/plugins/security/init.rb b/plugins/security/init.rb
new file mode 100644
index 0000000..3c19a74
--- /dev/null
+++ b/plugins/security/init.rb
@@ -0,0 +1 @@
+# Include hook code here
diff --git a/plugins/security/install.rb b/plugins/security/install.rb
new file mode 100644
index 0000000..f7732d3
--- /dev/null
+++ b/plugins/security/install.rb
@@ -0,0 +1 @@
+# Install hook code here
diff --git a/plugins/security/shortcuts.yml b/plugins/security/shortcuts.yml
new file mode 100644
index 0000000..789b4cb
--- /dev/null
+++ b/plugins/security/shortcuts.yml
@@ -0,0 +1,8 @@
+main:
+ icon: '/icons/yast-security.png'
+ url: /security
+ groups: [ Security ]
+ tags: [ security, access]
+ title: Firewall/Ssh
+ description: Setting firewall/ssh
+
diff --git a/plugins/security/tasks/security_tasks.rake
b/plugins/security/tasks/security_tasks.rake
new file mode 100644
index 0000000..1568c54
--- /dev/null
+++ b/plugins/security/tasks/security_tasks.rake
@@ -0,0 +1,6 @@
+begin
+ require 'tasks/webservice'
+rescue LoadError => e
+ $stderr.puts "Install rubygem-yast2-webservice-tasks.rpm"
+end
+
diff --git a/plugins/security/test/security_test.rb
b/plugins/security/test/security_test.rb
new file mode 100644
index 0000000..7c70fae
--- /dev/null
+++ b/plugins/security/test/security_test.rb
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class SecurityTest < ActiveSupport::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
diff --git a/plugins/security/test/test_helper.rb
b/plugins/security/test/test_helper.rb
new file mode 100644
index 0000000..cf148b8
--- /dev/null
+++ b/plugins/security/test/test_helper.rb
@@ -0,0 +1,3 @@
+require 'rubygems'
+require 'active_support'
+require 'active_support/test_case'
\ No newline at end of file
diff --git a/plugins/security/uninstall.rb b/plugins/security/uninstall.rb
new file mode 100644
index 0000000..9738333
--- /dev/null
+++ b/plugins/security/uninstall.rb
@@ -0,0 +1 @@
+# Uninstall hook code here
diff --git a/webclient/config/initializers/inflections.rb
b/webclient/config/initializers/inflections.rb
index 09158b8..b36d1d5 100644
--- a/webclient/config/initializers/inflections.rb
+++ b/webclient/config/initializers/inflections.rb
@@ -2,9 +2,9 @@

# Add new inflection rules using the following format
# (all these examples are active by default):
-# Inflector.inflections do |inflect|
+ ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
-# inflect.uncountable %w( fish sheep )
-# end
+ inflect.uncountable %w( security )
+ 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