kopia lustrzana https://github.com/magicbug/Cloudlog
Check Username is provided and valid before allowing clublog uploading
rodzic
b26e9e4bdb
commit
94daa81b2c
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Ładowanie…
Reference in New Issue