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
1aebb723
Commit
1aebb723
authored
Mar 13, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system: strip ntp config from general settings #818
(cherry picked from commit
e7723d47
)
parent
08a6f4c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
29 deletions
+0
-29
system_general.php
src/www/system_general.php
+0
-29
No files found.
src/www/system_general.php
View file @
1aebb723
...
...
@@ -58,7 +58,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig
[
'theme'
]
=
null
;
$pconfig
[
'language'
]
=
null
;
$pconfig
[
'timezone'
]
=
"Etc/UTC"
;
$pconfig
[
'timeservers'
]
=
"pool.ntp.org"
;
$pconfig
[
'mirror'
]
=
'default'
;
$pconfig
[
'flavour'
]
=
'default'
;
...
...
@@ -79,7 +78,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig
[
'dnsallowoverride'
]
=
isset
(
$config
[
'system'
][
'dnsallowoverride'
]);
$pconfig
[
'timezone'
]
=
$config
[
'system'
][
'timezone'
];
$pconfig
[
'timeservers'
]
=
$config
[
'system'
][
'timeservers'
];
if
(
isset
(
$config
[
'system'
][
'theme'
]))
{
$pconfig
[
'theme'
]
=
$config
[
'system'
][
'theme'
];
}
...
...
@@ -153,25 +151,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
# it's easy to have a little too much whitespace in the field, clean it up for the user before processing.
$pconfig
[
'timeservers'
]
=
preg_replace
(
'/[[:blank:]]+/'
,
' '
,
$pconfig
[
'timeservers'
]);
$pconfig
[
'timeservers'
]
=
trim
(
$pconfig
[
'timeservers'
]);
if
(
!
empty
(
$pconfig
[
'timeservers'
]))
{
foreach
(
explode
(
' '
,
$pconfig
[
'timeservers'
])
as
$ts
)
{
if
(
!
is_domain
(
$ts
))
{
$input_errors
[]
=
gettext
(
"A NTP Time Server name may only contain the characters a-z, 0-9, '-' and '.'."
);
}
}
}
if
(
count
(
$input_errors
)
==
0
)
{
$config
[
'system'
][
'hostname'
]
=
$pconfig
[
'hostname'
];
$config
[
'system'
][
'domain'
]
=
$pconfig
[
'domain'
];
$config
[
'system'
][
'timezone'
]
=
$pconfig
[
'timezone'
];
$config
[
'system'
][
'timeservers'
]
=
strtolower
(
$pconfig
[
'timeservers'
]);
if
(
empty
(
$config
[
'system'
][
'timeservers'
]))
{
unset
(
$config
[
'system'
][
'timeservers'
]);
}
$config
[
'theme'
]
=
$pconfig
[
'theme'
];
if
(
!
empty
(
$pconfig
[
'language'
])
&&
$pconfig
[
'language'
]
!=
$config
[
'system'
][
'language'
])
{
...
...
@@ -277,7 +260,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
system_timezone_configure
();
system_firmware_configure
();
system_ntp_configure
();
if
(
$olddnsallowoverride
!=
$config
[
'system'
][
'dnsallowoverride'
])
{
configd_run
(
"dns reload"
);
...
...
@@ -445,17 +427,6 @@ include("head.inc");
</div>
</td>
</tr>
<tr>
<td><a
id=
"help_for_ntp"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"NTP time server"
);
?>
</td>
<td
width=
"78%"
class=
"vtable"
>
<input
name=
"timeservers"
type=
"text"
class=
"formfld unknown"
value=
"
<?=
$pconfig
[
'timeservers'
];
?>
"
/>
<div
class=
"hidden"
for=
"help_for_ntp"
>
<?=
gettext
(
"Use a space to separate multiple hosts if "
.
"needed or leave blank to disable the network time service. "
.
"Remember to set up DNS if you enter host names here."
);
?>
</div>
</td>
</tr>
<tr>
<td><a
id=
"help_for_language"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Language"
);
?>
</td>
<td>
...
...
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