Commit graph

23 commits

Author SHA1 Message Date
Peter Goodhall
4440582389 Sanitize IDs and migrate SQL to Query Builder
Replace ad-hoc xss_clean calls with explicit casting and stronger type checks for ID/parameter handling, and convert many raw SQL strings to CodeIgniter Query Builder usage. Added normalize_location_ids helpers (Activators_model, Oqrs_model) to safely parse location lists and used where_in/parameter binding/escaping to avoid injection and improve maintainability. Also adjusted session user_id handling, improved LIKE/DATE/TIMEDIFF usage, and tightened several model/controller methods (Labels, Activators, Bands, Contesting, Labels_model, Modes, Oqrs_model, Qsl_model, Setup_model, Sstv_model, User_model) for safer, clearer DB queries and inputs.
2026-06-24 22:15:31 +01:00
Peter Goodhall
e3c602127a Use CI query builder for safer DB queries
Replace concatenated SQL with CodeIgniter query builder across models to improve safety and readability. Changes in Cat, Contesting_model and Oqrs_model convert raw SQL strings into active-record calls, add integer casting for ID/station values, use select/from/join/where/order_by/get patterns, and simplify delete/query flows. Affected methods include radio_status, multiple contest-related selects/inserts/deletes, and several oqrs/station_profile queries.
2026-06-24 22:10:20 +01:00
Peter Goodhall
2cb8d62860 Add gridsquare prefix index and optimizations
Bump migration version and add a new migration (246) to create/drop a 4-char prefix index on COL_GRIDSQUARE to speed LIKE queries; migration 245 now also drops the prefix index if present. Add Stations::user_owns_station and use it in Logbookadvanced_model to avoid N+1 station lookups. Add caching to Logbooks_model::list_logbook_relationships to prevent redundant queries. Optimize Oqrs_model queries to select only needed columns for several methods. Add Stats::getUniqueCallsignsConsolidated to combine multiple unique-callsign groupings into a single set of queries for better performance. Database debug toggles added where appropriate.
2026-02-11 11:09:39 +00:00
Peter Goodhall
cc3d728a1d Improve result limits and defaults in logbook and OQRS
Added validation and default values for result limits in Logbookadvanced_model and Oqrs_model to prevent invalid or empty limits. Updated views to set default selected options for result limits in logbook advanced and OQRS request pages. Also fixed SQL order by column alias typos in Logbookadvanced_model.
2025-10-11 10:27:47 +01:00
Peter Goodhall
a27b0cf571 Add input validation and parameterized queries to OQRS
Added server-side validation for callsign and station_id inputs in Oqrs controller to prevent invalid data and potential abuse. Updated Oqrs_model to use parameterized queries instead of string concatenation, improving security against SQL injection. Callsigns are now consistently uppercased before querying.
2025-10-10 22:34:06 +01:00
Peter Goodhall
1362d19608 fix Unauthenticated SQL Injection in in function delete_oqrs_line
Fixes injection issue reported by @trungpc19
2024-11-07 11:03:33 +00:00
phl0
7204d958d8
Set qsoid also for not found QSOs 2023-06-13 14:39:32 +02:00
Andreas Kristiansen
54e137db90
Merge pull request #2082 from AndreasK79/oqrs_grouped 2023-04-26 21:07:27 +02:00
phl0
91e04f24fa
Suppress seconds in OQRS requests (zeros anyway) 2023-04-26 06:15:24 +02:00
Andreas
0142209022 [OQRS] Now added option to search in all station locations with active OQRS 2023-04-25 14:00:30 +02:00
Andreas
f56d193426 [OQRS] Fixed filtering on station_id in OQRS Requests 2023-01-24 11:36:14 +01:00
Peter Goodhall
44869bfbde [OQRS] Added Missing func 2022-12-30 21:55:34 +00:00
Andreas
83ae7f3bd4 [OQRS] Fixed search not showing all QSOs 2022-12-30 10:11:38 +01:00
phl0
49af108202
Adjust SQL to exlude done requests 2022-12-29 23:32:40 +01:00
phl0
5e5d8ec653
Add badge with number of OQRS requests 2022-12-29 23:17:32 +01:00
Andreas
d5842bbc5a [OQRS] Created new view for OQRS requests 2022-12-29 17:14:18 +01:00
phl0
b332dee524
Merge branch 'dev' into fixOqrsFlaws 2022-12-29 16:12:45 +01:00
phl0
54ad24d3be
Set qsoid to 0 for not-in-log requests 2022-12-28 23:47:44 +01:00
phl0
bac26df67d
Show public OQRS link if at least one callsign has OQRS activated 2022-12-28 23:37:14 +01:00
Andreas
5d2ca03410 [OQRS] SAT fix for displaying QSOs around time/date/mode for OQRS 2022-12-22 21:13:02 +01:00
Andreas
723070cf30 [OQRS] Fix identifying of SAT OQRS QSO 2022-12-22 21:04:03 +01:00
Andreas
7a78c743ce [OQRS] Fixed SAT QSOs not showing up correctly in the result 2022-12-22 20:53:40 +01:00
Andreas
9d1f30d8e8 [OQRS] Added OQRS system 2022-11-15 18:29:33 +01:00