]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/connscheduler.cgi
There is no clockmod module for xen available.
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / connscheduler.cgi
index 1ad7ff16c9d38c7089b21631e6e62210366660b9..b257adb2e24c72ef6ba0480cd2c1cdce77ad4079 100644 (file)
@@ -1,10 +1,23 @@
 #!/usr/bin/perl
-#
-# IPCop Connection Scheduler Web-Iface
-#
-# 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;
 
@@ -18,6 +31,11 @@ require "${General::swroot}/header.pl";
 
 require '/var/ipfire/connscheduler/lib.pl';
 
+my %color = ();
+my %mainsettings = ();
+&General::readhash("${General::swroot}/main/settings", \%mainsettings);
+&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+
 my $buttontext = $Lang::tr{'add'};
 my $hiddenvalue = 'add';
 my $day;
@@ -40,6 +58,8 @@ $selected{'dial'} = '';
 $selected{'hangup'} = '';
 $selected{'reboot'} = '';
 $selected{'shutdown'} = '';
+$selected{'ipsecstart'} = '';
+$selected{'ipsecstop'} = '';
 my $selected_profile = 1;
 my $checked_days = "checked='checked'";
 my $selected_daystart = 1;
@@ -249,13 +269,13 @@ if ( ($cgiparams{'ACTION'} eq 'down') || ($cgiparams{'ACTION'} eq 'up') )
 # Add / Edit Box
 #
 
-&Header::openbox('100%', 'left', $Lang::tr{'add action'});
+&Header::openbox('100%', 'left', $Lang::tr{'ConnSched add action'});
 
 print <<END
 <form method='post' name='addevent' action='$ENV{'SCRIPT_NAME'}'>
 <table width='100%' border='0' cellspacing='6' cellpadding='0'>
 <tr>
-<td width='15%' class='base'>$Lang::tr{'connscheduler time'}</td>
+<td width='15%' class='base'>$Lang::tr{'ConnSched time'}</td>
 <td><select name='ACTION_HOUR'>
 END
 ;
@@ -288,16 +308,18 @@ for ($minute = 0; $minute <= 55; $minute += 5)
 print <<END
 </select></td></tr>
 <tr><td colspan='2'><hr /></td></tr>
-<tr><td width='15%' class='base'>$Lang::tr{'connscheduler action'}</td><td>
+<tr><td width='15%' class='base'>$Lang::tr{'ConnSched action'}</td><td>
 <input type='radio' value='CONNECT' name='ACTION_ACTION' $checked_connect />&nbsp;<select name='ACTION_CONNECT'>
-<option value='reconnect' $selected{'reconnect'}>$Lang::tr{'reconnect'}</option>
+<option value='reconnect' $selected{'reconnect'}>$Lang::tr{'ConnSched reconnect'}</option>
 <option value='dial' $selected{'dial'}>$Lang::tr{'dial'}</option>
 <option value='hangup' $selected{'hangup'}>$Lang::tr{'hangup'}</option>
 <option value='reboot' $selected{'reboot'}>$Lang::tr{'reboot'}</option>
 <option value='shutdown' $selected{'shutdown'}>$Lang::tr{'shutdown'}</option>
+<option value='ipsecstart' $selected{'ipsecstart'}>$Lang::tr{'ConnSched ipsecstart'}</option>
+<option value='ipsecstop' $selected{'ipsecstop'}>$Lang::tr{'ConnSched ipsecstop'}</option>
 </select></td></tr>
 <tr><td width='15%' class='base'>&nbsp;</td>
-<td><input type='radio' value='PROFILE' name='ACTION_ACTION' $checked_profile />&nbsp;$Lang::tr{'change profile title'}&nbsp;<select name='ACTION_PROFILENR'>
+<td><input type='radio' value='PROFILE' name='ACTION_ACTION' $checked_profile />&nbsp;$Lang::tr{'ConnSched change profile title'}&nbsp;<select name='ACTION_PROFILENR'>
 END
 ;
 for ($i = 1; $i <= $CONNSCHED::maxprofiles; $i++)
@@ -314,7 +336,7 @@ for ($i = 1; $i <= $CONNSCHED::maxprofiles; $i++)
 print <<END
 </select></td></tr>
 <tr><td colspan='2'><hr /></td></tr>
-<tr><td width='15%' class='base'>$Lang::tr{'connscheduler days'}</td>
+<tr><td width='15%' class='base'>$Lang::tr{'ConnSched days'}</td>
 <td><input type='radio' value='DAYS' name='ACTION_DAYSTYPE' $checked_days />&nbsp;<select name='ACTION_DAYSTART'>
 END
 ;
