diff options
Diffstat (limited to 'config/cron/cron_edit.php')
-rw-r--r-- | config/cron/cron_edit.php | 238 |
1 files changed, 73 insertions, 165 deletions
diff --git a/config/cron/cron_edit.php b/config/cron/cron_edit.php index 2b72a04d..b89c28e0 100644 --- a/config/cron/cron_edit.php +++ b/config/cron/cron_edit.php @@ -1,9 +1,9 @@ <?php -/* $Id$ */ /* - cron_edit.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 @@ -27,11 +27,9 @@ 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']; $id = $_GET['id']; @@ -40,19 +38,18 @@ if (isset($_POST['id'])) { } if ($_GET['act'] == "del") { - if ($_GET['type'] == 'php') { - if ($a_cron[$_GET['id']]) { - unset($a_cron[$_GET['id']]); - write_config(); - cron_sync_package(); - header("Location: cron.php"); - exit; - } - } + if ($_GET['type'] == 'php') { + if ($a_cron[$_GET['id']]) { + unset($a_cron[$_GET['id']]); + write_config(); + cron_sync_package(); + header("Location: cron.php"); + exit; + } + } } if (isset($id) && $a_cron[$id]) { - $pconfig['minute'] = $a_cron[$id]['minute']; $pconfig['hour'] = $a_cron[$id]['hour']; $pconfig['mday'] = $a_cron[$id]['mday']; @@ -60,11 +57,9 @@ if (isset($id) && $a_cron[$id]) { $pconfig['wday'] = $a_cron[$id]['wday']; $pconfig['who'] = $a_cron[$id]['who']; $pconfig['command'] = $a_cron[$id]['command']; - } if ($_POST) { - unset($input_errors); $pconfig = $_POST; @@ -80,10 +75,10 @@ if ($_POST) { $ent['command'] = $_POST['command']; if (isset($id) && $a_cron[$id]) { - //update + // update $a_cron[$id] = $ent; } else { - //add + // add $a_cron[] = $ent; } @@ -115,165 +110,78 @@ function show_advanced_config() { <?php if ($input_errors) print_input_errors($input_errors); ?> - <div id="mainlevel"> <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="mainlevel"> <tr><td class="tabnavtbl"> <?php - $tab_array = array(); $tab_array[] = array(gettext("Settings"), false, "/packages/cron/cron.php"); $tab_array[] = array(gettext("Edit"), true, "/packages/cron/cron_edit.php"); display_top_tabs($tab_array); - ?> </td></tr> </table> -<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="mainarea"> - <tr> - <td class="tabcont" > - - <!-- - <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> - </p> - </td> - </tr> - </table> - --> - <br /> - <form action="cron_edit.php" method="post" name="iform" id="iform"> - <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="form"> - <tr> - <td width="25%" valign="top" class="vncellreq">minute</td> - <td width="75%" class="vtable"> - <input name="minute" type="text" class="formfld" id="minute" size="40" value="<?=htmlspecialchars($pconfig['minute']);?>" /> - </td> - </tr> - - <tr> - <td width="25%" valign="top" class="vncellreq">hour</td> - <td width="75%" class="vtable"> - <input name="hour" type="text" class="formfld" id="hour" size="40" value="<?=htmlspecialchars($pconfig['hour']);?>" /> - </td> - </tr> - - <tr> - <td width="25%" valign="top" class="vncellreq">mday</td> - <td width="75%" class="vtable"> - <input name="mday" type="text" class="formfld" id="mday" size="40" value="<?=htmlspecialchars($pconfig['mday']);?>" /> - </td> - </tr> - - <tr> - <td width="25%" valign="top" class="vncellreq">month</td> - <td width="75%" class="vtable"> - <input name="month" type="text" class="formfld" id="month" size="40" value="<?=htmlspecialchars($pconfig['month']);?>" /> - </td> - </tr> - - <tr> - <td width="25%" valign="top" class="vncellreq">wday</td> - <td width="75%" class="vtable"> - <input name="wday" type="text" class="formfld" id="wday" size="40" value="<?=htmlspecialchars($pconfig['wday']);?>" /> - </td> - </tr> - - <tr> - <td width="25%" valign="top" class="vncellreq">who</td> - <td width="75%" class="vtable"> - <input name="who" type="text" class="formfld" id="who" size="40" value="<?=htmlspecialchars($pconfig['who']);?>" /> - </td> - </tr> - - <tr> - <td width="25%" valign="top" class="vncellreq">command</td> - <td width="75%" class="vtable"> - <!-- <input name="command" type="text" class="formfld" id="command" size="40" value="<?=htmlspecialchars($pconfig['command']);?>" /> --> - <textarea rows="3" cols="68" name="command" id="command"><?=htmlspecialchars($pconfig['command']);?></textarea> - </td> - </tr> - <!-- - <tr> - <td width="22%" valign="top" class="vncell">PHP</td> - <td width="78%" class="vtable"> - --> - <?php - //echo "<textarea name=\"php\" id=\"php\" cols=\"70\" rows=\"15\" wrap=\"off\">".htmlspecialchars($pconfig['php'])."</textarea>\n"; - ?> - <!-- - <br> - <select name='dialplan_expression_select' id='dialplan_expression_select' onchange="document.getElementById('dialplan_expression').value += document.getElementById('dialplan_expression_select').value + '\n';" class='formfld'> - <option></option> - <option value='snortkillsessions'>snort kill sessions</option> - </select> - <span class="vexpl"> - <br /> - </span> - </td> - </tr> - --> - <!-- - <tr> - <td width="22%" valign="top" class="vncellreq">Enabled</td> - <td width="78%" class="vtable"> - <?php - echo " <select name='enabled' class='formfld'>\n"; - echo " <option></option>\n"; - switch (htmlspecialchars($pconfig['enabled'])) { - case "true": - echo " <option value='true' selected='selected'>true</option>\n"; - echo " <option value='false'>false</option>\n"; - break; - case "false": - echo " <option value='true'>true</option>\n"; - echo " <option value='false' selected='selected'>false</option>\n"; - - break; - default: - echo " <option value='true' selected='selected'>true</option>\n"; - echo " <option value='false'>false</option>\n"; - } - echo " </select>\n"; - ?> - </td> - </tr> - --> - <!-- - <tr> - <td width="25%" valign="top" class="vncellreq">Description</td> - <td width="75%" class="vtable"> - <input name="description" type="text" class="formfld" id="description" size="40" value="<?=htmlspecialchars($pconfig['description']);?>" /> - <br /><span class="vexpl">Enter the description here.<br /></span> - </td> - </tr> - --> - - <tr> - <td valign="top"> </td> - <td> - <input name="Submit" type="submit" class="formbtn" value="Save" /> <input class="formbtn" type="button" value="Cancel" onclick="history.back()" /> - <?php if (isset($id) && $a_cron[$id]): ?> - <input name="id" type="hidden" value="<?=$id;?>" /> - <?php endif; ?> - </td> - </tr> - </table> - </form> - - <br /> - <br /> - <br /> - <br /> - <br /> - <br /> - - </td> - </tr> +<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="mainarea"> +<tr><td class="tabcont" > + <br /> + <form action="cron_edit.php" method="post" name="iform" id="iform"> + <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="form"> + <tr> + <td width="25%" valign="top" class="vncellreq">minute</td> + <td width="75%" class="vtable"> + <input name="minute" type="text" class="formfld" id="minute" size="40" value="<?=htmlspecialchars($pconfig['minute']);?>" /> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">hour</td> + <td width="75%" class="vtable"> + <input name="hour" type="text" class="formfld" id="hour" size="40" value="<?=htmlspecialchars($pconfig['hour']);?>" /> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">mday</td> + <td width="75%" class="vtable"> + <input name="mday" type="text" class="formfld" id="mday" size="40" value="<?=htmlspecialchars($pconfig['mday']);?>" /> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">month</td> + <td width="75%" class="vtable"> + <input name="month" type="text" class="formfld" id="month" size="40" value="<?=htmlspecialchars($pconfig['month']);?>" /> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">wday</td> + <td width="75%" class="vtable"> + <input name="wday" type="text" class="formfld" id="wday" size="40" value="<?=htmlspecialchars($pconfig['wday']);?>" /> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">who</td> + <td width="75%" class="vtable"> + <input name="who" type="text" class="formfld" id="who" size="40" value="<?=htmlspecialchars($pconfig['who']);?>" /> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">command</td> + <td width="75%" class="vtable"> + <textarea rows="3" cols="68" name="command" id="command"><?=htmlspecialchars($pconfig['command']);?></textarea> + </td> + </tr> + <tr> + <td valign="top"> </td> + <td> + <input name="Submit" type="submit" class="formbtn" value="Save" /> <input class="formbtn" type="button" value="Cancel" onclick="history.back()" /> + <?php if (isset($id) && $a_cron[$id]): ?> + <input name="id" type="hidden" value="<?=$id;?>" /> + <?php endif; ?> + </td> + </tr> + </table> + </form> + <br /> +</td></tr> </table> </div> |