activesambaldap 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/NEWS.en +8 -1
  2. data/NEWS.ja +8 -1
  3. data/README.en +9 -6
  4. data/README.ja +5 -3
  5. data/Rakefile +47 -1
  6. data/bin/asl-groupadd +8 -5
  7. data/bin/asl-groupdel +6 -3
  8. data/bin/asl-groupmod +15 -11
  9. data/bin/asl-groupshow +3 -1
  10. data/bin/asl-passwd +14 -11
  11. data/bin/asl-populate +19 -14
  12. data/bin/asl-purge +3 -1
  13. data/bin/asl-samba-computeradd +8 -6
  14. data/bin/asl-samba-groupadd +4 -2
  15. data/bin/asl-samba-groupdel +4 -2
  16. data/bin/asl-samba-groupmod +8 -7
  17. data/bin/asl-samba-useradd +8 -6
  18. data/bin/asl-samba-userdel +4 -2
  19. data/bin/asl-samba-usermod +15 -8
  20. data/bin/asl-useradd +50 -49
  21. data/bin/asl-userdel +17 -8
  22. data/bin/asl-usermod +54 -49
  23. data/bin/asl-usershow +3 -1
  24. data/data/locale/ja/LC_MESSAGES/active-samba-ldap.mo +0 -0
  25. data/lib/active_samba_ldap.rb +2 -1
  26. data/lib/active_samba_ldap/account_entry.rb +13 -11
  27. data/lib/active_samba_ldap/base.rb +26 -25
  28. data/lib/active_samba_ldap/command.rb +11 -7
  29. data/lib/active_samba_ldap/configuration.rb +6 -4
  30. data/lib/active_samba_ldap/entry.rb +5 -4
  31. data/lib/active_samba_ldap/get_text_support.rb +12 -0
  32. data/lib/active_samba_ldap/group_entry.rb +4 -3
  33. data/lib/active_samba_ldap/populate.rb +1 -1
  34. data/lib/active_samba_ldap/samba_account_entry.rb +4 -4
  35. data/lib/active_samba_ldap/samba_group_entry.rb +4 -3
  36. data/lib/active_samba_ldap/user.rb +5 -4
  37. data/lib/active_samba_ldap/version.rb +1 -1
  38. data/po/active-samba-ldap.pot +463 -0
  39. data/po/ja/active-samba-ldap.po +469 -0
  40. 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
  41. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/computer.rb +0 -0
  42. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/dc.rb +0 -0
  43. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/group.rb +0 -0
  44. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/idmap.rb +0 -0
  45. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/ldap.yml +0 -0
  46. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/ou.rb +0 -0
  47. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/samba_controller.rb +0 -0
  48. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/samba_helper.rb +0 -0
  49. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/samba_index.rhtml +0 -0
  50. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/samba_populate.rhtml +0 -0
  51. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/samba_purge.rhtml +0 -0
  52. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/unix_id_pool.rb +0 -0
  53. data/rails/plugin/active_samba_ldap/generators/{scaffold_asl → scaffold_active_samba_ldap}/templates/user.rb +0 -0
  54. data/rails/plugin/active_samba_ldap/init.rb +15 -3
  55. data/test/asl-test-utils.rb +2 -1
  56. data/test/command.rb +5 -2
  57. data/test/run-test.rb +6 -2
  58. data/test/test-unit-ext.rb +4 -2
  59. data/test/test-unit-ext/backtrace-filter.rb +17 -0
  60. data/test/test-unit-ext/long-display-for-emacs.rb +25 -0
  61. data/test/test-unit-ext/priority.rb +20 -7
  62. data/test/test_asl_groupadd.rb +2 -2
  63. data/test/test_asl_groupdel.rb +11 -11
  64. data/test/test_asl_groupmod.rb +7 -6
  65. data/test/test_asl_groupshow.rb +1 -1
  66. data/test/test_asl_passwd.rb +11 -10
  67. data/test/test_asl_populate.rb +6 -6
  68. data/test/test_asl_purge.rb +1 -1
  69. data/test/test_asl_useradd.rb +11 -9
  70. data/test/test_asl_userdel.rb +6 -4
  71. data/test/test_asl_usermod.rb +8 -8
  72. data/test/test_asl_usershow.rb +1 -1
  73. data/test/test_entry.rb +21 -0
  74. metadata +38 -30
