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.

这个提交包含在:
Jeremy Brown 2020-11-11 14:38:00 -05:00
父节点 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)) 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')); $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); $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. // 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')); $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'));
$this->session->set_userdata('qrz_session_key', $qrz_session_key); $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 { } else {
// Lookup using hamli // Lookup using hamli
$this->load->library('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; $data = null;
try { try {
// URL to the XML Source // URL to the XML Source
@ -79,8 +76,8 @@ class Qrz {
// Return Required Fields // Return Required Fields
$data['callsign'] = (string)$xml->Callsign->call; $data['callsign'] = (string)$xml->Callsign->call;
if ($private === true) { if ($use_fullname === true) {
$data['name'] = (string)$xml->Callsign->fname . ' AAAA ' . (string)$xml->Callsign->name; $data['name'] = (string)$xml->Callsign->fname . ' ' . (string)$xml->Callsign->name;
} else { } else {
$data['name'] = (string)$xml->Callsign->fname; $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; $callbook = null;
try { 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'), $use_fullname);
$callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $this->config->item('qrz_password'), "foobar");
echo ("part 4: ". $personal. "<br/>");
} }
if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) { 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_username' QRZ.com user login
| 'qrz_password' QRZ.com user password | 'qrz_password' QRZ.com user password
| 'use_fullname' Get full names from QRZ, may not be GDPR compliant
*/ */
$config['qrz_username'] = ""; $config['qrz_username'] = "";
$config['qrz_password'] = ""; $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;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------