Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
2935542e
Commit
2935542e
authored
Mar 13, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace config_install
parent
eae996e5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
diag_backup.php
src/www/diag_backup.php
+5
-2
uploadconfig.php
src/www/uploadconfig.php
+3
-1
No files found.
src/www/diag_backup.php
View file @
2935542e
...
...
@@ -27,6 +27,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once
(
"script/load_phalcon.php"
);
/* Allow additional execution time 0 = no limit. */
ini_set
(
'max_execution_time'
,
'0'
);
...
...
@@ -384,7 +385,8 @@ if ($_POST) {
}
else
{
/* restore the entire configuration */
file_put_contents
(
$_FILES
[
'conffile'
][
'tmp_name'
],
$data
);
if
(
config_install
(
$_FILES
[
'conffile'
][
'tmp_name'
])
==
0
)
{
$cnf
=
OPNsense\Core\Config
::
getInstance
();
if
(
$cnf
->
restoreBackup
(
$filename
))
{
/* this will be picked up by /index.php */
mark_subsystem_dirty
(
"restore"
);
touch
(
"/conf/needs_package_sync"
);
...
...
@@ -543,7 +545,8 @@ if ($_POST) {
$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'
;
if
(
config_install
(
$conf_file
)
==
0
)
{
$cnf
=
OPNsense\Core\Config
::
getInstance
();
if
(
$cnf
->
restoreBackup
(
$conf_file
))
{
mark_subsystem_dirty
(
"restore"
);
}
else
{
$input_errors
[]
=
gettext
(
"The configuration could not be restored."
);
...
...
src/www/uploadconfig.php
View file @
2935542e
...
...
@@ -28,6 +28,7 @@
*/
require_once
(
"guiconfig.inc"
);
require_once
(
"script/load_phalcon.php"
);
header
(
"Content-Type: text/plain"
);
...
...
@@ -40,7 +41,8 @@ if ($_POST['config']) {
}
fwrite
(
$fd
,
$_POST
[
'config'
]);
fclose
(
$fd
);
if
(
config_install
(
"
{
$g
[
'tmp_path'
]
}
/config.xml"
)
==
0
)
{
$cnf
=
OPNsense\Core\Config
::
getInstance
();
if
(
$cnf
->
restoreBackup
(
"
{
$g
[
'tmp_path'
]
}
/config.xml"
))
{
echo
gettext
(
"OK"
)
.
"
\n
"
;
system_reboot
();
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment