activesambaldap 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS.en +8 -1
- data/NEWS.ja +8 -1
- data/README.en +9 -6
- data/README.ja +5 -3
- data/Rakefile +47 -1
- data/bin/asl-groupadd +8 -5
- data/bin/asl-groupdel +6 -3
- data/bin/asl-groupmod +15 -11
- data/bin/asl-groupshow +3 -1
- data/bin/asl-passwd +14 -11
- data/bin/asl-populate +19 -14
- data/bin/asl-purge +3 -1
- data/bin/asl-samba-computeradd +8 -6
- data/bin/asl-samba-groupadd +4 -2
- data/bin/asl-samba-groupdel +4 -2
- data/bin/asl-samba-groupmod +8 -7
- data/bin/asl-samba-useradd +8 -6
- data/bin/asl-samba-userdel +4 -2
- data/bin/asl-samba-usermod +15 -8
- data/bin/asl-useradd +50 -49
- data/bin/asl-userdel +17 -8
- data/bin/asl-usermod +54 -49
- data/bin/asl-usershow +3 -1
- data/data/locale/ja/LC_MESSAGES/active-samba-ldap.mo +0 -0
- data/lib/active_samba_ldap.rb +2 -1
- data/lib/active_samba_ldap/account_entry.rb +13 -11
- data/lib/active_samba_ldap/base.rb +26 -25
- data/lib/active_samba_ldap/command.rb +11 -7
- data/lib/active_samba_ldap/configuration.rb +6 -4
- data/lib/active_samba_ldap/entry.rb +5 -4
- data/lib/active_samba_ldap/get_text_support.rb +12 -0
- data/lib/active_samba_ldap/group_entry.rb +4 -3
- data/lib/active_samba_ldap/populate.rb +1 -1
- data/lib/active_samba_ldap/samba_account_entry.rb +4 -4
- data/lib/active_samba_ldap/samba_group_entry.rb +4 -3
- data/lib/active_samba_ldap/user.rb +5 -4
- data/lib/active_samba_ldap/version.rb +1 -1
- data/po/active-samba-ldap.pot +463 -0
- data/po/ja/active-samba-ldap.po +469 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl/scaffold_asl_generator.rb → scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb} +1 -2
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/computer.rb +0 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/dc.rb +0 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/group.rb +0 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/idmap.rb +0 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/ldap.yml +0 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/ou.rb +0 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/samba_controller.rb +0 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/samba_helper.rb +0 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/samba_index.rhtml +0 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/samba_populate.rhtml +0 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/samba_purge.rhtml +0 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/unix_id_pool.rb +0 -0
- data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/user.rb +0 -0
- data/rails/plugin/active_samba_ldap/init.rb +15 -3
- data/test/asl-test-utils.rb +2 -1
- data/test/command.rb +5 -2
- data/test/run-test.rb +6 -2
- data/test/test-unit-ext.rb +4 -2
- data/test/test-unit-ext/backtrace-filter.rb +17 -0
- data/test/test-unit-ext/long-display-for-emacs.rb +25 -0
- data/test/test-unit-ext/priority.rb +20 -7
- data/test/test_asl_groupadd.rb +2 -2
- data/test/test_asl_groupdel.rb +11 -11
- data/test/test_asl_groupmod.rb +7 -6
- data/test/test_asl_groupshow.rb +1 -1
- data/test/test_asl_passwd.rb +11 -10
- data/test/test_asl_populate.rb +6 -6
- data/test/test_asl_purge.rb +1 -1
- data/test/test_asl_useradd.rb +11 -9
- data/test/test_asl_userdel.rb +6 -4
- data/test/test_asl_usermod.rb +8 -8
- data/test/test_asl_usershow.rb +1 -1
- data/test/test_entry.rb +21 -0
- metadata +38 -30
data/test/test_asl_useradd.rb
CHANGED
@@ -9,9 +9,9 @@ class AslUserAddTest < Test::Unit::TestCase
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_run_as_normal_user
|
12
|
-
assert_equal([false, "", "need root authority
|
12
|
+
assert_equal([false, "", _("need root authority.") + "\n"],
|
13
13
|
run_asl_useradd_as_normal_user("user-name"))
|
14
|
-
assert_equal([false, "", "need root authority
|
14
|
+
assert_equal([false, "", _("need root authority.") + "\n"],
|
15
15
|
run_asl_useradd_as_normal_user("computer-name$",
|
16
16
|
"--computer-account"))
|
17
17
|
end
|
@@ -19,7 +19,7 @@ class AslUserAddTest < Test::Unit::TestCase
|
|
19
19
|
def test_exist_user
|
20
20
|
make_dummy_user do |user, password|
|
21
21
|
assert(@user_class.exists?(user.uid))
|
22
|
-
assert_equal([false, "", "user
|
22
|
+
assert_equal([false, "", _("user already exists: %s") % user.uid + "\n"],
|
23
23
|
run_asl_useradd(user.uid))
|
24
24
|
assert(@user_class.exists?(user.uid))
|
25
25
|
end
|
@@ -29,7 +29,8 @@ class AslUserAddTest < Test::Unit::TestCase
|
|
29
29
|
make_dummy_computer do |computer, password|
|
30
30
|
uid = computer.uid
|
31
31
|
assert(@computer_class.exists?(uid))
|
32
|
-
assert_equal([false, "",
|
32
|
+
assert_equal([false, "",
|
33
|
+
_("%s already exists: %s") % [_("computer"), uid] + "\n"],
|
33
34
|
run_asl_useradd(uid, "--computer-account"))
|
34
35
|
assert(@computer_class.exists?(uid))
|
35
36
|
end
|
@@ -250,10 +251,10 @@ class AslUserAddTest < Test::Unit::TestCase
|
|
250
251
|
end
|
251
252
|
end
|
252
253
|
|
253
|
-
def
|
254
|
+
def test_common_name_user
|
254
255
|
ensure_delete_user("test-user") do |uid,|
|
255
256
|
cn = "John Kennedy"
|
256
|
-
assert_asl_useradd_successfully(uid, "--
|
257
|
+
assert_asl_useradd_successfully(uid, "--common-name", cn)
|
257
258
|
user = @user_class.find(uid)
|
258
259
|
assert_equal(uid, user.given_name)
|
259
260
|
assert_equal(uid, user.surname)
|
@@ -261,11 +262,12 @@ class AslUserAddTest < Test::Unit::TestCase
|
|
261
262
|
end
|
262
263
|
end
|
263
264
|
|
264
|
-
def
|
265
|
+
def test_common_name_computer
|
265
266
|
ensure_delete_computer("test-computer$") do |uid,|
|
266
267
|
cn = "A computer"
|
267
|
-
assert_asl_useradd_successfully(uid,
|
268
|
-
"--
|
268
|
+
assert_asl_useradd_successfully(uid,
|
269
|
+
"--computer-account",
|
270
|
+
"--common-name", cn)
|
269
271
|
computer = @computer_class.find(uid)
|
270
272
|
assert_equal(uid, computer.given_name)
|
271
273
|
assert_equal(uid, computer.surname)
|
data/test/test_asl_userdel.rb
CHANGED
@@ -9,12 +9,12 @@ class AslUserDelTest < Test::Unit::TestCase
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_run_as_normal_user
|
12
|
-
assert_equal([false, "", "need root authority
|
12
|
+
assert_equal([false, "", _("need root authority.") + "\n"],
|
13
13
|
run_command_as_normal_user("user-name"))
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_not_exist_user
|
17
|
-
assert_equal([false, "", "user 'not-exist'
|
17
|
+
assert_equal([false, "", _("user doesn't exist: %s") % 'not-exist' + "\n"],
|
18
18
|
run_command("not-exist"))
|
19
19
|
end
|
20
20
|
|
@@ -38,7 +38,8 @@ class AslUserDelTest < Test::Unit::TestCase
|
|
38
38
|
|
39
39
|
def test_user_as_computer
|
40
40
|
make_dummy_user do |user, password|
|
41
|
-
|
41
|
+
message = _("%s doesn't exist: %s") % [_("computer"), "#{user.uid}$"]
|
42
|
+
assert_equal([false, "", "#{message}\n"],
|
42
43
|
run_command(user.uid, "--computer-account"))
|
43
44
|
assert(@user_class.exists?(user.uid))
|
44
45
|
end
|
@@ -46,7 +47,8 @@ class AslUserDelTest < Test::Unit::TestCase
|
|
46
47
|
|
47
48
|
def test_computer_as_user
|
48
49
|
make_dummy_computer do |computer, password|
|
49
|
-
|
50
|
+
message = _("%s doesn't exist: %s") % [_("user"), computer.uid]
|
51
|
+
assert_equal([false, "", "#{message}\n"],
|
50
52
|
run_command(computer.uid))
|
51
53
|
assert(@computer_class.exists?(computer.uid))
|
52
54
|
end
|
data/test/test_asl_usermod.rb
CHANGED
@@ -9,7 +9,7 @@ class AslUserModTest < Test::Unit::TestCase
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_not_exist_user
|
12
|
-
assert_equal([false, "", "user 'not-exist'
|
12
|
+
assert_equal([false, "", _("user doesn't exist: %s") % 'not-exist' + "\n"],
|
13
13
|
run_command("not-exist"))
|
14
14
|
end
|
15
15
|
|
@@ -106,7 +106,7 @@ class AslUserModTest < Test::Unit::TestCase
|
|
106
106
|
new_rid = (2 * Integer(new_uid_number) + 1000).to_s
|
107
107
|
new_samba_sid = old_samba_sid.sub(/#{Regexp.escape(old_rid)}$/, new_rid)
|
108
108
|
|
109
|
-
message = "uid number
|
109
|
+
message = _("uid number already exists: %s") % new_uid_number + "\n"
|
110
110
|
args = ["--uid", new_uid_number]
|
111
111
|
assert_asl_usermod_failed(user.uid, password, message, *args)
|
112
112
|
|
@@ -163,7 +163,7 @@ class AslUserModTest < Test::Unit::TestCase
|
|
163
163
|
|
164
164
|
group.destroy
|
165
165
|
args = ["--gid", new_gid_number]
|
166
|
-
message = "gid number
|
166
|
+
message = _("gid number doesn't exist: %s") % new_gid_number + "\n"
|
167
167
|
assert_asl_usermod_failed(user.uid, password, message, *args)
|
168
168
|
|
169
169
|
new_user = @user_class.find(user.uid)
|
@@ -270,7 +270,7 @@ class AslUserModTest < Test::Unit::TestCase
|
|
270
270
|
:value => user.uid)
|
271
271
|
|
272
272
|
args = ["--groups", new_gid_numbers.join(",")]
|
273
|
-
message = "gid number '
|
273
|
+
message = _("gid number doesn't exist: %s") % new_gid_numbers[0] + "\n"
|
274
274
|
assert_asl_usermod_failed(user.uid, password, message, *args)
|
275
275
|
|
276
276
|
new_user = @user_class.find(user.uid)
|
@@ -299,12 +299,12 @@ class AslUserModTest < Test::Unit::TestCase
|
|
299
299
|
end
|
300
300
|
end
|
301
301
|
|
302
|
-
def
|
302
|
+
def test_common_name
|
303
303
|
make_dummy_user do |user, password|
|
304
304
|
old_cn = user.cn
|
305
305
|
new_cn = "new-#{new_cn}"
|
306
306
|
|
307
|
-
args = ["--
|
307
|
+
args = ["--common-name", new_cn]
|
308
308
|
assert_asl_usermod_successfully(user.uid, password, *args)
|
309
309
|
|
310
310
|
new_user = @user_class.find(user.uid)
|
@@ -523,7 +523,7 @@ class AslUserModTest < Test::Unit::TestCase
|
|
523
523
|
private
|
524
524
|
def assert_asl_usermod_successfully(name, password, *args)
|
525
525
|
args << name
|
526
|
-
assert_equal([true, "Enter your password: \n", ""],
|
526
|
+
assert_equal([true, _("Enter your password: ") + "\n", ""],
|
527
527
|
run_command_as_normal_user(*args) do |input, output|
|
528
528
|
output.puts password
|
529
529
|
output.puts password
|
@@ -532,7 +532,7 @@ class AslUserModTest < Test::Unit::TestCase
|
|
532
532
|
|
533
533
|
def assert_asl_usermod_failed(name, password, message, *args)
|
534
534
|
args << name
|
535
|
-
assert_equal([false, "Enter your password: \n", message],
|
535
|
+
assert_equal([false, _("Enter your password: ") + "\n", message],
|
536
536
|
run_command_as_normal_user(*args) do |input, output|
|
537
537
|
output.puts password
|
538
538
|
output.puts password
|
data/test/test_asl_usershow.rb
CHANGED
@@ -21,7 +21,7 @@ class AslUserShowTest < Test::Unit::TestCase
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_not_exist_user
|
24
|
-
assert_equal([false, "", "user 'not-exist'
|
24
|
+
assert_equal([false, "", _("user doesn't exist: %s") % 'not-exist' + "\n"],
|
25
25
|
run_command("not-exist"))
|
26
26
|
end
|
27
27
|
end
|
data/test/test_entry.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'asl-test-utils'
|
2
|
+
|
3
|
+
class EntryTest < Test::Unit::TestCase
|
4
|
+
include AslTestUtils
|
5
|
+
|
6
|
+
priority :must
|
7
|
+
def test_entry_create
|
8
|
+
assert_created_user("temporary-user1", false)
|
9
|
+
assert_created_user("temporary-user2", true)
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
def assert_created_user(name, stringify)
|
14
|
+
params = {:uid => name}
|
15
|
+
params = params.stringify_keys if stringify
|
16
|
+
user = @user_class.create(params)
|
17
|
+
assert(@user_class.exists?(name))
|
18
|
+
assert_equal(ActiveSambaLdap::Group::DOMAIN_USERS_RID.to_s,
|
19
|
+
user.primary_group.gid_number)
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.4
|
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.4
|
7
|
+
date: 2007-09-16 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
|
@@ -52,6 +52,7 @@ files:
|
|
52
52
|
- bin/asl-userdel
|
53
53
|
- bin/asl-usermod
|
54
54
|
- bin/asl-usershow
|
55
|
+
- data/locale/ja/LC_MESSAGES/active-samba-ldap.mo
|
55
56
|
- lib/active_samba_ldap.rb
|
56
57
|
- lib/active_samba_ldap/account_entry.rb
|
57
58
|
- lib/active_samba_ldap/base.rb
|
@@ -61,6 +62,7 @@ files:
|
|
61
62
|
- lib/active_samba_ldap/configuration.rb
|
62
63
|
- lib/active_samba_ldap/dc.rb
|
63
64
|
- lib/active_samba_ldap/entry.rb
|
65
|
+
- lib/active_samba_ldap/get_text_support.rb
|
64
66
|
- lib/active_samba_ldap/group.rb
|
65
67
|
- lib/active_samba_ldap/group_entry.rb
|
66
68
|
- lib/active_samba_ldap/idmap.rb
|
@@ -76,21 +78,23 @@ files:
|
|
76
78
|
- lib/active_samba_ldap/version.rb
|
77
79
|
- lib/samba/encrypt.rb
|
78
80
|
- misc/rd2html.rb
|
81
|
+
- po/active-samba-ldap.pot
|
82
|
+
- po/ja/active-samba-ldap.po
|
79
83
|
- rails/plugin/active_samba_ldap/README
|
80
|
-
- rails/plugin/active_samba_ldap/generators/
|
81
|
-
- rails/plugin/active_samba_ldap/generators/
|
82
|
-
- rails/plugin/active_samba_ldap/generators/
|
83
|
-
- rails/plugin/active_samba_ldap/generators/
|
84
|
-
- rails/plugin/active_samba_ldap/generators/
|
85
|
-
- rails/plugin/active_samba_ldap/generators/
|
86
|
-
- rails/plugin/active_samba_ldap/generators/
|
87
|
-
- rails/plugin/active_samba_ldap/generators/
|
88
|
-
- rails/plugin/active_samba_ldap/generators/
|
89
|
-
- rails/plugin/active_samba_ldap/generators/
|
90
|
-
- rails/plugin/active_samba_ldap/generators/
|
91
|
-
- rails/plugin/active_samba_ldap/generators/
|
92
|
-
- rails/plugin/active_samba_ldap/generators/
|
93
|
-
- rails/plugin/active_samba_ldap/generators/
|
84
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb
|
85
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/computer.rb
|
86
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/dc.rb
|
87
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/group.rb
|
88
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/idmap.rb
|
89
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/ldap.yml
|
90
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/ou.rb
|
91
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/samba_controller.rb
|
92
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/samba_helper.rb
|
93
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/samba_index.rhtml
|
94
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/samba_populate.rhtml
|
95
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/samba_purge.rhtml
|
96
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/unix_id_pool.rb
|
97
|
+
- rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/user.rb
|
94
98
|
- rails/plugin/active_samba_ldap/init.rb
|
95
99
|
- setup.rb
|
96
100
|
- test/asl-test-utils.rb
|
@@ -99,6 +103,8 @@ files:
|
|
99
103
|
- test/run-test.rb
|
100
104
|
- test/test-unit-ext.rb
|
101
105
|
- test/test-unit-ext/always-show-result.rb
|
106
|
+
- test/test-unit-ext/backtrace-filter.rb
|
107
|
+
- test/test-unit-ext/long-display-for-emacs.rb
|
102
108
|
- test/test-unit-ext/priority.rb
|
103
109
|
- test/test_asl_groupadd.rb
|
104
110
|
- test/test_asl_groupdel.rb
|
@@ -111,26 +117,28 @@ files:
|
|
111
117
|
- test/test_asl_userdel.rb
|
112
118
|
- test/test_asl_usermod.rb
|
113
119
|
- test/test_asl_usershow.rb
|
120
|
+
- test/test_entry.rb
|
114
121
|
- test/test_group.rb
|
115
122
|
- test/test_password.rb
|
116
123
|
- test/test_samba_encrypt.rb
|
117
124
|
- test/test_user_home_directory.rb
|
118
125
|
test_files:
|
119
|
-
- test/test_asl_usershow.rb
|
120
|
-
- test/test_asl_groupdel.rb
|
121
|
-
- test/test_asl_useradd.rb
|
122
|
-
- test/test_samba_encrypt.rb
|
123
|
-
- test/test_asl_populate.rb
|
124
|
-
- test/test_asl_groupmod.rb
|
125
|
-
- test/test_asl_groupshow.rb
|
126
|
-
- test/test_asl_purge.rb
|
127
|
-
- test/test_asl_passwd.rb
|
128
126
|
- test/test_asl_userdel.rb
|
129
|
-
- test/
|
127
|
+
- test/test_asl_groupmod.rb
|
130
128
|
- test/test_asl_usermod.rb
|
131
|
-
- test/
|
129
|
+
- test/test_entry.rb
|
130
|
+
- test/test_asl_useradd.rb
|
132
131
|
- test/test_password.rb
|
132
|
+
- test/test_asl_groupadd.rb
|
133
|
+
- test/test_group.rb
|
134
|
+
- test/test_asl_passwd.rb
|
135
|
+
- test/test_asl_groupdel.rb
|
136
|
+
- test/test_asl_purge.rb
|
133
137
|
- test/test_user_home_directory.rb
|
138
|
+
- test/test_asl_usershow.rb
|
139
|
+
- test/test_asl_groupshow.rb
|
140
|
+
- test/test_asl_populate.rb
|
141
|
+
- test/test_samba_encrypt.rb
|
134
142
|
rdoc_options:
|
135
143
|
- --main
|
136
144
|
- README.txt
|
@@ -167,7 +175,7 @@ dependencies:
|
|
167
175
|
requirements:
|
168
176
|
- - ">="
|
169
177
|
- !ruby/object:Gem::Version
|
170
|
-
version: 0.8.
|
178
|
+
version: 0.8.3.1
|
171
179
|
version:
|
172
180
|
- !ruby/object:Gem::Dependency
|
173
181
|
name: hoe
|
@@ -176,5 +184,5 @@ dependencies:
|
|
176
184
|
requirements:
|
177
185
|
- - ">="
|
178
186
|
- !ruby/object:Gem::Version
|
179
|
-
version: 1.
|
187
|
+
version: 1.3.0
|
180
188
|
version:
|