#!/usr/bin/perl # list_services.cgi # Displays a list of standard and custom services require './itsecur-lib.pl'; &can_use_error("services"); &header($text{'services_title'}, "", undef, undef, undef, undef, &apply_button()); print "
\n"; @services = &list_services(); $edit = &can_edit("services"); print "$text{'services_add'}
\n" if ($edit); print "\n"; print " ", "\n"; if (!$services[0]->{'standard'}) { print "\n"; } foreach $s (@services) { if ($s->{'standard'} && !$doneheader) { print "\n"; $doneheader++; } print "\n"; if ($s->{'standard'}) { print "\n"; } else { print "\n"; } print "\n"; print "\n"; } print "
$text{'service_name'}$text{'service_ports'}
$text{'services_header1'}
$text{'services_header2'}
$s->{'name'}", "$s->{'name'}"; for($i=0; $i<@{$s->{'protos'}}; $i++) { print &protocol_name($s->{'protos'}->[$i], $s->{'ports'}->[$i]); print "\n"; } for($i=0; $i<@{$s->{'others'}}; $i++) { print "$s->{'others'}->[$i]\n"; } print "
\n"; print "$text{'services_add'}

\n" if ($edit); print "


\n"; &footer("", $text{'index_return'});