diff --git a/application/controllers/Qrz.php b/application/controllers/Qrz.php index e8c457939..e9f82dc05 100644 --- a/application/controllers/Qrz.php +++ b/application/controllers/Qrz.php @@ -39,6 +39,7 @@ class Qrz extends CI_Controller { curl_setopt( $ch, CURLOPT_HEADER, 0); curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 20); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt( $ch, CURLOPT_USERAGENT, 'Wavelog '.$this->optionslib->get_option('version')); $content = curl_exec($ch); curl_close($ch); @@ -358,6 +359,7 @@ class Qrz extends CI_Controller { curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt( $ch, CURLOPT_HEADER, 0); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt( $ch, CURLOPT_USERAGENT, 'Wavelog '.$this->optionslib->get_option('version')); $content = htmlspecialchars_decode(curl_exec($ch)); file_put_contents($file, $content); diff --git a/application/libraries/Qrz.php b/application/libraries/Qrz.php index cc51b7b9b..db3be07d1 100644 --- a/application/libraries/Qrz.php +++ b/application/libraries/Qrz.php @@ -10,6 +10,7 @@ class Qrz { // Return session key public function session($username, $password) { // URL to the XML Source + $ci = & get_instance(); $xml_feed_url = 'https://xmldata.qrz.com/xml/current/?username='.$username.';password='.urlencode($password).';agent=wavelog'; // CURL Functions @@ -18,7 +19,8 @@ class Qrz { curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); - curl_setopt($ch, CURLOPT_TIMEOUT, 10); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); + curl_setopt($ch, CURLOPT_USERAGENT, 'Wavelog '.$ci->optionslib->get_option('version')); $xml = curl_exec($ch); curl_close($ch); @@ -43,7 +45,8 @@ class Qrz { curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); - curl_setopt($ch, CURLOPT_TIMEOUT, 10); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); + curl_setopt($ch, CURLOPT_USERAGENT, 'Wavelog '.$ci->optionslib->get_option('version')); $xml = curl_exec($ch); curl_close($ch); @@ -60,6 +63,7 @@ class Qrz { public function search($callsign, $key, $use_fullname = false, $reduced = false) { $data = null; + $ci = & get_instance(); try { // URL to the XML Source $xml_feed_url = 'https://xmldata.qrz.com/xml/current/?s=' . $key . ';callsign=' . $callsign . ''; @@ -71,6 +75,7 @@ class Qrz { curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, 10); + curl_setopt($ch, CURLOPT_USERAGENT, 'Wavelog '.$ci->optionslib->get_option('version')); $xml = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 0e3ad4156..ea9d06bf9 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -994,7 +994,7 @@ class Logbook_model extends CI_Model { curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - + curl_setopt($ch, CURLOPT_USERAGENT, 'Wavelog '.$this->optionslib->get_option('version')); $content = curl_exec($ch); if ($content) { if (stristr($content, 'RESULT=OK') || stristr($content, 'RESULT=REPLACE')) {