[TikiWiki-commits] [Git][tikiwiki/tiki][cherry-pick-36a59af4] 2 commits: [FIX] perms: Prevent endless perm denied redirect loop
"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]> Tue, 30 Jun 2026 10:50:47 +0000
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a439f8722b63_384fb2ff88975a@gitlab-sidekiq-low-urgency-cpu-bound-v2-656d6f88d7-wnk5p.mail> |
Jonny Bradley pushed to branch cherry-pick-36a59af4 at Tiki Wiki CMS Groupware / Tiki Commits: 8f3d51a7 by Jonny Bradley at 2026-06-30T09:40:40+00:00 [FIX] perms: Prevent endless perm denied redirect loop --- * [FIX] perms: When permission is denied on a file gallery file we end up in an endless loop instead of getting redirected to tiki-login.php - seems `session_id()` can be empty when `$_SESSION` contains valid data (possibly happening since !9161?) See merge request tikiwiki/tiki!10557 (cherry picked from commit 49e5f018e6d96159b745c9b5305b42800b6f2006) c7d50f61 [FIX] perms: When permission is denied on a file gallery file we end up in an... Co-authored-by: Jonny Bradley <[email protected]> - - - - - ca756c5d by Jonny Bradley at 2026-06-30T10:50:44+00:00 Fix cookie consent finally --- * [FIX] cookies: Remove ugly hard-coded styles and replace with a bootstrap class * [FIX] cookies: Better still, remove the pointless div entirely * [FIX] cookies: Add missing closing div in dialog mode html (yes, that's all it was) * [REF] cookies: Attempt to reformat cookie_consent.tpl (not easy as the structure is wrong) See merge request tikiwiki/tiki!10567 (cherry picked from commit 36a59af46d373004bda0b8b2dac1fcc083d17030) 93c85851 [REF] cookies: Attempt to reformat cookie_consent.tpl (not easy as the structure is wrong) ed118d67 [FIX] cookies: Add missing closing div in dialog mode html (yes, that's all it was) 22ff7c73 [FIX] cookies: Better still, remove the pointless div entirely 4919b565 [FIX] cookies: Remove ugly hard-coded styles and replace with a bootstrap class Co-authored-by: Jonny Bradley <[email protected]> - - - - - 2 changed files: - lib/tikiaccesslib.php - templates/cookie_consent.tpl Changes: ===================================== lib/tikiaccesslib.php ===================================== @@ -1228,7 +1228,7 @@ class TikiAccessLib extends TikiLib if (trim($msg)) { $session = session_id(); - if (empty($session)) { + if (empty($session) && empty($_SESSION['loginfrom'])) { // Can happen if session_silent is enabled. But does any instance enable session_silent? // Removing this case would allow removing the $msg parameters and just have callers using Feedback::add() before calling redirect(). Chealer 2017-08-16 $start = strpos($url, '?') ? '&' : '?'; ===================================== templates/cookie_consent.tpl ===================================== @@ -1,80 +1,71 @@ {strip} - {if $prefs.cookie_consent_mode eq 'dialog'} +{if $prefs.cookie_consent_mode eq 'dialog'} <div class="modal" tabindex="-1" role="dialog" id="{$prefs.cookie_consent_dom_id}"> - <div class="modal-dialog modal-xl modal-dialog-centered" role="document"> - <div class="modal-content"> - <div class="modal-header"> - <h5 class="modal-title">{tr}Cookie Consent{/tr}</h5> - </div> - <div class="modal-body"> - <form method="POST"> - <div class="w-100 h-100"> - {else} - <div id="{$prefs.cookie_consent_dom_id}" role="alert" style="position: fixed; top:0; z-index: 1050; background-color: rgba(0, 0, 0, 0.74); height: 100vh; width: 100vw;" - {if not empty($prefs.cookie_consent_mode)} - class="{$prefs.cookie_consent_mode}" {/if}> - <form method="POST" class="position-fixed bottom-0 start-0 end-0 collapse show" - style="z-index: 1050;"> - <div class="alert alert-primary rounded-2 border-top border-secondary border-1 mb-0 py-4 collapse show"> - <div class="container"> - {/if} - <div class="row mb-4"> - <div class="col-12"> - <p class="mb-0 lead"> - {wiki}{tr}{$prefs.cookie_consent_description}{/tr}{/wiki} - </p> - </div> - </div> - - <div id="customConsentSectionBanner" class="row mb-4"> - <div class="col-12 d-flex flex-wrap gap-3 gap-md-4"> - {foreach from=$cookie_categories key=category item=data} - <div class="form-check form-switch d-flex align-items-center flex-shrink-0"> - <input class="form-check-input me-2" type="checkbox" id="toggle{$category|capitalize}" - name="cookie_consent_{$category}" - {if $category == 'essential'}checked disabled aria-disabled="true"{/if}> - <label class="form-check-label me-2 fw-semibold" for="toggle{$category|capitalize}"> - {tr}{$data.name}{/tr} - </label> - <button type="button" class="btn btn-link p-0 text-decoration-none text-dark" - data-bs-toggle="tooltip" data-bs-placement="right" title="{tr}{$data.description}{/tr}" - aria-label="{tr}{$data.description}{/tr}"> - <i class="fas fa-info-circle"></i> - </button> - </div> - {/foreach} - </div> - </div> - - <div class="row"> - <div class="col-12 d-flex flex-wrap gap-2 justify-content-center justify-content-md-end"> - {if $prefs.cookie_consent_disable eq 'n'} - <button type="submit" class="btn btn-outline-danger" - id="cookie_decline_unnecessary_button"> - {tr}Refuse unnecessary{/tr} - </button> - {/if} - <button type="submit" class="btn btn-secondary" - id="cookie_save_button"> - {tr}Save preferences{/tr} - </button> - <button type="submit" class="btn btn-primary" - id="cookie_consent_preference" name="cookie_consent_preference"> - {tr}Accept all{/tr} - </button> - </div> - </div> - - {if $prefs.cookie_consent_mode neq 'dialog'} - </div> - </div> - {/if} - </form> - - {if $prefs.cookie_consent_mode eq 'dialog'} - </div> - </div> - </div> - {/if} + <div class="modal-dialog modal-xl modal-dialog-centered" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title">{tr}Cookie Consent{/tr}</h5> + </div> + <div class="modal-body"> + <form method="POST"> +{else} + <div id="{$prefs.cookie_consent_dom_id}" role="alert" class="fixed-bottom" + {if not empty($prefs.cookie_consent_mode)}class="{$prefs.cookie_consent_mode}" {/if}> + <form method="POST" class="position-fixed bottom-0 start-0 end-0 collapse show"> + <div class="alert alert-primary rounded-2 border-top border-secondary border-1 mb-0 py-4 collapse show"> + <div class="container"> +{/if} + <div class="row mb-4"> + <div class="col-12"> + <p class="mb-0 lead"> + {wiki}{tr}{$prefs.cookie_consent_description}{/tr}{/wiki} + </p> + </div> + </div> + + <div id="customConsentSectionBanner" class="row mb-4"> + <div class="col-12 d-flex flex-wrap gap-3 gap-md-4"> + {foreach from=$cookie_categories key=category item=data} + <div class="form-check form-switch d-flex align-items-center flex-shrink-0"> + <input class="form-check-input me-2" type="checkbox" id="toggle{$category|capitalize}" + name="cookie_consent_{$category}" + {if $category == 'essential'}checked disabled aria-disabled="true"{/if}> + <label class="form-check-label me-2 fw-semibold" for="toggle{$category|capitalize}"> + {tr}{$data.name}{/tr} + </label> + <button type="button" class="btn btn-link p-0 text-decoration-none text-dark" + data-bs-toggle="tooltip" data-bs-placement="right" + title="{tr}{$data.description}{/tr}" + aria-label="{tr}{$data.description}{/tr}"> + <i class="fas fa-info-circle"></i> + </button> + </div> + {/foreach} + </div> + </div> + + <div class="row"> + <div class="col-12 d-flex flex-wrap gap-2 justify-content-center justify-content-md-end"> + {if $prefs.cookie_consent_disable eq 'n'} + <button type="submit" class="btn btn-outline-danger" + id="cookie_decline_unnecessary_button"> + {tr}Refuse unnecessary{/tr} + </button> + {/if} + <button type="submit" class="btn btn-secondary" + id="cookie_save_button"> + {tr}Save preferences{/tr} + </button> + <button type="submit" class="btn btn-primary" + id="cookie_consent_preference" name="cookie_consent_preference"> + {tr}Accept all{/tr} + </button> + </div> + </div> + + {if $prefs.cookie_consent_mode neq 'dialog'}</div></div>{/if} + </form> + + {if $prefs.cookie_consent_mode eq 'dialog'}</div></div></div>{/if} </div> {/strip} View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/compare/33d70e668a03c87a729a7990f4756ddaaed2741a...ca756c5d44efd1246237e48ec107d748e1cd68bf -- View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/compare/33d70e668a03c87a729a7990f4756ddaaed2741a...ca756c5d44efd1246237e48ec107d748e1cd68bf You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help _______________________________________________ TikiWiki-cvs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs