diff options
author | doktornotor <notordoktor@gmail.com> | 2015-08-08 23:14:58 +0200 |
---|---|---|
committer | doktornotor <notordoktor@gmail.com> | 2015-08-08 23:14:58 +0200 |
commit | 074a64e004046d6c2fa2379be5852dd291e6251c (patch) | |
tree | 626a2d3942c86af731a62e6a3862ab44067d0d97 /config | |
parent | fc07dc3a9de4b65e66e050063f2780d13b077cb4 (diff) | |
download | pfsense-packages-074a64e004046d6c2fa2379be5852dd291e6251c.tar.gz pfsense-packages-074a64e004046d6c2fa2379be5852dd291e6251c.tar.bz2 pfsense-packages-074a64e004046d6c2fa2379be5852dd291e6251c.zip |
backup package - cleanup round two
- Clean up obvious leftover crap
- XHTML valid code
Diffstat (limited to 'config')
-rwxr-xr-x | config/backup/backup_edit.php | 81 |
1 files changed, 31 insertions, 50 deletions
diff --git a/config/backup/backup_edit.php b/config/backup/backup_edit.php index fbaa9096..63b1d52a 100755 --- a/config/backup/backup_edit.php +++ b/config/backup/backup_edit.php @@ -1,9 +1,9 @@ <?php -/* $Id$ */ /* - 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,7 +62,7 @@ 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; @@ -76,10 +75,10 @@ if ($_POST) { $ent['description'] = $_POST['description']; if (isset($id) && $a_backup[$id]) { - //update + // update $a_backup[$id] = $ent; } else { - //add + // add $a_backup[] = $ent; } @@ -91,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 = ''; 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,16 +122,6 @@ function show_advanced_config() { <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"> @@ -142,67 +130,60 @@ function show_advanced_config() { <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']);?>"> + <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']);?>"> + <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"; + 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 " <option value='true' selected='yes'>true</option>\n"; - echo " <option value='false'>false</option>\n"; + 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 " <option value='true'>true</option>\n"; - echo " <option value='false' selected='yes'>false</option>\n"; + 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 " <option value='true' selected='yes'>true</option>\n"; - echo " <option value='false'>false</option>\n"; + 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 " </select>\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> + <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()"> + <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;?>"> + <input name="id" type="hidden" value="<?=$id;?>" /> <?php endif; ?> </td> </tr> </table> </form> - - <br> - <br> - <br> - <br> - <br> - <br> - </td> </tr> </table> |