Skip to content

Conversation

@magicbug
Copy link
Owner

@magicbug magicbug commented Dec 10, 2025

This pull request introduces several significant enhancements and fixes across the application, focusing on user management, award settings, open registration, LoTW user import deduplication, and managed configuration enforcement. The most important changes are grouped and summarized below.

User Registration and Management:

  • Added a public signup (open registration) feature, allowing users to self-register if enabled in the options and configuration. Includes form validation, user creation, and optional welcome email sending. Registration is gated by new configuration and option values. (application/controllers/User.php)
  • Introduced new registration management endpoints in Options.php, allowing admins to control open registration settings, including the ability to disable or enable public signup and handle managed deployments. (application/controllers/Options.php)
  • Added new language strings for registration options and hints. (application/language/english/options_lang.php)

Award Settings:

  • Introduced a new Award controller to handle displaying and saving award preferences, including endpoints for activating/deactivating all awards and saving individual award settings. (application/controllers/Award.php)
  • Added a new language string for "Award Settings" in multiple translations for improved internationalization. (application/language/english/awards_lang.php, application/language/bulgarian/awards_lang.php, application/language/czech/awards_lang.php, application/language/dutch/awards_lang.php, application/language/chinese_simplified/awards_lang.php, application/language/finnish/awards_lang.php, application/language/french/awards_lang.php, application/language/german/awards_lang.php, application/language/greek/awards_lang.php) [1] [2] [3] [4] [5] [6] [7]

LoTW User Import Deduplication:

  • Improved the LoTW user import process to deduplicate entries by callsign and keep only the latest timestamp for each, significantly reducing duplicate records and improving performance. Batch insertion and progress reporting were updated accordingly. (application/controllers/Update.php) [1] [2] [3]

Managed Configuration Enforcement:

  • Enforced managed service restrictions on email and registration options: if the service or protocol is centrally managed, the relevant settings pages are hidden or changes are blocked, and users are notified. (application/controllers/Options.php) [1] [2]

Other Notable Changes:

  • Updated the migration version to 238 in migration.php to reflect the new database schema state. (application/config/migration.php)
  • The QRZ import now downloads all data regardless of user date selection, simplifying the import logic. (application/controllers/Qrz.php)

These updates collectively improve user onboarding, system manageability, award tracking, and data integrity.


Note

Introduce award menu preferences, open user registration, managed email overrides, and LoTW import dedup with related query updates; tag version 2.8.2.

  • Awards preferences (UI + backend)
    • Add Award controller, views (awards/settings), JS (assets/js/sections/awards.js), and nav integration to let users show/hide specific awards.
    • New awardxuser table and model Awards_model to store per-user award visibility; bulk activate/deactivate endpoints.
    • Language keys for "Award Settings" added across locales.
  • Open registration
    • Public signup flow in User::signup with validation, defaults, and optional welcome email; login page link when enabled.
    • Admin controls in Options::registration (+ registration_save) and new view options/registration; language strings for registration options.
  • Managed configuration
    • Load optional managed.php; override email options in OptionsLib::get_option (managed_* keys).
    • Block/mark read-only email settings when centrally managed; hide registration section when disable_open_registration.
    • .gitignore ignores application/config/managed*.php.
  • LoTW import & queries
    • Deduplicate lotw_users import by callsign keeping latest lastupload; batch inserts and revised counters.
    • Replace direct lotw_users joins with subquery selecting MAX(lastupload) across multiple models for correct/latest data.
  • Migrations/versioning
    • New migrations 237_add_awardxuser and 238_tag_2_8_2; bump migration_version to 238.
  • Other
    • QRZ import now downloads all data regardless of date.
    • UI polish for options pages (icons, active states) and load assets/js/sections/awards.js from footer.

Written by Cursor Bugbot for commit 3acfa64. This will update automatically on new commits. Configure here.

Changed the FFMA award description from 'Flora and Fauna in Marche Award' to 'Fred Fish Memorial Award' for accuracy.
Deleted the 'Award Settings' dropdown item from the header navigation to streamline the menu options.
Introduces open registration settings in the options area, allowing administrators to enable or disable public user signup. Adds a registration options page, updates sidebar navigation, and implements a public signup form and controller logic. Also refines user model to ensure correct data types for user fields and updates language strings for registration. The login page now links to signup when open registration is enabled.
Replaces direct join with lotw_users table by joining a subquery that selects the latest lastupload per callsign. This improves performance and ensures only the most recent LOTW upload date is included for each callsign.
Replaces direct joins to lotw_users with subqueries that select the latest (MAX) lastupload per callsign in Distances_model, Logbook_model, and Logbookadvanced_model. This ensures only the most recent LoTW upload per callsign is joined, improving data accuracy and preventing duplicate join results.
Changed the import logic to deduplicate LoTW users by callsign, keeping only the latest timestamp for each callsign. Updated batch insertion to process only unique callsigns and improved reporting to show both total records read and unique callsigns inserted.
Introduces logic to detect and enforce centrally managed email settings. When managed, email options are displayed as read-only and cannot be changed by users; attempts to save changes are blocked with a notice. The email options view now conditionally renders a read-only summary and test email form if management is enabled.
Added FontAwesome icons to options pages and sidebar for better visual distinction. Improved the options index page with overview cards for each settings category. Updated CSS for active and hover states in the options sidebar, providing a more modern and user-friendly interface. Added a subscription management link to the header if configured.
Simplifies the QRZ data download process by removing the custom date selection logic. Now, all QRZ data is downloaded regardless of the date specified in the request.
Introduces migration 238 to update the application version to 2.8.2 and trigger the version info dialog for users. Updates the migration version in the configuration to 238.
@magicbug magicbug merged commit d84977f into master Dec 10, 2025
2 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

$sql .= 'JOIN `station_profile` ON station_profile.station_id = qsos.station_id ';
$sql .= 'LEFT OUTER JOIN `dxcc_entities` ON dxcc_entities.adif = qsos.COL_DXCC ';
$sql .= 'LEFT OUTER JOIN `lotw_users` ON lotw_users.callsign = qsos.COL_CALL ';
$sql .= 'LEFT OUTER JOIN (SELECT callsign, MAX(lastupload) AS lastupload FROM lotw_users GROUP BY callsign) lotw ON lotw.callsign = qsos.COL_CALL ';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: SQL alias mismatch causes query to fail

In the activated_grids_qso_details function, the JOIN was changed to alias the subquery as lotw, but the SELECT clause on line 545 still references lotw_users.callsign and lotw_users.lastupload. This alias mismatch will cause the SQL query to fail with an "unknown column" error since lotw_users is no longer a valid table alias after the change.

Additional Locations (1)

Fix in Cursor Fix in Web

</script>

<?php } else { ?>
<!-- Normal email configuration form -->
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing form opening tag prevents email settings save

The email settings form in the non-managed section is missing its opening form_open('options/email_save') tag. The diff shows this line was removed but not re-added in the else block. The form fields (emailProtocol, smtpEncryption, etc.) and the closing </form> tag exist, but there's no opening form tag, so the Save button at line 164 won't submit the form data to email_save. Users will be unable to save email configuration changes.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants