[LOTW] Run through every Cloudlog user with LOTW user info and download and match QSOs
这个提交包含在:
父节点
2fdda56338
当前提交
44edb1361b
共有 2 个文件被更改,包括 53 次插入 和 36 次删除
|
|
@ -513,18 +513,23 @@ class Lotw extends CI_Controller {
|
|||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
public function lotw_download($user_id) {
|
||||
public function lotw_download() {
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$query = $this->user_model->get_all_lotw_users();
|
||||
|
||||
if ($query->num_rows() >= 1) {
|
||||
|
||||
foreach ($query->result() as $user)
|
||||
{
|
||||
|
||||
$config['upload_path'] = './uploads/';
|
||||
$file = $config['upload_path'] . 'lotwreport_download.adi';
|
||||
|
||||
// Get credentials for LoTW
|
||||
$query = $this->user_model->get_by_id($user_id);
|
||||
$q = $query->row();
|
||||
$data['user_lotw_name'] = rawurlencode($q->user_lotw_name);
|
||||
$data['user_lotw_password'] = rawurlencode($q->user_lotw_password);
|
||||
$data['user_lotw_name'] = rawurlencode($user->user_lotw_name);
|
||||
$data['user_lotw_password'] = rawurlencode($user->user_lotw_password);
|
||||
|
||||
// Get URL for downloading LoTW
|
||||
$query = $query = $this->db->query('SELECT lotw_download_url FROM config');
|
||||
|
|
@ -557,6 +562,10 @@ class Lotw extends CI_Controller {
|
|||
ini_set('memory_limit', '-1');
|
||||
$this->loadFromFile($file);
|
||||
}
|
||||
} else {
|
||||
echo "No users found";
|
||||
}
|
||||
}
|
||||
|
||||
public function import() {
|
||||
$this->load->model('user_model');
|
||||
|
|
|
|||
|
|
@ -41,6 +41,14 @@ class User_Model extends CI_Model {
|
|||
return $r;
|
||||
}
|
||||
|
||||
// FUNCTION: object get_all_lotw_users
|
||||
// Returns all users with lotw details
|
||||
function get_all_lotw_users() {
|
||||
$this->db->where('user_lotw_name !=', null);
|
||||
$r = $this->db->get($this->config->item('auth_table'));
|
||||
return $r;
|
||||
}
|
||||
|
||||
// FUNCTION: object get_by_email($email)
|
||||
// Retrieve a user by email address
|
||||
function get_by_email($email) {
|
||||
|
|
|
|||
正在加载…
在新工单中引用