Commit 42d24d89 authored by Franco Fichtner's avatar Franco Fichtner

config import/export: stale string/functionality

Spotted by: @fabianfrz
parent 06f5db67
...@@ -214,14 +214,9 @@ if ($_POST) { ...@@ -214,14 +214,9 @@ if ($_POST) {
$mode = "restore"; $mode = "restore";
else if (stristr($_POST['Submit'], gettext("Download"))) else if (stristr($_POST['Submit'], gettext("Download")))
$mode = "download"; $mode = "download";
else if (stristr($_POST['Submit'], gettext("Restore version")))
$mode = "restore_ver";
else if (stristr($_POST['Submit'], gettext("Setup/Test Google Drive"))) else if (stristr($_POST['Submit'], gettext("Setup/Test Google Drive")))
$mode = "setup_gdrive"; $mode = "setup_gdrive";
if ($_POST["ver"] <> "")
$ver2restore = $_POST["ver"];
if ($mode) { if ($mode) {
if ($mode == "download") { if ($mode == "download") {
...@@ -453,19 +448,6 @@ if ($_POST) { ...@@ -453,19 +448,6 @@ if ($_POST) {
$input_errors[] = gettext("The configuration could not be restored (file upload error)."); $input_errors[] = gettext("The configuration could not be restored (file upload error).");
} }
} }
} elseif ($mode == "restore_ver") {
$input_errors[] = gettext("XXX - this feature may hose your config (do NOT backrev configs!) - billm");
if ($ver2restore <> "") {
$conf_file = '/conf/backup/config-' . strtotime($ver2restore) . '.xml';
$cnf = OPNsense\Core\Config::getInstance();
if ($cnf->restoreBackup($conf_file)) {
mark_subsystem_dirty("restore");
} else {
$input_errors[] = gettext("The configuration could not be restored.");
}
} else {
$input_errors[] = gettext("No version selected.");
}
} elseif ( $mode == "setup_gdrive" ){ } elseif ( $mode == "setup_gdrive" ){
global $config; global $config;
if (!isset($config['system']['remotebackup'])) { if (!isset($config['system']['remotebackup'])) {
...@@ -580,10 +562,6 @@ function backuparea_change(obj) { ...@@ -580,10 +562,6 @@ function backuparea_change(obj) {
<section class="col-xs-12"> <section class="col-xs-12">
<div class="container-fluid tab-content">
<div class="tab-pane active" id="system">
<section class="__mb"> <section class="__mb">
<div class="content-box"> <div class="content-box">
...@@ -591,7 +569,7 @@ function backuparea_change(obj) { ...@@ -591,7 +569,7 @@ function backuparea_change(obj) {
<h3><?=gettext('Download')?></h3> <h3><?=gettext('Download')?></h3>
</header> </header>
<div class="content-box-main "> <div class="content-box-main">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped __nomb"> <table class="table table-striped __nomb">
...@@ -640,7 +618,7 @@ function backuparea_change(obj) { ...@@ -640,7 +618,7 @@ function backuparea_change(obj) {
</tr> </tr>
</table> </table>
<input name="Submit" type="submit" class="btn btn-default __mt" id="download" value="<?=gettext("Download configuration"); ?>" /> <input name="Submit" type="submit" class="btn btn-primary __mt" id="download" value="<?=gettext("Download configuration"); ?>" />
</td> </td>
...@@ -702,8 +680,8 @@ function backuparea_change(obj) { ...@@ -702,8 +680,8 @@ function backuparea_change(obj) {
</td> </td>
</tr> </tr>
</table> </table>
<p><input name="Submit" type="submit" class="btn btn-default" id="restore" value="<?=gettext("Restore configuration"); ?>" /></p> <p><input name="Submit" type="submit" class="btn btn-primary" id="restore" value="<?=gettext("Restore configuration"); ?>" /></p>
<p><strong><span class="red"><?=gettext("Note:"); ?></span></strong><br /><?=gettext("The firewall will reboot after restoring the configuration."); ?><br /></p> <p><strong><span class="text-danger"><?=gettext("Note:"); ?> <?=gettext("The firewall will reboot after restoring the configuration."); ?></span></strong></p>
</td> </td>
...@@ -739,7 +717,7 @@ function backuparea_change(obj) { ...@@ -739,7 +717,7 @@ function backuparea_change(obj) {
<tr><td colspan=2><?=gettext("Password protect your data"); ?> :</td></tr> <tr><td colspan=2><?=gettext("Password protect your data"); ?> :</td></tr>
<tr><td><?=gettext("Password :"); ?></td> <td> <input name="GDrivePassword" type="password" class="formfld pwd" size="20" value="<? echo $config['system']['remotebackup']['GDrivePassword'] ;?>" /> </td></tr> <tr><td><?=gettext("Password :"); ?></td> <td> <input name="GDrivePassword" type="password" class="formfld pwd" size="20" value="<? echo $config['system']['remotebackup']['GDrivePassword'] ;?>" /> </td></tr>
<tr><td><?=gettext("Confirm :"); ?></td> <td> <input name="GDrivePasswordConfirm" type="password" class="formfld pwd" size="20" value="<? echo $config['system']['remotebackup']['GDrivePassword'] ;?>" /> </td></tr> <tr><td><?=gettext("Confirm :"); ?></td> <td> <input name="GDrivePasswordConfirm" type="password" class="formfld pwd" size="20" value="<? echo $config['system']['remotebackup']['GDrivePassword'] ;?>" /> </td></tr>
<tr><td><input name="Submit" class="btn btn-default" id="Gdrive" value="<?=gettext("Setup/Test Google Drive");?>" type="submit"></td><td></td></tr> <tr><td><input name="Submit" class="btn btn-primary" id="Gdrive" value="<?=gettext("Setup/Test Google Drive");?>" type="submit"></td><td></td></tr>
</tbody> </tbody>
</table> </table>
</div> </div>
...@@ -747,10 +725,6 @@ function backuparea_change(obj) { ...@@ -747,10 +725,6 @@ function backuparea_change(obj) {
</div> </div>
</section> </section>
</div>
</div>
</section> </section>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment