mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Check Username is provided and valid before allowing clublog uploading
This commit is contained in:
@@ -12,11 +12,23 @@ class Clublog extends CI_Controller {
|
||||
}
|
||||
|
||||
// Upload ADIF to Clublog
|
||||
public function upload() {
|
||||
public function upload($username) {
|
||||
$this->load->helper('file');
|
||||
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
|
||||
$this->load->model('clublog_model');
|
||||
|
||||
$clublog_info = $this->clublog_model->get_clublog_auth_info($username);
|
||||
|
||||
if(!isset($clublog_info['user_name'])) {
|
||||
echo "Username unknown";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
print_r($clublog_info);
|
||||
|
||||
$data['qsos'] = $this->logbook_model->get_clublog_qsos();
|
||||
|
||||
// Create ADIF File of contacts not uploaded to Clublog
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Clublog extends CI_Model {
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
18
application/models/Clublog_model.php
Normal file
18
application/models/Clublog_model.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
class Clublog_model extends CI_Model {
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function get_clublog_auth_info($username) {
|
||||
$this->db->select('user_name, user_clublog_name, user_clublog_password, user_clublog_callsign');
|
||||
$this->db->where('user_name', $username);
|
||||
$query = $this->db->get($this->config->item('auth_table'));
|
||||
return $row = $query->row_array();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user