-
-
Notifications
You must be signed in to change notification settings - Fork 200
2.8.4 #3392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.8.4 #3392
Changes from all commits
429d23f
3c2d846
e78dedc
1aeec6e
1583590
3d77c3d
d9e0fe0
1a62e40
30ee758
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <?php | ||
|
|
||
| defined('BASEPATH') OR exit('No direct script access allowed'); | ||
|
|
||
| /* | ||
| * Tag Cloudlog as 2.8.4 Migration | ||
| */ | ||
|
|
||
| class Migration_tag_2_8_4 extends CI_Migration { | ||
|
|
||
| public function up() | ||
| { | ||
|
|
||
| // Tag Cloudlog 2.8.4 | ||
| $this->db->where('option_name', 'version'); | ||
| $this->db->update('options', array('option_value' => '2.8.4')); | ||
|
|
||
| // Trigger Version Info Dialog | ||
| $this->db->where('option_type', 'version_dialog'); | ||
| $this->db->where('option_name', 'confirmed'); | ||
| $this->db->update('user_options', array('option_value' => 'false')); | ||
|
|
||
| } | ||
|
|
||
| public function down() | ||
| { | ||
| $this->db->where('option_name', 'version'); | ||
| $this->db->update('options', array('option_value' => '2.8.3')); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,6 +122,15 @@ class="btn btn-primary btn-sm" | |
| title="<?php echo lang('station_logbooks_edit_logbook') . ': ' . $row->logbook_name;?>"> | ||
| <i class="fas fa-edit"></i> | ||
| </a> | ||
| <?php if($row->public_slug != '') { ?> | ||
| <button class="btn btn-success btn-sm" | ||
| title="Get Embed Code" | ||
| data-bs-toggle="modal" | ||
| data-bs-target="#embedModal" | ||
| onclick="setEmbedCode('<?php echo $row->public_slug; ?>', '<?php echo addslashes($row->logbook_name); ?>')"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incomplete JavaScript escaping breaks embed modal for special charactersThe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incomplete JavaScript escaping breaks embed modal for special charactersThe |
||
| <i class="fas fa-code"></i> | ||
| </button> | ||
| <?php } ?> | ||
| <?php if($row->user_id == $this->session->userdata('user_id') || (isset($row->access_level) && $row->access_level == 'admin')) { ?> | ||
| <a href="<?php echo site_url('logbooks/manage_sharing')."/".$row->logbook_id; ?>" | ||
| class="btn btn-info btn-sm" | ||
|
|
@@ -167,3 +176,68 @@ class="btn btn-danger btn-sm" | |
| <?php } ?> | ||
|
|
||
| </div> | ||
|
|
||
| <!-- Embed Code Modal --> | ||
| <div class="modal fade" id="embedModal" tabindex="-1" aria-labelledby="embedModalLabel" aria-hidden="true"> | ||
| <div class="modal-dialog modal-lg"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <h5 class="modal-title" id="embedModalLabel"> | ||
| <i class="fas fa-code me-2"></i>Embed Widget - <span id="embedLogbookName"></span> | ||
| </h5> | ||
| <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||
| </div> | ||
| <div class="modal-body"> | ||
| <p class="text-muted mb-3">Copy the code below and paste it into your website to embed your logbook widget:</p> | ||
| <div class="mb-3"> | ||
| <label for="embedCodeInput" class="form-label">Embed Code</label> | ||
| <div class="input-group"> | ||
| <textarea class="form-control" id="embedCodeInput" rows="4" readonly></textarea> | ||
| <button class="btn btn-primary" type="button" id="copyEmbedBtn" title="Copy to clipboard"> | ||
| <i class="fas fa-copy me-1"></i>Copy | ||
| </button> | ||
| </div> | ||
| </div> | ||
| <div class="alert alert-info" role="alert"> | ||
| <strong>Note:</strong> Make sure your logbook has a public slug configured before embedding. | ||
| </div> | ||
| </div> | ||
| <div class="modal-footer"> | ||
| <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <script> | ||
| function setEmbedCode(publicSlug, logbookName) { | ||
| const baseUrl = '<?php echo site_url('widgets/qsos'); ?>'; | ||
| const iframeCode = `<iframe src="${baseUrl}/${publicSlug}" width="100%" height="600" frameborder="0" allowfullscreen></iframe>`; | ||
|
|
||
| document.getElementById('embedCodeInput').value = iframeCode; | ||
| document.getElementById('embedLogbookName').textContent = logbookName; | ||
| } | ||
|
|
||
| document.addEventListener('DOMContentLoaded', function() { | ||
| const copyBtn = document.getElementById('copyEmbedBtn'); | ||
| if (copyBtn) { | ||
| copyBtn.addEventListener('click', function() { | ||
| const textarea = document.getElementById('embedCodeInput'); | ||
| textarea.select(); | ||
| document.execCommand('copy'); | ||
|
|
||
| // Visual feedback | ||
| const originalText = copyBtn.innerHTML; | ||
| copyBtn.innerHTML = '<i class="fas fa-check me-1"></i>Copied!'; | ||
| copyBtn.classList.add('btn-success'); | ||
| copyBtn.classList.remove('btn-primary'); | ||
|
|
||
| setTimeout(() => { | ||
| copyBtn.innerHTML = originalText; | ||
| copyBtn.classList.remove('btn-success'); | ||
| copyBtn.classList.add('btn-primary'); | ||
| }, 2000); | ||
| }); | ||
| } | ||
| }); | ||
| </script> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read-only users can delete/modify QSOs in shared logbooks
The expanded
check_qso_is_accessiblefunction now allows access when a user has only 'read' permission to a shared logbook. However, this function is used as a gatekeeper for destructive operations likedelete()andpaperqsl_update(). This means a user granted read-only access to a shared logbook can now delete or modify QSOs they shouldn't be able to change. The shared-logbook check usescheck_logbook_is_accessible($activeLogbookId, 'read')but the calling code inQso.phpuses the result to authorize deletions and updates.