test_dummy.rb
1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require 'SystemDataBackend'
require 'SystemDataBackendLdap'
backend = SystemDataBackend.new(
SystemDataBackendLdap.new('host.one.virtual', 389, 'dc=weird-web-workers,dc=org')
)
backend.users.each do |user|
puts 'user: '+user.name+','+user.uid+','+user.gid+','+user.home
end
puts
backend.groups.each do |group|
members = backend.usersInGroup(group)
puts 'group: '+group.name+','+group.gid
puts ' members:'
group.members.each do |name|
print ' ' + name + ': '
print members[name].uid + ', ' + members[name].home if members[name]
puts
end
puts
end
backend.sites.each do |site|
puts 'site: ' + site.name
puts ' MailAliases:'
backend.mailAliasesBySite(site).each{|account| puts ' ' + account.mail}
puts
puts ' MailAccounts:'
backend.mailAccountsBySite(site).each{|account| puts ' ' + account.mail}
puts
end
backend.mailAliases.each do |mailAlias|
puts 'mailAlias: '+mailAlias.mail.inspect+','+mailAlias.maildrop.inspect
end
puts
backend.mailAccounts.each do |mailAccount|
puts 'mailAccount: '+mailAccount.mail.inspect+','+mailAccount.mailbox.inspect
end