aboutsummaryrefslogtreecommitdiffstats
path: root/config/cron/cron.php
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-08-12 12:04:25 +0200
committerdoktornotor <notordoktor@gmail.com>2015-08-12 12:04:25 +0200
commit7d4d7a31d30ca24e54437599e2ac0438af68bc12 (patch)
treeb5d1ad87df9ad301a6fe9377ca8272db415bac08 /config/cron/cron.php
parentfc15c06f6f8e135ac5ec2819702b9eb03882a747 (diff)
downloadpfsense-packages-7d4d7a31d30ca24e54437599e2ac0438af68bc12.tar.gz
pfsense-packages-7d4d7a31d30ca24e54437599e2ac0438af68bc12.tar.bz2
pfsense-packages-7d4d7a31d30ca24e54437599e2ac0438af68bc12.zip
cron - rewrite broken package
- Fix copyright header - Code style and indentation
Diffstat (limited to 'config/cron/cron.php')
-rw-r--r--config/cron/cron.php199
1 files changed, 76 insertions, 123 deletions
diff --git a/config/cron/cron.php b/config/cron/cron.php
index d7ed1494..7d55b086 100644
--- a/config/cron/cron.php
+++ b/config/cron/cron.php
@@ -1,8 +1,9 @@
<?php
-/* $Id$ */
/*
cron.php
+ part of pfSense (https://www.pfSense.org/)
Copyright (C) 2008 Mark J Crane
+ Copyright (C) 2015 ESF, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,11 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
require_once("guiconfig.inc");
require_once("/usr/local/pkg/cron.inc");
$a_cron = &$config['cron']['item'];
-
if ($_GET['act'] == "del") {
if ($_GET['type'] == 'php') {
if ($a_cron[$_GET['id']]) {
@@ -56,147 +55,101 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="tabs">
<tr><td class="tabnavtbl">
<?php
-
$tab_array = array();
$tab_array[] = array(gettext("Settings"), true, "/packages/cron/cron.php");
$tab_array[] = array(gettext("Edit"), false, "/packages/cron/cron_edit.php");
display_top_tabs($tab_array);
-
?>
</td></tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="content">
- <tr>
- <td class="tabcont" >
-
-<form action="cron.php" method="post" name="iform" id="iform">
-<?php
-
-if ($config_change == 1) {
- write_config();
- $config_change = 0;
-}
-
-//if ($savemsg) print_info_box($savemsg);
-//if (file_exists($d_hostsdirty_path)): echo"<p>";
-//print_info_box_np("This is an info box.");
-//echo"<br />";
-//endif;
-
-?>
+<tr><td class="tabcont" >
+ <form action="cron.php" method="post" name="iform" id="iform">
+ <?php
+ if ($config_change == 1) {
+ write_config();
+ $config_change = 0;
+ }
+ ?>
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="title">
- <tr>
- <td>
- <p><!--<span class="vexpl"><span class="red"><strong>Cron<br></strong></span>-->
- Cron controls the scheduling of commands.
- <br /><br />
- For more information see: <a href='http://www.freebsd.org/doc/en/books/handbook/configtuning-cron.html' target='_blank'>http://www.freebsd.org/doc/en/books/handbook/configtuning-cron.html</a>
- </p>
- </td>
- </tr>
+ <tr><td>
+ <div>
+ Cron controls the scheduling of commands.<br /><br />
+ For more information see: <a href='http://www.freebsd.org/doc/en/books/handbook/configtuning-cron.html'>http://www.freebsd.org/doc/en/books/handbook/configtuning-cron.html</a>
+ </div>
+ </td></tr>
</table>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="heading">
- <tr>
- <td width="5%" class="listhdrr">minute</td>
- <td width="5%" class="listhdrr">hour</td>
- <td width="5%" class="listhdrr">mday</td>
- <td width="5%" class="listhdrr">month</td>
- <td width="5%" class="listhdrr">wday</td>
- <td width="5%" class="listhdrr">who</td>
- <td width="60%" class="listhdr">command</td>
- <td width="10%" class="list">
- <table border="0" cellspacing="0" cellpadding="1" summary="icons">
- <tr>
- <td width="17"></td>
- <td valign="middle"><a href="cron_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="edit" /></a></td>
- </tr>
- </table>
- </td>
- </tr>
-
-
- <?php
-
- $i = 0;
- if (count($a_cron) > 0) {
- foreach ($a_cron as $ent) {
+ <tr>
+ <td width="5%" class="listhdrr">minute</td>
+ <td width="5%" class="listhdrr">hour</td>
+ <td width="5%" class="listhdrr">mday</td>
+ <td width="5%" class="listhdrr">month</td>
+ <td width="5%" class="listhdrr">wday</td>
+ <td width="5%" class="listhdrr">who</td>
+ <td width="60%" class="listhdr">command</td>
+ <td width="10%" class="list">
+ <table border="0" cellspacing="0" cellpadding="1" summary="icons">
+ <tr>
+ <td width="17"></td>
+ <td valign="middle"><a href="cron_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="edit" /></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
- ?>
- <tr>
- <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';">
- <?=$ent['minute'];?>&nbsp;
- </td>
- <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';">
- <?=$ent['hour'];?>&nbsp;
- </td>
- <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';">
- <?=$ent['mday'];?>&nbsp;
- </td>
- <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';">
- <?=$ent['month'];?>&nbsp;
- </td>
- <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';">
- <?=$ent['wday'];?>&nbsp;
- </td>
- <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';">
- <?=$ent['who'];?>&nbsp;
- </td>
- <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';">
- <?=$ent['command'];?>&nbsp;
- </td>
- <td valign="middle" style="white-space:nowrap" class="list">
- <table border="0" cellspacing="0" cellpadding="1" summary="edit delete">
- <tr>
- <td valign="middle"><a href="cron_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a></td>
- <td><a href="cron_edit.php?type=php&amp;act=del&amp;id=<?=$i;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <?php
-
- $i++;
+ <?php
+ $i = 0;
+ if (count($a_cron) > 0) {
+ foreach ($a_cron as $ent) {
+ ?>
+ <tr>
+ <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';"><?=$ent['minute'];?>&nbsp;</td>
+ <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';"><?=$ent['hour'];?>&nbsp;</td>
+ <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';"><?=$ent['mday'];?>&nbsp;</td>
+ <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';"><?=$ent['month'];?>&nbsp;</td>
+ <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';"><?=$ent['wday'];?>&nbsp;</td>
+ <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';"><?=$ent['who'];?>&nbsp;</td>
+ <td class="listr" ondblclick="document.location='cron_edit.php?id=<?=$i;?>';"><?=$ent['command'];?>&nbsp;</td>
+ <td valign="middle" style="white-space:nowrap" class="list">
+ <table border="0" cellspacing="0" cellpadding="1" summary="edit delete">
+ <tr>
+ <td valign="middle"><a href="cron_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a></td>
+ <td><a href="cron_edit.php?type=php&amp;act=del&amp;id=<?=$i;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <?php
+ $i++;
+ }
}
- }
?>
- <tr>
- <td class="list" colspan="7"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1" summary="add">
- <tr>
- <td width="17"></td>
- <td valign="middle"><a href="cron_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
- </tr>
- </table>
- </td>
- </tr>
-
-
- <tr>
- <td class="list" colspan="8"></td>
- <td class="list"></td>
- </tr>
- </table>
-
-</form>
-
-
-<br />
-<br />
-<br />
-<br />
-<br />
-<br />
-<br />
-<br />
-
+ <tr>
+ <td class="list" colspan="7"></td>
+ <td class="list">
+ <table border="0" cellspacing="0" cellpadding="1" summary="add">
+ <tr>
+ <td width="17"></td>
+ <td valign="middle"><a href="cron_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
+ </tr>
+ </table>
</td>
</tr>
+
+ <tr>
+ <td class="list" colspan="8"></td>
+ <td class="list"></td>
+ </tr>
+ </table>
+
+ </form>
+</td></tr>
</table>
</div>