Skip to content

Password protected course updates#2649

Open
sazedul-haque wants to merge 2 commits intodevfrom
modal-accessibility-fix
Open

Password protected course updates#2649
sazedul-haque wants to merge 2 commits intodevfrom
modal-accessibility-fix

Conversation

@sazedul-haque
Copy link
Copy Markdown
Collaborator

@sazedul-haque sazedul-haque commented May 5, 2026

  1. Make password modal non-dismissible
  2. Bypass password for enrolled users

Add data-tutor-modal-no-dismiss to the password-protected template to mark the modal as non-dismissible. Update modal.js to skip closing modals that have this attribute on Escape or overlay/click, while still allowing explicit close buttons to close such modals. This prevents accidental dismissal of the password prompt while preserving deliberate close actions.
@sazedul-haque sazedul-haque requested a review from shewa12 May 5, 2026 06:42
@sazedul-haque sazedul-haque added the v3 Tutor 3.0 label May 5, 2026
Add a post_password_required filter and implement bypass_password_for_enrolled to allow enrolled users to view password-protected course and bundle posts. The new method returns false (no password required) when the post is a course or bundle and the current user is enrolled; otherwise it preserves the original value. Includes a docblock (since 3.0.0) and registers the filter in the class initialization.
@sazedul-haque sazedul-haque changed the title Make password modal non-dismissible Password protected course updates May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3 Tutor 3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant