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
21086738
Commit
21086738
authored
Jun 18, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inc: shift more functions to their rightful place
parent
21803172
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
60 deletions
+26
-60
pfsense-utils.inc
src/etc/inc/pfsense-utils.inc
+0
-54
legacy.inc
src/etc/inc/xmlrpc/legacy.inc
+10
-5
setup.xml
src/wizard/setup.xml
+1
-1
diag_backup.php
src/www/diag_backup.php
+15
-0
No files found.
src/etc/inc/pfsense-utils.inc
View file @
21086738
...
@@ -93,21 +93,6 @@ function get_carp_interface_status($carpinterface) {
...
@@ -93,21 +93,6 @@ function get_carp_interface_status($carpinterface) {
return
;
return
;
}
}
/*
* backup_config_section($section): returns as an xml file string of
* the configuration section
*/
function
backup_config_section
(
$section_name
)
{
global
$config
;
$new_section
=
&
$config
[
$section_name
];
/* generate configuration XML */
$xmlconfig
=
dump_xml_config
(
$new_section
,
$section_name
);
$xmlconfig
=
str_replace
(
"<?xml version=
\"
1.0
\"
?>"
,
""
,
$xmlconfig
);
return
$xmlconfig
;
}
/* KEEP THIS: unbreaks syntax highlighting <?php */
/*
/*
* restore_config_section($section_name, new_contents): restore a configuration section,
* restore_config_section($section_name, new_contents): restore a configuration section,
* and write the configuration out
* and write the configuration out
...
@@ -149,26 +134,6 @@ function restore_config_section($section_name, $new_contents)
...
@@ -149,26 +134,6 @@ function restore_config_section($section_name, $new_contents)
return
true
;
return
true
;
}
}
/*
* host_firmware_version(): Return the versions used in this install
*/
function
host_firmware_version
()
{
global
$config
;
return
array
(
'firmware'
=>
array
(
'version'
=>
file_get_contents
(
'/usr/local/opnsense/version/opnsense'
)),
'kernel'
=>
array
(
'version'
=>
file_get_contents
(
'/usr/local/opnsense/version/opnsense-update.kernel'
)),
'base'
=>
array
(
'version'
=>
file_get_contents
(
'/usr/local/opnsense/version/opnsense-update.base'
)),
'config_version'
=>
$config
[
'version'
]
);
}
function
reload_all
()
{
configd_run
(
'service reload all'
,
true
);
}
function
setup_serial_port
(
$sync
=
true
)
function
setup_serial_port
(
$sync
=
true
)
{
{
global
$config
;
global
$config
;
...
@@ -250,25 +215,6 @@ function reload_ttys()
...
@@ -250,25 +215,6 @@ function reload_ttys()
exec
(
'/bin/kill -HUP 1'
);
exec
(
'/bin/kill -HUP 1'
);
}
}
/* Any PPPoE servers enabled? */
function
is_pppoe_server_enabled
()
{
global
$config
;
$pppoeenable
=
false
;
if
(
!
isset
(
$config
[
'pppoes'
][
'pppoe'
])
||
!
is_array
(
$config
[
'pppoes'
][
'pppoe'
]))
{
return
false
;
}
foreach
(
$config
[
'pppoes'
][
'pppoe'
]
as
$pppoes
)
{
if
(
$pppoes
[
'mode'
]
==
'server'
)
{
$pppoeenable
=
true
;
}
}
return
$pppoeenable
;
}
function
add_hostname_to_watch
(
$hostname
)
{
function
add_hostname_to_watch
(
$hostname
)
{
if
(
!
is_dir
(
"/var/db/dnscache"
))
{
if
(
!
is_dir
(
"/var/db/dnscache"
))
{
mkdir
(
"/var/db/dnscache"
);
mkdir
(
"/var/db/dnscache"
);
...
...
src/etc/inc/xmlrpc/legacy.inc
View file @
21086738
<?php
<?php
/*
/*
Copyright (C) 2015-2016 Deciso B.V.
Copyright (C) 2015-2016 Deciso B.V.
Copyright (C) 200
9,
2010 Scott Ullrich
Copyright (C) 200
4-
2010 Scott Ullrich
Copyright (C) 2005 Colin Smith
Copyright (C) 2005 Colin Smith
All rights reserved.
All rights reserved.
...
@@ -100,14 +100,19 @@ function merge_config_attributes(&$cnf_source, &$cnf_dest)
...
@@ -100,14 +100,19 @@ function merge_config_attributes(&$cnf_source, &$cnf_dest)
/**
/**
* retrieve firmware version
* retrieve firmware version
* @return
mixed
* @return
array
*/
*/
function
firmware_version_xmlrpc
()
function
firmware_version_xmlrpc
()
{
{
require_once
(
"pfsense-utils.inc"
);
global
$config
;
return
host_firmware_version
();
}
return
array
(
'kernel'
=>
array
(
'version'
=>
file_get_contents
(
'/usr/local/opnsense/version/opnsense-update.kernel'
)),
'base'
=>
array
(
'version'
=>
file_get_contents
(
'/usr/local/opnsense/version/opnsense-update.base'
)),
'firmware'
=>
array
(
'version'
=>
file_get_contents
(
'/usr/local/opnsense/version/opnsense'
)),
'config_version'
=>
$config
[
'version'
],
);
}
/**
/**
* filter reconfigure
* filter reconfigure
...
...
src/wizard/setup.xml
View file @
21086738
...
@@ -632,7 +632,7 @@
...
@@ -632,7 +632,7 @@
</description>
</description>
<stepafterformdisplay>
<stepafterformdisplay>
<![CDATA[
<![CDATA[
reload_all(
);
configd_run('service reload all', true
);
]]>
]]>
</stepafterformdisplay>
</stepafterformdisplay>
</step>
</step>
...
...
src/www/diag_backup.php
View file @
21086738
...
@@ -40,6 +40,21 @@ require_once("rrd.inc");
...
@@ -40,6 +40,21 @@ require_once("rrd.inc");
require_once
(
"system.inc"
);
require_once
(
"system.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"pfsense-utils.inc"
);
/*
* backup_config_section($section): returns as an xml file string of
* the configuration section
*/
function
backup_config_section
(
$section_name
)
{
global
$config
;
$new_section
=
&
$config
[
$section_name
];
/* generate configuration XML */
$xmlconfig
=
dump_xml_config
(
$new_section
,
$section_name
);
$xmlconfig
=
str_replace
(
"<?xml version=
\"
1.0
\"
?>"
,
""
,
$xmlconfig
);
return
$xmlconfig
;
}
/* KEEP THIS: unbreaks syntax highlighting <?php */
function
rrd_data_xml
()
{
function
rrd_data_xml
()
{
$rrddbpath
=
'/var/db/rrd'
;
$rrddbpath
=
'/var/db/rrd'
;
...
...
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