activesambaldap 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS.en +11 -3
- data/NEWS.ja +13 -2
- data/README.en +22 -3
- data/README.ja +21 -3
- data/Rakefile +38 -3
- data/bin/asl-groupadd +1 -1
- data/bin/asl-groupdel +3 -3
- data/bin/asl-groupmod +3 -3
- data/bin/asl-groupshow +1 -1
- data/bin/asl-passwd +1 -7
- data/bin/asl-populate +10 -10
- data/bin/asl-samba-computeradd +3 -3
- data/bin/asl-samba-groupadd +1 -1
- data/bin/asl-samba-groupdel +3 -3
- data/bin/asl-samba-groupmod +3 -3
- data/bin/asl-samba-useradd +3 -3
- data/bin/asl-samba-userdel +3 -3
- data/bin/asl-samba-usermod +3 -3
- data/bin/asl-useradd +4 -4
- data/bin/asl-userdel +3 -3
- data/bin/asl-usermod +3 -3
- data/bin/asl-usershow +1 -1
- data/lib/active_samba_ldap/{account.rb → account_entry.rb} +6 -1
- data/lib/active_samba_ldap/base.rb +8 -0
- data/lib/active_samba_ldap/command.rb +2 -0
- data/lib/active_samba_ldap/computer.rb +15 -4
- data/lib/active_samba_ldap/{computer_account.rb → computer_account_entry.rb} +2 -2
- data/lib/active_samba_ldap/configuration.rb +13 -4
- data/lib/active_samba_ldap/group.rb +7 -172
- data/lib/active_samba_ldap/group_entry.rb +188 -0
- data/lib/active_samba_ldap/populate.rb +7 -4
- data/lib/active_samba_ldap/{samba_account.rb → samba_account_entry.rb} +34 -9
- data/lib/active_samba_ldap/samba_entry.rb +26 -0
- data/lib/active_samba_ldap/{samba_group.rb → samba_group_entry.rb} +26 -10
- data/lib/active_samba_ldap/user.rb +33 -4
- data/lib/active_samba_ldap/{user_account.rb → user_account_entry.rb} +2 -2
- data/lib/active_samba_ldap/version.rb +1 -1
- data/lib/active_samba_ldap.rb +4 -2
- data/rails/plugin/active_samba_ldap/init.rb +1 -1
- data/test/asl-test-utils.rb +3 -3
- data/test/run-test.rb +2 -0
- data/test/test-unit-ext/priority.rb +4 -0
- metadata +17 -17
- data/lib/active_samba_ldap/configuration_files +0 -2
- data/lib/active_samba_ldap/samba_computer.rb +0 -20
- data/lib/active_samba_ldap/samba_user.rb +0 -39
@@ -1,14 +1,43 @@
|
|
1
|
+
require 'active_samba_ldap/base'
|
1
2
|
require 'active_samba_ldap/entry'
|
2
|
-
require 'active_samba_ldap/
|
3
|
-
require 'active_samba_ldap/
|
3
|
+
require 'active_samba_ldap/samba_entry'
|
4
|
+
require 'active_samba_ldap/account_entry'
|
5
|
+
require 'active_samba_ldap/user_account_entry'
|
6
|
+
require 'active_samba_ldap/samba_account_entry'
|
4
7
|
|
5
8
|
module ActiveSambaLdap
|
6
9
|
class User < Base
|
7
10
|
include Reloadable
|
8
11
|
|
9
12
|
include Entry
|
13
|
+
include SambaEntry
|
10
14
|
|
11
|
-
include
|
12
|
-
include
|
15
|
+
include AccountEntry
|
16
|
+
include UserAccountEntry
|
17
|
+
include SambaAccountEntry
|
18
|
+
|
19
|
+
def fill_default_values(options={})
|
20
|
+
result = super
|
21
|
+
return result unless samba_available?
|
22
|
+
|
23
|
+
subst = Proc.new do |key|
|
24
|
+
value = options[key]
|
25
|
+
if value
|
26
|
+
substitute_template(value)
|
27
|
+
else
|
28
|
+
substituted_value(key)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
self.samba_home_path ||= subst[:user_home_unc]
|
33
|
+
self.samba_home_drive ||= subst[:user_home_drive].sub(/([^:])$/, "\\1:")
|
34
|
+
self.samba_profile_path ||= subst[:user_profile]
|
35
|
+
self.samba_logon_script ||= subst[:user_logon_script]
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
def default_account_flags
|
40
|
+
"[UH]"
|
41
|
+
end
|
13
42
|
end
|
14
43
|
end
|
data/lib/active_samba_ldap.rb
CHANGED
@@ -3,12 +3,14 @@ require_gem_if_need = Proc.new do |library_name, gem_name, *options|
|
|
3
3
|
require library_name
|
4
4
|
rescue LoadError
|
5
5
|
require 'rubygems'
|
6
|
-
|
6
|
+
gem gem_name, *options
|
7
7
|
require library_name
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
|
11
|
+
required_active_ldap_version = ">= 0.8.2"
|
12
|
+
require_gem_if_need.call("active_ldap", "ruby-activeldap",
|
13
|
+
required_active_ldap_version)
|
12
14
|
|
13
15
|
if Dependencies.respond_to?(:load_paths)
|
14
16
|
Dependencies.load_paths << File.expand_path(File.dirname(__FILE__))
|
data/test/asl-test-utils.rb
CHANGED
@@ -85,11 +85,11 @@ module AslTestUtils
|
|
85
85
|
module TemporaryEntry
|
86
86
|
def setup
|
87
87
|
super
|
88
|
-
@user_class = Class.new(ActiveSambaLdap::
|
88
|
+
@user_class = Class.new(ActiveSambaLdap::User)
|
89
89
|
@user_class.ldap_mapping
|
90
|
-
@computer_class = Class.new(ActiveSambaLdap::
|
90
|
+
@computer_class = Class.new(ActiveSambaLdap::Computer)
|
91
91
|
@computer_class.ldap_mapping
|
92
|
-
@group_class = Class.new(ActiveSambaLdap::
|
92
|
+
@group_class = Class.new(ActiveSambaLdap::Group)
|
93
93
|
@group_class.ldap_mapping
|
94
94
|
|
95
95
|
@user_class.set_associated_class(:primary_group, @group_class)
|
data/test/run-test.rb
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: activesambaldap
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.0.3
|
7
|
+
date: 2007-05-26 00:00:00 +09:00
|
8
8
|
summary: ActiveSambaLdap is a library and a management tool for Samba + LDAP environment.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -53,27 +53,26 @@ files:
|
|
53
53
|
- bin/asl-usermod
|
54
54
|
- bin/asl-usershow
|
55
55
|
- lib/active_samba_ldap.rb
|
56
|
-
- lib/active_samba_ldap/
|
56
|
+
- lib/active_samba_ldap/account_entry.rb
|
57
57
|
- lib/active_samba_ldap/base.rb
|
58
58
|
- lib/active_samba_ldap/command.rb
|
59
59
|
- lib/active_samba_ldap/computer.rb
|
60
|
-
- lib/active_samba_ldap/
|
60
|
+
- lib/active_samba_ldap/computer_account_entry.rb
|
61
61
|
- lib/active_samba_ldap/configuration.rb
|
62
|
-
- lib/active_samba_ldap/configuration_files
|
63
62
|
- lib/active_samba_ldap/dc.rb
|
64
63
|
- lib/active_samba_ldap/entry.rb
|
65
64
|
- lib/active_samba_ldap/group.rb
|
65
|
+
- lib/active_samba_ldap/group_entry.rb
|
66
66
|
- lib/active_samba_ldap/idmap.rb
|
67
67
|
- lib/active_samba_ldap/ou.rb
|
68
68
|
- lib/active_samba_ldap/populate.rb
|
69
69
|
- lib/active_samba_ldap/reloadable.rb
|
70
|
-
- lib/active_samba_ldap/
|
71
|
-
- lib/active_samba_ldap/
|
72
|
-
- lib/active_samba_ldap/
|
73
|
-
- lib/active_samba_ldap/samba_user.rb
|
70
|
+
- lib/active_samba_ldap/samba_account_entry.rb
|
71
|
+
- lib/active_samba_ldap/samba_entry.rb
|
72
|
+
- lib/active_samba_ldap/samba_group_entry.rb
|
74
73
|
- lib/active_samba_ldap/unix_id_pool.rb
|
75
74
|
- lib/active_samba_ldap/user.rb
|
76
|
-
- lib/active_samba_ldap/
|
75
|
+
- lib/active_samba_ldap/user_account_entry.rb
|
77
76
|
- lib/active_samba_ldap/version.rb
|
78
77
|
- lib/samba/encrypt.rb
|
79
78
|
- misc/rd2html.rb
|
@@ -124,16 +123,17 @@ test_files:
|
|
124
123
|
- test/test_asl_populate.rb
|
125
124
|
- test/test_asl_groupmod.rb
|
126
125
|
- test/test_asl_groupshow.rb
|
127
|
-
- test/
|
126
|
+
- test/test_asl_purge.rb
|
128
127
|
- test/test_asl_passwd.rb
|
129
128
|
- test/test_asl_userdel.rb
|
130
129
|
- test/test_asl_groupadd.rb
|
131
130
|
- test/test_asl_usermod.rb
|
132
|
-
- test/test_asl_purge.rb
|
133
131
|
- test/test_group.rb
|
132
|
+
- test/test_password.rb
|
134
133
|
- test/test_user_home_directory.rb
|
135
|
-
rdoc_options:
|
136
|
-
|
134
|
+
rdoc_options:
|
135
|
+
- --main
|
136
|
+
- README.txt
|
137
137
|
extra_rdoc_files: []
|
138
138
|
|
139
139
|
executables:
|
@@ -161,13 +161,13 @@ requirements: []
|
|
161
161
|
|
162
162
|
dependencies:
|
163
163
|
- !ruby/object:Gem::Dependency
|
164
|
-
name: activeldap
|
164
|
+
name: ruby-activeldap
|
165
165
|
version_requirement:
|
166
166
|
version_requirements: !ruby/object:Gem::Version::Requirement
|
167
167
|
requirements:
|
168
168
|
- - ">="
|
169
169
|
- !ruby/object:Gem::Version
|
170
|
-
version: 0.8.
|
170
|
+
version: 0.8.2
|
171
171
|
version:
|
172
172
|
- !ruby/object:Gem::Dependency
|
173
173
|
name: hoe
|
@@ -176,5 +176,5 @@ dependencies:
|
|
176
176
|
requirements:
|
177
177
|
- - ">="
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version: 1.1
|
179
|
+
version: 1.2.1
|
180
180
|
version:
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'active_samba_ldap/account'
|
2
|
-
require 'active_samba_ldap/user_account'
|
3
|
-
require 'active_samba_ldap/samba_account'
|
4
|
-
|
5
|
-
module ActiveSambaLdap
|
6
|
-
class SambaComputer < Base
|
7
|
-
include Reloadable
|
8
|
-
|
9
|
-
include Entry
|
10
|
-
|
11
|
-
include Account
|
12
|
-
include ComputerAccount
|
13
|
-
include SambaAccount
|
14
|
-
|
15
|
-
private
|
16
|
-
def default_account_flags
|
17
|
-
"[W]"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require 'active_samba_ldap/entry'
|
2
|
-
require 'active_samba_ldap/account'
|
3
|
-
require 'active_samba_ldap/user_account'
|
4
|
-
require 'active_samba_ldap/samba_account'
|
5
|
-
|
6
|
-
module ActiveSambaLdap
|
7
|
-
class SambaUser < Base
|
8
|
-
include Reloadable
|
9
|
-
|
10
|
-
include Entry
|
11
|
-
|
12
|
-
include Account
|
13
|
-
include UserAccount
|
14
|
-
include SambaAccount
|
15
|
-
|
16
|
-
def fill_default_values(options={})
|
17
|
-
super
|
18
|
-
|
19
|
-
subst = Proc.new do |key|
|
20
|
-
value = options[key]
|
21
|
-
if value
|
22
|
-
substitute_template(value)
|
23
|
-
else
|
24
|
-
substituted_value(key)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
self.samba_home_path ||= subst[:user_home_unc]
|
29
|
-
self.samba_home_drive ||= subst[:user_home_drive].sub(/([^:])$/, "\\1:")
|
30
|
-
self.samba_profile_path ||= subst[:user_profile]
|
31
|
-
self.samba_logon_script ||= subst[:user_logon_script]
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
def default_account_flags
|
36
|
-
"[UH]"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|