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
93e4773f
Commit
93e4773f
authored
Jun 08, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firmware: for now, push crypto settings to "System: Settings: General"
parent
de984e2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
35 deletions
+88
-35
system.inc
src/etc/inc/system.inc
+39
-32
system_general.php
src/www/system_general.php
+49
-3
No files found.
src/etc/inc/system.inc
View file @
93e4773f
...
...
@@ -787,9 +787,47 @@ EOD;
return
$retval
;
}
function
system_firmware_configure
()
{
global
$config
;
$pkg_mirror
=
'http://pkg.opnsense.org'
;
$pkg_flavour
=
'latest'
;
if
(
!
file_exists
(
'/usr/local/etc/pkg/repos/OPNsense.conf.sample'
))
{
return
;
}
if
(
isset
(
$config
[
'system'
][
'firmware'
][
'flavour'
]))
{
$pkg_flavour
=
$config
[
'system'
][
'firmware'
][
'flavour'
];
}
if
(
isset
(
$config
[
'system'
][
'firmware'
][
'mirror'
]))
{
$pkg_mirror
=
$config
[
'system'
][
'firmware'
][
'mirror'
];
}
$pkg_sample
=
file_get_contents
(
'/usr/local/etc/pkg/repos/OPNsense.conf.sample'
);
$pkg_sample
=
explode
(
PHP_EOL
,
$pkg_sample
);
$pkg_config
=
''
;
foreach
(
$pkg_sample
as
$pkg_line
)
{
if
(
!
strlen
(
$pkg_line
))
{
continue
;
}
elseif
(
!
strncasecmp
(
$pkg_line
,
' url:'
,
6
))
{
$pkg_line
=
sprintf
(
' url: "pkg+%s/${ABI}/%s",'
,
$pkg_mirror
,
$pkg_flavour
);
}
$pkg_config
.=
$pkg_line
.
PHP_EOL
;
}
file_put_contents
(
'/usr/local/etc/pkg/repos/OPNsense.conf'
,
$pkg_config
);
}
function
system_webgui_start
()
{
global
$config
,
$g
;
global
$config
;
chdir
(
'/usr/local/www'
);
...
...
@@ -799,37 +837,6 @@ function system_webgui_start()
$key
=
""
;
$ca
=
""
;
/* XXX migrate this to a more appropriate place */
if
(
file_exists
(
'/usr/local/etc/pkg/repos/OPNsense.conf.sample'
))
{
$pkg_flavour
=
'latest'
;
if
(
isset
(
$config
[
'system'
][
'firmware'
][
'flavour'
]))
{
$pkg_flavour
=
$config
[
'system'
][
'firmware'
][
'flavour'
];
}
$pkg_mirror
=
'http://pkg.opnsense.org'
;
if
(
isset
(
$config
[
'system'
][
'firmware'
][
'mirror'
]))
{
$pkg_mirror
=
$config
[
'system'
][
'firmware'
][
'mirror'
];
}
/* upgrade pkg(8) mirror info */
$pkg_sample
=
file_get_contents
(
'/usr/local/etc/pkg/repos/OPNsense.conf.sample'
);
$pkg_sample
=
explode
(
PHP_EOL
,
$pkg_sample
);
$pkg_config
=
''
;
foreach
(
$pkg_sample
as
$pkg_line
)
{
if
(
!
strlen
(
$pkg_line
))
{
continue
;
}
elseif
(
!
strncasecmp
(
$pkg_line
,
' url:'
,
6
))
{
$pkg_line
=
sprintf
(
' url: "pkg+%s/${ABI}/%s",'
,
$pkg_mirror
,
$pkg_flavour
);
}
$pkg_config
.=
$pkg_line
.
PHP_EOL
;
}
file_put_contents
(
'/usr/local/etc/pkg/repos/OPNsense.conf'
,
$pkg_config
);
}
/* non-standard port? */
if
(
isset
(
$config
[
'system'
][
'webgui'
][
'port'
])
&&
$config
[
'system'
][
'webgui'
][
'port'
]
<>
""
)
$portarg
=
"
{
$config
[
'system'
][
'webgui'
][
'port'
]
}
"
;
...
...
src/www/system_general.php
View file @
93e4773f
...
...
@@ -45,6 +45,18 @@ function get_locale_list()
return
$locales
;
}
function
get_flavour_list
()
{
$flavours
=
array
();
$flavours
[
'libressl'
]
=
'LibreSSL'
;
$flavours
[
'latest'
]
=
'OpenSSL'
;
asort
(
$flavours
);
return
$flavours
;
}
$pconfig
[
'hostname'
]
=
$config
[
'system'
][
'hostname'
];
$pconfig
[
'domain'
]
=
$config
[
'system'
][
'domain'
];
list
(
$pconfig
[
'dns1'
],
$pconfig
[
'dns2'
],
$pconfig
[
'dns3'
],
$pconfig
[
'dns4'
])
=
$config
[
'system'
][
'dnsserver'
];
...
...
@@ -62,6 +74,9 @@ $pconfig['timeupdateinterval'] = $config['system']['time-update-interval'];
$pconfig
[
'timeservers'
]
=
$config
[
'system'
][
'timeservers'
];
$pconfig
[
'theme'
]
=
$config
[
'system'
][
'theme'
];
$pconfig
[
'language'
]
=
$config
[
'system'
][
'language'
];
if
(
$isset
(
$config
[
'system'
][
'firmware'
][
'flavour'
]))
{
$pconfig
[
'firmware_flavour'
]
=
$config
[
'system'
][
'firmware'
][
'flavour'
];
}
$pconfig
[
'dnslocalhost'
]
=
isset
(
$config
[
'system'
][
'dnslocalhost'
]);
...
...
@@ -173,11 +188,23 @@ if ($_POST) {
update_if_changed
(
"NTP servers"
,
$config
[
'system'
][
'timeservers'
],
strtolower
(
$_POST
[
'timeservers'
]));
update_if_changed
(
"NTP update interval"
,
$config
[
'system'
][
'time-update-interval'
],
$_POST
[
'timeupdateinterval'
]);
if
(
$_POST
[
'language'
]
&&
$_POST
[
'language'
]
!=
$config
[
'system'
][
'language'
])
{
if
(
$_POST
[
'language'
]
&&
$_POST
[
'language'
]
!=
$config
[
'system'
][
'language'
])
{
$config
[
'system'
][
'language'
]
=
$_POST
[
'language'
];
set_language
(
$config
[
'system'
][
'language'
]);
}
if
(
!
isset
(
$config
[
'system'
][
'firmware'
]))
{
$config
[
'system'
][
'firmware'
]
=
array
();
}
if
(
$_POST
[
'firmware_flavour'
])
{
$config
[
'system'
][
'firmware'
][
'flavour'
]
=
$_POST
[
'firmware_flavour'
];
}
else
{
if
(
isset
(
$config
[
'system'
][
'firmware'
][
'flavour'
]))
{
unset
(
$config
[
'system'
][
'firmware'
][
'flavour'
]);
}
}
system_firmware_configure
();
update_if_changed
(
"System Theme"
,
$config
[
'theme'
],
$_POST
[
'theme'
]);
/* XXX - billm: these still need updating after figuring out how to check if they actually changed */
...
...
@@ -460,11 +487,30 @@ include("head.inc");
</td>
</tr>
<tr>
<td
width=
"22%"
valign=
"top"
class=
"vncell"
>
<?php
echo
gettext
(
"Language"
);
?>
</td>
<td
width=
"22%"
valign=
"top"
class=
"vncell"
>
<?=
gettext
(
"Cryptography"
);
?>
</td>
<td
width=
"78%"
class=
"vtable"
>
<select
name=
"firmware_flavour"
class=
"selectpicker"
data-style=
"btn-default"
data-width=
"auto"
>
<?php
foreach
(
get_flavour_list
()
as
$fcode
=>
$fdesc
)
{
$selected
=
' selected="selected"'
;
if
(
$fcode
!=
$pconfig
[
'firmware_flavour'
])
{
$selected
=
''
;
}
echo
"<option value=
\"
{
$fcode
}
\"
{
$selected
}
>
{
$fdesc
}
</option>"
;
}
?>
</select>
<strong>
<?=
gettext
(
"Choose the cryptography library to be used by the system."
);
?>
</strong>
</td>
</tr>
<tr>
<td
width=
"22%"
valign=
"top"
class=
"vncell"
>
<?=
gettext
(
"Language"
);
?>
</td>
<td
width=
"78%"
class=
"vtable"
>
<select
name=
"language"
class=
"selectpicker"
data-style=
"btn-default"
data-width=
"auto"
>
<?php
foreach
(
get_locale_list
()
as
$lcode
=>
$ldesc
)
{
foreach
(
get_locale_list
()
as
$lcode
=>
$ldesc
)
{
$selected
=
' selected="selected"'
;
if
(
$lcode
!=
$pconfig
[
'language'
])
$selected
=
''
;
...
...
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