mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Added config switch to upload function in controller
This commit is contained in:
@@ -122,28 +122,33 @@ class Clublog extends CI_Controller
|
||||
}
|
||||
|
||||
public function uploadlog() {
|
||||
$this->load->model('clublog_model');
|
||||
if (!($this->config->item('disable_manual_clublog'))) {
|
||||
$this->load->model('clublog_model');
|
||||
|
||||
$clean_station_id = $this->security->xss_clean($this->input->post('station_id'));
|
||||
$clean_station_id = $this->security->xss_clean($this->input->post('station_id'));
|
||||
|
||||
$users = $this->clublog_model->get_clublog_users($this->session->userdata('user_id'));
|
||||
$users = $this->clublog_model->get_clublog_users($this->session->userdata('user_id'));
|
||||
|
||||
if (!empty($users)) {
|
||||
$stationinfo = $this->clublog_model->stations_with_clublog_enabled();
|
||||
$info = $stationinfo->result();
|
||||
$data['info'] = $info;
|
||||
foreach ($users as $user) {
|
||||
$data['status'] = 'OK';
|
||||
$data['infomessage'] = $this->clublog_model->uploadUser($user->user_id, $user->user_clublog_name, $user->user_clublog_password, $clean_station_id);
|
||||
if (!empty($users)) {
|
||||
$stationinfo = $this->clublog_model->stations_with_clublog_enabled();
|
||||
$info = $stationinfo->result();
|
||||
$data['info'] = $info;
|
||||
foreach ($users as $user) {
|
||||
$data['status'] = 'OK';
|
||||
$data['infomessage'] = $this->clublog_model->uploadUser($user->user_id, $user->user_clublog_name, $user->user_clublog_password, $clean_station_id);
|
||||
$data['errormessages'] = '';
|
||||
}
|
||||
} else {
|
||||
$data['status'] = 'Error';
|
||||
$data['errormessages'] = __("No user has configured Clublog.");
|
||||
$data['info'] = '';
|
||||
}
|
||||
} else {
|
||||
$data['status'] = 'Error';
|
||||
$data['errormessages']= __("No user has configured Clublog.");
|
||||
$data['info'] = '';
|
||||
}
|
||||
|
||||
header('Content-type: application/json');
|
||||
echo json_encode($data);
|
||||
header('Content-type: application/json');
|
||||
echo json_encode($data);
|
||||
} else {
|
||||
redirect('dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
public function importlog() {
|
||||
|
||||
Reference in New Issue
Block a user