require 'net-lib.pl'; # acl_security_form(&options) # Output HTML for editing security options for the net module sub acl_security_form { print " $text{'acl_ifcs'} \n"; printf " $text{'yes'}\n", $_[0]->{'ifcs'} == 2 ? "checked" : ""; printf " $text{'acl_view'}\n", $_[0]->{'ifcs'} == 1 ? "checked" : ""; printf " $text{'no'}
\n", $_[0]->{'ifcs'} ? "" : "checked"; printf " $text{'acl_ifcs_only'}\n", $_[0]->{'ifcs'} == 3 ? "checked" : ""; print " ", &interfaces_chooser_button("interfaces", 1),"
\n"; printf " $text{'acl_ifcs_ex'}\n", $_[0]->{'ifcs'} == 4 ? "checked" : ""; print " ", &interfaces_chooser_button("interfaces", 1)," \n"; print " $text{'acl_bootonly'}\n"; print "",&ui_radio("bootonly", $_[0]->{'bootonly'}, [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]),"\n"; print "$text{'acl_netmask'}\n"; print "",&ui_radio("netmask", $_[0]->{'netmask'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ])," \n"; print " $text{'acl_broadcast'}\n"; print "",&ui_radio("broadcast", $_[0]->{'broadcast'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]),"\n"; print "$text{'acl_mtu'}\n"; print "",&ui_radio("mtu", $_[0]->{'mtu'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ])," \n"; print " $text{'acl_up'}\n"; print "",&ui_radio("up", $_[0]->{'up'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]),"\n"; print "$text{'acl_virt'}\n"; print "",&ui_radio("virt", $_[0]->{'virt'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ])," \n"; print " $text{'acl_delete'}\n"; print "",&ui_radio("delete", $_[0]->{'delete'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]),"\n"; print "$text{'acl_hide'}\n"; print "",&ui_radio("hide", $_[0]->{'hide'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ])," \n"; print " $text{'acl_routes'} \n"; printf " $text{'yes'}\n", $_[0]->{'routes'} == 2 ? "checked" : ""; printf " $text{'acl_view'}\n", $_[0]->{'routes'} == 1 ? "checked" : ""; printf " $text{'no'} \n", $_[0]->{'routes'} ? "" : "checked"; print " $text{'acl_dns'} \n"; printf " $text{'yes'}\n", $_[0]->{'dns'} == 2 ? "checked" : ""; printf " $text{'acl_view'}\n", $_[0]->{'dns'} == 1 ? "checked" : ""; printf " $text{'no'} \n", $_[0]->{'dns'} ? "" : "checked"; print " $text{'acl_hosts'} \n"; printf " $text{'yes'}\n", $_[0]->{'hosts'} == 2 ? "checked" : ""; printf " $text{'acl_view'}\n", $_[0]->{'hosts'} == 1 ? "checked" : ""; printf " $text{'no'} \n", $_[0]->{'hosts'} ? "" : "checked"; print " $text{'acl_apply'} \n"; printf " $text{'yes'}\n", $_[0]->{'apply'} == 1 ? "checked" : ""; printf " $text{'no'} \n", $_[0]->{'apply'} ? "" : "checked"; } # acl_security_save(&options) # Parse the form for security options for the file module sub acl_security_save { $_[0]->{'ifcs'} = $in{'ifcs'}; $_[0]->{'routes'} = $in{'routes'}; $_[0]->{'dns'} = $in{'dns'}; $_[0]->{'hosts'} = $in{'hosts'}; $_[0]->{'interfaces'} = $in{'ifcs'} == 3 ? $in{'interfaces3'} : $in{'ifcs'} == 4 ? $in{'interfaces4'} : undef; $_[0]->{'apply'} = $in{'apply'}; $_[0]->{'bootonly'} = $in{'bootonly'}; $_[0]->{'netmask'} = $in{'netmask'}; $_[0]->{'broadcast'} = $in{'broadcast'}; $_[0]->{'mtu'} = $in{'mtu'}; $_[0]->{'up'} = $in{'up'}; $_[0]->{'virt'} = $in{'virt'}; $_[0]->{'delete'} = $in{'delete'}; $_[0]->{'hide'} = $in{'hide'}; }