]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - html/cgi-bin/wakeonlan.cgi
ipsec: Allow to create firewall rules for IPsec input as well.
[people/teissler/ipfire-2.x.git] / html / cgi-bin / wakeonlan.cgi
index e38ff2825bbf3ab22c7203bf97b787c002afe6d8..4a7fc84f0def61b167eb434feda196e8bef5abda 100644 (file)
@@ -1,12 +1,23 @@
 #!/usr/bin/perl
-#
-# IPFire WakeOnLan-AddOn CGI
-# This code is based on the wol-gui addon
-# for ipcop written by weizen_42.
-# http://www.ban-solms.de/t/IPCop-wolgui.html
-#
-# This code is distributed under the terms of the GPL
-#
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
 
 use strict;
 
@@ -249,12 +260,12 @@ print <<END
   <td colspan='4' align='left'><input type='text' name='CLIENT_COMMENT' value='$cgiparams{'CLIENT_COMMENT'}' size='40' /></td>
 </tr>
 </table>
+<br>
 <hr />
 <table width='100%'>
 <tr>
-  <td class='base' valign='top'><img src='/blob.gif' alt='*' /></td>
-  <td width='55%' class='base'>$Lang::tr{'this field may be blank'}</td>
-  <td width='40%' align='center'>
+  <td class='base' valign='top'><img src='/blob.gif' alt='*' />$Lang::tr{'this field may be blank'}</td>
+  <td width='40%' align='right'>
 END
 ;
 
@@ -281,16 +292,17 @@ print "</form>\n";
 &Header::openbox('100%', 'left', "$Lang::tr{'current devices'}");
 
 print <<END
-<table width='100%'>
+<table width='100%' class='tbl'>
 <tr>
-<td align='center' width='20%'><b>$Lang::tr{'mac address'}</b></td>
-<td align='center' width='10%'><b>$Lang::tr{'interface'}</b></td>
-<td align='center' width='60%'><b>$Lang::tr{'remark'}</b></td>
-<td align='center' colspan='2'><b>$Lang::tr{'action'}</b></td>
+<th align='center' width='20%'><b>$Lang::tr{'mac address'}</b></th>
+<th align='center' width='10%'><b>$Lang::tr{'interface'}</b></th>
+<th align='center' width='60%'><b>$Lang::tr{'remark'}</b></th>
+<th align='center' colspan='2'><b>$Lang::tr{'action'}</b></th>
+<th></th>
 </tr>
 END
 ;
-
+my $col="";
 for $i ( 0 .. $#wol_devices )
 {
   my $wol_mac = $wol_devices[$i]{'MAC'};
@@ -299,22 +311,25 @@ for $i ( 0 .. $#wol_devices )
 
   if ( (($cgiparams{'ACTION'} eq 'edit') || ($cgiparams{'ACTION'} eq 'update')) && ($i == $cgiparams{'ID'}) ) 
   {
-    print "<tr bgcolor='${Header::colouryellow}'>";
+    print "<tr>";
+    $col="bgcolor='${Header::colouryellow}'";
   }
   elsif ( $i % 2) 
   {
-    print "<tr bgcolor='$color{'color22'}'>";
+    print "<tr>";
+    $col="bgcolor='$color{'color20'}'";
   }
-  else 
+  else
   {
-    print "<tr bgcolor='$color{'color20'}'>";
+    print "<tr>";
+    $col="bgcolor='$color{'color22'}'";
   }
 
   print <<END
-<td align='center'>$wol_mac</td>
-<td align='center'>$Lang::tr{"$wol_iface"}</td>
-<td align='left'>$wol_txt</td>
-<td align='center'>
+<td align='center' $col>$wol_mac</td>
+<td align='center' $col>$Lang::tr{"$wol_iface"}</td>
+<td align='left' $col>$wol_txt</td>
+<td align='center' $col>
 END
 ;
   if ( (($wol_iface eq 'blue') && ! &haveBlueNet()) 
@@ -336,14 +351,14 @@ END
   }
   print <<END
 </td>
-<td align='center'>
+<td align='center' $col>
   <form method='post' name='frmb$i' action='$ENV{'SCRIPT_NAME'}'>
   <input type='hidden' name='ACTION' value='edit' />
   <input type='image' name='$Lang::tr{'edit'}' src='/images/edit.gif' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />
   <input type='hidden' name='ID' value='$i' />
   </form>
 </td>
-<td align='center'>
+<td align='center' $col>
   <form method='post' name='frmc$i' action='$ENV{'SCRIPT_NAME'}'>
   <input type='hidden' name='ACTION' value='remove' />
   <input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' />
@@ -430,18 +445,14 @@ sub WriteConfig
 #
 sub haveOrangeNet
 {
-  if ($netsettings{'CONFIG_TYPE'} == 1) {return 1;}
-  if ($netsettings{'CONFIG_TYPE'} == 3) {return 1;}
-  if ($netsettings{'CONFIG_TYPE'} == 5) {return 1;}
-  if ($netsettings{'CONFIG_TYPE'} == 7) {return 1;}
+  if ($netsettings{'CONFIG_TYPE'} == 2) {return 1;}
+  if ($netsettings{'CONFIG_TYPE'} == 4) {return 1;}
   return 0;
 }
 
 sub haveBlueNet
 {
+  if ($netsettings{'CONFIG_TYPE'} == 3) {return 1;}
   if ($netsettings{'CONFIG_TYPE'} == 4) {return 1;}
-  if ($netsettings{'CONFIG_TYPE'} == 5) {return 1;}
-  if ($netsettings{'CONFIG_TYPE'} == 6) {return 1;}
-  if ($netsettings{'CONFIG_TYPE'} == 7) {return 1;}
   return 0;
 }