Added support for a config flag to determine if we should get full names from qrz. Added error checking for this with the api for import as well.
这个提交包含在:
父节点
4064418942
当前提交
30600ae220
共有 4 个文件被更改,包括 22 次插入 和 16 次删除
|
|
@ -139,7 +139,7 @@ class Logbook extends CI_Controller {
|
|||
}
|
||||
|
||||
|
||||
$callbook = $this->logbook_model->loadCallBook($callsign, $this->config->item('personal'));
|
||||
$callbook = $this->logbook_model->loadCallBook($callsign, $this->config->item('use_fullname'));
|
||||
|
||||
|
||||
if (isset($callbook))
|
||||
|
|
@ -491,8 +491,8 @@ class Logbook extends CI_Controller {
|
|||
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
|
||||
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
|
||||
}
|
||||
echo("Part 1: ". (int)$this->config->item('personal'));
|
||||
$data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('personal'));
|
||||
|
||||
$data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
|
||||
}
|
||||
|
||||
// There's no hamli integration? Disabled for now.
|
||||
|
|
@ -548,8 +548,8 @@ class Logbook extends CI_Controller {
|
|||
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'));
|
||||
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
|
||||
}
|
||||
echo ("Part 2: ". $this->config->item('personal'). "<br/>");
|
||||
$data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('qrz_password'), $this->config->item('personal'));
|
||||
|
||||
$data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('qrz_password'), $this->config->item('use_fullname'));
|
||||
} else {
|
||||
// Lookup using hamli
|
||||
$this->load->library('hamli');
|
||||
|
|
|
|||
|
|
@ -54,11 +54,8 @@ class Qrz {
|
|||
}
|
||||
|
||||
|
||||
public function search($callsign, $key, $private="dog")
|
||||
public function search($callsign, $key, $use_fullname)
|
||||
{
|
||||
echo("Callsign: ".$callsign."<br/>");
|
||||
echo("key: ".$key."<br/>");
|
||||
echo("FOOOOOO: ". $private."<br/>");
|
||||
$data = null;
|
||||
try {
|
||||
// URL to the XML Source
|
||||
|
|
@ -79,8 +76,8 @@ class Qrz {
|
|||
// Return Required Fields
|
||||
$data['callsign'] = (string)$xml->Callsign->call;
|
||||
|
||||
if ($private === true) {
|
||||
$data['name'] = (string)$xml->Callsign->fname . ' AAAA ' . (string)$xml->Callsign->name;
|
||||
if ($use_fullname === true) {
|
||||
$data['name'] = (string)$xml->Callsign->fname . ' ' . (string)$xml->Callsign->name;
|
||||
} else {
|
||||
$data['name'] = (string)$xml->Callsign->fname;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2168,7 +2168,7 @@ class Logbook_model extends CI_Model {
|
|||
}
|
||||
}
|
||||
|
||||
public function loadCallBook($callsign, $personal=false)
|
||||
public function loadCallBook($callsign, $use_fullname=false)
|
||||
{
|
||||
$callbook = null;
|
||||
try {
|
||||
|
|
@ -2182,10 +2182,8 @@ class Logbook_model extends CI_Model {
|
|||
}
|
||||
|
||||
|
||||
$personal = "foo";
|
||||
echo ("part 3: ". $personal. "<br/>");
|
||||
$callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $this->config->item('qrz_password'), "foobar");
|
||||
echo ("part 4: ". $personal. "<br/>");
|
||||
|
||||
$callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $use_fullname);
|
||||
}
|
||||
|
||||
if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) {
|
||||
|
|
|
|||
|
|
@ -40,10 +40,21 @@ $config['display_freq'] = false;
|
|||
|
|
||||
| 'qrz_username' QRZ.com user login
|
||||
| 'qrz_password' QRZ.com user password
|
||||
| 'use_fullname' Get full names from QRZ, may not be GDPR compliant
|
||||
*/
|
||||
|
||||
$config['qrz_username'] = "";
|
||||
$config['qrz_password'] = "";
|
||||
$config['use_fullname'] = false;
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Are we running this on a personal server? If we are, GDPR laws
|
||||
| prevent us from storing personal information.
|
||||
|
|
||||
*/
|
||||
$config['personal'] = false;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
正在加载…
在新工单中引用