diff options
author | mcrane <mctch@yahoo.com> | 2009-10-02 19:21:05 -0600 |
---|---|---|
committer | mcrane <mctch@yahoo.com> | 2009-10-02 19:22:32 -0600 |
commit | 31d4f4e0a177725f98d8e670de3170f0fb47ee3e (patch) | |
tree | 0591e18a3417f99e9e03de124cdb77085e90e16a /config/backup/backup_edit.tmp | |
parent | ec204945983f8570c57d64d7a4358e7db59a7011 (diff) | |
download | pfsense-packages-31d4f4e0a177725f98d8e670de3170f0fb47ee3e.tar.gz pfsense-packages-31d4f4e0a177725f98d8e670de3170f0fb47ee3e.tar.bz2 pfsense-packages-31d4f4e0a177725f98d8e670de3170f0fb47ee3e.zip |
Backup package make changes so that it will work on nano version and some white space clean up.
Diffstat (limited to 'config/backup/backup_edit.tmp')
-rwxr-xr-x | config/backup/backup_edit.tmp | 200 |
1 files changed, 101 insertions, 99 deletions
diff --git a/config/backup/backup_edit.tmp b/config/backup/backup_edit.tmp index 69d63866..12020556 100755 --- a/config/backup/backup_edit.tmp +++ b/config/backup/backup_edit.tmp @@ -5,17 +5,17 @@ backup_edit.php Copyright (C) 2008 Mark J Crane All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE @@ -32,7 +32,7 @@ require("guiconfig.inc"); require("/usr/local/pkg/backup.inc"); -$a_backup = &$config['installedpackages']['backup']['config']; +$a_backup = &$config['installedpackages']['backup']['config']; $id = $_GET['id']; if (isset($_POST['id'])) { @@ -40,15 +40,17 @@ if (isset($_POST['id'])) { } if ($_GET['act'] == "del") { - if ($_GET['type'] == 'backup') { - if ($a_backup[$_GET['id']]) { - unset($a_backup[$_GET['id']]); - write_config(); - php_sync_package(); - header("Location: backup.php"); - exit; - } - } + if ($_GET['type'] == 'backup') { + if ($a_backup[$_GET['id']]) { + conf_mount_rw(); + unset($a_backup[$_GET['id']]); + write_config(); + php_sync_package(); + header("Location: backup.php"); + conf_mount_ro(); + exit; + } + } } if (isset($id) && $a_backup[$id]) { @@ -57,7 +59,7 @@ if (isset($id) && $a_backup[$id]) { $pconfig['path'] = $a_backup[$id]['path']; $pconfig['enabled'] = $a_backup[$id]['enabled']; $pconfig['description'] = $a_backup[$id]['description']; - + } if ($_POST) { @@ -66,11 +68,11 @@ if ($_POST) { $pconfig = $_POST; if (!$input_errors) { - + $ent = array(); $ent['name'] = $_POST['name']; - $ent['path'] = $_POST['path']; - $ent['enabled'] = $_POST['enabled']; + $ent['path'] = $_POST['path']; + $ent['enabled'] = $_POST['enabled']; $ent['description'] = $_POST['description']; if (isset($id) && $a_backup[$id]) { @@ -78,13 +80,13 @@ if ($_POST) { $a_backup[$id] = $ent; } else { - //add + //add $a_backup[] = $ent; } - + write_config(); php_sync_package(); - + header("Location: backup.php"); exit; } @@ -112,98 +114,98 @@ function show_advanced_config() { <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td class="tabnavtbl"> <?php - + $tab_array = array(); $tab_array[] = array(gettext("Settings"), false, "/packages/backup/backup.php"); display_top_tabs($tab_array); - + ?> </td></tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td class="tabcont" > + <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"> + <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> + </td> + </tr> - <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"; - 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> - </tr> + </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> + </tr> </table> </div> |