summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2005-09-08 15:26:23 +0000
committerAntoine Ginies <aginies@mandriva.com>2005-09-08 15:26:23 +0000
commitab3c900c45c59a252a5a2f0956b601edd553f2a5 (patch)
tree103fe83947b96073d7d0d7de6f53b3fa1654ee29
parent5a9eada94ce001bef51ab89d6e147c944bde92aa (diff)
downloaddrakwizard-ab3c900c45c59a252a5a2f0956b601edd553f2a5.tar
drakwizard-ab3c900c45c59a252a5a2f0956b601edd553f2a5.tar.gz
drakwizard-ab3c900c45c59a252a5a2f0956b601edd553f2a5.tar.bz2
drakwizard-ab3c900c45c59a252a5a2f0956b601edd553f2a5.tar.xz
drakwizard-ab3c900c45c59a252a5a2f0956b601edd553f2a5.zip
some perl_checker fix
-rwxr-xr-xsamba_wizard/Samba.pm118
1 files changed, 59 insertions, 59 deletions
diff --git a/samba_wizard/Samba.pm b/samba_wizard/Samba.pm
index fe19b3b9..6149bf69 100755
--- a/samba_wizard/Samba.pm
+++ b/samba_wizard/Samba.pm
@@ -72,7 +72,7 @@ my $o = {
};
$::Wizard_pix_up = "/usr/share/wizards/samba_wizard/images/sambasrv.png";
# we ask glueconf to give us the structure representing /etc/samba/smb.conf
-if (!-f "/etc/samba/smb.conf") { cp_af("/usr/share/wizards/samba_wizard/scripts/smb.conf.default", "/etc/samba/smb.conf"); }
+if (!-f "/etc/samba/smb.conf") { mkdir_p("/etc/samba/"); cp_af("/usr/share/wizards/samba_wizard/scripts/smb.conf.default", "/etc/samba/smb.conf") }
my $samba = new Libconf::Glueconf::Samba::Smb_conf({ filename => '/etc/samba/smb.conf', show_commented_info => 1 });
#debug
@@ -80,10 +80,10 @@ use Data::Dumper;
print Dumper($samba);
my %type = (
- 1 => N('BDC - backup domain controller (need PDC+LDAP)'),
- 2 => N('PDC - primary domain controller'),
- 3 => N('Standalone - standalone server'),
- # 4 => N('Member - member of a domain'),
+ 1 => N("BDC - backup domain controller (need PDC+LDAP)"),
+ 2 => N("PDC - primary domain controller"),
+ 3 => N("Standalone - standalone server"),
+ # 4 => N("Member - member of a domain"),
);
my @yesorno = qw(yes no); push @yesorno, "";
@@ -91,7 +91,7 @@ my @loglevel = qw(0 1 2 3 4 5 6 7 8 9);
$o->{pages} = {
welcome => {
- name => N('Samba server configuration Wizard') . "\n\n" . N('Samba allows your server to behave as a file and print server for workstations running non-Linux systems.'),
+ name => N("Samba server configuration Wizard") . "\n\n" . N("Samba allows your server to behave as a file and print server for workstations running non-Linux systems."),
no_back => 1,
pre => sub {
if (-f $wiz_samba_etc) {
@@ -118,7 +118,7 @@ $o->{pages} = {
],
},
pdc => {
- name => N('PDC server: primary domain controller') . "\n\n" . N('Server configured as a PDC is responsible for Windows authentication throughout the domain.') . "\n" . N('Single server installations may use smbpasswd or tdbsam password backends') . "\n" . N('Domain master = yes, causes the server to register the NetBIOS name <pdc name>1B. This name will be recognized by other servers.'),
+ name => N("PDC server: primary domain controller") . "\n\n" . N("Server configured as a PDC is responsible for Windows authentication throughout the domain.") . "\n" . N("Single server installations may use smbpasswd or tdbsam password backends") . "\n" . N("Domain master = yes, causes the server to register the NetBIOS name <pdc name>1B. This name will be recognized by other servers."),
pre => sub {
$o->{var}{wiz_domain_master} = "yes";
$o->{var}{wiz_security} = "user";
@@ -138,13 +138,13 @@ $o->{pages} = {
# $o->{var}{wiz_passdb_backend_yn} =~ /yes/ and return 'ldap_conf';
# },
data => [
- { label => N('Domain logons:'), fixed_val => \$o->{var}{wiz_domain_logons} },
- { label => N('Domain master:'), fixed_val => \$o->{var}{wiz_domain_master} },
- { label => N('Security:'), fixed_val => \$o->{var}{wiz_security} },
- { label => N('Wins support:'), val => \$o->{var}{wiz_wins_support}, fixed_list => \@yesorno },
- { label => N('admin users:'), val => \$o->{var}{wiz_admin_users}, help => N('root @adm') },
- { label => N('Os level:'), fixed_val => \$o->{var}{wiz_oslevel}, help =>N("The global os level option dictates the operating system level at which Samba will masquerade during a browser election. If you wish to have Samba win an election and become the master browser, you can set the level above that of the operating system on your network with the highest current value. ie: os level = 34") },
-# { label => N('Use LDAP Passdb backend'), val => \$o->{var}{wiz_passdb_backend_yn}, fixed_list => \@yesorno },
+ { label => N("Domain logons:"), fixed_val => \$o->{var}{wiz_domain_logons} },
+ { label => N("Domain master:"), fixed_val => \$o->{var}{wiz_domain_master} },
+ { label => N("Security:"), fixed_val => \$o->{var}{wiz_security} },
+ { label => N("Wins support:"), val => \$o->{var}{wiz_wins_support}, fixed_list => \@yesorno },
+ { label => N("admin users:"), val => \$o->{var}{wiz_admin_users}, help => N("root @adm") },
+ { label => N("Os level:"), fixed_val => \$o->{var}{wiz_oslevel}, help =>N("The global os level option dictates the operating system level at which Samba will masquerade during a browser election. If you wish to have Samba win an election and become the master browser, you can set the level above that of the operating system on your network with the highest current value. ie: os level = 34") },
+# { label => N("Use LDAP Passdb backend"), val => \$o->{var}{wiz_passdb_backend_yn}, fixed_list => \@yesorno },
],
complete => sub {
if (!$o->{var}{wiz_domain_master}) {
@@ -155,7 +155,7 @@ $o->{pages} = {
next => 'ask_workgroup',
},
bdc => {
- name => N('BDC server: backup domain controller') . "\n\n" . N('This enables BDCs to carry much of the network logon processing. A BDC on a local segment handles logon requests and authenticates users when the PDC is busy on the local network. When a segment becomes heavily loaded, the reponsibility is offloaded to another segment\'s BDC or to the PDC.'),
+ name => N("BDC server: backup domain controller") . "\n\n" . N("This enables BDCs to carry much of the network logon processing. A BDC on a local segment handles logon requests and authenticates users when the PDC is busy on the local network. When a segment becomes heavily loaded, the reponsibility is offloaded to another segment\'s BDC or to the PDC."),
pre => sub {
$o->{var}{wiz_domain_master} = "no";
$o->{var}{wiz_security} = "user";
@@ -172,9 +172,9 @@ $o->{pages} = {
$o->{var}{wiz_dns_proxy} = "no";
},
data => [
- { label => N('Wins support:'), val => \$o->{var}{wiz_wins_support}, fixed_list => \@yesorno },
- { label => N('Wins server:'), val => \$o->{var}{wiz_wins_server}, help => N('This specifies the IP address (or DNS name: IP address for preference) of the WINS server that nmbd(8) should register with. If you have a WINS server on your network then you should set this to the WINS server\'s IP.') },
- { label => N('Wins name resolve order:'), val => \$o->{var}{wiz_name_resolve_order} },
+ { label => N("Wins support:"), val => \$o->{var}{wiz_wins_support}, fixed_list => \@yesorno },
+ { label => N("Wins server:"), val => \$o->{var}{wiz_wins_server}, help => N("This specifies the IP address (or DNS name: IP address for preference) of the WINS server that nmbd(8) should register with. If you have a WINS server on your network then you should set this to the WINS server\'s IP.") },
+ { label => N("Wins name resolve order:"), val => \$o->{var}{wiz_name_resolve_order} },
],
complete => sub {
if ($o->{var}{wiz_wins_support} =~ /no/ and !$o->{var}{wiz_wins_server} ) {
@@ -185,21 +185,21 @@ $o->{pages} = {
next => 'ask_bdc2',
},
ask_bdc2 => {
- name => N('BDC server: needed fixed options'),
+ name => N("BDC server: needed fixed options"),
data => [
- { label => N('Domain master:'), fixed_val => \$o->{var}{wiz_domain_master} },
- { label => N('Security:'), fixed_val => \$o->{var}{wiz_security} },
- { label => N('Os level:'), fixed_val => \$o->{var}{wiz_oslevel} },
- { label => N('Local master:'), fixed_val => \$o->{var}{wiz_local_master} },
- { label => N('Domain master'), fixed_val => \$o->{var}{wiz_domain_master} },
- { label => N('Preferred master'), fixed_val => \$o->{var}{wiz_preferred_master} },
- { label => N('Domain logons'), fixed_val => \$o->{var}{wiz_domain_logons} },
- { label => N('admin users:'), val => \$o->{var}{wiz_admin_users}, help => N('root @adm') },
+ { label => N("Domain master:"), fixed_val => \$o->{var}{wiz_domain_master} },
+ { label => N("Security:"), fixed_val => \$o->{var}{wiz_security} },
+ { label => N("Os level:"), fixed_val => \$o->{var}{wiz_oslevel} },
+ { label => N("Local master:"), fixed_val => \$o->{var}{wiz_local_master} },
+ { label => N("Domain master"), fixed_val => \$o->{var}{wiz_domain_master} },
+ { label => N("Preferred master"), fixed_val => \$o->{var}{wiz_preferred_master} },
+ { label => N("Domain logons"), fixed_val => \$o->{var}{wiz_domain_logons} },
+ { label => N("admin users:"), val => \$o->{var}{wiz_admin_users}, help => N("root @adm") },
],
next => 'ldap_conf',
},
member => {
- name => N('Member of a domain') . "\n\n" . ('Share data, users home or printers.') . "\n" . N('Please enter the domain you want to join.'),
+ name => N("Member of a domain") . "\n\n" . ("Share data, users home or printers.") . "\n" . N("Please enter the domain you want to join."),
pre => sub {
$o->{var}{wiz_security} = "domain";
$o->{var}{wiz_domain_master} = "no";
@@ -214,10 +214,10 @@ $o->{pages} = {
$o->{var}{wiz_passdb_backend_yn} =~ /yes/ and return 'ldap_conf';
},
data => [
- { label => N('Password server'), hidden => 1, val => \$o->{var}{wiz_password_server} },
- { label => N('Use LDAP Passdb backend'), val => \$o->{var}{wiz_passdb_backend_yn}, fixed_list => \@yesorno },
- { label => N('Security:'), fixed_val => \$o->{var}{wiz_security} },
- { label => N('Domain master:'), fixed_val => \$o->{var}{wiz_domain_master} },
+ { label => N("Password server"), hidden => 1, val => \$o->{var}{wiz_password_server} },
+ { label => N("Use LDAP Passdb backend"), val => \$o->{var}{wiz_passdb_backend_yn}, fixed_list => \@yesorno },
+ { label => N("Security:"), fixed_val => \$o->{var}{wiz_security} },
+ { label => N("Domain master:"), fixed_val => \$o->{var}{wiz_domain_master} },
],
complete => sub {
@@ -229,7 +229,7 @@ $o->{pages} = {
next => 'ask_workgroup',
},
ldap_conf => {
- name => N('LDAP configuration for Domain Controlling') . "\n\n" . N('The account (dn) that samba uses to access the LDAP server. This account needs to have write access to the LDAP tree. You will need to give samba the password for this dn.'),
+ name => N("LDAP configuration for Domain Controlling") . "\n\n" . N("The account (dn) that samba uses to access the LDAP server. This account needs to have write access to the LDAP tree. You will need to give samba the password for this dn."),
pre => sub {
$o->{var}{wiz_ldap_passwd_sync} = "yes";
if ($samba->{global}{'ldap suffix'}) {
@@ -252,43 +252,43 @@ $o->{pages} = {
else { $o->{var}{wiz_ldap_user_suffix} = "ou=Users" }
},
data => [
- { label => N('Passdb backend'), val => \$o->{var}{wiz_passdb_backend}, help => "ldapsam:ldap://<ldap server name>" },
- { label => N('LDAP administrator'), val => \$o->{var}{wiz_ldap_admin_dn}, help => N(' The ldap admin dn defines the Distinguished Name (DN) name used by Samba to contact the ldap server when retreiving user account information. ie: cn=Manager,dc=mydomain,dc=com') },
- { label => N('LDAP suffix'), val => \$o->{var}{wiz_ldap_suffix}, help => N('Specifies where user and machine accounts are added to the tree. Can be overriden by ldap user suffix and ldap machine suffix. It also used as the base dn for all ldap searches. ie: dc=$DOMAINNAME,dc=com') },
- { label => N('LDAP password'), hidden => 1, val => \$o->{var}{wiz_ldap_root_pw} },
- { label => N('LDAP password check:'), hidden => 1, val => \$o->{var}{wiz_ldap_root_pw_2} },
- { label => N('LDAP machine suffix:'), val => \$o->{var}{wiz_ldap_machine_suffix}, help => N('It specifies where machines should be added to the ldap tree. ie: ou=Computers') },
- { label => N('LDAP user suffix:'), val => \$o->{var}{wiz_ldap_user_suffix}, help => N('This parameter specifies where users are added to the tree. If this parameter is not specified, the value from ldap suffix will be used.') },
- { label => N('LDAP group suffix:'), val => \$o->{var}{wiz_ldap_group_suffix}, help => N('This parameters specifies the suffix that is used for groups when these are added to the LDAP directory. ie: ou=Groups') },
+ { label => N("Passdb backend"), val => \$o->{var}{wiz_passdb_backend}, help => "ldapsam:ldap://<ldap server name>" },
+ { label => N("LDAP administrator"), val => \$o->{var}{wiz_ldap_admin_dn}, help => N(" The ldap admin dn defines the Distinguished Name (DN) name used by Samba to contact the ldap server when retreiving user account information. ie: cn=Manager,dc=mydomain,dc=com") },
+ { label => N("LDAP suffix"), val => \$o->{var}{wiz_ldap_suffix}, help => N("Specifies where user and machine accounts are added to the tree. Can be overriden by ldap user suffix and ldap machine suffix. It also used as the base dn for all ldap searches. ie: dc=$DOMAINNAME,dc=com") },
+ { label => N("LDAP password"), hidden => 1, val => \$o->{var}{wiz_ldap_root_pw} },
+ { label => N("LDAP password check:"), hidden => 1, val => \$o->{var}{wiz_ldap_root_pw_2} },
+ { label => N("LDAP machine suffix:"), val => \$o->{var}{wiz_ldap_machine_suffix}, help => N("It specifies where machines should be added to the ldap tree. ie: ou=Computers") },
+ { label => N("LDAP user suffix:"), val => \$o->{var}{wiz_ldap_user_suffix}, help => N("This parameter specifies where users are added to the tree. If this parameter is not specified, the value from ldap suffix will be used.") },
+ { label => N("LDAP group suffix:"), val => \$o->{var}{wiz_ldap_group_suffix}, help => N("This parameters specifies the suffix that is used for groups when these are added to the LDAP directory. ie: ou=Groups") },
],
complete => sub {
if (!($o->{var}{wiz_ldap_suffix})) {
- $::in->ask_warn(N('Error'), N('Please provide an LDAP suffix.'));
+ $::in->ask_warn(N("Error"), N("Please provide an LDAP suffix."));
return 1;
}
if (! ($o->{var}{wiz_ldap_admin_dn})) {
- $::in->ask_warn(N('Error'), N('Please enter an LDAP administrator.'));
+ $::in->ask_warn(N("Error"), N("Please enter an LDAP administrator."));
return 1;
}
if (! ($o->{var}{wiz_ldap_root_pw})) {
- $::in->ask_warn(N('Error'), N('Please enter an LDAP password.'));
+ $::in->ask_warn(N("Error"), N("Please enter an LDAP password."));
return 1;
}
if ($o->{var}{wiz_ldap_root_pw} ne $o->{var}{wiz_ldap_root_pw_2}) {
- $::in->ask_warn(N('Error'), N('Passwords do not match.'));
+ $::in->ask_warn(N("Error"), N("Passwords do not match."));
return 1;
}
},
next => 'ask_workgroup',
},
ask_workgroup => {
- name => N('Workgroup') . "\n\n" . N('Samba needs to know the Windows Workgroup it will serve.'),
+ name => N("Workgroup") . "\n\n" . N("Samba needs to know the Windows Workgroup it will serve."),
pre => sub {
$o->{var}{wiz_workgroup} ||= $samba->{global}{workgroup};
$o->{var}{wiz_netbios} ||= $samba->{global}{netbios};
},
data => [
- { label => N('Workgroup:'), val => \$o->{var}{wiz_workgroup} },
+ { label => N("Workgroup:"), val => \$o->{var}{wiz_workgroup} },
],
complete => sub {
if (!$o->{var}{wiz_workgroup}) {
@@ -299,12 +299,12 @@ $o->{pages} = {
next => 'ask_banner',
},
ask_banner => {
- name => N('Server Banner.') . "\n\n" . N('The banner is the way this server will be described in the Windows workstations.'),
+ name => N("Server Banner.") . "\n\n" . N("The banner is the way this server will be described in the Windows workstations."),
pre => sub {
$o->{var}{wiz_banner} ||= $samba->{global}{'server string'}
},
data => [
- { label => N('Banner:'), val => \$o->{var}{wiz_banner}, help => "Samba Server %v" },
+ { label => N("Banner:"), val => \$o->{var}{wiz_banner}, help => "Samba Server %v" },
],
complete => sub {
if (!$o->{var}{wiz_banner}) {
@@ -315,35 +315,35 @@ $o->{pages} = {
next => 'ask_log',
},
ask_log => {
- name => N('Samba Log') . "\n\n" . N('Log file: use file.%m to use a separate log file for each machine that connects') . "\n" . N('Log level: set the log (verbosity) level (0 <= log level <= 10)') . "\n" . N('Max Log size: put a capping on the size of the log files (in Kb).'),
+ name => N("Samba Log") . "\n\n" . N("Log file: use file.%m to use a separate log file for each machine that connects") . "\n" . N("Log level: set the log (verbosity) level (0 <= log level <= 10)") . "\n" . N("Max Log size: put a capping on the size of the log files (in Kb)."),
pre => sub {
$o->{var}{wiz_log_file} ||= $samba->{global}{'log file'};
$o->{var}{wiz_log_level} ||= $samba->{global}{'log level'};
$o->{var}{wiz_max_log_size} ||= $samba->{global}{'max log size'};
},
data => [
- { label => N('Log file:'), val => \$o->{var}{wiz_log_file}, help => "/var/log/samba/log.%m" },
- { label => N('Max log size:'), val => \$o->{var}{wiz_max_log_size}, help => "50" },
- { label => N('Log level:'), val => \$o->{var}{wiz_log_level}, fixed_list => \@loglevel },
+ { label => N("Log file:"), val => \$o->{var}{wiz_log_file}, help => "/var/log/samba/log.%m" },
+ { label => N("Max log size:"), val => \$o->{var}{wiz_max_log_size}, help => "50" },
+ { label => N("Log level:"), val => \$o->{var}{wiz_log_level}, fixed_list => \@loglevel },
],
next => 'summary',
},
summary => {
- name => N('Configuring Samba') . "\n\n" . N('The wizard collected the following parameters to configure Samba.') . "\n\n" . N('To accept these values, and configure your server, click the Next button or use the Back button to correct them.') . "\n" . N('If you have previously create some shares, they will appear in this configuration. Run "drakwizard sambashare" to manage your shares.'),
+ name => N("Configuring Samba") . "\n\n" . N("The wizard collected the following parameters to configure Samba.") . "\n\n" . N("To accept these values, and configure your server, click the Next button or use the Back button to correct them.") . "\n" . N("If you have previously create some shares, they will appear in this configuration. Run "drakwizard sambashare" to manage your shares."),
pre => sub {
$o->{var}{wiz_sambatype} = $type{$o->{var}{wiz_type}};
},
data => [
- { label => N('Samba type:'), fixed_val => \$o->{var}{wiz_sambatype} },
- { label => N('Workgroup:'), fixed_val => \$o->{var}{wiz_workgroup} },
- { label => N('Server banner:'), fixed_val => \$o->{var}{wiz_banner} },
- { label => N('Log file:'), fixed_val => \$o->{var}{wiz_log_file} },
+ { label => N("Samba type:"), fixed_val => \$o->{var}{wiz_sambatype} },
+ { label => N("Workgroup:"), fixed_val => \$o->{var}{wiz_workgroup} },
+ { label => N("Server banner:"), fixed_val => \$o->{var}{wiz_banner} },
+ { label => N("Log file:"), fixed_val => \$o->{var}{wiz_log_file} },
],
post => \&do_it,
next => 'end'
},
end => {
- name => N('Congratulations') . "\n\n" . N('The wizard successfully configured your Samba server.'),
+ name => N("Congratulations") . "\n\n" . N("The wizard successfully configured your Samba server."),
post => sub {
store_samba_type($o->{var}{wiz_type});
},