#!/usr/local/bin/perl # conf_pass.cgi # Display password options options require './samba-lib.pl'; # check acls &error_setup("$text{'eacl_aviol'}"); &error("$text{'eacl_np'} $text{'eacl_pcp'}") unless $access{'conf_pass'}; &ui_print_header(undef, $text{'passwd_title'}, ""); &get_share("global"); print "
\n"; print "\n"; print "\n"; print "
$text{'passwd_title'}
\n"; print "\n"; printf "\n", &istrue("encrypt passwords") ? "" : "checked"; print "\n"; printf "\n", &istrue("null passwords") ? "" : "checked"; print "\n"; printf "\n", &getval("passwd program"); print "\n"; printf "\n", &istrue("unix password sync") ? "" : "checked"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'passwd_encrypt'} $text{'yes'}\n", &istrue("encrypt passwords") ? "checked" : ""; printf "  $text{'no'}$text{'passwd_allownull'} $text{'yes'}\n", &istrue("null passwords") ? "checked" : ""; printf "$gap $text{'no'}
$text{'passwd_program'} $text{'default'}\n", &getval("passwd program") eq "" ? "checked" : ""; printf "\n", &getval("passwd program") eq "" ? "" : "checked"; printf "$text{'passwd_sync'} $text{'yes'}\n", &istrue("unix password sync") ? "checked" : ""; printf "$gap $text{'no'}
$text{'passwd_chat'}\n"; printf " $text{'default'}\n", &getval("passwd chat") eq "" ? "checked" : ""; printf " $text{'passwd_below'}
\n", &getval("passwd chat") eq "" ? "" : "checked"; print "\n"; $pc = &getval("passwd chat"); while($pc =~ /^"([^"]*)"\s*(.*)/ || $pc =~ /^(\S+)\s*(.*)/) { if ($send) { push(@send, $1); $send = 0; } else { push(@recv, $1); $send = 1; } $pc = $2; } for($i=0; $i<(@recv < 5 ? 5 : @recv+1); $i++) { printf "\n", $recv[$i] eq "." ? "" : $recv[$i]; printf "\n", $send[$i]; } print "
$text{'passwd_waitfor'} $text{'passwd_send'}
$text{'passwd_map'}\n"; printf " $text{'config_none'}\n", &getval("username map") eq "" ? "checked" : ""; printf" $text{'passwd_below'}
\n", &getval("username map") eq "" ? "" : "checked"; print "\n"; print " \n"; open(UMAP, &getval("username map")); while() { s/\r|\n//g; s/[#;].*$//g; if (/^\s*(\S+)\s*=\s*(.*)$/) { local $uunix = $1; local $rest = $2; while($rest =~ /^\s*"([^"]*)"(.*)$/ || $rest =~ /^\s*(\S+)(.*)$/) { push(@uunix, $uunix); push(@uwin, $1); $rest = $2; } } } close(UMAP); for($i=0; $i<@uunix+1; $i++) { printf "\n", $uunix[$i]; printf "\n", $uwin[$i]; } print "
$text{'passwd_unixuser'}$text{'passwd_winuser'}

\n"; print "

\n"; &ui_print_footer("", $text{'index_sharelist'});