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) {
$mode = "restore";
else if (stristr($_POST['Submit'], gettext("Download")))
$mode = "download";
else if (stristr($_POST['Submit'], gettext("Restore version")))
$mode = "restore_ver";
else if (stristr($_POST['Submit'], gettext("Setup/Test Google Drive")))
$mode = "setup_gdrive";
if ($_POST["ver"] <> "")
$ver2restore = $_POST["ver"];
if ($mode) {
if ($mode == "download") {
......@@ -453,19 +448,6 @@ if ($_POST) {
$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" ){
global $config;
if (!isset($config['system']['remotebackup'])) {
......@@ -580,18 +562,14 @@ function backuparea_change(obj) {
<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">
<header class="content-box-head container-fluid">
<h3><?=gettext('Download')?></h3>
</header>
<div class="content-box-main ">
<div class="content-box-main">
<div class="table-responsive">
<table class="table table-striped __nomb">
......@@ -640,7 +618,7 @@ function backuparea_change(obj) {
</tr>
</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>
......@@ -702,8 +680,8 @@ function backuparea_change(obj) {
</td>
</tr>
</table>
<p><input name="Submit" type="submit" class="btn btn-default" 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><input name="Submit" type="submit" class="btn btn-primary" id="restore" value="<?=gettext("Restore configuration"); ?>" /></p>
<p><strong><span class="text-danger"><?=gettext("Note:"); ?> <?=gettext("The firewall will reboot after restoring the configuration."); ?></span></strong></p>
</td>
......@@ -739,7 +717,7 @@ function backuparea_change(obj) {
<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("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>
</table>
</div>
......@@ -747,10 +725,6 @@ function backuparea_change(obj) {
</div>
</section>
</div>
</div>
</section>
</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