Commit graph

7911 commits

Author SHA1 Message Date
Peter Goodhall
4fa84363aa
2.8.16 2026-07-16 13:28:45 +01:00
Peter Goodhall
444207dc38 Add 2.8.16 migration and bump version
Updates the migration target to 273 and adds a new migration to tag Cloudlog as 2.8.16. The migration sets `options.version` to `2.8.16` and resets `user_options` version dialog confirmation so users see the version info dialog; the down migration restores the version value to `2.8.15`.
2026-07-16 13:28:12 +01:00
Peter Goodhall
ffa9d5017e Consolidate callbook display into tab interface
Refactored the callsign profile display from a separate hidden card to an integrated tab-based interface. The new callbook tab includes a responsive grid layout with profile image, external links (QRZ and HamQTH), and metadata fields (name, QTH, locator, IOTA). Added proper HTML escaping for security and improved visual organization with Bootstrap 5 styling.
2026-07-11 16:55:34 +01:00
Peter Goodhall
fb9ffdb3ad Enable Leaflet maps in logbookadvanced
Add 'logbookadvanced' controller to the list of routes that require Leaflet map assets. Also conditionally load easyprint.js only when Leaflet is enabled to reduce unnecessary script loading.

#3453 Fixed
2026-07-11 16:45:29 +01:00
Peter Goodhall
239add94e1 Fix label default checkbox handling
Add the `labeltable` class to the labels table and switch the checkbox handler to a delegated `change` event. The uncheck logic is now scoped to the current table so only labels in the same list are affected.
2026-07-08 23:00:44 +01:00
Peter Goodhall
8439798799 Lazy-load Leaflet and fix QRB modal map
Leaflet CSS/JS assets are now loaded conditionally in shared headers/footers so map libraries are only included on pages that need them. For the QRB calculator dialog, Leaflet is loaded on demand in `common.js`, and the `newpath` map-rendering function was moved into the QRB view so the modal still works when global map scripts are skipped. Also adds a small HTMX updating indicator to the dashboard’s Today’s QSOs section.
2026-07-06 17:18:39 +01:00
Peter Goodhall
f6d7f0a897
2.8.15
2.8.15
2026-07-05 15:14:14 +01:00
Peter Goodhall
6fe8bbee77 Add 2.8.15 version tag migration
Bumps the configured migration target to 272 and adds migration `272_tag_2_8_15`. The new migration updates the app version in `options` to `2.8.15` and resets `user_options` version dialog confirmation so users see release info. The `down()` method rolls the version value back to `2.8.14`.
2026-07-05 15:13:24 +01:00
Peter Goodhall
3e944f71cc Normalize location lists and sanitize SQL
Replace fragile quoted-implode station lists with normalized integer CSVs and where_in usage to ensure station_id lists are numeric. Add normalize_location_list helpers in multiple models (Lookup_model, Sig, Timeline_model) and update controllers to cast inputs (e.g. dxcc_id) to ints. Escape user-supplied SQL fragments with $this->db->escape_str/escape_like_str and sanitize band/mode parameters; consolidate band/mode filtering into add_band_mode_filters in Timeline_model. Add guards for empty location lists (returning empty results) and a method_exists check around a legacy vucc_shit call. Overall this improves input validation and reduces SQL injection risk while removing duplicated list-building logic.
2026-06-24 22:29:00 +01:00
Peter Goodhall
c6bdee1bc5 Sanitize location lists and harden SQL
Replace string-quoted station_id lists with comma-separated, integer-casted lists and harden SQL across awards models. This diff converts constructions like "'a','b'" to implode(',', array_map('intval', ...)) and uses $this->db->escape_str() for band/mode values and band lists to reduce injection/format issues. Added helper methods (addModeToQuery, addBandToQuery variants) to centralize mode/band filtering, parameterized time/mode/band queries in Gmdxsummer_model, and escaped band arrays when building IN() lists. Also added null/empty-checks for logbook arrays in several models and small refactors (e.g. VUCC addBandToQuery) to keep SQL building consistent.
2026-06-24 22:26:11 +01:00
Peter Goodhall
d6fe6e8110 Sanitize and escape query inputs in models
Sanitize location lists and escape query parameters across multiple models to prevent SQL injection and fix query formatting. Changes include: converting location arrays to comma-separated integer lists (array_map('intval')) instead of quoted implode, adding escape_str for band/mode/sat, adding a sanitize_location_list helper and early-return checks in CQ, escaping band lists, and updating Adif_data date where clauses to use $this->db->escape(..., NULL, FALSE). Files modified: Accumulate_model, Activated_gridmap_model, Adif_data, Cq, and Gridmap_model.
2026-06-24 22:19:35 +01:00
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
f5e3aac0d0 Cast IDs to int; use query builder
Normalize incoming ID parameters to integers and replace concatenated/raw SQL with CodeIgniter query builder. Controllers (Contesting.php, Themes.php) now cast $id to (int) instead of using xss_clean; models (Contesting_model.php, Themes_model.php) cast $id and use $this->db->where()/get()/select() to build queries. This improves type safety and reduces risk of injection while using more idiomatic CI DB APIs.
2026-06-24 22:08:30 +01:00
Peter Goodhall
43715eed98 Use language lines for Prev/Next pagination
Replace direct lang('prev')/lang('next') calls with localized labels using general_word_previous and general_word_next language lines (falling back to 'Previous'/'Next'). Adds $prev_label and $next_label and updates the pagination links/spans to use them, improving localization support for the previous-contacts pagination.
2026-06-23 12:01:45 +01:00
Peter Goodhall
6282b48dab Merge branch 'dev' of https://github.com/magicbug/Cloudlog into dev 2026-06-23 11:35:53 +01:00
Peter Goodhall
a0f953dfa8 Add CAT cache and satellite lookup helper
Introduce window.cloudlogLastCatData and window.cloudlogLastCatRadioId to cache the last CAT response and radio ID, set on successful CAT poll and cleared on UI reset. Add isSatelliteLookupContext() in qso.js to centralize logic for detecting satellite lookup context using UI fields or the cached CAT data, and replace scattered sat_name checks with this helper. This makes satellite lookups more reliable when CAT populates fields and avoids duplicated logic across handlers.
2026-06-23 11:35:51 +01:00
Peter Goodhall
1397087433
Merge pull request #3445 from magicbug/dependabot/npm_and_yarn/form-data-4.0.6
Bump form-data from 4.0.4 to 4.0.6
2026-06-22 13:24:47 +01:00
Peter Goodhall
b0fabe98a4
Merge pull request #3441 from magicbug/dependabot/npm_and_yarn/tmp-0.2.7
Bump tmp from 0.2.4 to 0.2.7
2026-06-22 13:24:17 +01:00
dependabot[bot]
0ef8d2a673
Bump form-data from 4.0.4 to 4.0.6
Bumps [form-data](https://github.com/form-data/form-data) from 4.0.4 to 4.0.6.
- [Changelog](https://github.com/form-data/form-data/blob/master/CHANGELOG.md)
- [Commits](https://github.com/form-data/form-data/compare/v4.0.4...v4.0.6)

---
updated-dependencies:
- dependency-name: form-data
  dependency-version: 4.0.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-21 10:53:02 +00:00
Peter Goodhall
2476c65beb Treat empty numeric inputs as NULL
In Logbook_model, only sanitize 'a_index' and 'age' when the input is not an empty string; if filter_var returns an empty string or false, set the variable to NULL. This prevents empty/invalid sanitized values from being treated as valid numeric inputs.
2026-06-09 11:22:01 +01:00
Peter Goodhall
a1bc0f415e Use per-install temp dir for session files
Replace hardcoded '/tmp' sess_save_path with a dynamically generated temp directory based on sys_get_temp_dir() and a hash of the installation path (realpath(FCPATH)). Create the directory with 0700 permissions if it does not exist. Changes applied to application/config/config.sample.php and install/config/config.php to avoid shared /tmp collisions and improve session isolation/security.
2026-06-06 10:29:41 +01:00
Peter Goodhall
5a44ef4b4e Per-install encryption key and session checks
Replace hardcoded encryption key in installer with a %encryption_key% placeholder and generate a unique per-install key during installation (uses random_bytes, falls back to openssl_random_pseudo_bytes or sha1(uniqid)). Inject the generated key into config.php. Also tighten User_Model::validate_session(): return early if no user_id, clear session if user_hash is missing, re-read the user from the database to verify user_type before authenticating, and refresh or clear the session accordingly. These changes improve security by using a unique encryption key per install and by validating session state against persisted user data.
2026-06-06 10:25:45 +01:00
Peter Goodhall
a3cb952a98
2.8.14 2026-06-05 13:33:45 +01:00
copilot-swe-agent[bot]
5ad7c2e9da
Merge origin/master into dev 2026-06-05 12:30:23 +00:00
Peter Goodhall
42e6b8a335 Bump migration to 271 and add tag 2.8.14
Update migration_version to 271 and add Migration_tag_2_8_14. The new migration sets options.version to 2.8.14 and resets user_options (version_dialog/confirmed) to 'false' to trigger the version info dialog for users. The down() method reverts options.version back to 2.8.13.
2026-06-05 13:27:15 +01:00
Peter Goodhall
764c61b0a4 Add advanced search status and UI state persistence
Introduce an advanced search status display and persist UI state for the Logbook Advanced view. Adds CSS and a status span to show result/selection counts and transient messages. Implements setAdvancedSearchStatus(), getVisibleColumnIndex(), restoreAdvancedSearchUiState() and persistAdvancedSearchUiState() to update status, handle visible columns dynamically, and save/restore collapsed sections and the QSO results selection via localStorage. Also adds client-side date range validation, sets status messages during load/search/failure, and updates status when rows are selected/unselected. Adjusts band/mode column lookups to respect visible columns.
2026-06-01 21:46:30 +01:00
Peter Goodhall
32dd9af125 Normalize user_options and add defaults
Decode the PHP $options JSON into an object, ensure pota/operator/stationLocation keys exist (each with show:'true') when missing, and emit user_options via json_encode. Replace the previous string-based JS assembly with a robust PHP-side normalization and set $options for the view to the normalized object. Also add a defensive JS check around user_options.operator.show to avoid runtime errors when operator is absent.
2026-06-01 18:23:39 +01:00
Peter Goodhall
5f72af8338 Prefer selected radio CAT over sat defaults
Detect a selected radio and avoid reapplying saved satellite defaults when CAT is in use. Adds checks for a non-zero selected radio, skips restoring sat_name/sat_mode when a radio is selected, clears sat fields and their stored catValue, and triggers a radios change to resync CAT state. Also updates reset-on-escape behavior to preserve/clear satellite fields appropriately to prevent stale values from being restored.
2026-05-29 17:42:30 +01:00
Peter Goodhall
ab219e8cb4 Prevent duplicate Escape handling and fix SAT reset
Avoid double-processing of the Escape key by setting a timestamp (window.cloudlogQsoEscHandledAt) when handling the QSO-escape keydown and short-circuiting subsequent handlers within 500ms. Also broaden the SAT field restore logic in resetQsoEntryOnEscape to restore sat_name/sat_mode when preSatMode exists or when the previous propagation mode was SAT (not just when preSatName is present). These changes prevent accidental duplicate resets and ensure SAT fields are correctly restored.
2026-05-28 22:19:53 +01:00
Peter Goodhall
9894c627db Retry radio sync after saving QSO
After reapplying post-save defaults, schedule a second call to syncFromSelectedRadioAfterReset (250ms delay) in addition to the immediate call. This helps ensure the selected radio state is correctly propagated and avoids timing/race issues with UI or async updates after saving a QSO.
2026-05-28 22:16:42 +01:00
Peter Goodhall
9057e13fc2 Sync radio after post-save reset
Call syncFromSelectedRadioAfterReset() after reapplyPostSaveDefaults() in assets/js/sections/qso.js so the radio state is re-synchronized following a QSO save/reset. This prevents stale UI values and ensures fields reflect the currently selected radio after saving.
2026-05-28 22:16:07 +01:00
Peter Goodhall
5b3272eafc Return upload status and report no Clublog QSOs
Track and return whether any QSOs were actually uploaded to Clublog and log/report when none are pending. index(): introduced $uploaded_any_qsos and aggregate per-user upload results; if nothing uploaded, echo a message and write an info log. uploadUser(): return false on invalid Clublog username (was previously void); added $uploaded_for_user tracking while iterating station profiles and set it when Clublog responds with 'accepted'. uploadUser now returns true when QSOs were uploaded for the user, otherwise false.
2026-05-28 13:42:41 +01:00
Peter Goodhall
0e0244dd73 Resolve file path for Clublog uploads
Use FCPATH to build the upload file path and fall back to DOCUMENT_ROOT plus the configured install directory if the file is missing. Normalizes leading/trailing slashes and casts values to strings to avoid notices, and checks file existence before attempting the fallback. This improves robustness when the app is installed in a subdirectory or when DOCUMENT_ROOT is not set.
2026-05-28 13:40:47 +01:00
dependabot[bot]
b1a835e952
Bump tmp from 0.2.4 to 0.2.7
Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.4 to 0.2.7.
- [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/raszi/node-tmp/compare/v0.2.4...v0.2.7)

---
updated-dependencies:
- dependency-name: tmp
  dependency-version: 0.2.7
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-28 02:58:30 +00:00
Peter Goodhall
538f6ccf8a Clear selectPropagation when prop_mode empty
Trim and store data.prop_mode into propModeFromCat and use it to decide how to update the propagation select. If the value is empty, clear #selectPropagation and remove its stored catValue to avoid carrying stale propagation settings; otherwise call cat2UI with the trimmed value. This prevents leftover propagation mode when CAT provides no prop_mode.
2026-05-27 22:27:52 +01:00
Peter Goodhall
c610e1e378 Preserve satellite fields & save radio default
Prevent CAT polling from overwriting user-entered satellite fields by introducing lockSatelliteFieldsToUserInput and only updating #sat_name, #sat_mode and propagation when not locked. Clear stale sat fields if CAT returns empty values. Reset the lock on radio changes and when UI is reset, and set the lock dynamically on user input (or when propagation is SAT).

Also persist the selected radio as a post-save default: include radio in postSaveDefaults, restore it in reapplyPostSaveDefaults (update selects and localStorage), and trigger sat_name input after restore so the locking logic reacts to restored satellite fields.
2026-05-27 22:04:14 +01:00
Peter Goodhall
c02e0d7a1f Persist qso start_date in post-save defaults
Capture the QSO start_date when a record is saved and include it in postSaveDefaults so it can be reapplied. Added retrieval of start_date from #qso_input on save and updated reapplyPostSaveDefaults to set the start_date input when provided, preserving the user's selected start date after save.
2026-05-25 14:16:26 +01:00
Peter Goodhall
320370e90e Default winkey_websocket to false when unset
Check isset($u->row()->winkey_websocket) before casting to bool and default to false if the property is missing. This prevents PHP notices and ensures a consistent boolean value when the winkey_websocket field is null or not present.
2026-05-21 22:35:46 +01:00
Peter Goodhall
e7045f3d5a Support varying slp permission column names
Add get_slp_permission_column() to detect and cache the permission column name in station_logbooks_permissions (checks permission_level, access_level, then falls back to legacy permission). Replace hardcoded slp.permission_level references with the resolved column (aliasing to permission_level where needed) across show_all(), public_slugs_accessible_by_user(), check_logbook_is_accessible(), get_user_permission(), add_user_to_logbook(), and list_logbook_collaborators() to avoid failures on partially migrated databases.
2026-05-21 16:12:22 +01:00
Peter Goodhall
3ca30c161a Remove redundant qso['lng'] assignments
Delete duplicate qso['lng'] assignments in application/controllers/Api.php. Longitude is stored in qso['long'], so removing the extra qso['lng'] assignments (from plot_latlng and dxcc fallback) avoids redundant/conflicting keys and keeps the QSO data consistent.
2026-05-18 22:02:40 +01:00
Peter Goodhall
318d9a4c6f Prefer VUCC grids for gridsquare and coords
Prefer COL_VUCC_GRIDS over COL_GRIDSQUARE when populating the gridsquare field, and compute plotting coordinates from the grid (via qralatlng) to support VUCC multi-grid line/corner records. Populate lat, long and lng from the grid-derived coordinates, and only fall back to DXCC table coordinates if grid-derived values are not present, avoiding accidental overrides.
2026-05-18 22:00:22 +01:00
Peter Goodhall
769837ce09 Apply user remote_operation option and messaging
Load and interpret the 'remote_operation' user option when no POST value is provided, converting stored 'true'/'1' to 1 and falling back to the existing database value or 0. Ensure post_data always has a default 'user_remote_operation' of '0'. Use a strict check on $post_data['user_remote_operation'] === '1' when persisting the option via user_options_model, and append a concise enabled/disabled status to the success flash message after editing the user.
2026-05-16 16:01:12 +01:00
Peter Goodhall
4f462683a7 Add microphone mute toggle to remote operation
Add a microphone mute control to the remote operation UI and wire it into the audio pipeline and settings. A new checkbox (remoteOperationMicMuteToggle) is added to the view. JavaScript gains a micMuted setting (default true), persistence to localStorage, UI syncing, and an applyMicMuteState() helper which enables/disables audio tracks on the media stream. The setting is applied when a stream is attached and updated immediately when the user toggles the checkbox.
2026-05-16 14:19:50 +01:00
Peter Goodhall
c9e0761383 Persist remote operation secret to account
Add server endpoints to store and retrieve the remote operation link password in the user's account and update the client to use them. Qso controller: added remoteoperationsecret_json and remoteoperationsecret_save which use user_options_model and CI encryption to get/set an encrypted link_password (save enforces a minimum 16-char password, empty value clears it). View and JS: default WebSocket URL changed to wss://relay.cloudlog.org/ws-webrtc; client no longer stores link password in localStorage and instead loads/saves it via the new endpoints (with error handling and UI feedback). Also clear the account secret on reset and stop exposing the password in browser storage.
2026-05-16 13:55:11 +01:00
Peter Goodhall
7c0c7515a5 Add experimental Remote Operation feature
Introduce an experimental browser-based remote audio feature: bump migration version to 270 and add a migration to add a remote_operation flag to the users table. Add server-side support to User and QSO controllers/models to read/save the remote_operation option (stored via user_options_model) and expose isRemoteOperationEnabled to views and session updates. Add UI: a Remote Operation card on the QSO page, a modal component for detailed settings, a toggle in the user edit page, and conditional loading of assets/js/remote-operation.js. Add a large client-side implementation (assets/js/remote-operation.js) implementing WebRTC signalling, device selection, level meters and diagnostics. Minor session/session-update and helper changes to keep UI state in sync.
2026-05-16 13:44:09 +01:00
Peter Goodhall
66e81bbdc4 Add TEVEL2 satellites and migration
Bump migration version to 269, add TEVEL2-1..TEVEL2-9 entries to the Lotw satellite mapping, and add migration 269_set_tevel2_series_to_notsent. The migration sets COL_LOTW_QSL_SENT = 'N' for TEVEL2-1 through TEVEL2-9 so their QSOs are marked not-sent to LoTW; down() is intentionally empty since previous per-QSO sent state cannot be safely restored.
2026-05-16 11:45:03 +01:00
Peter Goodhall
c27442df52 Revamp Winkey macros modal layout
Replace verbose stacked inputs with a compact, responsive grid for F1–F5 macros, add placeholder examples and a macro tokens note, and prefill values in the results view via a $macro_result variable. Also make the modal larger and scrollable and add a close button to improve usability.
2026-05-15 16:17:51 +01:00
Peter Goodhall
cc7593c892 Add WinKey relay settings API and UI persistence
Introduce server endpoints to get/save WinKey WebSocket relay settings and token (winkeyrelaysettings_json, winkeyrelaysettings_save, winkeyrelaytoken_json, winkeyrelaytoken_save) using the user_options_model. Add client-side changes to load settings from the account (with a localStorage fallback), save settings to the account, validate URL/token (ws:// or wss:// and token ≥ 8 chars), and clear legacy localStorage keys after a successful save. Defer WebSocket connect until account settings are loaded and update UI text to reflect that relay settings are stored in the user account and follow login across devices.
2026-05-15 14:19:48 +01:00
Peter Goodhall
64c97e71fd Add Winkey Relay support and settings UI
Introduce optional Winkey Relay transport for CW commands and a browser-based settings UI. Adds localStorage-backed relay config (enabled, url, token, room), a modal to edit/save settings, and validation for URL/token/room. WebSocket logic now switches between direct localhost connection and relay mode, handles relay protocol messages (join, frame, error), authenticates/join on open, and wraps sends via sendWinkeyCommand to support framed relay messages. Updates UI: new Relay button/modal, changed Settings button label/icon, socket status badge updates, and reconnect on save. Keeps compatibility with direct WebSocket server and retains logging and sidetone playback behavior.
2026-05-15 13:48:34 +01:00