data/NEWS.en CHANGED
@@ -2,7 +2,14 @@
2
2
 
3
3
  = NEWS.en
4
4
 
5
- $Id: NEWS.en 93 2007-05-26 07:29:06Z kou $
5
+ $Id: NEWS.en 119 2007-09-16 13:14:27Z kou $
6
+
7
+ == 0.0.4: 2007-09-16
8
+
9
+ * Supported Ruby/ActiveLdap 0.8.3.1.
10
+ * Supported Ruby-GetText-Package.
11
+ * scaffold_asl -> scaffold_active_samba_ldap
12
+ * Improved Rails support.
6
13
 
7
14
  == 0.0.3: 2007-05-26
8
15
 
data/NEWS.ja CHANGED
@@ -2,7 +2,14 @@
2
2
 
3
3
  = NEWS.ja
4
4
 
5
- $Id: NEWS.ja 93 2007-05-26 07:29:06Z kou $
5
+ $Id: NEWS.ja 119 2007-09-16 13:14:27Z kou $
6
+
7
+ == 0.0.4: 2007-09-16
8
+
9
+ * Ruby/ActiveLdap 0.8.3.1対応。
10
+ * Ruby-GetText-Package対応。
11
+ * scaffold_asl -> scaffold_active_samba_ldap
12
+ * Rails対応を強化。
6
13
 
7
14
  == 0.0.3: 2007-05-26
8
15
 
data/README.en CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  = README.en
4
4
 
5
- $Id: README.en 92 2007-05-02 09:35:00Z kou $
5
+ $Id: README.en 120 2007-09-16 13:17:37Z kou $
6
6
 
7
7
  == Name
8
8
 
@@ -37,7 +37,7 @@ asl-devel@rubyforge.org
37
37
 
38
38
  == Dependency libraries
39
39
 
40
- * ActiveLdap >= 0.8.2
40
+ * ActiveLdap >= 0.8.3.1
41
41
 
42
42
  == Usage
43
43
 
@@ -50,11 +50,12 @@ the following URL because the URL is for trunk.
50
50
 
51
51
  Next, scaffold the environment of ActiveSambaLdap for Rails.
52
52
 
53
- % script/generate scaffold_asl
53
+ % script/generate scaffold_active_samba_ldap
54
54
 
55
- Modify config/ldap.yml generated by scaffold_asl to adapt
56
- to your environment. See "Options in configuration file"
57
- section to find available options.
55
+ Modify config/ldap.yml generated by
56
+ scaffold_active_samba_ldap to adapt to your environment. See
57
+ "Options in configuration file" section to find available
58
+ options.
58
59
 
59
60
  ==== Populate
60
61
 
@@ -327,3 +328,5 @@ asl-populate, please confirm the following:
327
328
  SUBSTR caseExactIA5SubstringsMatch
328
329
 
329
330
  == Thanks
331
+
332
+ * Henrik Krög: He reported some bugs.
data/README.ja CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  = README.ja
4
4
 
5
- $Id: README.ja 91 2007-05-02 09:21:55Z kou $
5
+ $Id: README.ja 120 2007-09-16 13:17:37Z kou $
6
6
 
7
7
  == 名前
8
8
 
@@ -34,7 +34,7 @@ asl-devel-ja@rubyforge.org
34
34
 
35
35
  == 依存ライブラリ
36
36
 
37
- * ActiveLdap >= 0.8.2
37
+ * ActiveLdap >= 0.8.3.1
38
38
 
39
39
  == 使用法
40
40
 
@@ -47,7 +47,7 @@ trunk用ですので,環境にあわせて変更してください.
47
47
 
48
48
  次に,Rails用ActiveSambaLdap環境を構築します.
49
49
 
50
- % script/generate scaffold_asl
50
+ % script/generate scaffold_active_samba_ldap
51
51
 
52
52
  config/ldap.ymlが生成されるので,環境にあわせて編集します.
53
53
  指定できるオプションは,以下の「設定ファイルのオプション」の
@@ -323,3 +323,5 @@ LDAP管理ユーザのパスワードを設定しておく必要があります
323
323
  SUBSTR caseExactIA5SubstringsMatch
324
324
 
325
325
  == 感謝
326
+
327
+ * Henrik Krög: バグを報告してくれました。
data/Rakefile CHANGED
@@ -9,7 +9,8 @@ truncate_base_dir = Proc.new do |x|
9
9
  end
