File: log.pl

package info (click to toggle)
webmin-ldap-netgroups 0.17
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 240 kB
  • ctags: 35
  • sloc: perl: 856; makefile: 65; sh: 15
file content (25 lines) | stat: -rw-r--r-- 515 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
sub view_log
{

   $output = qq~
<a href="/ldap-netgroups">$text{back}</a>
<table border="0" width="500" class="ng">
<tr class="header"><td align="center">$text{execution_results}</td></tr>
~;

   my $x = 0;
   foreach my $message (@log) {
      my $style = ($x % 2) ? 'nc1' : 'nc2';
      my $color = ($message =~ /success/i) ? '#000000' : '#FF0000';
      $output .= qq~
      <tr class="$style"><td><font color="$color">$message</td></td></tr>
      ~;
   }

   $output .= '</table>';

   return $output;

}

1;