activesambaldap 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/NEWS.en +11 -3
  2. data/NEWS.ja +13 -2
  3. data/README.en +22 -3
  4. data/README.ja +21 -3
  5. data/Rakefile +38 -3
  6. data/bin/asl-groupadd +1 -1
  7. data/bin/asl-groupdel +3 -3
  8. data/bin/asl-groupmod +3 -3
  9. data/bin/asl-groupshow +1 -1
  10. data/bin/asl-passwd +1 -7
  11. data/bin/asl-populate +10 -10
  12. data/bin/asl-samba-computeradd +3 -3
  13. data/bin/asl-samba-groupadd +1 -1
  14. data/bin/asl-samba-groupdel +3 -3
  15. data/bin/asl-samba-groupmod +3 -3
  16. data/bin/asl-samba-useradd +3 -3
  17. data/bin/asl-samba-userdel +3 -3
  18. data/bin/asl-samba-usermod +3 -3
  19. data/bin/asl-useradd +4 -4
  20. data/bin/asl-userdel +3 -3
  21. data/bin/asl-usermod +3 -3
  22. data/bin/asl-usershow +1 -1
  23. data/lib/active_samba_ldap/{account.rb → account_entry.rb} +6 -1
  24. data/lib/active_samba_ldap/base.rb +8 -0
  25. data/lib/active_samba_ldap/command.rb +2 -0
  26. data/lib/active_samba_ldap/computer.rb +15 -4
  27. data/lib/active_samba_ldap/{computer_account.rb → computer_account_entry.rb} +2 -2
  28. data/lib/active_samba_ldap/configuration.rb +13 -4
  29. data/lib/active_samba_ldap/group.rb +7 -172
  30. data/lib/active_samba_ldap/group_entry.rb +188 -0
  31. data/lib/active_samba_ldap/populate.rb +7 -4
  32. data/lib/active_samba_ldap/{samba_account.rb → samba_account_entry.rb} +34 -9
  33. data/lib/active_samba_ldap/samba_entry.rb +26 -0
  34. data/lib/active_samba_ldap/{samba_group.rb → samba_group_entry.rb} +26 -10
  35. data/lib/active_samba_ldap/user.rb +33 -4
  36. data/lib/active_samba_ldap/{user_account.rb → user_account_entry.rb} +2 -2
  37. data/lib/active_samba_ldap/version.rb +1 -1
  38. data/lib/active_samba_ldap.rb +4 -2
  39. data/rails/plugin/active_samba_ldap/init.rb +1 -1
  40. data/test/asl-test-utils.rb +3 -3
  41. data/test/run-test.rb +2 -0
  42. data/test/test-unit-ext/priority.rb +4 -0
  43. metadata +17 -17
  44. data/lib/active_samba_ldap/configuration_files +0 -2
  45. data/lib/active_samba_ldap/samba_computer.rb +0 -20
  46. data/lib/active_samba_ldap/samba_user.rb +0 -39
data/NEWS.en CHANGED
@@ -2,12 +2,20 @@
2
2
 
3
3
  = NEWS.en
4
4
 
5
- $Id: NEWS.en 70 2007-01-29 03:45:14Z kou $
5
+ $Id: NEWS.en 93 2007-05-26 07:29:06Z kou $
6
6
 
7
- == 0.0.2: 2006-01-29
7
+ == 0.0.3: 2007-05-26
8
+
9
+ * Fixed a typo of Ruby/ActiveLDAP's RubyGems name.
10
+ * Supported Ruby/AtiveLDAP 0.8.2.
11
+ * Integrated ActiveLdap::User, ActiveLdap::Computer and ActiveLdap::Group
12
+ with ActiveLdap::SambaUser, ActiveLdap::SambaComputer and
13
+ ActiveLdap::SambaGroup.
14
+
15
+ == 0.0.2: 2007-01-29
8
16
 
9
17
  * Supported ActiveSupport 1.4.0.
10
- * Fixed typo of Ruby/ActiveLDAP's RubyGems name.
18
+ * Fixed a typo of Ruby/ActiveLDAP's RubyGems name.
11
19
 
12
20
  == 0.0.1: 2006-11-17
13
21
 
data/NEWS.ja CHANGED
@@ -2,9 +2,20 @@
2
2
 
3
3
  = NEWS.ja
4
4
 