10
10
 
11
11
  _binding = binding
12
- eval(File.read("#{base_dir}/lib/active_samba_ldap.rb"), _binding)
12
+ file = "#{base_dir}/lib/active_samba_ldap.rb"
13
+ eval(File.read(file), _binding, file)
13
14
  eval('require_gem_if_need.call("hoe")', _binding)
14
15
  required_active_ldap_version = eval('required_active_ldap_version', _binding)
15
16
 
@@ -88,7 +89,10 @@ rdoc_task.rdoc_files += project.bin_files.collect {|x| "#{x}.help"}
88
89
  project.bin_files.each do |bin|
89
90
  bin_help = "#{bin}.help"
90
91
  File.open(bin_help, "w") do |f|
92
+ lang = ENV["LANG"]
93
+ ENV["LANG"] = "C"
91
94
  f.puts(`#{RUBY} -I #{File.join(base_dir, 'lib')} #{bin} --help`)
95
+ ENV["LANG"] = lang
92
96
  end
93
97
  at_exit do
94
98
  FileUtils.rm_f(bin_help)
@@ -103,6 +107,8 @@ task :tag do
103
107
  sh 'svn', 'copy', '-m', message, "#{base}trunk", "#{base}tags/#{version}"
104
108
  end
105
109
 
110
+ desc "Distribute new release."
111
+ task :dist => [:publish_docs, :release, :tag, :announce]
106
112
 
107
113
  # # fix Hoe's incorrect guess.
108
114
  # project.spec.executables.clear
@@ -136,3 +142,43 @@ task :uninstall do
136
142
  rm_f project.bin_files.collect {|f| f.sub(/^bin#{File::SEPARATOR}/, '')}
137
143
  end
138
144
  end
145
+
146
+
147
+ desc "Update *.po/*.pot files and create *.mo from *.po files"
148
+ task :gettext => ["gettext:po:update", "gettext:mo:create"]
149
+
150
+ namespace :gettext do
151
+ desc "Setup environment for GetText"
152
+ task :environment do
153
+ require "gettext/utils"
154
+ end
155
+
156
+ namespace :po do
157
+ desc "Update po/pot files (GetText)"
158
+ task :update => "gettext:environment" do
159
+ module GetText::RGetText
160
+ class << self
161
+ alias_method :generate_pot_original, :generate_pot
162
+ def generate_pot(ary)
163
+ ary = ary.collect {|key, *other| [key.gsub(/\\/, "\\\\\\"), *other]}
164
+ generate_pot_original(ary)
165
+ end
166
+ end
167
+ end
168
+ files = Dir.glob("{lib,rails}/**/*.rb")
169
+ files += Dir.glob("bin/asl*")
170
+ GetText.update_pofiles("active-samba-ldap",
171
+ files,
172
+ "Ruby/ActiveSambaLdap #{ActiveSambaLdap::VERSION}")
173
+ end
174
+ end
175
+
176
+ namespace :mo do
177
+ desc "Create *.mo from *.po (GetText)"
178
+ task :create => "gettext:environment" do
179
+ GetText.create_mofiles(false)
180
+ end
181
+ end
182
+ end
183
+
184
+ task(:gem).prerequisites.unshift("gettext:mo:create")
data/bin/asl-groupadd CHANGED
@@ -3,6 +3,8 @@
3
3
  require 'active_samba_ldap'
4
4
  require 'active_samba_ldap/command'
5
5
 
6
+ include ActiveSambaLdap::GetTextSupport
7
+
6
8
  argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options|
7
9
  options.gid = nil
8
10
  options.group_type = "domain"
@@ -10,11 +12,12 @@ argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options|
10
12
 
11
13
  opts.banner += " GROUP_NAME"
12
14
 
13
- opts.on("-g", "--gid=GID", Integer, "GID number") {|options.gid|}
15
+ opts.on("-g", "--gid=GID", Integer, _("GID number")) {|options.gid|}
14
16
  opts.on("-t", "--type=TYPE",
15
- "group type (#{options.group_type})") {|options.group_type|}
17
+ _("group type"),
18
+ "(#{options.group_type})") {|options.group_type|}
16
19
  opts.on("-p", "--[no-]print-gid-number",
17
- "print the gid number to stdout",
20
+ _("print the gid number to stdout"),
18
21
  "(#{options.print_gid_number})") {|options.print_gid_number|}
19
22
  end
20
23
 
@@ -27,7 +30,7 @@ else
27
30
  end
28
31
 
29
32
  unless Process.uid.zero?
30
- $stderr.puts "need root authority."
33
+ $stderr.puts(_("need root authority."))
31
34
  exit 1
32
35
  end
33
36
 
@@ -42,7 +45,7 @@ class UnixIdPool < ActiveSambaLdap::UnixIdPool
42
45
  end
43
46
 
44
47
  if Group.exists?(name)
45
- $stderr.puts "group '#{name}' already exists."
48
+ $stderr.puts(_("group already exists: %s") % name)
46
49
  exit 1
47
50
  end
48
51
 
data/bin/asl-groupdel CHANGED
@@ -3,13 +3,16 @@
3
3
  require 'active_samba_ldap'
4
4
  require 'active_samba_ldap/command'
5
5
 
6
+ include ActiveSambaLdap::GetTextSupport
7
+
6
8
  argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options|
7
9
  options.force = false
8
10
 
9
11
  opts.banner += " GROUP_NAME"
10
12
 
11
13
  opts.on("-f", "--[no-]force",
12
- "force delete group (#{options.force})") {|options.force|}
14
+ _("force delete group"),
15
+ "(#{options.force})") {|options.force|}
13
16
  end
