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
45602999
Commit
45602999
authored
Mar 04, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
services/dyndns: general sanity and custom* hostname apply fix
parent
9e078f91
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
33 deletions
+63
-33
services.inc
src/etc/inc/services.inc
+34
-3
services_dyndns.php
src/www/services_dyndns.php
+8
-9
services_dyndns_edit.php
src/www/services_dyndns_edit.php
+12
-10
dyn_dns_status.widget.php
src/www/widgets/widgets/dyn_dns_status.widget.php
+9
-11
No files found.
src/etc/inc/services.inc
View file @
45602999
...
...
@@ -27,9 +27,6 @@
POSSIBILITY OF SUCH DAMAGE.
*/
define
(
'DYNDNS_PROVIDER_VALUES'
,
'dnsomatic dyndns dyndns-static dyndns-custom dhs dyns easydns noip noip-free ods zoneedit loopia freedns dnsexit opendns namecheap he-net he-net-v6 he-net-tunnelbroker selfhost route53 cloudflare custom custom-v6 eurodns gratisdns ovh-dynhost citynetwork'
);
define
(
'DYNDNS_PROVIDER_DESCRIPTIONS'
,
'DNS-O-Matic,DynDNS (dynamic),DynDNS (static),DynDNS (custom),DHS,DyNS,easyDNS,No-IP,No-IP (free),ODS.org,ZoneEdit,Loopia,freeDNS,DNSexit,OpenDNS,Namecheap,HE.net,HE.net (v6),HE.net Tunnelbroker,SelfHost,Route 53,CloudFlare,Custom,Custom (v6),Euro Dns,GratisDNS,OVH DynHOST,City Network'
);
/* implement ipv6 route advertising deamon */
function
services_radvd_configure
(
$blacklist
=
array
())
{
...
...
@@ -1595,6 +1592,40 @@ function services_dhcrelay6_configure()
return
0
;
}
function
services_dyndns_list
()
{
return
array
(
'dnsomatic'
=>
'DNS-O-Matic'
,
'dyndns'
=>
'DynDNS (dynamic)'
,
'dyndns-static'
=>
'DynDNS (static)'
,
'dyndns-custom'
=>
'DynDNS (custom)'
,
'dhs'
=>
'DHS'
,
'dyns'
=>
'DyNS'
,
'easydns'
=>
'easyDNS'
,
'noip'
=>
'No-IP'
,
'noip-free'
=>
'No-IP (free)'
,
'ods'
=>
'ODS.org'
,
'zoneedit'
=>
'ZoneEdit'
,
'loopia'
=>
'Loopia'
,
'freedns'
=>
'freeDNS'
,
'dnsexit'
=>
'DNSexit'
,
'opendns'
=>
'OpenDNS'
,
'namecheap'
=>
'Namecheap'
,
'he-net'
=>
'HE.net'
,
'he-net-v6'
=>
'HE.net (v6)'
,
'he-net-tunnelbroker'
=>
'HE.net Tunnelbroker'
,
'selfhost'
=>
'SelfHost'
,
'route53'
=>
'Route 53'
,
'cloudflare'
=>
'CloudFlare'
,
'custom'
=>
'Custom'
,
'custom-v6'
=>
'Custom (v6)'
,
'eurodns'
=>
'EuroDNS'
,
'gratisdns'
=>
'GratisDNS'
,
'ovh-dynhost'
=>
'OVH DynHOST'
,
'citynetwork'
=>
'City Network'
);
}
function
services_dyndns_configure_client
(
$conf
)
{
if
(
!
isset
(
$conf
[
'enable'
]))
...
...
src/www/services_dyndns.php
View file @
45602999
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2008 Ermal Luçi
...
...
@@ -119,16 +120,14 @@ $main_buttons = array(
</td>
<td
class=
"listr"
>
<?php
$types
=
explode
(
","
,
DYNDNS_PROVIDER_DESCRIPTIONS
);
$vals
=
explode
(
" "
,
DYNDNS_PROVIDER_VALUES
);
for
(
$j
=
0
;
$j
<
count
(
$vals
);
$j
++
)
if
(
$vals
[
$j
]
==
$dyndns
[
'type'
])
{
if
(
!
isset
(
$dyndns
[
'enable'
]))
echo
"<span class=
\"
gray
\"
>"
.
htmlspecialchars
(
$types
[
$j
])
.
"</span>"
;
else
echo
htmlspecialchars
(
$types
[
$j
]);
break
;
$types
=
services_dyndns_list
();
if
(
isset
(
$types
[
$dyndns
[
'type'
]]))
{
if
(
!
isset
(
$dyndns
[
'enable'
]))
{
echo
'<span class="gray">'
.
htmlspecialchars
(
$types
[
$dyndns
[
'type'
]])
.
'</span>'
;
}
else
{
echo
htmlspecialchars
(
$types
[
$dyndns
[
'type'
]]);
}
}
?>
</td>
<td
class=
"listr"
>
...
...
src/www/services_dyndns_edit.php
View file @
45602999
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2008 Ermal Luçi
...
...
@@ -83,7 +84,7 @@ if ($_POST) {
$reqdfieldsn
=
array
();
$reqdfields
=
array
(
"type"
);
$reqdfieldsn
=
array
(
gettext
(
"Service type"
));
if
(
$pconfig
[
'type'
]
!=
"custom"
&&
$pconfig
[
'type'
]
!=
"custom-v6"
)
{
if
(
$pconfig
[
'type'
]
!=
'custom'
&&
$pconfig
[
'type'
]
!=
'custom-v6'
)
{
$reqdfields
[]
=
"host"
;
$reqdfieldsn
[]
=
gettext
(
"Hostname"
);
$reqdfields
[]
=
"password"
;
...
...
@@ -97,7 +98,7 @@ if ($_POST) {
do_input_validation
(
$_POST
,
$reqdfields
,
$reqdfieldsn
,
$input_errors
);
if
(
isset
(
$_POST
[
'host'
]))
{
if
(
isset
(
$_POST
[
'host'
])
&&
in_array
(
'host'
,
$reqdfields
)
)
{
/* Namecheap can have a @. in hostname */
if
(
$pconfig
[
'type'
]
==
"namecheap"
&&
substr
(
$_POST
[
'host'
],
0
,
2
)
==
'@.'
)
$host_to_check
=
substr
(
$_POST
[
'host'
],
2
);
...
...
@@ -109,6 +110,7 @@ if ($_POST) {
unset
(
$host_to_check
);
}
if
((
$_POST
[
'mx'
]
&&
!
is_domain
(
$_POST
[
'mx'
])))
$input_errors
[]
=
gettext
(
"The MX contains invalid characters."
);
if
((
in_array
(
"username"
,
$reqdfields
)
&&
$_POST
[
'username'
]
&&
!
is_dyndns_username
(
$_POST
[
'username'
]))
||
((
in_array
(
"username"
,
$reqdfields
))
&&
(
$_POST
[
'username'
]
==
""
)))
...
...
@@ -250,14 +252,14 @@ include("head.inc");
<td
width=
"22%"
valign=
"top"
class=
"vncellreq"
>
<?=
gettext
(
"Service type"
);
?>
</td>
<td
width=
"78%"
class=
"vtable"
>
<select
name=
"type"
class=
"formselect"
id=
"type"
onchange=
"_onTypeChange(this.options[this.selectedIndex].value);"
>
<?php
$types
=
explode
(
","
,
DYNDNS_PROVIDER_DESCRIPTIONS
);
$vals
=
explode
(
" "
,
DYNDNS_PROVIDER_VALUES
);
$j
=
0
;
for
(
$j
=
0
;
$j
<
count
(
$vals
);
$j
++
)
:
?>
<option
value=
"
<?=
$val
s
[
$j
];
?>
"
<?php
if
(
$vals
[
$j
]
==
$pconfig
[
'type'
])
echo
"selected=
\"
selected
\"
"
;
?>
>
<?=
htmlspecialchars
(
$types
[
$j
]);
?>
</option>
<?php
endfor
;
?>
<?php
$types
=
services_dyndns_list
(
);
foreach
(
$types
as
$value
=>
$type
)
{
?>
<option
value=
"
<?=
$val
ue
;
?>
"
<?php
if
(
$value
==
$pconfig
[
'type'
])
echo
'selected="selected"'
;
?>
>
<?=
htmlspecialchars
(
$type
);
?>
</option
>
<?php
}
?>
</select></td>
</tr>
<tr>
...
...
src/www/widgets/widgets/dyn_dns_status.widget.php
View file @
45602999
<?php
/*
Copyright (C) 2014 Deciso B.V.
Copyright (C) 2014 Deciso B.V.
Copyright (C) 2008 Ermal Luci
Copyright (C) 2013 Stanley P. Miller \ stan-qaz
All rights reserved.
...
...
@@ -27,7 +28,6 @@
POSSIBILITY OF SUCH DAMAGE.
*/
$nocsrf
=
true
;
require_once
(
"guiconfig.inc"
);
...
...
@@ -103,16 +103,14 @@ if($_REQUEST['getdyndnsstatus']) {
</td>
<td
class=
"listr"
>
<?php
$types
=
explode
(
","
,
DYNDNS_PROVIDER_DESCRIPTIONS
);
$vals
=
explode
(
" "
,
DYNDNS_PROVIDER_VALUES
);
for
(
$j
=
0
;
$j
<
count
(
$vals
);
$j
++
)
if
(
$vals
[
$j
]
==
$dyndns
[
'type'
])
{
if
(
!
isset
(
$dyndns
[
'enable'
]))
echo
"<span class=
\"
gray
\"
>"
.
htmlspecialchars
(
$types
[
$j
])
.
"</span>"
;
else
echo
htmlspecialchars
(
$types
[
$j
]);
break
;
$types
=
services_dyndns_list
();
if
(
isset
(
$types
[
$dyndns
[
'type'
]]))
{
if
(
!
isset
(
$dyndns
[
'enable'
]))
{
echo
'<span class="gray">'
.
htmlspecialchars
(
$types
[
$dyndns
[
'type'
]])
.
'</span>'
;
}
else
{
echo
htmlspecialchars
(
$types
[
$dyndns
[
'type'
]]);
}
}
?>
</td>
<td
class=
"listr"
>
...
...
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