From 0ff28424ec1178ba6369d643d3b5f43d51a17514 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 11 Jun 2002 08:29:09 +0000 Subject: [PATCH 1/1] add crypt option to (bsd|sysv)shell export --- FS/FS/part_export.pm | 26 ++++++++++++++++++++++---- httemplate/edit/part_export.cgi | 23 +++++++++++++++++++---- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index bf6072089..7661d7e10 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -514,6 +514,20 @@ sub exporttype2svcdb { ''; } +tie my %sysvshell_options, 'Tie::IxHash', + 'crypt' => { label=>'Password encryption', + type=>'select', options=>[qw(crypt md5)], + default=>'crypt', + }, +; + +tie my %bsdshell_options, 'Tie::IxHash', + 'crypt' => { label=>'Password encryption', + type=>'select', options=>[qw(crypt md5)], + default=>'crypt', + }, +; + tie my %shellcommands_options, 'Tie::IxHash', #'machine' => { label=>'Remote machine' }, 'user' => { label=>'Remote username', default=>'root' }, @@ -599,12 +613,16 @@ tie my %sqlmail_options, 'Tie::IxHash', 'sysvshell' => { 'desc' => 'Batch export of /etc/passwd and /etc/shadow files (Linux/SysV)', - 'options' => {}, + 'options' => \%sysvshell_options, + 'nodomain' => 'Y', + 'notes' => 'MD5 crypt requires installation of Crypt::PasswdMD5 from CPAN.', }, 'bsdshell' => { 'desc' => 'Batch export of /etc/passwd and /etc/master.passwd files (BSD)', - 'options' => {}, + 'options' => \%bsdshell_options, + 'nodomain' => 'Y', + 'notes' => 'MD5 crypt requires installation of Crypt::PasswdMD5 from CPAN.', }, # 'nis' => { # 'desc' => @@ -614,6 +632,7 @@ tie my %sqlmail_options, 'Tie::IxHash', 'textradius' => { 'desc' => 'Batch export of a text /etc/raddb/users file (Livingston, Cistron)', 'options' => {}, + 'notes' => 'unfinished...', }, 'shellcommands' => { @@ -634,8 +653,7 @@ tie my %sqlmail_options, 'Tie::IxHash', 'desc' => 'Real-time export to SQL-backed mail server', 'options' => \%sqlmail_options, 'nodomain' => 'Y', - 'notes' => 'Database schema can be made to work with Courier IMAP and - Exim. Others could work but are untested.', + 'notes' => 'Database schema can be made to work with Courier IMAP and Exim. Others could work but are untested.', }, 'cyrus' => { diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi index af89c4ead..fbc698e8b 100644 --- a/httemplate/edit/part_export.cgi +++ b/httemplate/edit/part_export.cgi @@ -45,15 +45,30 @@ my $widget = new HTML::Widgets::SelectLayers( if $layer; foreach my $option ( keys %{$exports->{$layer}{options}} ) { -# foreach my $option ( qw(url login password groupID ) ) { my $optinfo = $exports->{$layer}{options}{$option}; my $label = $optinfo->{label}; + my $type = defined($optinfo->{type}) ? $optinfo->{type} : 'text'; my $value = $cgi->param($option) || $part_export->option($option) || (exists $optinfo->{default} ? $optinfo->{default} : ''); - $html .= qq!$label!. - qq!!. - ''; + $html .= qq!$label!; + if ( $type eq 'select' ) { + $html .= qq!'; + } elsif ( $type eq 'text' ) { + $html .= qq!!; + } else { + $html .= "unknown type $type"; + } + $html .= ''; } $html .= ''; -- 2.11.0