Merge remote-tracking branch 'upstream/dev' into bootstrap_5
这个提交包含在:
当前提交
5ddd5f7528
共有 4 个文件被更改,包括 65 次插入 和 15 次删除
|
|
@ -52,9 +52,11 @@ class Debug extends CI_Controller {
|
||||||
// Check if the subdirectories are writable (recursive check)
|
// Check if the subdirectories are writable (recursive check)
|
||||||
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
|
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
|
||||||
foreach ($iterator as $item) {
|
foreach ($iterator as $item) {
|
||||||
if (!is_writable($item->getPathname())) {
|
if ($item->isDir() && basename($item->getPathName()) != '..') {
|
||||||
return false;
|
if (!is_writable($item->getRealPath())) {
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -851,16 +851,40 @@ function worked_grid_before($gridsquare, $type, $band, $mode)
|
||||||
$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);
|
||||||
}
|
}
|
||||||
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
|
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
|
||||||
|
|
||||||
if (empty($callsign['callsign']['callsign']))
|
if (empty($callsign['callsign']['callsign'])) {
|
||||||
{
|
$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);
|
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
|
||||||
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
|
}
|
||||||
}
|
} else if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) {
|
||||||
|
// Load the HamQTH library
|
||||||
|
$this->load->library('hamqth');
|
||||||
|
|
||||||
|
if(!$this->session->userdata('hamqth_session_key')) {
|
||||||
|
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
|
||||||
|
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
|
||||||
|
}
|
||||||
|
|
||||||
|
$callsign['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key'));
|
||||||
|
|
||||||
|
// If HamQTH session has expired, start a new session and retry the search.
|
||||||
|
if($callsign['callsign']['error'] == "Session does not exist or expired") {
|
||||||
|
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
|
||||||
|
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
|
||||||
|
$callsign['callsign'] = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key'));
|
||||||
|
}
|
||||||
|
if (isset($data['callsign']['gridsquare'])) {
|
||||||
|
$CI = &get_instance();
|
||||||
|
$CI->load->model('logbook_model');
|
||||||
|
$callsign['grid_worked'] = $CI->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'));
|
||||||
|
}
|
||||||
|
if (isset($callsign['callsign']['error'])) {
|
||||||
|
$callsign['error'] = $callsign['callsign']['error'];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$callsign['error'] = 'Lookup not configured or set to hamqth. Currently only qrz is supported.';
|
$callsign['error'] = 'Lookup not configured. Please review configuration.';
|
||||||
}
|
}
|
||||||
|
|
||||||
// There's no hamli integration? Disabled for now.
|
// There's no hamli integration? Disabled for now.
|
||||||
|
|
@ -937,8 +961,33 @@ function worked_grid_before($gridsquare, $type, $band, $mode)
|
||||||
if (isset($data['callsign']['error'])) {
|
if (isset($data['callsign']['error'])) {
|
||||||
$data['error'] = $data['callsign']['error'];
|
$data['error'] = $data['callsign']['error'];
|
||||||
}
|
}
|
||||||
|
} else if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) {
|
||||||
|
// Load the HamQTH library
|
||||||
|
$this->load->library('hamqth');
|
||||||
|
|
||||||
|
if(!$this->session->userdata('hamqth_session_key')) {
|
||||||
|
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
|
||||||
|
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key'));
|
||||||
|
|
||||||
|
// If HamQTH session has expired, start a new session and retry the search.
|
||||||
|
if($data['callsign']['error'] == "Session does not exist or expired") {
|
||||||
|
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
|
||||||
|
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
|
||||||
|
$data['callsign'] = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key'));
|
||||||
|
}
|
||||||
|
if (isset($data['callsign']['gridsquare'])) {
|
||||||
|
$CI = &get_instance();
|
||||||
|
$CI->load->model('logbook_model');
|
||||||
|
$data['grid_worked'] = $CI->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'));
|
||||||
|
}
|
||||||
|
if (isset($data['callsign']['error'])) {
|
||||||
|
$data['error'] = $data['callsign']['error'];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$data['error'] = 'Lookup not configured or set to hamqth. Currently only qrz is supported.';
|
$data['error'] = 'Lookup not configured. Please review configuration.';
|
||||||
} /*else {
|
} /*else {
|
||||||
// Lookup using hamli
|
// Lookup using hamli
|
||||||
$this->load->library('hamli');
|
$this->load->library('hamli');
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ class Curl {
|
||||||
function __construct($url = '')
|
function __construct($url = '')
|
||||||
{
|
{
|
||||||
$this->_ci = & get_instance();
|
$this->_ci = & get_instance();
|
||||||
log_message('debug', 'cURL Class Initialized');
|
|
||||||
|
|
||||||
if ( ! $this->is_enabled())
|
if ( ! $this->is_enabled())
|
||||||
{
|
{
|
||||||
|
|
@ -369,4 +368,4 @@ class Curl {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End of file Curl.php */
|
/* End of file Curl.php */
|
||||||
/* Location: ./application/libraries/Curl.php */
|
/* Location: ./application/libraries/Curl.php */
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ class Hamqth {
|
||||||
|
|
||||||
// Create XML object
|
// Create XML object
|
||||||
$xml = simplexml_load_string($xml);
|
$xml = simplexml_load_string($xml);
|
||||||
if (empty($xml)) return;
|
if (!empty($xml->session->error)) return $data['error'] = $xml->session->error;
|
||||||
|
|
||||||
// Return Required Fields
|
// Return Required Fields
|
||||||
$data['callsign'] = (string)$xml->search->callsign;
|
$data['callsign'] = (string)$xml->search->callsign;
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用