diff options
author | Antoine Ginies <aginies@mandriva.com> | 2005-05-27 06:57:45 +0000 |
---|---|---|
committer | Antoine Ginies <aginies@mandriva.com> | 2005-05-27 06:57:45 +0000 |
commit | cf36d038d28969f615e45e9dbbf61ffd9cac49c0 (patch) | |
tree | 7ca11918572662c5cd45393b133255bd7eea343a /samba_wizard | |
parent | aebcce084afa34d494602318a89c495ac25de89c (diff) | |
download | drakwizard-cf36d038d28969f615e45e9dbbf61ffd9cac49c0.tar drakwizard-cf36d038d28969f615e45e9dbbf61ffd9cac49c0.tar.gz drakwizard-cf36d038d28969f615e45e9dbbf61ffd9cac49c0.tar.bz2 drakwizard-cf36d038d28969f615e45e9dbbf61ffd9cac49c0.tar.xz drakwizard-cf36d038d28969f615e45e9dbbf61ffd9cac49c0.zip |
add global options suppoert, pdc, bdc, member, add help, info
Diffstat (limited to 'samba_wizard')
-rwxr-xr-x | samba_wizard/Samba.pm | 93 |
1 files changed, 73 insertions, 20 deletions
diff --git a/samba_wizard/Samba.pm b/samba_wizard/Samba.pm index 0f8b9616..561f96ac 100755 --- a/samba_wizard/Samba.pm +++ b/samba_wizard/Samba.pm @@ -69,12 +69,19 @@ my $o = { wiz_home_browseable => '', wiz_home_createmode => '', wiz_home_comment => '', + wiz_local_master => '', + wiz_os_level => '', + wiz_security => '', + wiz_domain_logons => '', + wiz_domain_master => '', + wiz_password_server => '', + wiz_passdb_backend => '', + wiz_domain => '', test => '', - }, -# init => sub { -# test_host_domain($SHORTHOSTNAME, $DOMAINNAME); -# }, + init => sub { + test_host_domain($SHORTHOSTNAME, $DOMAINNAME); + }, needed_rpm => [ 'samba-server' ], defaultimage => "/usr/share/wizards/samba_wizard/images/samba.png" }; @@ -82,7 +89,7 @@ my $o = { #pdc #bdc #standalone #membre #share_files #share_printers # we ask glueconf to give us the structure representing /etc/samba/smb.conf -my $samba = new Libconf::Glueconf::Samba::Smb_conf({ filename => '/etc/samba/smb.conf', }); +my $samba = new Libconf::Glueconf::Samba::Smb_conf({ filename => '/etc/samba/smb.conf', show_commented_info => 1 }); #debug use Data::Dumper; @@ -126,27 +133,52 @@ $o->{pages} = { ], }, pdc => { - name => N('PDC server: primary domain controller'), + 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, but large installations should use the LDAP backend to provide centralized management of both Posix users and Windows users.') . "\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"; + $o->{var}{wiz_domain_logons} = "yes"; + $o->{var}{wiz_passdb_backend} ||= $samba->{global}{'passdb backend'}; + $o->{var}{wiz_wins_support} ||= $samba->{global}{'wins support'}; + }, data => [ - { label => N('val:'), val => \$o->{var}{test} }, + { 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('Passdb backend'), val => \$o->{var}{wiz_passdb_backend}, help => "ldapsam:ldap://<ldap server name>" }, ], # complete => {}, next => 'ask_workgroup', }, bdc => { - name => N('BDC server: backup domain controller'), + 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. Therefore, you can optimize resources and add robustness to network services by deploying BDCs throughout the network.'), + pre => sub { + $o->{var}{wiz_domain_master} = "no"; + $o->{var}{wiz_security} = "user"; + }, data => [ - { label => N('val:'), val => \$o->{var}{test} }, -# { label => N(':'), val => \$o->{var}{} }, + { label => N('Security:'), fixed_val => \$o->{var}{wiz_security} }, + { label => N('Domain master:'), fixed_val => \$o->{var}{wiz_domain_master} }, ], # complete => {}, next => 'ask_workgroup', }, member => { - name => N('Member of a domain'), + 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"; + $o->{var}{wiz_password_server} ||= $samba->{global}{'password server'}; + $o->{var}{wiz_domain} ||= $samba->{global}{domain}; + $o->{var}{wiz_passdb_backend} ||= $samba->{global}{'passdb backend'};; + }, data => [ - { label => N('val:'), val => \$o->{var}{test} }, -# { label => N(':'), val => \$o->{var}{} }, + { label => N('Password server'), val => \$o->{var}{wiz_password_server} }, + { label => N('Domain:'), val => \$o->{var}{wiz_domain} }, + { label => N('Passdb backend'), val => \$o->{var}{wiz_passdb_backend}, help => "ldapsam:ldap://<ldap server name>" }, + { label => N('Security:'), fixed_val => \$o->{var}{wiz_security} }, + { label => N('Domain master:'), fixed_val => \$o->{var}{wiz_domain_master} }, ], # complete => {}, next => 'ask_workgroup', @@ -433,13 +465,14 @@ sub list_printers { sub list_share { my @listshare; - my $share; - if ($samba->{$_}{printable} =~ /yes/) { - print "$share is a printer\n"; - () - } else { - print "$share is a share\n"; - push @listshare, $share; + foreach my $clef (keys %$samba) { + if ($samba->{$clef}{printable} =~ /yes/i) { + print "$clef est une imprimante\n"; + } else { + push @listshare, $clef; + } + print "------------- \n"; + foreach (@listshare) { print "$_\n"; } } } @@ -466,6 +499,16 @@ sub printer_sharing { } } +sub global_special_options { + $o->{var}{wiz_domain_master} and $samba->{global}{'domain master'} = $o->{var}{wiz_domain_master}; + $o->{var}{wiz_security} and $samba->{global}{security} = $o->{var}{wiz_security}; + $o->{var}{wiz_domain_logons} and $samba->{global}{'domain logons'} = $o->{var}{wiz_domain_logons}; + $o->{var}{wiz_passdb_backend} and $samba->{global}{'passdb backend'} = $o->{var}{wiz_passdb_backend}; + $o->{var}{wiz_wins_support} and $samba->{global}{'wins support'} = $o->{var}{wiz_wins_support}; + $o->{var}{wiz_password_server} and $samba->{global}{'password server'} = $o->{var}{wiz_password_server}; + $o->{var}{wiz_domain} and $samba->{global}{domain} = $o->{var}{wiz_domain}; +} + sub get_printers { if ($o->{var}{wiz_do_printer_sharing}) { my $string; @@ -495,6 +538,9 @@ sub do_it { $samba->{global}{netbios} = $o->{var}{wiz_netbios}; } + # add special global options + global_special_options; + # log level in global section $samba->{global}{'log file'} = $o->{var}{wiz_log_file}; if ($o->{var}{wiz_log_level}) { @@ -538,6 +584,13 @@ sub do_it { standalone->explanations("Samba deny $o->{var}{wiz_hosts_deny}"); standalone->explanations("Samba allow $o->{var}{wiz_hosts_allow}"); + print "---------debug D\n"; + my $v = $samba->get_comments('{printers}'); + print $v->{normal}; + # print $v->{right_inline}; + print "\n-------debug E\n"; +# list_share; + # share printers if ($o->{var}{wiz_do_printer_sharing}) { standalone->explanations("Enabling printer sharing"); |