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
c7edcbf8
Commit
c7edcbf8
authored
Mar 20, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
services: align the code some more, fix bugs #996
parent
9f8e2d67
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
9 deletions
+9
-9
dyndns.inc
src/etc/inc/plugins.inc.d/dyndns.inc
+1
-1
phpDynDNS.inc
src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc
+3
-3
rfc2136.inc
src/etc/inc/plugins.inc.d/rfc2136.inc
+1
-1
services_dyndns.php
src/www/services_dyndns.php
+1
-1
services_rfc2136.php
src/www/services_rfc2136.php
+2
-2
dyn_dns_status.widget.php
src/www/widgets/widgets/dyn_dns_status.widget.php
+1
-1
No files found.
src/etc/inc/plugins.inc.d/dyndns.inc
View file @
c7edcbf8
...
...
@@ -127,7 +127,7 @@ function dyndns_cache_file($conf, $ipver = 4)
{
$ipver
=
$ipver
==
6
?
'_v6'
:
''
;
return
"/var/cache/dyndns_
{
$conf
[
'interface'
]
}
_
{
$conf
[
'host'
]
}
_
{
$
dyndns
[
'id'
]
}{
$ipver
}
.cache"
;
return
"/var/cache/dyndns_
{
$conf
[
'interface'
]
}
_
{
$conf
[
'host'
]
}
_
{
$
conf
[
'id'
]
}{
$ipver
}
.cache"
;
}
function
dyndns_configure_client
(
$conf
)
...
...
src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc
View file @
c7edcbf8
...
...
@@ -1252,7 +1252,7 @@
$currentTime
=
time
();
notify_all_remote
(
sprintf
(
gettext
(
"Dynamic DNS updated IP Address on %s (%s) to %s"
),
convert_real_interface_to_friendly_descr
(
$this
->
_if
),
$this
->
_if
,
$wan_ip
));
log_error
(
"Dynamic DNS: updating cache file
{
$this
->
_cacheFile
}
:
{
$wan_ip
}
"
);
@
file_put_contents
(
$this
->
_cacheFile
,
"
{
$wan_ip
}
:
{
$currentTime
}
"
);
@
file_put_contents
(
$this
->
_cacheFile
,
"
{
$wan_ip
}
|
{
$currentTime
}
"
);
}
else
@
unlink
(
$this
->
_cacheFile
);
if
(
$this
->
_useIPv6
==
true
&&
$wan_ip
>
0
)
{
...
...
@@ -1345,13 +1345,13 @@
}
else
{
if
(
file_exists
(
$this
->
_cacheFile
))
{
$contents
=
file_get_contents
(
$this
->
_cacheFile
);
list
(
$cacheIP
,
$cacheTime
)
=
explode
(
'
:
'
,
$contents
);
list
(
$cacheIP
,
$cacheTime
)
=
explode
(
'
|
'
,
$contents
);
$this
->
_debug
(
$cacheIP
.
'/'
.
$cacheTime
);
$initial
=
false
;
$log_error
.=
"Cached IP:
{
$cacheIP
}
"
;
}
else
{
$cacheIP
=
'0.0.0.0'
;
@
file_put_contents
(
$this
->
_cacheFile
,
"0.0.0.0
:
{
$currentTime
}
"
);
@
file_put_contents
(
$this
->
_cacheFile
,
"0.0.0.0
|
{
$currentTime
}
"
);
$cacheTime
=
$currentTime
;
$initial
=
true
;
$log_error
.=
"No Cached IP found."
;
...
...
src/etc/inc/plugins.inc.d/rfc2136.inc
View file @
c7edcbf8
...
...
@@ -84,7 +84,7 @@ function rfc2136_cron()
return
$jobs
;
}
function
rfc2136_cache_file
(
$dnspdate
,
$ipver
=
4
)
function
rfc2136_cache_file
(
$dns
u
pdate
,
$ipver
=
4
)
{
$ipver
=
$ipver
==
6
?
'_v6'
:
''
;
...
...
src/www/services_dyndns.php
View file @
c7edcbf8
...
...
@@ -162,7 +162,7 @@ $main_buttons = array(
}
if
(
!
empty
(
$fdata
))
{
$cached_ip_s
=
explode
(
'
:
'
,
$fdata
);
$cached_ip_s
=
explode
(
'
|
'
,
$fdata
);
$cached_ip
=
$cached_ip_s
[
0
];
echo
sprintf
(
'<font color="%s">%s</font>'
,
...
...
src/www/services_rfc2136.php
View file @
c7edcbf8
...
...
@@ -148,7 +148,7 @@ $main_buttons = array(
<td>
<?php
$filename
=
rfc2136_cache_file
(
$rfc2136
,
4
);
if
(
file_exists
(
$filename
)
&&
!
empty
(
$rfc2136
[
'enable'
])
&&
(
empty
(
$
dnsupdate
[
'recordtype'
])
||
$dnsupdate
[
'recordtype'
]
==
'A'
))
{
if
(
file_exists
(
$filename
)
&&
!
empty
(
$rfc2136
[
'enable'
])
&&
(
empty
(
$
rfc2136
[
'recordtype'
])
||
$rfc2136
[
'recordtype'
]
==
'A'
))
{
echo
"IPv4: "
;
if
(
isset
(
$rfc2136
[
'usepublicip'
]))
{
$ipaddr
=
get_dyndns_ip
(
$rfc2136
[
'interface'
],
4
);
...
...
@@ -169,7 +169,7 @@ $main_buttons = array(
}
echo
"<br />"
;
$filename6
=
rfc2136_cache_file
(
$rfc2136
,
6
);
if
(
file_exists
(
$filename6
)
&&
!
empty
(
$rfc2136
[
'enable'
])
&&
(
empty
(
$
dnsupdate
[
'recordtype'
])
||
$dnsupdate
[
'recordtype'
]
==
'AAAA'
))
{
if
(
file_exists
(
$filename6
)
&&
!
empty
(
$rfc2136
[
'enable'
])
&&
(
empty
(
$
rfc2136
[
'recordtype'
])
||
$rfc2136
[
'recordtype'
]
==
'AAAA'
))
{
echo
"IPv6: "
;
if
(
isset
(
$rfc2136
[
'usepublicip'
]))
{
$ipaddr
=
get_dyndns_ip
(
$rfc2136
[
'interface'
],
6
);
...
...
src/www/widgets/widgets/dyn_dns_status.widget.php
View file @
c7edcbf8
...
...
@@ -65,7 +65,7 @@ if (!empty($_REQUEST['getdyndnsstatus'])) {
}
if
(
!
empty
(
$fdata
))
{
$cached_ip_s
=
preg_split
(
'/:/
'
,
$fdata
);
$cached_ip_s
=
explode
(
'|
'
,
$fdata
);
$cached_ip
=
$cached_ip_s
[
0
];
echo
sprintf
(
'<font color="%s">%s</font>'
,
...
...
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