diff options
author | smos <seth.mos@dds.nl> | 2012-09-13 18:49:12 +0200 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2012-09-13 18:49:12 +0200 |
commit | 2223aa954ed15c537438ccd1cd6895585a64ff3f (patch) | |
tree | e335704aa14dc8a39885b87729308d40866ac76a | |
parent | 768eb89c423f647fb938a9e0a5bbda2a8810c9c7 (diff) | |
download | pfsense-2223aa954ed15c537438ccd1cd6895585a64ff3f.zip pfsense-2223aa954ed15c537438ccd1cd6895585a64ff3f.tar.gz |
Always prepend the hostname we are working on
-rw-r--r-- | etc/inc/dyndns.class | 232 |
1 files changed, 116 insertions, 116 deletions
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class index 8a6ca3a..843a03c 100644 --- a/etc/inc/dyndns.class +++ b/etc/inc/dyndns.class @@ -158,12 +158,12 @@ $this->_dnsUpdateURL = $dnsUpdateURL; $this->_dnsResultMatch = $dnsResultMatch; $this->_dnsRequestIf = get_failover_interface($dnsRequestIf); - log_error("running get_failover_interface for {$dnsRequestIf}. found {$this->_dnsRequestIf}"); + log_error("DynDNS ({$this->_dnsHost}): running get_failover_interface for {$dnsRequestIf}. found {$this->_dnsRequestIf}"); $this->_dnsRequestIfIP = get_interface_ip($dnsRequestIf); // Ensure that we where able to lookup the IP if(!is_ipaddr($this->_dnsIP)) { - log_error("There was an error trying to determine the public IP for interface - {$dnsIf}({$this->_if}). Probably interface is not a WAN interface."); + log_error("DynDNS ({$this->_dnsHost}) There was an error trying to determine the public IP for interface - {$dnsIf}({$this->_if}). Probably interface is not a WAN interface."); unlock($dyndnslck); return; } @@ -213,7 +213,7 @@ */ function _update() { - log_error("DynDns: DynDns _update() starting."); + log_error("DynDNS ({$this->_dnsHost}): DynDns _update() starting."); if ($this->_dnsService != 'ods' and $this->_dnsService != 'route53 ') { $ch = curl_init(); @@ -229,7 +229,7 @@ case 'dyndns-static': case 'dyndns-custom': $needsIP = FALSE; - //log_error("DynDns: DynDns _update() starting. Dynamic"); + //log_error("DynDNS ({$this->_dnsHost}) DynDns _update() starting. Dynamic"); if (isset($this->_dnsWildcard) && $this->_dnsWildcard != "OFF") $this->_dnsWildcard = "ON"; curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); @@ -418,7 +418,7 @@ https://dynamicdns.park-your-domain.com/update?host=[host_name]&domain=[domain.com]&password=[domain_password]&ip=[your_ip] */ $needsIP = FALSE; - log_error("Namecheap: DNS update() starting."); + log_error("Namecheap ({$this->_dnsHost}): DNS update() starting."); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $dparts = explode(".", trim($this->_dnsHost)); $domain_part_count = ($dparts[count($dparts)-1] == "uk") ? 3 : 2; @@ -431,7 +431,7 @@ break; case 'he-net': $needsIP = FALSE; - log_error("HE.net: DNS update() starting."); + log_error("HE.net ({$this->_dnsHost}): DNS update() starting."); $server = "https://dyn.dns.he.net/nic/update?"; curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsHost . ':' . $this->_dnsPass); @@ -460,7 +460,7 @@ curl_setopt($ch, CURLOPT_URL, $server .$port . '?system=dyndns&hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP . '&wildcard='.$this->_dnsWildcard . '&mx=' . $this->_dnsMX . '&backmx=NO'); break; case 'route53': - log_error("Route53: DNS update() starting."); + log_error("Route53 ({$this->_dnsHost}): DNS update() starting."); /* Setting Variables */ $hostname = "{$this->_dnsHost}."; @@ -515,7 +515,7 @@ $this->_checkStatus(0, $result); break; case 'custom': - log_error("Custom DDNS: DNS update() starting."); + log_error("Custom DDNS ({$this->_dnsHost}): DNS update() starting."); if (strstr($this->dnsUpdateURL, "%IP%")) {$needsIP = TRUE;} else {$needsIP = FALSE;} if ($this->_dnsUser != '') { curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); @@ -540,8 +540,8 @@ * Retrieve Update Status */ function _checkStatus($ch, $data) { - log_error("DynDns: DynDns _checkStatus() starting."); - log_error("DynDns: Current Service: {$this->_dnsService}"); + log_error("DynDNS ({$this->_dnsHost}): DynDns _checkStatus() starting."); + log_error("DynDNS ({$this->_dnsHost}): Current Service: {$this->_dnsService}"); $successful_update = false; if ($this->_dnsService != 'ods' and $this->_dnsService != 'route53' && @curl_error($ch)) { $status = "Curl error occurred: " . curl_error($ch); @@ -552,74 +552,74 @@ switch ($this->_dnsService) { case 'dnsomatic': if (preg_match('/badauth/i', $data)) { - $status = "DNS-O-Matic: The DNS-O-Matic username or password specified are incorrect. No updates will be distributed to services until this is resolved."; + $status = "DNS-O-Matic ({$this->_dnsHost}): The DNS-O-Matic username or password specified are incorrect. No updates will be distributed to services until this is resolved."; } else if (preg_match('/notfqdn /i', $data)) { - $status = "DNS-O-Matic: The hostname specified is not a fully-qualified domain name. If no hostnames included, notfqdn will be returned once."; + $status = "DNS-O-Matic ({$this->_dnsHost}): The hostname specified is not a fully-qualified domain name. If no hostnames included, notfqdn will be returned once."; } else if (preg_match('/nohost/i', $data)) { - $status = "DNS-O-Matic: The hostname passed could not be matched to any services configured. The service field will be blank in the return code."; + $status = "DNS-O-Matic ({$this->_dnsHost}): The hostname passed could not be matched to any services configured. The service field will be blank in the return code."; } else if (preg_match('/numhost/i', $data)) { - $status = "DNS-O-Matic: You may update up to 20 hosts. numhost is returned if you try to update more than 20 or update a round-robin."; + $status = "DNS-O-Matic ({$this->_dnsHost}): You may update up to 20 hosts. numhost is returned if you try to update more than 20 or update a round-robin."; } else if (preg_match('/abuse/i', $data)) { - $status = "DNS-O-Matic: The hostname is blocked for update abuse."; + $status = "DNS-O-Matic ({$this->_dnsHost}): The hostname is blocked for update abuse."; } else if (preg_match('/good/i', $data)) { - $status = "DNS-O-Matic: (Success) IP Address Changed Successfully! (".$this->_dnsIP.")"; + $status = "DNS-O-Matic ({$this->_dnsHost}): (Success) IP Address Changed Successfully! (".$this->_dnsIP.")"; $successful_update = true; } else if (preg_match('/dnserr/i', $data)) { - $status = "DNS-O-Matic: DNS error encountered. Stop updating for 30 minutes."; + $status = "DNS-O-Matic ({$this->_dnsHost}): DNS error encountered. Stop updating for 30 minutes."; } else { - $status = "DNS-O-Matic: (Unknown Response)"; - log_error("DNS-O-Matic: PAYLOAD: {$data}"); + $status = "DNS-O-Matic ({$this->_dnsHost}): (Unknown Response)"; + log_error("DNS-O-Matic ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; case 'dyndns': if (preg_match('/notfqdn/i', $data)) { - $status = "phpDynDNS: (Error) Not A FQDN!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Not A FQDN!"; } else if (preg_match('/nochg/i', $data)) { - $status = "phpDynDNS: (Success) No Change In IP Address"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) No Change In IP Address"; $successful_update = true; } else if (preg_match('/good/i', $data)) { - $status = "phpDynDNS: (Success) IP Address Changed Successfully! (".$this->_dnsIP.")"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Changed Successfully! (".$this->_dnsIP.")"; $successful_update = true; } else if (preg_match('/noauth/i', $data)) { - $status = "phpDynDNS: (Error) User Authorization Failed"; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) User Authorization Failed"; } else { - $status = "phpDynDNS: (Unknown Response)"; - log_error("phpDynDNS: PAYLOAD: {$data}"); + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; case 'dyndns-static': if (preg_match('/notfqdn/i', $data)) { - $status = "phpDynDNS: (Error) Not A FQDN!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Not A FQDN!"; } else if (preg_match('/nochg/i', $data)) { - $status = "phpDynDNS: (Success) No Change In IP Address"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) No Change In IP Address"; $successful_update = true; } else if (preg_match('/good/i', $data)) { - $status = "phpDynDNS: (Success) IP Address Changed Successfully!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Changed Successfully!"; $successful_update = true; } else if (preg_match('/noauth/i', $data)) { - $status = "phpDynDNS: (Error) User Authorization Failed"; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) User Authorization Failed"; } else { - $status = "phpDynDNS: (Unknown Response)"; - log_error("phpDynDNS: PAYLOAD: {$data}"); + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; case 'dyndns-custom': if (preg_match('/notfqdn/i', $data)) { - $status = "phpDynDNS: (Error) Not A FQDN!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Not A FQDN!"; } else if (preg_match('/nochg/i', $data)) { $status = "phpDynDNS: (Success) No Change In IP Address"; $successful_update = true; } else if (preg_match('/good/i', $data)) { - $status = "phpDynDNS: (Success) IP Address Changed Successfully!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Changed Successfully!"; $successful_update = true; } else if (preg_match('/noauth/i', $data)) { - $status = "phpDynDNS: (Error) User Authorization Failed"; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) User Authorization Failed"; } else { - $status = "phpDynDNS: (Unknown Response)"; - log_error("phpDynDNS: PAYLOAD: {$data}"); + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; @@ -629,81 +629,81 @@ list($ip,$code) = explode(":",$data); switch ($code) { case 0: - $status = "phpDynDNS: (Success) IP address is current, no update performed."; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP address is current, no update performed."; $successful_update = true; break; case 1: - $status = "phpDynDNS: (Success) DNS hostname update successful."; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) DNS hostname update successful."; $successful_update = true; break; case 2: - $status = "phpDynDNS: (Error) Hostname supplied does not exist."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Hostname supplied does not exist."; break; case 3: - $status = "phpDynDNS: (Error) Invalid Username."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Invalid Username."; break; case 4: - $status = "phpDynDNS: (Error) Invalid Password."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Invalid Password."; break; case 5: - $status = "phpDynDNS: (Error) To many updates sent."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) To many updates sent."; break; case 6: - $status = "phpDynDNS: (Error) Account disabled due to violation of No-IP terms of service."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Account disabled due to violation of No-IP terms of service."; break; case 7: - $status = "phpDynDNS: (Error) Invalid IP. IP Address submitted is improperly formatted or is a private IP address or is on a blacklist."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Invalid IP. IP Address submitted is improperly formatted or is a private IP address or is on a blacklist."; break; case 8: - $status = "phpDynDNS: (Error) Disabled / Locked Hostname."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Disabled / Locked Hostname."; break; case 9: - $status = "phpDynDNS: (Error) Host updated is configured as a web redirect and no update was performed."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Host updated is configured as a web redirect and no update was performed."; break; case 10: - $status = "phpDynDNS: (Error) Group supplied does not exist."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Group supplied does not exist."; break; case 11: - $status = "phpDynDNS: (Success) DNS group update is successful."; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) DNS group update is successful."; $successful_update = true; break; case 12: - $status = "phpDynDNS: (Success) DNS group is current, no update performed."; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) DNS group is current, no update performed."; $successful_update = true; break; case 13: - $status = "phpDynDNS: (Error) Update client support not available for supplied hostname or group."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Update client support not available for supplied hostname or group."; break; case 14: - $status = "phpDynDNS: (Error) Hostname supplied does not have offline settings configured."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Hostname supplied does not have offline settings configured."; break; case 99: - $status = "phpDynDNS: (Error) Client disabled. Client should exit and not perform any more updates without user intervention."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Client disabled. Client should exit and not perform any more updates without user intervention."; break; case 100: - $status = "phpDynDNS: (Error) Client disabled. Client should exit and not perform any more updates without user intervention."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Client disabled. Client should exit and not perform any more updates without user intervention."; break; default: - $status = "phpDynDNS: (Unknown Response)"; + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; $this->_debug("Unknown Response: ".$data); break; } break; case 'easydns': if (preg_match('/NOACCESS/i', $data)) { - $status = "phpDynDNS: (Error) Authentication Failed: Username and/or Password was Incorrect."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Authentication Failed: Username and/or Password was Incorrect."; } else if (preg_match('/NOSERVICE/i', $data)) { - $status = "phpDynDNS: (Error) No Service: Dynamic DNS Service has been disabled for this domain."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) No Service: Dynamic DNS Service has been disabled for this domain."; } else if (preg_match('/ILLEGAL INPUT/i', $data)) { - $status = "phpDynDNS: (Error) Illegal Input: Self-Explantory"; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Illegal Input: Self-Explantory"; } else if (preg_match('/TOOSOON/i', $data)) { - $status = "phpDynDNS: (Error) Too Soon: Not Enough Time Has Elapsed Since Last Update"; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Too Soon: Not Enough Time Has Elapsed Since Last Update"; } else if (preg_match('/NOERROR/i', $data)) { - $status = "phpDynDNS: (Success) IP Updated Successfully!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Updated Successfully!"; $successful_update = true; } else { - $status = "phpDynDNS: (Unknown Response)"; - log_error("phpDynDNS: PAYLOAD: {$data}"); + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; @@ -712,130 +712,130 @@ break; case 'zoneedit': if (preg_match('/799/i', $data)) { - $status = "phpDynDNS: (Error 799) Update Failed!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Error 799) Update Failed!"; } else if (preg_match('/700/i', $data)) { - $status = "phpDynDNS: (Error 700) Update Failed!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Error 700) Update Failed!"; } else if (preg_match('/200/i', $data)) { - $status = "phpDynDNS: (Success) IP Address Updated Successfully!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Updated Successfully!"; $successful_update = true; } else if (preg_match('/201/i', $data)) { - $status = "phpDynDNS: (Success) IP Address Updated Successfully!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Updated Successfully!"; $successful_update = true; } else { - $status = "phpDynDNS: (Unknown Response)"; - log_error("phpDynDNS: PAYLOAD: {$data}"); + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; case 'dyns': if (preg_match("/400/i", $data)) { - $status = "phpDynDNS: (Error) Bad Request - The URL was malformed. Required parameters were not provided."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Bad Request - The URL was malformed. Required parameters were not provided."; } else if (preg_match('/402/i', $data)) { - $status = "phpDynDNS: (Error) Update Too Soon - You have tried updating to quickly since last change."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Update Too Soon - You have tried updating to quickly since last change."; } else if (preg_match('/403/i', $data)) { - $status = "phpDynDNS: (Error) Database Error - There was a server-sided database error."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Database Error - There was a server-sided database error."; } else if (preg_match('/405/i', $data)) { - $status = "phpDynDNS: (Error) Hostname Error - The hostname (".$this->_dnsHost.") doesn't belong to you."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Hostname Error - The hostname (".$this->_dnsHost.") doesn't belong to you."; } else if (preg_match('/200/i', $data)) { - $status = "phpDynDNS: (Success) IP Address Updated Successfully!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Updated Successfully!"; $successful_update = true; } else { - $status = "phpDynDNS: (Unknown Response)"; - log_error("phpDynDNS: PAYLOAD: {$data}"); + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; case 'ods': if (preg_match("/299/i", $data)) { - $status = "phpDynDNS: (Success) IP Address Updated Successfully!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Updated Successfully!"; $successful_update = true; } else { - $status = "phpDynDNS: (Unknown Response)"; - log_error("phpDynDNS: PAYLOAD: {$data}"); + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; case 'freedns': if (preg_match("/has not changed./i", $data)) { - $status = "phpDynDNS: (Success) No Change In IP Address"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) No Change In IP Address"; $successful_update = true; } else if (preg_match("/Updated/i", $data)) { - $status = "phpDynDNS: (Success) IP Address Changed Successfully!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Changed Successfully!"; $successful_update = true; } else { - $status = "phpDynDNS: (Unknown Response)"; - log_error("phpDynDNS: PAYLOAD: {$data}"); + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; case 'dnsexit': if (preg_match("/is the same/i", $data)) { - $status = "phpDynDns: (Success) No Change In IP Address"; + $status = "phpDynDns ({$this->_dnsHost}): (Success) No Change In IP Address"; $successful_update = true; } else if (preg_match("/Success/i", $data)) { - $status = "phpDynDNS: (Success) IP Address Changed Successfully!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Changed Successfully!"; $successful_update = true; } else { - $status = "phpDynDNS: (Unknown Response)"; - log_error("phpDynDNS: PAYLOAD: {$data}"); + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; case 'loopia': if (preg_match("/nochg/i", $data)) { - $status = "phpDynDNS: (Success) No Change In IP Address"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) No Change In IP Address"; $successful_update = true; } else if (preg_match("/good/i", $data)) { - $status = "phpDynDNS: (Success) IP Address Changed Successfully!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Changed Successfully!"; $successful_update = true; } else if (preg_match('/badauth/i', $data)) { - $status = "phpDynDNS: (Error) User Authorization Failed"; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) User Authorization Failed"; } else { - $status = "phpDynDNS: (Unknown Response)"; - log_error("phpDynDNS: PAYLOAD: {$data}"); + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; case 'opendns': if (preg_match('/badauth/i', $data)) { - $status = "phpDynDNS: (Error) Not a valid username or password!"; + $status = "phpDynDNS({$this->_dnsHost}): (Error) Not a valid username or password!"; } else if (preg_match('/nohost/i', $data)) { - $status = "phpDynDNS: (Error) Hostname you are trying to update does not exist."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Hostname you are trying to update does not exist."; $successful_update = true; } else if (preg_match('/good/i', $data)) { - $status = "phpDynDNS: (Success) IP Address Changed Successfully! (".$this->_dnsIP.")"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Changed Successfully! (".$this->_dnsIP.")"; $successful_update = true; } else if (preg_match('/yours/i', $data)) { - $status = "phpDynDNS: (Error) hostname specified exists, but not under the username specified."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) hostname specified exists, but not under the username specified."; } else if (preg_match('/abuse/i', $data)) { - $status = "phpDynDns: (Error) Updating too frequently, considered abuse."; + $status = "phpDynDns ({$this->_dnsHost}): (Error) Updating too frequently, considered abuse."; } else { - $status = "phpDynDNS: (Unknown Response)"; - log_error("phpDynDNS: PAYLOAD: {$data}"); + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; case 'staticcling': if (preg_match("/invalid ip/i", $data)) { - $status = "phpDynDNS: (Error) Bad Request - The IP provided was invalid."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Bad Request - The IP provided was invalid."; } else if (preg_match('/required info missing/i', $data)) { - $status = "phpDynDNS: (Error) Bad Request - Required parameters were not provided."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Bad Request - Required parameters were not provided."; } else if (preg_match('/invalid characters/i', $data)) { - $status = "phpDynDNS: (Error) Bad Request - Illegal characters in either the username or the password."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Bad Request - Illegal characters in either the username or the password."; } else if (preg_match('/bad password/i', $data)) { - $status = "phpDynDNS: (Error) Invalid password."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Invalid password."; } else if (preg_match('/account locked/i', $data)) { - $status = "phpDynDNS: (Error) This account has been administratively locked."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) This account has been administratively locked."; } else if (preg_match('/update too frequent/i', $data)) { - $status = "phpDynDNS: (Error) Updating too frequently."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Updating too frequently."; } else if (preg_match('/DB error/i', $data)) { - $status = "phpDynDNS: (Error) Server side error."; + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Server side error."; } else if (preg_match('/success/i', $data)) { - $status = "phpDynDNS: (Success) IP Address Updated Successfully!"; + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Updated Successfully!"; $successful_update = true; } else { - $status = "phpDynDNS: (Unknown Response)"; - log_error("phpDynDNS: PAYLOAD: {$data}"); + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); $this->_debug($data); } break; @@ -1018,16 +1018,16 @@ global $debug; if ($debug) - log_error("DynDns: _detectChange() starting."); + log_error("DynDns ({$this->_dnsHost}): _detectChange() starting."); $currentTime = time(); $wan_ip = $this->_checkIP(); if ($wan_ip == 0) { - log_error("DynDns: Current WAN IP could not be determined, skipping update process."); + log_error("DynDns ({$this->_dnsHost}): Current WAN IP could not be determined, skipping update process."); return false; } - $log_error = "DynDns: Current WAN IP: {$wan_ip} "; + $log_error = "DynDns ({$this->_dnsHost}): Current WAN IP: {$wan_ip} "; if (file_exists($this->_cacheFile)) { $contents = file_get_contents($this->_cacheFile); @@ -1072,7 +1072,7 @@ * new cache value and return true */ if ($needs_updating == true) { - log_error("DynDns debug information: {$update_reason}"); + log_error("DynDns debug information ({$this->_dnsHost}): {$update_reason}"); return true; } @@ -1097,7 +1097,7 @@ global $debug; if ($debug) - log_error("DynDns: _checkIP() starting."); + log_error("DynDns ({$this->_dnsHost}): _checkIP() starting."); $ip_address = find_interface_ip($this->_if); if (!is_ipaddr($ip_address)) @@ -1112,7 +1112,7 @@ $try++; } if ($try >= 3) { - log_error("Dyndns debug information: Could not resolve {$hosttocheck} to ip using interface ip {$ip_address}."); + log_error("Dyndns debug information ({$this->_dnsHost}): Could not resolve {$hosttocheck} to ip using interface ip {$ip_address}."); return 0; } $ip_ch = curl_init("http://{$checkip}"); @@ -1127,13 +1127,13 @@ preg_match('/Current IP Address: (.*)<\/body>/', $ip_result_decoded, $matches); $ip_address = trim($matches[1]); if (is_ipaddr($ip_address)) - log_error("DynDns debug information: {$ip_address} extracted from {$hosttocheck}"); + log_error("DynDns debug information ({$this->_dnsHost}): {$ip_address} extracted from {$hosttocheck}"); else { - log_error("DynDns debug information: IP address could not be extracted from {$hosttocheck}"); + log_error("DynDns debug information ({$this->_dnsHost}): IP address could not be extracted from {$hosttocheck}"); return 0; } } else - log_error("DynDns debug information: {$ip_address} extracted from local system."); + log_error("DynDns debug information ({$this->_dnsHost}): {$ip_address} extracted from local system."); $this->_dnsIP = $ip_address; |