Only Export Cabrillo for stations belonging to the User

这个提交包含在:
int2001 2023-07-30 17:31:54 +00:00
父节点 e957402b37
当前提交 feb81eecde
找不到此签名对应的密钥
GPG 密钥 ID: DFB1C13CD2DB037B

查看文件

@ -42,11 +42,16 @@ class Cabrillo extends CI_Controller {
$this->load->model('Contesting_model');
$station_id = $this->security->xss_clean($this->input->post('station_id'));
$this->load->model('stations');
if ($this->stations->check_station_is_accessible($station_id)) {
$year = $this->security->xss_clean($this->input->post('year'));
$result = $this->Contesting_model->get_logged_contests($station_id, $year);
header('Content-Type: application/json');
echo json_encode($result);
} else {
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard');
}
}
public function getYears() {
@ -62,6 +67,8 @@ class Cabrillo extends CI_Controller {
public function getContestDates() {
$this->load->model('Contesting_model');
$station_id = $this->security->xss_clean($this->input->post('station_id'));
$this->load->model('stations');
if ($this->stations->check_station_is_accessible($station_id)) {
$year = $this->security->xss_clean($this->input->post('year'));
$contestid = $this->security->xss_clean($this->input->post('contestid'));
@ -69,6 +76,9 @@ class Cabrillo extends CI_Controller {
header('Content-Type: application/json');
echo json_encode($result);
} else {
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard');
}
}
public function export() {
@ -81,6 +91,7 @@ class Cabrillo extends CI_Controller {
$this->load->model('user_model');
$station_id = $this->security->xss_clean($this->input->post('station_id'));
if ($this->stations->check_station_is_accessible($station_id)) {
$contest_id = $this->security->xss_clean($this->input->post('contestid'));
$from = $this->security->xss_clean($this->input->post('contestdatesfrom'));
@ -120,5 +131,8 @@ class Cabrillo extends CI_Controller {
$data['gridlocator'] = $station->station_gridsquare;
$this->load->view('cabrillo/export', $data);
}else {
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard');
}
}
}