Fixes QRZ API session time outs
这个提交包含在:
父节点
054eb0598e
当前提交
0f6ba82f92
共有 3 个文件被更改,包括 13 次插入 和 21 次删除
|
|
@ -16,7 +16,7 @@ $config['app_name'] = "Cloudlog";
|
||||||
$config['app_version'] = "0.1";
|
$config['app_version'] = "0.1";
|
||||||
$config['directory'] = "logbook";
|
$config['directory'] = "logbook";
|
||||||
|
|
||||||
$config['callbook'] = "callbytxt"; // Options are qrz or callbytxt
|
$config['callbook'] = "qrz"; // Options are qrz or callbytxt
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -5,24 +5,13 @@ class Welcome extends CI_Controller {
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
//$this->load->view('welcome_message');
|
$this->load->library('qrz');
|
||||||
|
|
||||||
|
$qrz_session_key = $this->qrz->set_session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
|
||||||
|
|
||||||
// URL to the XML Source
|
echo $this->session->userdata('qrz_session_key');
|
||||||
$xml_feed_url = 'http://xmldata.qrz.com/xml/current/?username='.$username.';password='.$password.';agent=cloudlog';
|
|
||||||
|
|
||||||
// CURL Functions
|
$data['callsign'] = $this->qrz->search("m3php", $this->session->userdata('qrz_session_key'));
|
||||||
$ch = curl_init();
|
|
||||||
curl_setopt($ch, CURLOPT_URL, $xml_feed_url);
|
|
||||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
$xml = curl_exec($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
|
|
||||||
// Create XML object
|
|
||||||
$xml = simplexml_load_string($xml);
|
|
||||||
|
|
||||||
print_r($xml);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ class Qrz {
|
||||||
// Set Session Key session.
|
// Set Session Key session.
|
||||||
public function set_session($username, $password) {
|
public function set_session($username, $password) {
|
||||||
|
|
||||||
|
$ci = & get_instance();
|
||||||
|
|
||||||
// URL to the XML Source
|
// URL to the XML Source
|
||||||
$xml_feed_url = 'http://xmldata.qrz.com/xml/current/?username='.$username.';password='.$password.';agent=cloudlog';
|
$xml_feed_url = 'http://xmldata.qrz.com/xml/current/?username='.$username.';password='.$password.';agent=cloudlog';
|
||||||
|
|
||||||
|
|
@ -46,7 +48,7 @@ class Qrz {
|
||||||
|
|
||||||
$key = (string) $xml->Session->Key;
|
$key = (string) $xml->Session->Key;
|
||||||
|
|
||||||
$this->session->set_userdata('qrz_session_key', $key);
|
$ci->session->set_userdata('qrz_session_key', $key);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -78,6 +80,7 @@ class Qrz {
|
||||||
$data['long'] = (string) $xml->Callsign->lon;
|
$data['long'] = (string) $xml->Callsign->lon;
|
||||||
$data['iota'] = (string) $xml->Callsign->iota;
|
$data['iota'] = (string) $xml->Callsign->iota;
|
||||||
|
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用