require 'apache-lib.pl'; # acl_security_form(&options) # Output HTML for editing security options for the apache module sub acl_security_form { print " $text{'acl_virts'}\n"; print "\n"; printf " %s\n", $_[0]->{'virts'} eq '*' ? 'checked' : '', $text{'acl_vall'}; printf " %s
\n", $_[0]->{'virts'} eq '*' ? '' : 'checked', $text{'acl_vsel'}; print "\n"; print "$text{'acl_global'} \n", $_[0]->{'global'} == 0 ? "selected" : ""; print " $text{'acl_create'} \n"; printf " $text{'yes'}\n", $_[0]->{'create'} ? "checked" : ""; printf " $text{'no'} \n", $_[0]->{'create'} ? "" : "checked"; print " $text{'acl_vuser'} \n"; printf " $text{'yes'}\n", $_[0]->{'vuser'} ? "checked" : ""; printf " $text{'no'} \n", $_[0]->{'vuser'} ? "" : "checked"; print " $text{'acl_vaddr'} \n"; printf " $text{'yes'}\n", $_[0]->{'vaddr'} ? "checked" : ""; printf " $text{'no'} \n", $_[0]->{'vaddr'} ? "" : "checked"; print " $text{'acl_pipe'} \n"; printf " $text{'yes'}\n", $_[0]->{'pipe'} ? "checked" : ""; printf " $text{'no'}\n", $_[0]->{'pipe'} ? "" : "checked"; print "$text{'acl_stop'} \n"; printf " $text{'yes'}\n", $_[0]->{'stop'} ? "checked" : ""; printf " $text{'no'} \n", $_[0]->{'stop'} ? "" : "checked"; print " $text{'acl_apply'} \n"; printf " $text{'yes'}\n", $_[0]->{'apply'} ? "checked" : ""; printf " $text{'no'}\n", $_[0]->{'apply'} ? "" : "checked"; print "$text{'acl_names'} \n"; printf " $text{'yes'}\n", $_[0]->{'names'} ? "checked" : ""; printf " $text{'no'} \n", $_[0]->{'names'} ? "" : "checked"; print " $text{'acl_dir'}\n"; printf " %s \n", $_[0]->{'dir'}, &file_chooser_button("dir", 1); print " $text{'acl_aliasdir'}\n"; printf " %s \n", $_[0]->{'aliasdir'}, &file_chooser_button("aliasdir", 1); print " $text{'acl_types'}\n"; print "\n"; printf " $text{'acl_all'} \n", $_[0]->{'types'} eq '*' ? "checked" : ""; printf " $text{'acl_sel'}
\n", $_[0]->{'types'} eq '*' ? "" : "checked"; map { $types{$_}++ } split(/\s+/, $_[0]->{'types'}); print " \n"; print " $text{'acl_dirs'}\n"; print "\n"; print &ui_radio("dirsmode", $_[0]->{'dirsmode'}, [ [ 0, $text{'acl_dirs0'} ], [ 1, $text{'acl_dirs1'} ], [ 2, $text{'acl_dirs2'} ] ]),"
\n"; print &ui_textarea("dirs", join("\n", split(/\s+/, $_[0]->{'dirs'})), 5, 50); print " \n"; } # acl_security_save(&options) # Parse the form for security options for the apache module sub acl_security_save { if ($in{'virts_def'}) { $_[0]->{'virts'} = "*"; } else { $_[0]->{'virts'} = join(" ", split(/\0/, $in{'virts'})); } $_[0]->{'global'} = $in{'global'}; $_[0]->{'create'} = $in{'create'}; $_[0]->{'vuser'} = $in{'vuser'}; $_[0]->{'stop'} = $in{'stop'}; $_[0]->{'apply'} = $in{'apply'}; $_[0]->{'vaddr'} = $in{'vaddr'}; $_[0]->{'dir'} = $in{'dir'}; $_[0]->{'aliasdir'} = $in{'aliasdir'}; $_[0]->{'types'} = $in{'types_def'} ? '*' : join(" ", split(/\0/, $in{'types'})); $_[0]->{'pipe'} = $in{'pipe'}; $_[0]->{'names'} = $in{'names'}; $_[0]->{'dirsmode'} = $in{'dirsmode'}; $_[0]->{'dirs'} = join(" ", split(/\s+/, $in{'dirs'})); }