5
- $Id: NEWS.ja 70 2007-01-29 03:45:14Z kou $
5
+ $Id: NEWS.ja 93 2007-05-26 07:29:06Z kou $
6
6
 
7
- == 0.0.2: 2006-01-29
7
+ == 0.0.3: 2007-05-26
8
+
9
+ * Ruby/ActiveLDAPのRubyGems名を修正.
10
+ * Ruby/ActiveLDAP 0.8.2対応。
11
+ * ActiveSambaLdap::SambaUser,
12
+ ActiveSambaLdap::SambaComputer,
13
+ ActiveSambaLdap::SambaGroupを廃止し、
14
+ ActiveSambaLdap::User,
15
+ ActiveSambaLdap::Computer,
16
+ ActiveSambaLdap::Groupへ一本化。
17
+
18
+ == 0.0.2: 2007-01-29
8
19
 
9
20
  * ActiveSupport 1.4.0のサポート.
10
21
  * Ruby/ActiveLDAPのRubyGems名を修正.
data/README.en CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  = README.en
4
4
 
5
- $Id: README.en 63 2006-11-21 13:26:46Z kou $
5
+ $Id: README.en 92 2007-05-02 09:35:00Z kou $
6
6
 
7
7
  == Name
8
8
 
@@ -29,13 +29,15 @@ Ruby's.
29
29
 
30
30
  asl-devel@rubyforge.org
31
31
 
