diff options
Diffstat (limited to 'config/backup/backup_edit.php')
-rwxr-xr-x | config/backup/backup_edit.php | 186 |
1 files changed, 83 insertions, 103 deletions
diff --git a/config/backup/backup_edit.php b/config/backup/backup_edit.php index c7dbc38a..63b1d52a 100755 --- a/config/backup/backup_edit.php +++ b/config/backup/backup_edit.php @@ -1,9 +1,9 @@ -<?php -/* $Id$ */ +<?php /* - backup_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,9 +27,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -require("guiconfig.inc"); -require("/usr/local/pkg/backup.inc"); +require_once("guiconfig.inc"); +require_once("/usr/local/pkg/backup.inc"); $a_backup = &$config['installedpackages']['backup']['config']; @@ -63,10 +62,10 @@ if (isset($id) && $a_backup[$id]) { } if ($_POST) { - + /* TODO - This needs some basic input validation for the path at least */ unset($input_errors); $pconfig = $_POST; - + if (!$input_errors) { $ent = array(); @@ -76,11 +75,10 @@ if ($_POST) { $ent['description'] = $_POST['description']; if (isset($id) && $a_backup[$id]) { - //update - $a_backup[$id] = $ent; - } - else { - //add + // update + $a_backup[$id] = $ent; + } else { + // add $a_backup[] = $ent; } @@ -92,24 +90,23 @@ if ($_POST) { } } +$pgtitle = "Backup: Edit"; include("head.inc"); ?> -<script type="text/javascript" language="JavaScript"> - +<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> +<?php include("fbegin.inc"); ?> +<script type="text/javascript"> +//<![CDATA[ function show_advanced_config() { - document.getElementById("showadvancedbox").innerHTML=''; + document.getElementById("showadvancedbox").innerHTML = ''; aodiv = document.getElementById('showadvanced'); aodiv.style.display = "block"; +} +//]]> </script> -<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> -<?php include("fbegin.inc"); ?> -<p class="pgtitle">Backup: Edit</p> -<?php if ($input_errors) print_input_errors($input_errors); ?> - - <div id="mainlevel"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td class="tabnavtbl"> @@ -124,87 +121,70 @@ function show_advanced_config() { </table> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <td class="tabcont" > - - <!-- - <table width="100%" border="0" cellpadding="6" cellspacing="0"> - <tr> - <td><p><span class="vexpl"><span class="red"><strong>PHP<br> - </strong></span> - </p></td> - </tr> - </table> - --> - <br /> - - <form action="backup_edit.php" method="post" name="iform" id="iform"> - <table width="100%" border="0" cellpadding="6" cellspacing="0"> - - <tr> - <td width="25%" valign="top" class="vncellreq">Name</td> - <td width="75%" class="vtable"> - <input name="name" type="text" class="formfld" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>"> - </td> - </tr> - - <tr> - <td width="22%" valign="top" class="vncellreq">Path</td> - <td width="78%" class="vtable"> - <input name="path" type="text" class="formfld" id="path" size="40" value="<?=htmlspecialchars($pconfig['path']);?>"> - </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='yes'>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='yes'>false</option>\n"; - - break; - default: - echo " <option value='true' selected='yes'>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_backup[$id]): ?> - <input name="id" type="hidden" value="<?=$id;?>"> - <?php endif; ?> - </td> - </tr> - </table> - </form> - - <br> - <br> - <br> - <br> - <br> - <br> - - </td> + <td class="tabcont" > + <br /> + + <form action="backup_edit.php" method="post" name="iform" id="iform"> + <table width="100%" border="0" cellpadding="6" cellspacing="0"> + + <tr> + <td width="25%" valign="top" class="vncellreq">Name</td> + <td width="75%" class="vtable"> + <input name="name" type="text" class="formfld" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>" /> + </td> + </tr> + + <tr> + <td width="22%" valign="top" class="vncellreq">Path</td> + <td width="78%" class="vtable"> + <input name="path" type="text" class="formfld" id="path" size="40" value="<?=htmlspecialchars($pconfig['path']);?>" /> + </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 "\t\t\t\t\t\t\t\t<option></option>\n"; + switch (htmlspecialchars($pconfig['enabled'])) { + case "true": + echo "\t\t\t\t\t\t\t\t<option value='true' selected='selected'>true</option>\n"; + echo "\t\t\t\t\t\t\t\t<option value='false'>false</option>\n"; + break; + + case "false": + echo "\t\t\t\t\t\t\t\t<option value='true'>true</option>\n"; + echo "\t\t\t\t\t\t\t\t<option value='false' selected='selected'>false</option>\n"; + break; + + default: + echo "\t\t\t\t\t\t\t\t<option value='true' selected='selected'>true</option>\n"; + echo "\t\t\t\t\t\t\t\t<option value='false'>false</option>\n"; + } + echo "\t\t\t\t\t\t\t</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_backup[$id]): ?> + <input name="id" type="hidden" value="<?=$id;?>" /> + <?php endif; ?> + </td> + </tr> + </table> + </form> + </td> </tr> </table> |