14
17
 
15
18
  name = nil
@@ -21,7 +24,7 @@ else
21
24
  end
22
25
 
23
26
  unless Process.uid.zero?
24
- $stderr.puts "need root authority."
27
+ $stderr.puts(_("need root authority."))
25
28
  exit 1
26
29
  end
27
30
 
@@ -40,7 +43,7 @@ class Computer < ActiveSambaLdap::Computer
40
43
  end
41
44
 
42
45
  unless Group.exists?(name)
43
- $stderr.puts "group '#{name}' doesn't exist."
46
+ $stderr.puts(_("group doesn't exist: %s") % name)
44
47
  exit 1
45
48
  end
46
49
  group = Group.find(name)
data/bin/asl-groupmod CHANGED
@@ -3,6 +3,8 @@
3
3
  require 'active_samba_ldap'
4
4
  require 'active_samba_ldap/command'
5
5
 
6
+ include ActiveSambaLdap::GetTextSupport
7
+
6
8
  argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options|
7
9
  options.gid = nil
8
10
  options.allow_non_unique_gid_number = false
@@ -12,18 +14,18 @@ argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options|
12
14
 
13
15
  opts.banner += " GROUP_NAME"
14
16
 
15
- opts.on("-g", "--gid=GID", "gid") {|options.gid|}
17
+ opts.on("-g", "--gid=GID", _("GID number")) {|options.gid|}
16
18
  opts.on("--[no-]allow-non-unique-gid",
17
- "gid can be non unique " +
19
+ _("gid can be non unique"),
18
20
  "(#{options.allow_non_unique_gid_number})") do |bool|
19
21
  options.allow_non_unique_gid_number = bool
20
22
  end
21
23
  opts.on("-r", "--rename=NEW_NAME",
22
- "new group name") {|options.new_group_name|}
24
+ _("new group name")) {|options.new_group_name|}
23
25
  opts.on("-a", "--add-members=MEMBER1,MEMBER2,MEBMER3", Array,
24
- "add members (comma delimited)") {|options.members_to_add|}
26
+ _("add members (comma delimited)")) {|options.members_to_add|}
25
27
  opts.on("-d", "--delete-members=MEMBER1,MEMBER2,MEBMER3", Array,
26
- "delete members (comma delimited)") {|options.members_to_delete|}
28
+ _("delete members (comma delimited)")) {|options.members_to_delete|}
27
29
  end
28
30
 
29
31
  name = nil
@@ -35,7 +37,7 @@ else
35
37
  end
36
38
 
37
39
  unless Process.uid.zero?
38
- $stderr.puts "need root authority."
40
+ $stderr.puts(_("need root authority."))
39
41
  exit 1
40
42
  end
41
43
 
@@ -54,7 +56,7 @@ class Computer < ActiveSambaLdap::Computer
54
56
  end
55
57
 
56
58
  unless Group.exists?(name)
57
- $stderr.puts "group '#{name}' doesn't exist."
59
+ $stderr.puts(_("group doesn't exist: %s") % name)
58
60
  exit 1
59
61
  end
60
62
  group = Group.find(name)
