diff options
author | Phil Davis <phil.davis@world.inf.org> | 2013-02-24 12:48:06 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@world.inf.org> | 2013-02-24 12:48:06 +0545 |
commit | 1ddae7c36779a12db5d59c53abeba3ad550c5de8 (patch) | |
tree | 4c0ec0e1fe59966d61349679da484a631f818fe2 /usr/local/www/widgets | |
parent | 7a5fe50dbb174a816f90090d4cd0c712e77f07f1 (diff) | |
download | pfsense-1ddae7c36779a12db5d59c53abeba3ad550c5de8.zip pfsense-1ddae7c36779a12db5d59c53abeba3ad550c5de8.tar.gz |
Use common code and constants from services.inc
to reduce code duplication
Diffstat (limited to 'usr/local/www/widgets')
-rw-r--r-- | usr/local/www/widgets/widgets/dyn_dns_status.widget.php | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/usr/local/www/widgets/widgets/dyn_dns_status.widget.php b/usr/local/www/widgets/widgets/dyn_dns_status.widget.php index 94a4a1b..e177b8d 100644 --- a/usr/local/www/widgets/widgets/dyn_dns_status.widget.php +++ b/usr/local/www/widgets/widgets/dyn_dns_status.widget.php @@ -44,23 +44,6 @@ if (!is_array($config['dyndnses']['dyndns'])) $a_dyndns = &$config['dyndnses']['dyndns']; -function dyndnsCheckIP($int) { - $ip_address = get_interface_ip($int); - if (is_private_ip($ip_address)) { - $hosttocheck = "checkip.dyndns.org"; - $checkip = gethostbyname($hosttocheck); - $ip_ch = curl_init("http://{$checkip}"); - curl_setopt($ip_ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ip_ch, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($ip_ch, CURLOPT_INTERFACE, $ip_address); - $ip_result_page = curl_exec($ip_ch); - curl_close($ip_ch); - $ip_result_decoded = urldecode($ip_result_page); - preg_match('=Current IP Address: (.*)</body>=siU', $ip_result_decoded, $matches); - $ip_address = trim($matches[1]); - } - return $ip_address; -} ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> @@ -97,8 +80,8 @@ function dyndnsCheckIP($int) { </td> <td class="listlr"> <?php - $types = explode(",", "DNS-O-Matic,DynDNS (dynamic),DynDNS (static),DynDNS (custom),DHS,DyNS,easyDNS,No-IP,ODS.org,ZoneEdit,Loopia,freeDNS,DNSexit,OpenDNS,Namecheap,HE.net,HE.net Tunnelbroker,SelfHost,Route 53,Custom"); - $vals = explode(" ", "dnsomatic dyndns dyndns-static dyndns-custom dhs dyns easydns noip ods zoneedit loopia freedns dnsexit opendns namecheap he-net he-net-tunnelbroker selfhost route53 custom"); + $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'])) @@ -137,4 +120,4 @@ function dyndnsCheckIP($int) { </td> </tr> <?php $i++; endforeach; ?> -</table>
\ No newline at end of file +</table> |