@@ -344,7 +366,7 @@ for ($day = 1; $day <= 31; $day++)
 
 print <<END
 </select></td></tr>
-<tr><td width='15%' class='base'>&nbsp;</td><td><input type='radio' value='WEEKDAYS' name='ACTION_DAYSTYPE' $checked_weekdays />&nbsp;$Lang::tr{'connsched weekdays'}<br />
+<tr><td width='15%' class='base'>&nbsp;</td><td><input type='radio' value='WEEKDAYS' name='ACTION_DAYSTYPE' $checked_weekdays />&nbsp;$Lang::tr{'ConnSched weekdays'}<br />
 &nbsp;&nbsp;<input type='checkbox' name='Mon' $checked_mon />$Lang::tr{'monday'}<br />
 &nbsp;&nbsp;<input type='checkbox' name='Tue' $checked_tue />$Lang::tr{'tuesday'}<br />
 &nbsp;&nbsp;<input type='checkbox' name='Wed' $checked_wed />$Lang::tr{'wednesday'}<br />
@@ -375,7 +397,7 @@ END
 # Box with List of events
 #
 
-&Header::openbox('100%', 'left', $Lang::tr{'scheduled actions'});
+&Header::openbox('100%', 'left', $Lang::tr{'ConnSched scheduled actions'});
 print <<END
 <table width='100%' border='0' cellspacing='1' cellpadding='0'>
 <tr>
@@ -397,17 +419,17 @@ for my $id ( 0 .. $#CONNSCHED::config )
   }
   elsif ( $id % 2 )
   {
-    $trcolor = "<tr bgcolor='$Header::table2colour'>";
+    $trcolor = "<tr bgcolor='$color{'color20'}'>";
   }
   else 
   {
-    $trcolor = "<tr bgcolor='$Header::table1colour'>";
+    $trcolor = "<tr bgcolor='$color{'color22'}'>";
   }
 
 print <<END
 $trcolor
 <td align='center'>$CONNSCHED::config[$id]{'TIME'}</td>
-<td>$Lang::tr{"$CONNSCHED::config[$id]{'ACTION'}"}&nbsp;$CONNSCHED::config[$id]{'PROFILENR'}</td>
+<td>$Lang::tr{"ConnSched $CONNSCHED::config[$id]{'ACTION'}"}&nbsp;$CONNSCHED::config[$id]{'PROFILENR'}</td>
 <td>$CONNSCHED::config[$id]{'COMMENT'}</td>
 <td align='center'>
   <form method='post' name='frm$id' action='$ENV{'SCRIPT_NAME'}'>
@@ -433,14 +455,14 @@ $trcolor
 <td align='center'>
   <form method='post' name='frm$id' action='$ENV{'SCRIPT_NAME'}'>
   <input type='hidden' name='ACTION' value='up' />
-  <input type='image' name='$Lang::tr{'up'}' src='/images/up.gif' alt='$Lang::tr{'up'}' title='$Lang::tr{'up'}' />
+  <input type='image' name='$Lang::tr{'ConnSched up'}' src='/images/up.gif' alt='$Lang::tr{'ConnSched up'}' title='$Lang::tr{'ConnSched up'}' />
   <input type='hidden' name='ID' value='$id' />
   </form>
 </td>
 <td align='center'>
   <form method='post' name='frm$id' action='$ENV{'SCRIPT_NAME'}'>
   <input type='hidden' name='ACTION' value='down' />
-  <input type='image' name='$Lang::tr{'down'}' src='/images/down.gif' alt='$Lang::tr{'down'}' title='$Lang::tr{'down'}' />
+  <input type='image' name='$Lang::tr{'ConnSched down'}' src='/images/down.gif' alt='$Lang::tr{'ConnSched down'}' title='$Lang::tr{'ConnSched down'}' />
   <input type='hidden' name='ID' value='$id' />
   </form>
 </td>
@@ -457,14 +479,6 @@ print <<END
 </table>
 <br />
 <hr />
-<table width='100%'>
-<tr>
-       <td>&nbsp;</td>
-       <td align='right'>
-       <b><small><a href="http://www.ban-solms.de/t/IPCop.html" target="_blank">Connection Scheduler $CONNSCHED::version</a></small></b>
-       </td>
-</tr>
-</table>
 END
 ;