Merge branch 'dev' into dcl_frontend

This commit is contained in:
int2001
2025-08-17 13:42:16 +00:00
138 changed files with 48754 additions and 25227 deletions

View File

@@ -180,6 +180,81 @@ class Awards extends CI_Controller {
$this->load->view('interface_assets/footer');
}
public function wapc () {
$footerData = [];
$this->load->model('wapc');
$this->load->model('modes');
$this->load->model('bands');
$data['worked_bands'] = $this->bands->get_worked_bands('wapc');
$data['modes'] = $this->modes->active();
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
if ($this->input->post('band') == 'All') { // Did the user specify a band? If not, use all bands
$bands = $data['worked_bands'];
}
else {
$bands[] = $this->security->xss_clean($this->input->post('band'));
}
}
else {
$bands = $data['worked_bands'];
}
$data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view
if($this->input->method() === 'post') {
$postdata['qsl'] = $this->security->xss_clean($this->input->post('qsl'));
$postdata['lotw'] = $this->security->xss_clean($this->input->post('lotw'));
$postdata['eqsl'] = $this->security->xss_clean($this->input->post('eqsl'));
$postdata['qrz'] = $this->security->xss_clean($this->input->post('qrz'));
$postdata['clublog'] = $this->security->xss_clean($this->input->post('clublog'));
$postdata['worked'] = $this->security->xss_clean($this->input->post('worked'));
$postdata['confirmed'] = $this->security->xss_clean($this->input->post('confirmed'));
$postdata['notworked'] = $this->security->xss_clean($this->input->post('notworked'));
$postdata['includedeleted'] = $this->security->xss_clean($this->input->post('includedeleted'));
$postdata['Africa'] = $this->security->xss_clean($this->input->post('Africa'));
$postdata['Asia'] = $this->security->xss_clean($this->input->post('Asia'));
$postdata['Europe'] = $this->security->xss_clean($this->input->post('Europe'));
$postdata['NorthAmerica'] = $this->security->xss_clean($this->input->post('NorthAmerica'));
$postdata['SouthAmerica'] = $this->security->xss_clean($this->input->post('SouthAmerica'));
$postdata['Oceania'] = $this->security->xss_clean($this->input->post('Oceania'));
$postdata['Antarctica'] = $this->security->xss_clean($this->input->post('Antarctica'));
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
}
else { // Setting default values at first load of page
$postdata['qsl'] = 1;
$postdata['lotw'] = 1;
$postdata['eqsl'] = 0;
$postdata['qrz'] = 0;
$postdata['clublog'] = 0;
$postdata['worked'] = 1;
$postdata['confirmed'] = 1;
$postdata['notworked'] = 1;
$postdata['includedeleted'] = 0;
$postdata['Africa'] = 1;
$postdata['Asia'] = 1;
$postdata['Europe'] = 1;
$postdata['NorthAmerica'] = 1;
$postdata['SouthAmerica'] = 1;
$postdata['Oceania'] = 1;
$postdata['Antarctica'] = 1;
$postdata['band'] = 'All';
$postdata['mode'] = 'All';
}
$data['wapc_array'] = $this->wapc->get_wapc_array($bands, $postdata);
$data['wapc_summary'] = $this->wapc->get_wapc_summary($bands, $postdata);
// Render Page
$data['page_title'] =__( "Awards - WAPC");
$this->load->view('interface_assets/header', $data);
$this->load->view('awards/wapc/index');
$this->load->view('interface_assets/footer', $footerData);
}
public function waja () {
$footerData = [];
$footerData['scripts'] = [

View File

@@ -154,6 +154,7 @@ class Band extends CI_Controller {
$band['sota'] = $this->security->xss_clean($this->input->post('sota'));
$band['uscounties'] = $this->security->xss_clean($this->input->post('uscounties'));
$band['wap'] = $this->security->xss_clean($this->input->post('wap'));
$band['wapc'] = $this->security->xss_clean($this->input->post('wapc'));
$band['was'] = $this->security->xss_clean($this->input->post('was'));
$band['wwff'] = $this->security->xss_clean($this->input->post('wwff'));
$band['vucc'] = $this->security->xss_clean($this->input->post('vucc'));

View File

@@ -92,7 +92,17 @@ class cron extends CI_Controller {
echo "CRON: " . $cron->id . " -> is due: " . $isdue_result . "\n";
echo "CRON: " . $cron->id . " -> RUNNING...\n";
$url = local_url() . $cron->function;
if (ENVIRONMENT == "docker") {
// In Docker, we use the localhost[:80] to call the cron directly inside the container
$url = 'http://localhost/' . $cron->function;
log_message('debug', 'Docker Environment detected. Using URL: ' . $url);
} else {
// In other environments, we use the local_url() function to get the default url
// Even this local_url() helper created in https://github.com/wavelog/wavelog/pull/795 is not really necessary anymore
// we keep it in case of users do fancy things with it. It doesn't hurt to have it here as it usually returns the base_url
// from the config.php file.
$url = local_url() . $cron->function;
}
if (ENVIRONMENT == "development") {
echo "CRON: " . $cron->id . " -> URL: " . $url . "\n";
}

View File

@@ -54,8 +54,6 @@ class Logbook extends CI_Controller {
$data['qra'] = "none";
}
// load the view
$data['page_title'] = __("Logbook");
@@ -76,8 +74,27 @@ class Logbook extends CI_Controller {
function json($tempcallsign, $tempband, $tempmode, $tempstation_id = null, $date = "", $count = 5) {
session_write_close();
if (($date ?? '') != '') {
$date=date("Y-m-d",strtotime($date));
// Normalize the date only if it's not empty
if (!empty($date)) {
if (strpos($date, '_') !== false) {
// Replace slashes with dashes for URL processing
$date = str_replace('_', '/', $date);
}
// Get user-preferred date format
if ($this->session->userdata('user_date_format')) {
$date_format = $this->session->userdata('user_date_format');
} else {
$date_format = $this->config->item('qso_date_format');
}
$date = urldecode($date);
$dt = DateTime::createFromFormat($date_format, $date);
if ($dt !== false) {
$date = $dt->format('Y-m-d'); // or any normalized format
} else {
// Invalid date for the expected format, handle gracefully
$date = null;
}
}
// Cleaning for security purposes
$callsign = $this->security->xss_clean($tempcallsign);

View File

@@ -320,9 +320,7 @@ class Lotw extends CI_Controller {
}
}
$pos = strpos($result, "<!-- .UPL. accepted -->");
if ($pos === false) {
if (!preg_match('/<!-- \.UPL\.\s*accepted -->/', $result)) {
// Upload of TQ8 Failed for unknown reason
echo $station_profile->station_callsign." (".$station_profile->station_profile_name."): Upload Failed - ".curl_strerror(curl_errno($ch))." (".curl_errno($ch).")<br>";
$this->Lotw_model->last_upload($data['lotw_cert_info']->lotw_cert_id, "Upload failed");
@@ -552,7 +550,7 @@ class Lotw extends CI_Controller {
// Present only if the QSLing station specified a single valid grid square value in its station location uploaded to LoTW.
$qsl_gridsquare = "";
if (isset($record['gridsquare'])) {
if (strlen($record['gridsquare']) > strlen($status[2] ?? '') || substr(strtoupper($status[2] ?? ''), 0, 4) != substr(strtoupper($record['gridsquare']), 0, 4)) {
if (strlen($record['gridsquare']) >= strlen($status[2] ?? '') || substr(strtoupper($status[2] ?? ''), 0, 4) != substr(strtoupper($record['gridsquare']), 0, 4)) {
$qsl_gridsquare = $record['gridsquare'];
}
}

View File

@@ -319,38 +319,6 @@ class Options extends CI_Controller {
}
}
function oqrs() {
$data['page_title'] = __("Wavelog Options");
$data['sub_heading'] = __("OQRS Options");
$this->load->view('interface_assets/header', $data);
$this->load->view('options/oqrs');
$this->load->view('interface_assets/footer');
}
function oqrs_save() {
$data['page_title'] = __("Wavelog Options");
$data['sub_heading'] = __("OQRS Options");
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$global_oqrs_text = $this->optionslib->update('global_oqrs_text', $this->input->post('global_oqrs_text'), null);
$global_oqrs_text = $this->optionslib->update('groupedSearch', $this->input->post('groupedSearch'), null);
$global_oqrs_text = $this->optionslib->update('groupedSearchShowStationName', $this->input->post('groupedSearchShowStationName'), null);
if($global_oqrs_text == TRUE) {
$this->session->set_flashdata('success', __("OQRS options have been saved."));
}
redirect('/options/oqrs');
}
function sendTestMail() {
$this->load->model('user_model');

View File

@@ -36,16 +36,34 @@ class Oqrs extends CI_Controller {
public function index($public_slug = NULL) {
$this->load->model('oqrs_model');
$this->load->model('publicsearch');
$this->load->model('stationsetup_model');
$slug = $this->security->xss_clean($public_slug);
$data['slug'] = $slug;
$data['oqrs_enabled'] = $this->oqrs_model->oqrs_enabled($slug);
$data['public_search_enabled'] = $this->publicsearch->public_search_enabled($slug);
$data['disable_oqrs'] = $this->config->item('disable_oqrs');
$data['stations'] = $this->oqrs_model->get_oqrs_stations();
$data['page_title'] = __("Log Search & OQRS");
$data['global_oqrs_text'] = $this->optionslib->get_option('global_oqrs_text');
$data['groupedSearch'] = $this->optionslib->get_option('groupedSearch');
if ($public_slug === NULL) {
show_404(__("Unknown Public Page."));
}
$data['slug'] = $this->security->xss_clean($public_slug);
// check if the public slug exists
$logbook_id = $this->stationsetup_model->public_slug_exists_logbook_id($data['slug']);
if ($logbook_id == false) {
$data['userid'] = null;
$data['oqrs_enabled'] = null;
$data['public_search_enabled'] = false;
$data['disable_oqrs'] = $this->config->item('disable_oqrs');
$data['stations'] = null;
$data['page_title'] = __("Log Search & OQRS");
$data['global_oqrs_text'] = '';
$data['groupedSearch'] = false;
} else {
$data['userid'] = $this->publicsearch->get_userid_for_slug($data['slug']);
$data['oqrs_enabled'] = $this->oqrs_model->oqrs_enabled($data['slug']);
$data['public_search_enabled'] = $this->publicsearch->public_search_enabled($data['slug']);
$data['disable_oqrs'] = $this->config->item('disable_oqrs');
$data['stations'] = $this->oqrs_model->get_oqrs_stations($data['userid']);
$data['page_title'] = __("Log Search & OQRS");
$data['global_oqrs_text'] = $this->user_options_model->get_options('oqrs',array('option_name'=>'global_oqrs_text','option_key'=>'text'))->row()->option_value ?? '';
$data['groupedSearch'] = $this->user_options_model->get_options('oqrs',array('option_name'=>'oqrs_grouped_search','option_key'=>'boolean'), $data['userid'])->row()->option_value;
}
$this->load->view('visitor/layout/header', $data);
$this->load->view('oqrs/index');
@@ -82,13 +100,24 @@ class Oqrs extends CI_Controller {
public function get_qsos_grouped() {
$this->load->model('oqrs_model');
$data['result'] = $this->oqrs_model->getQueryDataGrouped($this->input->post('callsign', TRUE));
$this->load->model('publicsearch');
$slug = $this->input->post('slug', TRUE);
$userid = $this->publicsearch->get_userid_for_slug($slug);
$data['disable_oqrs'] = $this->config->item('disable_oqrs');
$data['oqrs_enabled'] = $this->oqrs_model->oqrs_enabled($slug);
$data['public_search_enabled'] = $this->publicsearch->public_search_enabled($slug);
$data['groupedSearchShowStationName'] = $this->user_options_model->get_options('oqrs',array('option_name'=>'oqrs_grouped_search_show_station_name','option_key'=>'boolean'), $userid)->row()->option_value;
$data['result'] = $this->oqrs_model->getQueryDataGrouped($this->input->post('callsign', TRUE), $userid);
$data['callsign'] = $this->input->post('callsign', TRUE);
$data['userid'] = $this->input->post('userid', TRUE);
$data['slug'] = $this->input->post('slug', TRUE);
if($this->input->post('widget') != 'true') {
$this->load->view('oqrs/request_grouped', $data);
} else {
$data['stations'] = $this->oqrs_model->get_oqrs_stations();
$data['stations'] = $this->oqrs_model->get_oqrs_stations($userid);
$data['page_title'] = __("Log Search & OQRS");
$data['global_oqrs_text'] = $this->optionslib->get_option('global_oqrs_text');
$data['groupedSearch'] = 'on';
@@ -146,7 +175,7 @@ class Oqrs extends CI_Controller {
$this->load->model('oqrs_model');
$data['result'] = $this->oqrs_model->getOqrsRequests($location_list);
$data['stations'] = $this->oqrs_model->get_oqrs_stations();
$data['stations'] = $this->oqrs_model->get_oqrs_stations((int)$this->session->userdata('user_id'));
$this->load->view('interface_assets/header', $data);
$this->load->view('oqrs/showrequests');
@@ -173,23 +202,46 @@ class Oqrs extends CI_Controller {
$this->oqrs_model->delete_oqrs_line($id);
}
public function reject_oqrs_line() {
$id = $this->input->post('id', TRUE);
$this->load->model('oqrs_model');
$this->oqrs_model->reject_oqrs_line($id);
}
public function search_log() {
$this->load->model('oqrs_model');
$callsign = $this->input->post('callsign', TRUE);
$data['qsoid'] = $this->input->post('qsoid', TRUE);
$data['oqrsid'] = $this->input->post('oqrsid', TRUE);
$data['qsos'] = $this->oqrs_model->search_log($callsign);
$this->load->view('qslprint/qsolist', $data);
$this->load->view('oqrs/qsolist', $data);
}
public function search_log_time_date() {
$this->load->model('oqrs_model');
// Get user-preferred date format
if ($this->session->userdata('user_date_format')) {
$date_format = $this->session->userdata('user_date_format');
} else {
$date_format = $this->config->item('qso_date_format');
}
$time = $this->input->post('time', TRUE);
$date = $this->input->post('date', TRUE);
$mode = $this->input->post('mode', TRUE);
$band = $this->input->post('band', TRUE);
$data['qsoid'] = $this->input->post('qsoid', TRUE);
$data['oqrsid'] = $this->input->post('oqrsid', TRUE);
$data['qsos'] = $this->oqrs_model->search_log_time_date($time, $date, $band, $mode);
// Parse datetime using createFromFormat
$datetime_obj = DateTime::createFromFormat("$date_format", "$date");
$formatted_date = $datetime_obj->format('Y-m-d'); // Format for SQL DATE comparison
$this->load->model('oqrs_model');
$data['qsos'] = $this->oqrs_model->search_log_time_date($time, $formatted_date, $band, $mode);
$this->load->view('oqrs/qsolist', $data);
}
@@ -199,9 +251,9 @@ class Oqrs extends CI_Controller {
$this->load->model('user_model');
$email = $this->user_model->get_email_address($id);
$this->load->model('oqrs_model');
$sendEmail = $this->oqrs_model->getOqrsEmailSetting($id);
if($email != "" && $sendEmail == "1") {
@@ -209,6 +261,11 @@ class Oqrs extends CI_Controller {
$this->load->library('email');
if($this->optionslib->get_option('emailProtocol') == "smtp") {
if ($this->optionslib->get_option('smtpHost') == '') {
log_message('error', 'OQRS request email message failed. Email settings are not configured properly.');
return;
}
$config = Array(
'protocol' => $this->optionslib->get_option('emailProtocol'),
'smtp_crypto' => $this->optionslib->get_option('smtpEncryption'),
@@ -246,6 +303,13 @@ class Oqrs extends CI_Controller {
}
}
public function add_oqrs_to_print_queue() {
$this->load->model('oqrs_model');
$id = $this->input->post('id', TRUE);
$this->oqrs_model->add_oqrs_to_print_queue($id);
}
public function mark_oqrs_line_as_done() {
$this->load->model('oqrs_model');
$id = $this->input->post('id', TRUE);
@@ -254,6 +318,15 @@ class Oqrs extends CI_Controller {
}
public function search() {
// Get Date format
if($this->session->userdata('user_date_format')) {
// If Logged in and session exists
$custom_date_format = $this->session->userdata('user_date_format');
} else {
// Get Default date format from /config/wavelog.php
$custom_date_format = $this->config->item('qso_date_format');
}
$this->load->model('oqrs_model');
$searchCriteria = array(
@@ -265,9 +338,36 @@ class Oqrs extends CI_Controller {
);
$qsos = $this->oqrs_model->searchOqrs($searchCriteria);
foreach ($qsos as &$qso) {
$qso['requesttime'] = date($custom_date_format . " H:i", strtotime($qso['requesttime']));
$qso['date'] = date($custom_date_format, strtotime($qso['date']));
$qso['time'] = date('H:i', strtotime($qso['time']));
}
header("Content-Type: application/json");
print json_encode($qsos);
}
public function status_info() {
$this->load->view('oqrs/status_info');
}
public function delete_oqrs_qso_match() {
$this->load->model('oqrs_model');
$id = $this->input->post('id', TRUE);
$qsoid = $this->input->post('qsoid', TRUE);
$this->oqrs_model->delete_oqrs_qso_match($id, $qsoid);
header('Content-Type: application/json');
echo json_encode(array('status' => 'success', 'message' => __("QSO match deleted successfully.")));
}
public function add_qso_match_to_oqrs() {
$this->load->model('oqrs_model');
$qsoid = $this->input->post('qsoid', TRUE);
$oqrsid = $this->input->post('oqrsid', TRUE);
$this->oqrs_model->add_qso_match_to_oqrs($qsoid, $oqrsid);
header('Content-Type: application/json');
echo json_encode(array('status' => 'success', 'message' => __("QSO match added successfully.")));
}
}

View File

@@ -151,12 +151,15 @@ class User extends CI_Controller {
$this->load->library('Genfunctions');
$this->form_validation->set_rules('user_name', 'Username', 'required');
$this->form_validation->set_rules('user_name', 'Username', 'required|callback_check_username');
$this->form_validation->set_rules('user_email', 'E-mail', 'required');
$this->form_validation->set_rules('user_password', 'Password', 'required');
$this->form_validation->set_rules('user_type', 'Type', 'required');
$this->form_validation->set_rules('user_callsign', 'Callsign', 'required');
$this->form_validation->set_rules('user_locator', 'Locator', 'required');
$this->form_validation->set_rules('user_locator', 'Locator', 'callback_check_locator');
$this->form_validation->set_rules('user_email', 'EMail', 'required|callback_check_email');
$this->form_validation->set_rules('user_email', 'EMail', 'required|valid_email');
$this->form_validation->set_rules('user_timezone', 'Timezone', 'required');
$data['user_add'] = true;
@@ -232,6 +235,11 @@ class User extends CI_Controller {
$data['user_sig_to_qso_tab'] = $this->input->post('user_sig_to_qso_tab');
$data['user_dok_to_qso_tab'] = $this->input->post('user_dok_to_qso_tab');
$data['user_language'] = $this->input->post('user_language');
$data['global_oqrs_text'] = $this->input->post('global_oqrs_text') ?? '';
$data['oqrs_grouped_search'] = $this->input->post('oqrs_grouped_search') ?? 'off';
$data['oqrs_grouped_search_show_station_name'] = $this->input->post('oqrs_grouped_search_show_station_name') ?? 'off';
$data['oqrs_auto_matching'] = $this->input->post('oqrs_auto_matching') ?? 'on';
$data['oqrs_direct_auto_matching'] = $this->input->post('oqrs_direct_auto_matching') ?? 'on';
$this->load->view('user/edit', $data);
} else {
$this->load->view('user/edit', $data);
@@ -291,8 +299,13 @@ class User extends CI_Controller {
$this->input->post('on_air_widget_show_only_most_recent_radio'),
$this->input->post('qso_widget_display_qso_time'),
$this->input->post('user_dashboard_banner') ?? 'Y',
$this->input->post('clubstation') == '1' ? true : false
)) {
$this->input->post('clubstation') == '1' ? true : false,
$this->input->post('global_oqrs_text') ?? '',
$this->input->post('oqrs_grouped_search') ?? 'off',
$this->input->post('oqrs_grouped_search_show_station_name') ?? 'off',
$this->input->post('oqrs_auto_matching') ?? 'on',
$this->input->post('oqrs_direct_auto_matching') ?? 'on')
) {
// Check for errors
case EUSERNAMEEXISTS:
$data['username_error'] = sprintf(__("Username %s already in use!"), '<b>' . $this->input->post('user_name') . '</b>');
@@ -344,6 +357,11 @@ class User extends CI_Controller {
$data['user_quicklog'] = $this->input->post('user_quicklog');
$data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter');
$data['user_language'] = $this->input->post('user_language');
$data['global_oqrs_text'] = $this->input->post('global_oqrs_text') ?? '';
$data['oqrs_grouped_search'] = $this->input->post('oqrs_grouped_search') ?? 'off';
$data['oqrs_grouped_search_show_station_name'] = $this->input->post('oqrs_grouped_search_show_station_name') ?? 'off';
$data['oqrs_auto_matching'] = $this->input->post('oqrs_auto_matching') ?? 'on';
$data['oqrs_direct_auto_matching'] = $this->input->post('oqrs_direct_auto_matching') ?? 'on';
$this->load->view('user/edit', $data);
$this->load->view('interface_assets/footer', $footerData);
}
@@ -363,6 +381,7 @@ class User extends CI_Controller {
$this->load->library('Genfunctions');
$this->form_validation->set_rules('user_name', 'Username', 'required|xss_clean');
$this->form_validation->set_rules('user_name', 'Username', 'required|callback_check_username');
$this->form_validation->set_rules('user_email', 'E-mail', 'required|xss_clean');
if($this->session->userdata('user_type') == 99)
{
@@ -372,6 +391,8 @@ class User extends CI_Controller {
$this->form_validation->set_rules('user_lastname', 'Last name', 'required|xss_clean');
$this->form_validation->set_rules('user_callsign', 'Callsign', 'trim|required|xss_clean');
$this->form_validation->set_rules('user_locator', 'Locator', 'callback_check_locator');
$this->form_validation->set_rules('user_email', 'EMail', 'required|callback_check_email');
$this->form_validation->set_rules('user_email', 'EMail', 'required|valid_email');
$this->form_validation->set_rules('user_timezone', 'Timezone', 'required');
$data['user_form_action'] = site_url('user/edit')."/".$this->uri->segment(3);
@@ -626,7 +647,7 @@ class User extends CI_Controller {
}
if($this->input->post('user_default_confirmation')) {
$data['user_default_confirmation'] = ($this->input->post('user_default_confirmation_qsl') !== null ? 'Q' : '').($this->input->post('user_default_confirmation_lotw') !== null ? 'L' : '').($this->input->post('user_default_confirmation_eqsl') !== null ? 'E' : '').($this->input->post('user_default_confirmation_qrz') !== null ? 'Z' : '').($this->input->post('user_default_confirmation_clublog') !== null ? 'C' : '');
$data['user_default_confirmation'] = ($this->input->post('user_default_confirmation_qsl') !== null ? 'Q' : '').($this->input->post('user_default_confirmation_lotw') !== null ? 'L' : '').($this->input->post('user_default_confirmation_eqsl') !== null ? 'E' : '').($this->input->post('user_default_confirmation_qrz') !== null ? 'Z' : '').($this->input->post('user_default_confirmation_clublog') !== null ? 'C' : '');
} else {
$data['user_default_confirmation'] = $q->user_default_confirmation;
}
@@ -759,6 +780,51 @@ class User extends CI_Controller {
}
}
if($this->input->post('global_oqrs_text')) {
$data['global_oqrs_text'] = $this->input->post('global_oqrs_text', false);
} else {
$qkey_opt = $this->user_options_model->get_options('oqrs',array('option_name'=>'global_oqrs_text','option_key'=>'text'), $this->uri->segment(3))->result();
if (count($qkey_opt) > 0) {
$data['global_oqrs_text'] = $qkey_opt[0]->option_value;
}
}
if($this->input->post('oqrs_grouped_search')) {
$data['oqrs_grouped_search'] = $this->input->post('oqrs_grouped_search', false);
} else {
$qkey_opt = $this->user_options_model->get_options('oqrs',array('option_name'=>'oqrs_grouped_search','option_key'=>'boolean'), $this->uri->segment(3))->result();
if (count($qkey_opt) > 0) {
$data['oqrs_grouped_search'] = $qkey_opt[0]->option_value;
}
}
if($this->input->post('oqrs_grouped_search_show_station_name')) {
$data['oqrs_grouped_search_show_station_name'] = $this->input->post('oqrs_grouped_search_show_station_name', false);
} else {
$qkey_opt = $this->user_options_model->get_options('oqrs',array('option_name'=>'oqrs_grouped_search_show_station_name','option_key'=>'boolean'), $this->uri->segment(3))->result();
if (count($qkey_opt) > 0) {
$data['oqrs_grouped_search_show_station_name'] = $qkey_opt[0]->option_value;
}
}
if($this->input->post('oqrs_auto_matching')) {
$data['oqrs_auto_matching'] = $this->input->post('oqrs_auto_matching', false);
} else {
$qkey_opt = $this->user_options_model->get_options('oqrs',array('option_name'=>'oqrs_auto_matching','option_key'=>'boolean'), $this->uri->segment(3))->result();
if (count($qkey_opt) > 0) {
$data['oqrs_auto_matching'] = $qkey_opt[0]->option_value;
}
}
if($this->input->post('oqrs_direct_auto_matching')) {
$data['oqrs_direct_auto_matching'] = $this->input->post('oqrs_direct_auto_matching', false);
} else {
$qkey_opt = $this->user_options_model->get_options('oqrs',array('option_name'=>'oqrs_direct_auto_matching','option_key'=>'boolean'), $this->uri->segment(3))->result();
if (count($qkey_opt) > 0) {
$data['oqrs_direct_auto_matching'] = $qkey_opt[0]->option_value;
}
}
// [MAP Custom] GET user options //
$options_object = $this->user_options_model->get_options('map_custom')->result();
if (count($options_object)>0) {
@@ -850,6 +916,13 @@ class User extends CI_Controller {
}
$this->user_options_model->set_option('header_menu', 'locations_quickswitch', array('boolean'=>xss_clean($this->input->post('user_locations_quickswitch', true))));
$this->user_options_model->set_option('header_menu', 'utc_headermenu', array('boolean'=>xss_clean($this->input->post('user_utc_headermenu', true))));
$this->user_options_model->set_option('oqrs', 'global_oqrs_text', array('text'=>$this->input->post('global_oqrs_text', true)));
$this->user_options_model->set_option('oqrs', 'oqrs_grouped_search', array('boolean'=>$this->input->post('oqrs_grouped_search', true)));
$this->user_options_model->set_option('oqrs', 'oqrs_grouped_search_show_station_name', array('boolean'=>$this->input->post('oqrs_grouped_search_show_station_name', true)));
$this->user_options_model->set_option('oqrs', 'oqrs_auto_matching', array('boolean'=>$this->input->post('oqrs_auto_matching', true)));
$this->user_options_model->set_option('oqrs', 'oqrs_direct_auto_matching', array('boolean'=>$this->input->post('oqrs_direct_auto_matching', true)));
$this->session->set_flashdata('success', sprintf(__("User %s edited"), $this->input->post('user_name', true)));
redirect('user/edit/'.$this->uri->segment(3));
} else {
@@ -902,6 +975,11 @@ class User extends CI_Controller {
$data['on_air_widget_display_last_seen'] = $this->input->post('on_air_widget_display_last_seen', true);
$data['on_air_widget_show_only_most_recent_radio'] = $this->input->post('on_air_widget_show_only_most_recent_radio', true);
$data['qso_widget_display_qso_time'] = $this->input->post('qso_widget_display_qso_time', true);
$data['global_oqrs_text'] = $this->input->post('global_oqrs_text', true);
$data['oqrs_grouped_search'] = $this->input->post('oqrs_grouped_search', true);
$data['oqrs_grouped_search_show_station_name'] = $this->input->post('oqrs_grouped_search_show_station_name', true);
$data['oqrs_auto_matching'] = $this->input->post('oqrs_auto_matching', true);
$data['oqrs_direct_auto_matching'] = $this->input->post('oqrs_direct_auto_matching', true);
$this->load->view('user/edit');
$this->load->view('interface_assets/footer');
@@ -1215,6 +1293,7 @@ class User extends CI_Controller {
$this->load->library('form_validation');
$this->form_validation->set_rules('email', 'Email', 'required');
$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
if ($this->form_validation->run() == FALSE)
{
@@ -1398,12 +1477,30 @@ class User extends CI_Controller {
}
}
function check_username($username) {
if (!($this->user_model->authorize(99)) && ($this->session->userdata('user_name') != $username) && ($this->user_model->exists($username) > 0)) {
$this->form_validation->set_message('check_username', sprintf(__("Couldn't set account to this username. Please try another one than \"%s\"."), $username));
return FALSE;
} else {
return TRUE;
}
}
function check_email($mail) {
if (($this->session->userdata('user_email') != $mail) && ($this->user_model->exists_by_email($mail) > 0)) {
$this->form_validation->set_message('check_email', sprintf(__("Couldn't set account to this email. Please try another address than \"%s\"."), $mail));
return FALSE;
} else {
return TRUE;
}
}
function check_locator($grid = '') {
if (empty($grid)) {
$grid = $this->input->post('locator', TRUE);
}
// Allow empty locator
if (preg_match('/^$/', $grid)) return true;
if (preg_match('/^$/', $grid ?? '')) return true;
$this->load->library('Qra');
if ($this->qra->validate_grid($grid)) {
return true;

View File

@@ -48,7 +48,7 @@ class Widgets extends CI_Controller {
// date format
$data['date_format'] = $this->config->item('qso_date_format'); // date format from /config/wavelog.php
$this->load->model('logbook_model');
$this->load->model('logbooks_model');
$this->load->model('stationsetup_model');
@@ -72,32 +72,32 @@ class Widgets extends CI_Controller {
$user_id = $this->stationsetup_model->public_slug_exists_userid($logbook_slug);
$widget_options = $this->get_qso_widget_options($user_id);
$data['show_time'] = $widget_options->display_qso_time;
$data['show_time'] = $widget_options->display_qso_time;
$data['last_qsos_list'] = $this->logbook_model->get_last_qsos($qso_count, $logbooks_locations_array);
$this->load->view('widgets/qsos', $data);
}
}
public function oqrs($user_callsign = 'CALL MISSING') {
public function oqrs($slug) {
$this->load->model('oqrs_model');
$stations = $this->oqrs_model->get_oqrs_stations();
$this->load->model('publicsearch');
$this->load->model('stationsetup_model');
$this->load->model('user_model');
$data['slug'] = $this->security->xss_clean($slug);
if ($stations->result() === NULL) {
$logbook_id = $this->stationsetup_model->public_slug_exists_logbook_id($data['slug']);
if ($logbook_id == false) {
show_404(__("No stations found that are using Wavelog OQRS."));
return;
}
}
$data['userid'] = $this->publicsearch->get_userid_for_slug($data['slug']);
$data['logo_url'] = site_url('visitor') . '/' . $data['slug'];
$slug = $this->input->get('slug', TRUE);
if ($slug != null) {
$data['logo_url'] = base_url() . 'index.php/visitor/' . $slug;
} else {
$data['logo_url'] = 'https://github.com/wavelog/wavelog';
}
$this->load->model('themes_model');
$theme = $this->input->get('theme', TRUE);
if ($theme != null) {
$this->load->model('themes_model');
if (($this->themes_model->get_theme_mode($theme) ?? '') != '') {
$data['theme'] = $theme;
} else {
@@ -107,7 +107,8 @@ class Widgets extends CI_Controller {
$data['theme'] = $this->config->item('option_theme');
}
$data['user_callsign'] = strtoupper($this->security->xss_clean($user_callsign));
$user = $this->user_model->get_by_id($data['userid'])->row();
$data['user_callsign'] = strtoupper($user->user_callsign);
$this->load->view('widgets/oqrs', $data);
}