This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "YaST web service".
The branch, master has been updated
via aaba41ea3119b6f6239edc62072ddcb43c675f5d (commit)
via 8ac7df84693076654f74f1e81b993a9f348c6a8b (commit)
from 51a352ef21eb051f8577f2ab831077b0c213eefa (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit aaba41ea3119b6f6239edc62072ddcb43c675f5d
Author: Jiri Suchomel
Date: Thu Jun 25 21:43:20 2009 +0200
new YaPI-based policy file, starting to move to dbus
commit 8ac7df84693076654f74f1e81b993a9f348c6a8b
Author: Jiri Suchomel
Date: Thu Jun 25 21:40:17 2009 +0200
new YaPI-based policy file, starting to move to dbus
-----------------------------------------------------------------------
Summary of changes and diff:
plugins/users/app/controllers/users_controller.rb | 29 +++++++++++++-----
.../org.opensuse.yast.modules.yapi.users.policy | 31 ++++++++++++++++++++
2 files changed, 52 insertions(+), 8 deletions(-)
create mode 100644 plugins/users/package/org.opensuse.yast.modules.yapi.users.policy
diff --git a/plugins/users/app/controllers/users_controller.rb b/plugins/users/app/controllers/users_controller.rb
index 372002c..a376e39 100644
--- a/plugins/users/app/controllers/users_controller.rb
+++ b/plugins/users/app/controllers/users_controller.rb
@@ -1,5 +1,8 @@
require "scr"
+# import YastService class FIXME move into the model...
+require "yast_service"
+
include ApplicationHelper
class UsersController < ApplicationController
@@ -18,14 +21,24 @@ class UsersController < ApplicationController
def get_user_list
- ret = @scr.execute(["/sbin/yast2", "users", "list"])
- lines = ret[:stderr].split "\n"
- @users = []
- lines.each do |s|
- user = User.new
- user.login_name = s.rstrip
- @users << user
- end
+ @users = []
+ # FIXME see convert_map in samba_share.rb
+ parameters = {
+ "type" => [ "s", "local" ],
+ "index" => [ "s", "uid" ]
+ }
+ users_map = YastService.Call("YaPI::USERS::UsersGet", parameters)
+ if users_map.nil?
+ puts "something wrong happened -------------------------------------"
+ else
+ users_map.each do |key, val|
+ user = User.new
+ # FIXME adapt the model to the return map
+ user.login_name = val["uid"]
+ user.full_name = val["cn"]
+ @users << user
+ end
+ end
end
def get_user (id)
diff --git a/plugins/users/package/org.opensuse.yast.modules.yapi.users.policy b/plugins/users/package/org.opensuse.yast.modules.yapi.users.policy
new file mode 100644
index 0000000..8353be0
--- /dev/null
+++ b/plugins/users/package/org.opensuse.yast.modules.yapi.users.policy
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
+
+<policyconfig>
+ <vendor>Novell, Inc.</vendor>
+ http://www.novell.com
+
+ <action id="org.opensuse.yast.modules.yapi.users.usersget">
+ <description>Get list of users.</description>
+ <message>System policy prevents the Yast DBus service from reading users.</message>
+
+ <defaults>
+ no
+ no
+ auth_admin_keep_session
+ </defaults>
+ </action>
+
+ <action id="org.opensuse.yast.modules.yapi.users.userget">
+ <description>Get the information about given user.</description>
+ <message>System policy prevents the Yast DBus service from reading user info.</message>
+
+ <defaults>
+ no
+ no
+ auth_admin_keep_session
+ </defaults>
+ </action>
+</policyconfig>
+
hooks/post-receive
--
YaST web service
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org