From 1ddae7c36779a12db5d59c53abeba3ad550c5de8 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sun, 24 Feb 2013 12:48:06 +0545 Subject: Use common code and constants from services.inc to reduce code duplication --- .../www/widgets/widgets/dyn_dns_status.widget.php | 23 +++------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'usr') 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: (.*)=siU', $ip_result_decoded, $matches); - $ip_address = trim($matches[1]); - } - return $ip_address; -} ?> @@ -97,8 +80,8 @@ function dyndnsCheckIP($int) { -
\ No newline at end of file + -- cgit v1.1