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
a7a0fbf0
Commit
a7a0fbf0
authored
Nov 09, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dyndns: fix previous widget race in actual page code again
(cherry picked from commit
74ca8331
)
parent
112fbba5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
23 deletions
+29
-23
services_dyndns.php
src/www/services_dyndns.php
+29
-23
No files found.
src/www/services_dyndns.php
View file @
a7a0fbf0
...
...
@@ -141,31 +141,37 @@ $main_buttons = array(
<td>
<?php
$filename
=
"/conf/dyndns_
{
$dyndns
[
'interface'
]
}{
$dyndns
[
'type'
]
}
"
.
escapeshellarg
(
$dyndns
[
'host'
])
.
"
{
$dyndns
[
'id'
]
}
.cache"
;
$f
ilename_v6
=
"/conf/dyndns_
{
$dyndns
[
'interface'
]
}{
$dyndns
[
'type'
]
}
"
.
escapeshellarg
(
$dyndns
[
'host'
])
.
"
{
$dyndns
[
'id'
]
}
_v6.cache"
;
$f
data
=
''
;
if
(
file_exists
(
$filename
)
&&
!
empty
(
$dyndns
[
'enable'
]))
{
$ipaddr
=
dyndnsCheckIP
(
$dyndns
[
'interface'
]);
$cached_ip_s
=
explode
(
":"
,
file_get_contents
(
$filename
));
$cached_ip
=
$cached_ip_s
[
0
];
if
(
$ipaddr
<>
$cached_ip
)
{
echo
"<font color='red'>"
;
}
else
{
echo
"<font color='green'>"
;
$fdata
=
@
file_get_contents
(
$filename
);
}
echo
htmlspecialchars
(
$cached_ip
);
echo
"</font>"
;
}
elseif
(
file_exists
(
$filename_v6
)
&&
!
empty
(
$dyndns
[
'enable'
]))
{
$filename_v6
=
"/conf/dyndns_
{
$dyndns
[
'interface'
]
}{
$dyndns
[
'type'
]
}
"
.
escapeshellarg
(
$dyndns
[
'host'
])
.
"
{
$dyndns
[
'id'
]
}
_v6.cache"
;
$fdata6
=
''
;
if
(
file_exists
(
$filename_v6
)
&&
!
empty
(
$dyndns
[
'enable'
]))
{
$ipv6addr
=
get_interface_ipv6
(
$dyndns
[
'interface'
]);
$cached_ipv6_s
=
explode
(
"|"
,
file_get_contents
(
$filename_v6
));
$cached_ipv6
=
$cached_ipv6_s
[
0
];
if
(
$ipv6addr
<>
$cached_ipv6
)
{
echo
"<font color='red'>"
;
}
else
{
echo
"<font color='green'>"
;
$fdata6
=
@
file_get_contents
(
$filename_v6
);
}
echo
htmlspecialchars
(
$cached_ipv6
);
echo
"</font>"
;
if
(
!
empty
(
$fdata
))
{
$cached_ip_s
=
explode
(
':'
,
$fdata
);
$cached_ip
=
$cached_ip_s
[
0
];
echo
sprintf
(
'<font color="%s">%s</font>'
,
$ipaddr
!=
$cached_ip
?
'red'
:
'green'
,
htmlspecialchars
(
$cached_ip
)
);
}
elseif
(
!
empty
(
$fdata6
))
{
$cached_ipv6_s
=
explode
(
'|'
,
$fdata6
);
$cached_ipv6
=
$cached_ipv6_s
[
0
];
echo
sprintf
(
'<font color="%s">%s</font>'
,
$ipv6addr
!=
$cached_ipv6
?
'red'
:
'green'
,
htmlspecialchars
(
$cached_ipv6
)
);
}
else
{
echo
gettext
(
'N/A'
);
echo
sprintf
(
'<span class="text-muted">%s</span>'
,
gettext
(
'N/A'
)
);
}
?>
</td>
<td>
<?=
$dyndns
[
'descr'
];
?>
</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