#!/usr/local/bin/perl # interface_chooser.cgi # # Based on user_chooser.cgi by Jamie Cameron # (c) Tomas Pospisek # Licensed under the webmin license # # made possible by: # Sourcepole http://sourcepole.ch # under contract from: # AO Media Services http://www.ao-asif.ch/aoi/media/ # Thanks! # # TODO: # replace active_interfaces by a merged list from active_* and boot_interfaces # # This CGI generated the HTML for choosing an interface or a list of interfaces. require './net-lib.pl'; &init_config(); &ReadParse(); %access = &get_module_acl(); if ($in{'multi'}) { # selecting multiple interfaces. if ($in{'frame'} == 0) { # base frame &PrintHeader(); print "\n"; print "$text{'interfaces_title1'}\n"; print "\n"; print "\n"; print "\n"; print " \n"; print " \n"; print "\n"; print "\n"; } elsif ($in{'frame'} == 1) { # list of all interfaces to choose from &ui_print_header(undef, ); print "\n"; print "$text{'interfaces_all'}\n"; print "\n"; foreach $if (&active_interfaces()) { if ($in{'interface'} eq $if->{'fullname'}) { print "\n"; } else { print "\n"; } print "\n"; } print "
$if->{'fullname'}
\n"; } elsif ($in{'frame'} == 2) { # show chosen interfaces &ui_print_header(undef, ); print "$text{'interfaces_sel'}\n"; print <<'EOF';
EOF } elsif ($in{'frame'} == 3) { # output OK and Cancel buttons &ui_print_header(undef, ); print "
\n"; print "\n"; print "\n"; print "  \n"; print "
\n"; } } else { # selecting just one interface .. display a list of all interfaces to choose from &ui_print_header(undef, ); print "\n"; print "$text{'interfaces_title2'}\n"; print "\n"; foreach $if (&active_interfaces()) { if ($in{'interface'} eq $if->{'fullname'}) { print "\n"; } else { print "\n"; } print "\n"; } print "
$if->{'fullname'}
\n"; }