Secure calltester so that it can only run when logged in and you are admin

这个提交包含在:
Andreas 2023-08-01 13:25:36 +02:00
父节点 57a5e2ae85
当前提交 41d535b805

查看文件

@ -1,6 +1,17 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); <?php
use Cloudlog\Dxcc\Dxcc;
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Calltester extends CI_Controller { class Calltester extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('user_model');
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
}
public function db() { public function db() {
set_time_limit(3600); set_time_limit(3600);
@ -344,7 +355,7 @@ class Calltester extends CI_Controller {
'Callsign' => 'FT8WW', 'Callsign' => 'FT8WW',
'Country' => 'Crozet Island', 'Country' => 'Crozet Island',
'Adif' => 41, 'Adif' => 41,
'Date' => $date = date('Ymd', time()) 'Date' => 20230314
); );
$testarray[] = array( $testarray[] = array(
@ -445,6 +456,27 @@ class Calltester extends CI_Controller {
'Date' => $date = date('Ymd', time()) 'Date' => $date = date('Ymd', time())
); );
$testarray[] = array(
'Callsign' => 'KG4W',
'Country' => 'United States Of America',
'Adif' => 291,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'KG4WW',
'Country' => 'Guantanamo Bay',
'Adif' => 105,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'KG4WWW',
'Country' => 'United States Of America',
'Adif' => 291,
'Date' => $date = date('Ymd', time())
);
set_time_limit(3600); set_time_limit(3600);
// Starting clock time in seconds // Starting clock time in seconds