@@ -71,9 +73,11 @@ end
71
73
  if options.members_to_add and options.members_to_delete
72
74
  duplicated_members = options.members_to_add & options.members_to_delete
73
75
  unless duplicated_members.empty?
74
- message = "there are duplicated members in adding and deleting members: "
75
- message << duplicated_members.join(", ")
76
- $stderr.puts message
76
+ format =
77
+ n_("there is duplicated member in adding and deleting members: %s",
78
+ "there are duplicated members in adding and deleting members: %s",
79
+ duplicated_members.size)
80
+ $stderr.puts(format % duplicated_members.join(", "))
77
81
  exit 1
78
82
  end
79
83
  end
@@ -110,7 +114,7 @@ group.save!
110
114
 
111
115
  if options.new_group_name
112
116
  if Group.exists?(options.new_group_name)
113
- $stderr.puts "group '#{options.new_group_name}' always exists."
117
+ $stderr.puts(_("group already exists: %s") % options.new_group_name)
114
118
  exit 1
115
119
  end
116
120
 
data/bin/asl-groupshow CHANGED
@@ -3,6 +3,8 @@
3
3
  require 'active_samba_ldap'
4
4
  require 'active_samba_ldap/command'
5
5
 
6
+ include ActiveSambaLdap::GetTextSupport
7
+
6
8
  argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options|
7
9
  opts.banner += " GROUP_NAME"
8
10
  end
@@ -22,7 +24,7 @@ class Group < ActiveSambaLdap::Group
22
24
  end
23
25
 
24
26
  unless Group.exists?(name)
25
- $stderr.puts "group '#{name}' doesn't exist."
27
+ $stderr.puts(_("group doesn't exist: %s") % name)
26
28
  exit 1
27
29
  end
28
30
  group = Group.find(name)
data/bin/asl-passwd CHANGED
@@ -5,6 +5,8 @@ require 'etc'
5
5
  require 'active_samba_ldap'
6
6
  require 'active_samba_ldap/command'
7
7
 
8
+ include ActiveSambaLdap::GetTextSupport
9
+
8
10
  argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options|
9
11
  options.update_samba_password = true
10
12
  options.update_unix_password = true
@@ -12,12 +14,14 @@ argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options|
12
14
  opts.banner += " [USER_NAME]"
13
15
 
14
16
  opts.on("-s", "--[no-]samba-password",
15
- "update samba password (#{options.update_samba_password})") do |bool|
17
+ _("update samba password"),
18
+ "(#{options.update_samba_password})") do |bool|
16
19
  options.update_samba_password = bool
17
20
  end
18
21
 
19
22
  opts.on("-u", "--[no-]unix-password",
20
- "update UNIX password (#{options.update_unix_password})") do |bool|
23
+ _("update UNIX password"),
24
+ "(#{options.update_unix_password})") do |bool|
21
25
  options.update_unix_password = bool
22
26
  end
23
27
  end
@@ -34,7 +38,7 @@ else
34
38
  end
35
39
 
36
40
  if !options.update_samba_password and !options.update_unix_password
37
- $stderr.puts "do nothing"
41
+ $stderr.puts(_("do nothing."))
38
42
  exit
39
43
  end
40
44
 
@@ -45,13 +49,13 @@ class User < ActiveSambaLdap::User
45
49
  end
46
50
 
47
51
  unless User.exists?(name)
48
- $stderr.puts "user '#{name}' doesn't exist."
52
+ $stderr.puts(_("user doesn't exist: %s") % name)
49
53
  exit 1
50
54
  end
51
55
  user = User.find(name)
52
56
 
53
57
  unless Process.uid.zero?
54
- prompt = "Enter your current password: "
58
+ prompt = _("Enter your current password: ")
55
59
  old_password = ActiveSambaLdap::Command.read_password(prompt)
56
60
 
57
61
  auth_class = Class.new(ActiveSambaLdap::Base)
@@ -60,19 +64,18 @@ unless Process.uid.zero?
60
64
  auth_class.establish_connection(config.merge(:bind_dn => user.dn,
61
65
  :password => old_password,
62
66
  :allow_anonymous => false))
67
+ auth_class.remove_connection
63
68
  rescue ActiveLdap::AuthenticationError
64
- $stderr.puts "password isn't match"
69
+ $stderr.puts(_("password doesn't match."))
65
70
  exit 1
