diff --git a/application/controllers/Backup.php b/application/controllers/Backup.php index 794a6f8c..e73306f7 100644 --- a/application/controllers/Backup.php +++ b/application/controllers/Backup.php @@ -20,7 +20,7 @@ class Backup extends CI_Controller { } /* Gets all QSOs and Dumps them to logbook.adi */ - public function adif($key){ + public function adif($key = null){ $this->load->helper('file'); // Set memory limit to unlimited to allow heavy usage ini_set('memory_limit', '-1'); diff --git a/application/models/Adif_data.php b/application/models/Adif_data.php index 4043bc2c..c01a6103 100644 --- a/application/models/Adif_data.php +++ b/application/models/Adif_data.php @@ -3,11 +3,11 @@ class adif_data extends CI_Model { function export_all($api_key = null) { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); if ($api_key != null) { - $CI =& get_instance(); $CI->load->model('api_model'); if (strpos($this->api_model->access($api_key), 'r') !== false) { - $CI->load->model('logbooks_model'); $this->api_model->update_last_used($api_key); $user_id = $this->api_model->key_userid($api_key); $active_station_logbook = $CI->logbooks_model->find_active_station_logbook_from_userid($user_id);