32
+ ((<URL:http://rubyforge.org/mailman/listinfo/asl-devel/>))
33
+
32
34
  == Reference manual
33
35
 
34
- ((<URL:http://asl.rubyforge.org/>))
36
+ ((<URL:http://asl.rubyforge.org/activesambaldap/>))
35
37
 
36
38
  == Dependency libraries
37
39
 
38
- * ActiveLdap >= 0.8.0
40
+ * ActiveLdap >= 0.8.2
39
41
 
40
42
  == Usage
41
43
 
@@ -307,4 +309,21 @@ command before invoke your Samba server.
307
309
 
308
310
  == Trouble shootings
309
311
 
312
+ === Groups aren't listed
313
+
314
+ You can list groups by the following command:
315
+
316
+ % net rpc group list --user=USER_NAME
317
+
318
+ If no groups listed by the above command after you execute
319
+ asl-populate, please confirm the following:
320
+
321
+ * Is your samba.schema old?
322
+
323
+ If your sambaSID entry in your samba.schema doesn't have
324
+ the following configuration, your samba.schema may be old.
325
+ Please update your samba.schema.
326
+
327
+ SUBSTR caseExactIA5SubstringsMatch
328
+
310
329
  == Thanks
data/README.ja CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  = README.ja
4
4
 
5
- $Id: README.ja 63 2006-11-21 13:26:46Z kou $
5
+ $Id: README.ja 91 2007-05-02 09:21:55Z kou $
6
6
 
7
7
  == 名前
8
8
 
@@ -26,13 +26,15 @@ Ruby's.
26
26
 
27
27
  asl-devel-ja@rubyforge.org
28
28
 
29
+ ((<URL:http://rubyforge.org/mailman/listinfo/asl-devel-ja/>))
30
+
29
31
  == リファレンスマニュアル
30
32
 
31
- ((<URL:http://asl.rubyforge.org/>))
33
+ ((<URL:http://asl.rubyforge.org/activesambaldap/>))
32
34
 
33
35
  == 依存ライブラリ
34
36
 
35
- * ActiveLdap >= 0.8.0
37
+ * ActiveLdap >= 0.8.2
36
38
 
37
39
  == 使用法
38
40
 
@@ -303,5 +305,21 @@ LDAP管理ユーザのパスワードを設定しておく必要があります
303
305
 
304
306
  == トラブルシューティング
305
307
 
308
+ === グループ一覧がでない
309
+
310
+ 以下のコマンドでグループ一覧を表示する事ができます。
311
+
312
+ % net rpc group list --user=USER_NAME
313
+
314
+ もし、asl-populateした後なのに上記のコマンドでひとつもグルー
315
+ プがでない場合は以下のことを確認してください。
316
+
317
+ * samba.schemaが古くないか
318
+
319
+ sambaSIDのエントリに以下の設定がない場合は古い
320
+ samba.schemaである可能性があります。最新のものに更新して
321
+ ください。
322
+
323
+ SUBSTR caseExactIA5SubstringsMatch
306
324
 
307
325
  == 感謝
data/Rakefile CHANGED
@@ -11,6 +11,7 @@ end
11
11
  _binding = binding
12
12
  eval(File.read("#{base_dir}/lib/active_samba_ldap.rb"), _binding)
13
13
  eval('require_gem_if_need.call("hoe")', _binding)
14
+ required_active_ldap_version = eval('required_active_ldap_version', _binding)
14
15
 
15
16
  manifest = File.join(base_dir, "Manifest.txt")
16
17
  manifest_contents = []
@@ -57,10 +58,9 @@ end
57
58
  ENV["VERSION"] = ActiveSambaLdap::VERSION
58
59
  project = Hoe.new("activesambaldap", ActiveSambaLdap::VERSION) do |p|
59
60
  p.rubyforge_name = "asl"
60
- p.name = p.rubyforge_name if ARGV.include?("public_docs")
61
61
  p.full_name = "ActiveSambaLdap"
62
62
  p.summary = "Samba+LDAP administration tools"
63
- p.extra_deps << ["activeldap", ">= 0.8.0"]
63
+ p.extra_deps << ["ruby-activeldap", required_active_ldap_version]
64
64
  p.email = "kou@cozmixng.org"
65
65
  p.author = "Kouhei Sutou"
66
66
  p.url = "http://asl.rubyforge.org/"
@@ -79,6 +79,7 @@ if ObjectSpace.each_object(Rake::RDocTask) {|rdoc_task|} != 1
79
79
  puts "hoe may be changed"
80
80
  end
81
81
  rdoc_task.main = "README.en"
82
+ rdoc_task.options.delete("-d")
82
83
  rdoc_task.options << "--charset=UTF-8"
83
84
  rdoc_task.template = "kilmer"
84
85
  rdoc_task.rdoc_files -= project.bin_files
@@ -99,5 +100,39 @@ task :tag do
99
100
  version = ActiveSambaLdap::VERSION
100
101
  message = "Released ActiveSambaLdap #{version}!"
101
102
  base = "svn+ssh://#{ENV['USER']}@rubyforge.org/var/svn/asl/"
102
- run("svn copy -m #{message.dump} #{base}/trunk #{base}/tags/#{version}")
103
+ sh 'svn', 'copy', '-m', message, "#{base}trunk", "#{base}tags/#{version}"
104
+ end
105
+
106
+
107
+ # # fix Hoe's incorrect guess.
108
+ # project.spec.executables.clear
109
+ # project.bin_files = project.spec.files.grep(/^bin/)
110
+
111
+ # fix Hoe's install and uninstall task.
112
+ task(:install).instance_variable_get("@actions").clear
113
+ task(:uninstall).instance_variable_get("@actions").clear
114
+
115
+ task :install do
116
+ [
117
+ [project.lib_files, "lib", Hoe::RUBYLIB, 0444],
118
+ [project.bin_files, "bin", File.join(Hoe::PREFIX, 'bin'), 0555]
119
+ ].each do |files, prefix, dest, mode|
120
+ FileUtils.mkdir_p dest unless test ?d, dest
121
+ files.each do |file|
122
+ base = File.dirname(file.sub(/^#{prefix}#{File::SEPARATOR}/, ''))
123
+ _dest = File.join(dest, base)
124
+ FileUtils.mkdir_p _dest unless test ?d, _dest
125
+ install file, _dest, :mode => mode
126
+ end
127
+ end
128
+ end
129
+
130
+ desc 'Uninstall the package.'
131
+ task :uninstall do
132
+ Dir.chdir Hoe::RUBYLIB do
133
+ rm_f project.lib_files.collect {|f| f.sub(/^lib#{File::SEPARATOR}/, '')}
134
+ end
135
+ Dir.chdir File.join(Hoe::PREFIX, 'bin') do
136
+ rm_f project.bin_files.collect {|f| f.sub(/^bin#{File::SEPARATOR}/, '')}
137
+ end
103
138
  end
data/bin/asl-groupadd CHANGED
@@ -33,7 +33,7 @@ end
33
33
 
34
34
  ActiveSambaLdap::Base.establish_connection("update")
35
35
 
36
- class Group < ActiveSambaLdap::SambaGroup
36
+ class Group < ActiveSambaLdap::Group
37
37
  ldap_mapping
38
38
  end
39
39
 
data/bin/asl-groupdel CHANGED
@@ -27,15 +27,15 @@ end
27
27
 
28
28
  ActiveSambaLdap::Base.establish_connection("update")
29
29
 
30
- class Group < ActiveSambaLdap::SambaGroup
30
+ class Group < ActiveSambaLdap::Group
31
31
  ldap_mapping
32
32
  end
33
33
 
34
- class User < ActiveSambaLdap::SambaUser
34
+ class User < ActiveSambaLdap::User
35
35
  ldap_mapping
36
36
  end
37
37
 
38
- class Computer < ActiveSambaLdap::SambaComputer
38
+ class Computer < ActiveSambaLdap::Computer
39
39
  ldap_mapping
40
40
  end
41
41
 
data/bin/asl-groupmod CHANGED
@@ -41,15 +41,15 @@ end
41
41
 
42
42
  ActiveSambaLdap::Base.establish_connection("update")
43
43
 
44
- class Group < ActiveSambaLdap::SambaGroup
44
+ class Group < ActiveSambaLdap::Group
45
45
  ldap_mapping
46
46
  end
47
47
 
48
- class User < ActiveSambaLdap::SambaUser
48
+ class User < ActiveSambaLdap::User
49
49
  ldap_mapping
50
50
  end
51
51
 
52
- class Computer < ActiveSambaLdap::SambaComputer
52
+ class Computer < ActiveSambaLdap::Computer
53
53
  ldap_mapping
54
54
  end
55
55
 
data/bin/asl-groupshow CHANGED
@@ -17,7 +17,7 @@ end
17
17
 
18
18
  ActiveSambaLdap::Base.establish_connection("reference")
19
19
 
20
- class Group < ActiveSambaLdap::SambaGroup
20
+ class Group < ActiveSambaLdap::Group
21
21
  ldap_mapping
22
22
  end
23
23
 
data/bin/asl-passwd CHANGED
@@ -40,13 +40,7 @@ end
40
40
 
41
41
  ActiveSambaLdap::Base.establish_connection("update")
42
42
 
43
- if options.update_samba_password
44
- parent = ActiveSambaLdap::SambaUser
45
- else
46
- parent = ActiveSambaLdap::User
47
- end
48
-
49
- class User < parent
43
+ class User < ActiveSambaLdap::User
50
44
  ldap_mapping
51
45
  end
52
46
 
data/bin/asl-populate CHANGED
@@ -11,16 +11,16 @@ argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options|
11
11
  default = ActiveSambaLdap::Configuration::ClassMethods::Private.new({})
12
12
  options.start_uid = Integer(default.start_uid)
13
13
  options.start_gid = Integer(default.start_gid)
14
- options.administrator = ActiveSambaLdap::SambaUser::DOMAIN_ADMIN_NAME
15
- admin_rid = ActiveSambaLdap::SambaUser::DOMAIN_ADMIN_RID
16
- admins_rid = ActiveSambaLdap::SambaGroup::DOMAIN_ADMINS_RID
17
- guest_rid = ActiveSambaLdap::SambaUser::DOMAIN_GUEST_RID
18
- guests_rid = ActiveSambaLdap::SambaGroup::DOMAIN_GUESTS_RID
19
- options.administrator_uid = ActiveSambaLdap::SambaUser.rid2uid(admin_rid)
20
- options.administrator_gid = ActiveSambaLdap::SambaGroup.rid2gid(admins_rid)
21
- options.guest = ActiveSambaLdap::SambaUser::DOMAIN_GUEST_NAME
22
- options.guest_uid = ActiveSambaLdap::SambaUser.rid2uid(guest_rid)
23
- options.guest_gid = ActiveSambaLdap::SambaGroup.rid2gid(guests_rid)
14
+ options.administrator = ActiveSambaLdap::User::DOMAIN_ADMIN_NAME
15
+ admin_rid = ActiveSambaLdap::User::DOMAIN_ADMIN_RID
16
+ admins_rid = ActiveSambaLdap::Group::DOMAIN_ADMINS_RID
17
+ guest_rid = ActiveSambaLdap::User::DOMAIN_GUEST_RID
18
+ guests_rid = ActiveSambaLdap::Group::DOMAIN_GUESTS_RID
19
+ options.administrator_uid = ActiveSambaLdap::User.rid2uid(admin_rid)
20
+ options.administrator_gid = ActiveSambaLdap::Group.rid2gid(admins_rid)
21
+ options.guest = ActiveSambaLdap::User::DOMAIN_GUEST_NAME
22
+ options.guest_uid = ActiveSambaLdap::User.rid2uid(guest_rid)
23
+ options.guest_gid = ActiveSambaLdap::Group.rid2gid(guests_rid)
24
24
  options.export_ldif = nil
25
25
  options.import_ldif = nil
26
26
 
@@ -36,15 +36,15 @@ ActiveSambaLdap::Base.establish_connection("update")
36
36
 
37
37
 
38
38
  class User < ActiveSambaLdap::User
39
- ldap_mapping
39
+ ldap_mapping :recommended_classes => []
40
40
  end
41
41
 
42
42
  class Computer < ActiveSambaLdap::Computer
43
- ldap_mapping
43
+ ldap_mapping :recommended_classes => []
44
44
  end
45
45
 
46
46
  class Group < ActiveSambaLdap::Group
47
- ldap_mapping
47
+ ldap_mapping :recommended_classes => []
48
48
  end
49
49
 
50
50
  class UnixIdPool < ActiveSambaLdap::UnixIdPool
@@ -23,7 +23,7 @@ end
23
23
  ActiveSambaLdap::Base.establish_connection("update")
24
24
 
25
25
  class Group < ActiveSambaLdap::Group
26
- ldap_mapping
26
+ ldap_mapping :recommended_classes => []
27
27
  end
28
28
 
29
29
  class UnixIdPool < ActiveSambaLdap::UnixIdPool
@@ -23,15 +23,15 @@ end
23
23
  ActiveSambaLdap::Base.establish_connection("update")
24
24
 
25
25
  class Group < ActiveSambaLdap::Group
26
- ldap_mapping
26
+ ldap_mapping :recommended_classes => []
27
27
  end
28
28
 
29
29
  class User < ActiveSambaLdap::User
30
- ldap_mapping
30
+ ldap_mapping :recommended_classes => []
31
31
  end
32
32
 
33
33
  class Computer < ActiveSambaLdap::Computer
34
- ldap_mapping
34
+ ldap_mapping :recommended_classes => []
35
35
  end
36
36
 
37
37
  unless Group.exists?(name)
@@ -31,15 +31,15 @@ end
31
31
  ActiveSambaLdap::Base.establish_connection("update")
32
32
 
33
33
  class Group < ActiveSambaLdap::Group
34
- ldap_mapping
34
+ ldap_mapping :recommended_classes => []
35
35
  end
36
36
 
37
37
  class User < ActiveSambaLdap::User
38
- ldap_mapping
38
+ ldap_mapping :recommended_classes => []
39
39
  end
40
40
 
41
41
  class Computer < ActiveSambaLdap::Computer
42
- ldap_mapping
42
+ ldap_mapping :recommended_classes => []
43
43
  end
44
44
 
45
45
  unless Group.exists?(name)
@@ -36,15 +36,15 @@ ActiveSambaLdap::Base.establish_connection("update")
36
36
 
37
37
 
38
38
  class User < ActiveSambaLdap::User
39
- ldap_mapping
39
+ ldap_mapping :recommended_classes => []
40
40
  end
41
41
 
42
42
  class Computer < ActiveSambaLdap::Computer
43
- ldap_mapping
43
+ ldap_mapping :recommended_classes => []
44
44
  end
45
45
 
46
46
  class Group < ActiveSambaLdap::Group
47
- ldap_mapping
47
+ ldap_mapping :recommended_classes => []
48
48
  end
49
49
 
50
50
  class UnixIdPool < ActiveSambaLdap::UnixIdPool
@@ -23,15 +23,15 @@ end
23
23
  ActiveSambaLdap::Base.establish_connection("update")
24
24
 
25
25
  class User < ActiveSambaLdap::User
26
- ldap_mapping
26
+ ldap_mapping :recommended_classes => []
27
27
  end
28
28
 
29
29
  class Computer < ActiveSambaLdap::Computer
30
- ldap_mapping
30
+ ldap_mapping :recommended_classes => []
31
31
  end
32
32
 
33
33
  class Group < ActiveSambaLdap::Group
34
- ldap_mapping
34
+ ldap_mapping :recommended_classes => []
35
35
  end
36
36
 
37
37
  unless User.exists?(name)
@@ -28,15 +28,15 @@ end
28
28
  ActiveSambaLdap::Base.establish_connection("update")
29
29
 
30
30
  class User < ActiveSambaLdap::User
31
- ldap_mapping
31
+ ldap_mapping :recommended_classes => []
32
32
  end
33
33
 
34
34
  class Computer < ActiveSambaLdap::Computer
35
- ldap_mapping
35
+ ldap_mapping :recommended_classes => []
36
36
  end
37
37
 
38
38
  class Group < ActiveSambaLdap::Group
39
- ldap_mapping
39
+ ldap_mapping :recommended_classes => []
40
40
  end
41
41
 
42
42
  options.computer_account = true if /\$$/ =~ name
data/bin/asl-useradd CHANGED
@@ -72,7 +72,7 @@ argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options|
72
72
  "permission of home directory") {|options.home_directory_mode|}
73
73
  opts.on("--[no-]setup-home-directory",
74
74
  "setup home directory",
75
- "(#{options.setup_home_directory}") {|options.setup_home_directory|}
75
+ "(#{options.setup_home_directory})") {|options.setup_home_directory|}
76
76
  opts.on("-k", "--skel=DIR", "--skeleton-directory=DIR",
77
77
  "skeleton directory") {|options.skeleton_directory|}
78
78
 
@@ -148,15 +148,15 @@ end
148
148
  ActiveSambaLdap::Base.establish_connection("update")
149
149
 
150
150
 
151
- class User < ActiveSambaLdap::SambaUser
151
+ class User < ActiveSambaLdap::User
152
152
  ldap_mapping
153
153
  end
154
154
 
155
- class Computer < ActiveSambaLdap::SambaComputer
155
+ class Computer < ActiveSambaLdap::Computer
156
156
  ldap_mapping
157
157
  end
158
158
 
159
- class Group < ActiveSambaLdap::SambaGroup
159
+ class Group < ActiveSambaLdap::Group
160
160
  ldap_mapping
161
161
  end
162
162
 
data/bin/asl-userdel CHANGED
@@ -41,15 +41,15 @@ end
41
41
 
42
42
  ActiveSambaLdap::Base.establish_connection("update")
43
43
 
44
- class User < ActiveSambaLdap::SambaUser
44
+ class User < ActiveSambaLdap::User
45
45
  ldap_mapping
46
46
  end
47
47
 
48
- class Computer < ActiveSambaLdap::SambaComputer
48
+ class Computer < ActiveSambaLdap::Computer
49
49
  ldap_mapping
50
50
  end
51
51
 
52
- class Group < ActiveSambaLdap::SambaGroup
52
+ class Group < ActiveSambaLdap::Group
53
53
  ldap_mapping
54
54
  end
55
55
 
data/bin/asl-usermod CHANGED
@@ -141,15 +141,15 @@ end
141
141
 
142
142
  ActiveSambaLdap::Base.establish_connection("update")
143
143
 
144
- class User < ActiveSambaLdap::SambaUser
144
+ class User < ActiveSambaLdap::User
145
145
  ldap_mapping
146
146
  end
147
147
 
148
- class Computer < ActiveSambaLdap::SambaComputer
148
+ class Computer < ActiveSambaLdap::Computer
149
149
  ldap_mapping
150
150
  end
151
151
 
152
- class Group < ActiveSambaLdap::SambaGroup
152
+ class Group < ActiveSambaLdap::Group
153
153
  ldap_mapping
154
154
  end
155
155
 
data/bin/asl-usershow CHANGED
@@ -17,7 +17,7 @@ end
17
17
 
18
18
  ActiveSambaLdap::Base.establish_connection("reference")
19
19
 
20
- class User < ActiveSambaLdap::SambaUser
20
+ class User < ActiveSambaLdap::User
21
21
  ldap_mapping
22
22
  end
23
23
 
@@ -5,7 +5,7 @@ require 'English'
5
5
  require 'active_samba_ldap/base'
6
6
 
7
7
  module ActiveSambaLdap
8
- module Account
8
+ module AccountEntry
9
9
  NAME_RE_SRC = "(?!\\d)[\\w @_\\-\\.]+"
10
10
 
11
11
  def self.included(base)
@@ -40,6 +40,7 @@ module ActiveSambaLdap
40
40
  :groups_many => "memberUid",
41
41
  :prefix => default_prefix,
42
42
  :classes => default_classes,
43
+ :recommended_classes => default_recommended_classes,
43
44
  }
44
45
  end
45
46
 
@@ -51,6 +52,10 @@ module ActiveSambaLdap
51
52
  ["top", "inetOrgPerson", "posixAccount"]
52
53
  end
53
54
 
55
+ def default_recommended_classes
56
+ []
57
+ end
58
+
54
59
  def primary_group_options(options)
55
60
  {
56
61
  :class => options[:primary_group_class],
@@ -103,6 +103,14 @@ module ActiveSambaLdap
103
103
  end
104
104
  end
105
105
 
106
+ class NotSambaAavialableError < Error
107
+ attr_reader :object
108
+ def initialize(object)
109
+ @object = object
110
+ super("#{@object.inspect} is not Samba available")
111
+ end
112
+ end
113
+
106
114
  class Base < ActiveLdap::Base
107
115
  include Reloadable
108
116
 
@@ -1,6 +1,8 @@
1
1
  require 'optparse'
2
2
  require 'ostruct'
3
3
 
4
+ require 'active_samba_ldap'
5
+
4
6
  module ActiveSambaLdap
5
7
  module Command
6
8
  module_function
@@ -1,13 +1,24 @@
1
- require 'active_samba_ldap/account'
2
- require 'active_samba_ldap/computer_account'
1
+ require 'active_samba_ldap/base'
2
+ require 'active_samba_ldap/entry'
3
+ require 'active_samba_ldap/samba_entry'
4
+ require 'active_samba_ldap/account_entry'
5
+ require 'active_samba_ldap/computer_account_entry'
6
+ require 'active_samba_ldap/samba_account_entry'
3
7
 
4
8
  module ActiveSambaLdap
5
9
  class Computer < Base
6
10
  include Reloadable
7
11
 
8
12
  include Entry
13
+ include SambaEntry
9
14
 
10
- include Account
11
- include ComputerAccount
15
+ include AccountEntry
16
+ include ComputerAccountEntry
17
+ include SambaAccountEntry
18
+
19
+ private
20
+ def default_account_flags
21
+ "[W]"
22
+ end
12
23
  end
13
24
  end
@@ -1,6 +1,6 @@
1
1
  module ActiveSambaLdap
2
- module ComputerAccount
3
- NAME_RE = /\A#{Account::NAME_RE_SRC}\$\z/
2
+ module ComputerAccountEntry
3
+ NAME_RE = /\A#{AccountEntry::NAME_RE_SRC}\$\z/
4
4
 
5
5
  def self.included(base)
6
6
  super
@@ -48,6 +48,15 @@ module ActiveSambaLdap
48
48
  end
49
49
  end
50
50
 
51
+ def remove_connection_related_configuration(config)
52
+ target_keys = Private::VARIABLES.collect do |name|
53
+ name.to_sym
54
+ end - ActiveLdap::Adapter::Base::VALID_ADAPTER_CONFIGURATION_KEYS
55
+ super(config).reject do |key, value|
56
+ target_keys.include?(key)
57
+ end
58
+ end
59
+
51
60
  def merge_configuration(config)
52
61
  config = config.symbolize_keys
53
62
  config = (configurations["common"] || {}).symbolize_keys.merge(config)
@@ -220,13 +229,13 @@ module ActiveSambaLdap
220
229
  end
221
230
 
222
231
  def default_user_gid
223
- rid = ActiveSambaLdap::SambaGroup::DOMAIN_USERS_RID
224
- ActiveSambaLdap::SambaGroup.rid2gid(rid)
232
+ rid = ActiveSambaLdap::Group::DOMAIN_USERS_RID
233
+ ActiveSambaLdap::Group.rid2gid(rid)
225
234
  end
226
235
 
227
236
  def default_computer_gid
228
- rid = ActiveSambaLdap::SambaGroup::DOMAIN_COMPUTERS_RID
229
- ActiveSambaLdap::SambaGroup.rid2gid(rid)
237
+ rid = ActiveSambaLdap::Group::DOMAIN_COMPUTERS_RID
238
+ ActiveSambaLdap::Group.rid2gid(rid)
230
239
  end
231
240
 
232
241
  def skeleton_directory