66
- ensure
67
- auth_class.remove_connection
68
71
  end
69
72
  end
70
73
 
71
- password = ActiveSambaLdap::Command.read_password("New password: ")
72
- password2 = ActiveSambaLdap::Command.read_password("Retype new password: ")
74
+ password = ActiveSambaLdap::Command.read_password(_("New password: "))
75
+ password2 = ActiveSambaLdap::Command.read_password(_("Retype new password: "))
73
76
 
74
77
  unless password == password2
75
- $stderr.puts "New passwords don't match."
78
+ $stderr.puts(_("New passwords don't match."))
76
79
  exit 1
77
80
  end
78
81
 
data/bin/asl-populate CHANGED
@@ -7,6 +7,8 @@ require 'time'
7
7
  require 'active_samba_ldap'
8
8
  require 'active_samba_ldap/command'
9
9
 
10
+ include ActiveSambaLdap::GetTextSupport
11
+
10
12
  argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options|
11
13
  default = ActiveSambaLdap::Configuration::ClassMethods::Private.new({})
12
14
  options.start_uid = Integer(default.start_uid)
@@ -25,34 +27,37 @@ argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options|
25
27
  options.import_ldif = nil
26
28
 
27
29
  opts.on("-u", "--start-uid=UID", Integer,
28
- "first uid number to allocate",
30
+ _("first uid number to allocate"),
29
31
  "(#{options.start_uid})") {|options.start_uid|}
30
32
  opts.on("-g", "--start-gid=GID", Integer,
31
- "first gid number to allocate",
33
+ _("first gid number to allocate"),
32
34
  "(#{options.start_gid})") {|options.start_gid|}
33
35
  opts.on("-a", "--administrator=NAME",
34
- "administrator login name",
36
+ _("administrator login name"),
35
37
  "(#{options.administrator})") {|options.administrator|}
36
38
  opts.on("--administrator-uid=UID", Integer,
37
- "administrator's uid number",
39
+ _("administrator's uid number"),
38
40
  "(#{options.administrator_uid})") {|options.administrator_uid|}
39
41
  opts.on("--administrator-gid=GID", Integer,
40
- "administrator's gid number",
42
+ _("administrator's gid number"),
41
43
  "(#{options.administrator_gid})") {|options.administrator_gid|}
42
44
  opts.on("-g", "--guest=NAME",
43
- "guest login name (#{options.guest})") {|options.guest|}
45
+ _("guest login name"),
46
+ "(#{options.guest})") {|options.guest|}
44
47
  opts.on("--guest-uid=UID", Integer,
45
- "guest's uid number (#{options.guest_uid})") {|options.guest_uid|}
48
+ _("guest's uid number"),
49
+ "(#{options.guest_uid})") {|options.guest_uid|}
46
50
  opts.on("--guest-gid=GID", Integer,
47
- "guest's gid number (#{options.guest_gid})") {|options.guest_gid|}
51
+ _("guest's gid number"),
52
+ "(#{options.guest_gid})") {|options.guest_gid|}
48
53
  opts.on("-e", "--export-ldif=LDIF",
49
- "export LDIF file") {|options.export_ldif|}
54
+ _("export LDIF file")) {|options.export_ldif|}
50
55
  # opts.on("-i", "--import-ldif=LDIF",
51
- # "import LDIF file") {|options.import_ldif|}
56
+ # _("import LDIF file")) {|options.import_ldif|}
52
57
  end
53
58
 
54
59
  unless Process.uid.zero?
55
- $stderr.puts "need root authority."
60
+ $stderr.puts(_("need root authority."))
56
61
  exit 1
57
62
  end
58
63
 
@@ -68,12 +73,12 @@ def init_administrator(opts, entries)
68
73
  end
69
74
  return if admin.new_entry?
70
75
 
71
- prompt = "Password for #{admin_name}: "
76
+ prompt = _("Password for %s: ") % admin_name
72
77
  password = ActiveSambaLdap::Command.read_password(prompt)
73
- prompt2 = "Retype password for #{admin_name}: "
78
+ prompt2 = _("Retype password for %s: ") % admin_name
74
79
  password2 = ActiveSambaLdap::Command.read_password(prompt2)
75
80
  unless password == password2
76
- $stderr.puts "Passwords don't match."
81
+ $stderr.puts(_("Passwords don't match."))
77
82
  exit 1
78
83
  end
79
84