3 # Displays a list of standard and custom services
5 require './itsecur-lib.pl';
6 &can_use_error("services");
7 &header($text{'services_title'}, "",
8 undef, undef, undef, undef, &apply_button());
11 @services = &list_services();
12 $edit = &can_edit("services");
13 print "<a href='edit_service.cgi?new=1'>$text{'services_add'}</a><br>\n"
15 print "<table border>\n";
16 print "<tr $tb> <td><b>$text{'service_name'}</b></td> ",
17 "<td><b>$text{'service_ports'}</b></td> </tr>\n";
18 if (!$services[0]->{'standard'}) {
19 print "<tr $tb> <td colspan=3><b>$text{'services_header1'}</b></td> </tr>\n";
21 foreach $s (@services) {
22 if ($s->{'standard'} && !$doneheader) {
23 print "<tr $tb> <td colspan=3><b>$text{'services_header2'}</b></td> </tr>\n";
27 if ($s->{'standard'}) {
28 print "<td>$s->{'name'}</td>\n";
31 print "<td><a href='edit_service.cgi?idx=$s->{'index'}'>",
32 "$s->{'name'}</a></td>\n";
35 for($i=0; $i<@{$s->{'protos'}}; $i++) {
36 print &protocol_name($s->{'protos'}->[$i], $s->{'ports'}->[$i]);
39 for($i=0; $i<@{$s->{'others'}}; $i++) {
40 print "<b>$s->{'others'}->[$i]</b>\n";
46 print "<a href='edit_service.cgi?new=1'>$text{'services_add'}</a><p>\n"
50 &footer("", $text{'index_return'});