From 4fbb180fb1d6037ae053d490bd172cb05d629df6 Mon Sep 17 00:00:00 2001 From: Eric Rasmussen Date: Thu, 9 May 2024 10:12:56 -0500 Subject: [PATCH] [#678] Add protected_pages module --- composer.json | 1 + composer.lock | 51 ++++++++++++++++++- config/sync/core.extension.yml | 1 + config/sync/editor.editor.html_code.yml | 2 +- config/sync/protected_pages.settings.yml | 26 ++++++++++ config/sync/unl_five.settings.yml | 6 +-- config/sync/user.role.administrator.yml | 6 +++ config/sync/user.role.anonymous.yml | 2 + config/sync/user.role.authenticated.yml | 2 + config/sync/user.role.coder.yml | 6 +++ .../install/user.role.administrator.yml | 4 ++ .../config/install/user.role.anonymous.yml | 2 + .../install/user.role.authenticated.yml | 2 + .../config/install/user.role.coder.yml | 4 ++ .../herbie_roles/herbie_roles.info.yml | 3 +- 15 files changed, 112 insertions(+), 6 deletions(-) create mode 100644 config/sync/protected_pages.settings.yml diff --git a/composer.json b/composer.json index 452701f34..3a88ce68f 100644 --- a/composer.json +++ b/composer.json @@ -191,6 +191,7 @@ "drupal/oembed_providers": "^2.1", "drupal/paragraphs": "^1.8", "drupal/pathauto": "^1.3", + "drupal/protected_pages": "^1.6", "drupal/queue_ui": "^3.1", "drupal/rabbit_hole": "^1.0@beta", "drupal/redirect": "^1.5", diff --git a/composer.lock b/composer.lock index d9ad9b8e9..cc4569c0b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c5bdc7a80f5422da74a889f0fb26c4b2", + "content-hash": "5619c0a9e7462218c0e05374495b4f25", "packages": [ { "name": "arthurkushman/query-path", @@ -5505,6 +5505,55 @@ "documentation": "https://www.drupal.org/docs/8/modules/pathauto" } }, + { + "name": "drupal/protected_pages", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/protected_pages.git", + "reference": "8.x-1.6" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/protected_pages-8.x-1.6.zip", + "reference": "8.x-1.6", + "shasum": "d55172cec155ee08618c2817c9b3d3e1ce8f9f63" + }, + "require": { + "drupal/core": "^8.8 || ^9 || ^10" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-1.6", + "datestamp": "1681317610", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "markdorison", + "homepage": "https://www.drupal.org/user/346106" + }, + { + "name": "oksana-c", + "homepage": "https://www.drupal.org/user/2916547" + } + ], + "description": "Protected Pages modules allows the administrator to secure any page or private file in your website by password.", + "homepage": "https://www.drupal.org/project/protected_pages", + "support": { + "source": "https://git.drupalcode.org/project/protected_pages", + "issues": "https://www.drupal.org/project/issues/protected_pages" + } + }, { "name": "drupal/queue_ui", "version": "3.1.3", diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index f6d500704..83923f921 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -119,6 +119,7 @@ module: page_cache: 0 path: 0 path_alias: 0 + protected_pages: 0 queue_ui: 0 rabbit_hole: 0 redirect: 0 diff --git a/config/sync/editor.editor.html_code.yml b/config/sync/editor.editor.html_code.yml index d83da02c9..8a7e6b7f3 100644 --- a/config/sync/editor.editor.html_code.yml +++ b/config/sync/editor.editor.html_code.yml @@ -1,4 +1,4 @@ -uuid: ef0e1aed-58c7-458d-b628-b5450e4ae112 +uuid: 1875535d-5bc4-435a-a62e-b6f373b2df0f langcode: en status: true dependencies: diff --git a/config/sync/protected_pages.settings.yml b/config/sync/protected_pages.settings.yml new file mode 100644 index 000000000..f455e55ce --- /dev/null +++ b/config/sync/protected_pages.settings.yml @@ -0,0 +1,26 @@ +_core: + default_config_hash: fcx2bfv-TfdQ_hGuvq4GkK3SAeANYibuVJMcEJBGG38 +email: + subject: 'Please visit this new page' + body: |- + Dear friend, + + I just created a new page on my website and wanted to invite you to visit. The page is protected by password. Please find the details below:- + + Page Url = [protected-page-url] + + Page Password = password here + + Thank you. + [site-name] +password: + protected_pages_session_expire_time: '0' + per_page_or_global: per_page_or_global +others: + protected_pages_title: 'Protected Page -- Enter password' + protected_pages_description: 'The page you are trying to view is password protected. Please enter the password below to proceed.' + protected_pages_password_fieldset_legend: 'Enter password' + protected_pages_password_label: 'Enter password' + protected_pages_submit_button_text: Authenticate + protected_pages_incorrect_password_msg: 'An incorrect password was submitted. Please check your password and try again.' +langcode: en diff --git a/config/sync/unl_five.settings.yml b/config/sync/unl_five.settings.yml index 913faa3ee..d66a3a52b 100644 --- a/config/sync/unl_five.settings.yml +++ b/config/sync/unl_five.settings.yml @@ -5,9 +5,9 @@ features: node_user_picture: false comment_user_picture: true comment_user_verification: true -_core: - default_config_hash: RzrFjHolQT4-m--ddhSf6ZZ-CQsPcP1Ln3IvgHsWPxk logo: use_default: 1 favicon: - use_default: 1 + use_default: 0 +_core: + default_config_hash: RzrFjHolQT4-m--ddhSf6ZZ-CQsPcP1Ln3IvgHsWPxk diff --git a/config/sync/user.role.administrator.yml b/config/sync/user.role.administrator.yml index 4cf4cddd5..2956577d1 100644 --- a/config/sync/user.role.administrator.yml +++ b/config/sync/user.role.administrator.yml @@ -44,9 +44,11 @@ dependencies: - media - media_file_delete - menu_admin_per_menu + - metatag - node - paragraphs - path + - protected_pages - rabbit_hole - redirect - replicate_ui @@ -80,6 +82,7 @@ permissions: - 'access files overview' - 'access media overview' - 'access own webform configuration' + - 'access protected page password screen' - 'access site in maintenance mode' - 'access site reports' - 'access taxonomy overview' @@ -98,6 +101,7 @@ permissions: - 'administer google analytics' - 'administer js assets injector' - 'administer main menu items' + - 'administer meta tags' - 'administer node display' - 'administer node fields' - 'administer node form display' @@ -106,6 +110,7 @@ permissions: - 'administer paragraph fields' - 'administer paragraph form display' - 'administer paragraphs types' + - 'administer protected pages configuration' - 'administer redirects' - 'administer rest resources' - 'administer scanner settings' @@ -116,6 +121,7 @@ permissions: - 'administer views' - 'administer webform submission' - 'allow empty user mail' + - 'bypass pages password protection' - 'configure editable builder_page node layout overrides' - 'create accordion block content' - 'create and edit custom blocks' diff --git a/config/sync/user.role.anonymous.yml b/config/sync/user.role.anonymous.yml index cfbfec1f7..854cfc335 100644 --- a/config/sync/user.role.anonymous.yml +++ b/config/sync/user.role.anonymous.yml @@ -6,6 +6,7 @@ dependencies: - entity_share_server - external_entities - media + - protected_pages - system _core: default_config_hash: 68rVss6EhJ70dZP3kK2ULmGVWGpw2_UrSNFAUiVDxu8 @@ -15,6 +16,7 @@ weight: -10 is_admin: false permissions: - 'access content' + - 'access protected page password screen' - entity_share_server_access_channels - 'view media' - 'view unl_directory_entry external entity' diff --git a/config/sync/user.role.authenticated.yml b/config/sync/user.role.authenticated.yml index b7c472362..0016f734b 100644 --- a/config/sync/user.role.authenticated.yml +++ b/config/sync/user.role.authenticated.yml @@ -6,6 +6,7 @@ dependencies: - external_entities - honeypot - media + - protected_pages - system _core: default_config_hash: ui2e3Eb7FufQhVaAjwcyBNb2prP1llg1ZKLSlq2AFf8 @@ -15,6 +16,7 @@ weight: -9 is_admin: false permissions: - 'access content' + - 'access protected page password screen' - 'bypass honeypot protection' - 'view media' - 'view unl_directory_entry external entity' diff --git a/config/sync/user.role.coder.yml b/config/sync/user.role.coder.yml index 648217e4b..b40e3b851 100644 --- a/config/sync/user.role.coder.yml +++ b/config/sync/user.role.coder.yml @@ -14,8 +14,10 @@ dependencies: - field_ui - filter - google_analytics + - metatag - node - paragraphs + - protected_pages - replicate_ui - system - taxonomy @@ -31,6 +33,7 @@ permissions: - 'access contextual links' - 'access css fields' - 'access feed overview' + - 'access protected page password screen' - 'access site reports' - 'access taxonomy overview' - 'add JS snippets for google analytics' @@ -38,15 +41,18 @@ permissions: - 'administer css assets injector' - 'administer feeds' - 'administer js assets injector' + - 'administer meta tags' - 'administer node display' - 'administer node fields' - 'administer node form display' - 'administer paragraph display' - 'administer paragraph fields' - 'administer paragraph form display' + - 'administer protected pages configuration' - 'administer taxonomy' - 'administer twig templates' - 'administer views' + - 'bypass pages password protection' - 'create html_code block content' - 'delete any html_code block content' - 'load twig templates from file system' diff --git a/web/modules/custom/features/herbie_roles/config/install/user.role.administrator.yml b/web/modules/custom/features/herbie_roles/config/install/user.role.administrator.yml index a32e7e056..9fa99712d 100644 --- a/web/modules/custom/features/herbie_roles/config/install/user.role.administrator.yml +++ b/web/modules/custom/features/herbie_roles/config/install/user.role.administrator.yml @@ -47,6 +47,7 @@ dependencies: - node - paragraphs - path + - protected_pages - rabbit_hole - redirect - replicate_ui @@ -78,6 +79,7 @@ permissions: - 'access files overview' - 'access media overview' - 'access own webform configuration' + - 'access protected page password screen' - 'access site in maintenance mode' - 'access site reports' - 'access taxonomy overview' @@ -105,6 +107,7 @@ permissions: - 'administer paragraph fields' - 'administer paragraph form display' - 'administer paragraphs types' + - 'administer protected pages configuration' - 'administer redirects' - 'administer rest resources' - 'administer scanner settings' @@ -115,6 +118,7 @@ permissions: - 'administer views' - 'administer webform submission' - 'allow empty user mail' + - 'bypass pages password protection' - 'configure editable builder_page node layout overrides' - 'create accordion block content' - 'create and edit custom blocks' diff --git a/web/modules/custom/features/herbie_roles/config/install/user.role.anonymous.yml b/web/modules/custom/features/herbie_roles/config/install/user.role.anonymous.yml index 36b728cc5..64e99c7f1 100644 --- a/web/modules/custom/features/herbie_roles/config/install/user.role.anonymous.yml +++ b/web/modules/custom/features/herbie_roles/config/install/user.role.anonymous.yml @@ -5,6 +5,7 @@ dependencies: - entity_share_server - external_entities - media + - protected_pages - system id: anonymous label: 'Anonymous user' @@ -12,6 +13,7 @@ weight: -10 is_admin: false permissions: - 'access content' + - 'access protected page password screen' - entity_share_server_access_channels - 'view media' - 'view unl_directory_entry external entity' diff --git a/web/modules/custom/features/herbie_roles/config/install/user.role.authenticated.yml b/web/modules/custom/features/herbie_roles/config/install/user.role.authenticated.yml index 57317e57f..1dcbbdb83 100644 --- a/web/modules/custom/features/herbie_roles/config/install/user.role.authenticated.yml +++ b/web/modules/custom/features/herbie_roles/config/install/user.role.authenticated.yml @@ -5,6 +5,7 @@ dependencies: - external_entities - honeypot - media + - protected_pages - system id: authenticated label: 'Authenticated user' @@ -12,6 +13,7 @@ weight: -9 is_admin: false permissions: - 'access content' + - 'access protected page password screen' - 'bypass honeypot protection' - 'view media' - 'view unl_directory_entry external entity' diff --git a/web/modules/custom/features/herbie_roles/config/install/user.role.coder.yml b/web/modules/custom/features/herbie_roles/config/install/user.role.coder.yml index 139d6b5cc..559ae7f6e 100644 --- a/web/modules/custom/features/herbie_roles/config/install/user.role.coder.yml +++ b/web/modules/custom/features/herbie_roles/config/install/user.role.coder.yml @@ -16,6 +16,7 @@ dependencies: - metatag - node - paragraphs + - protected_pages - replicate_ui - system - taxonomy @@ -29,6 +30,7 @@ permissions: - 'access contextual links' - 'access css fields' - 'access feed overview' + - 'access protected page password screen' - 'access site reports' - 'access taxonomy overview' - 'add JS snippets for google analytics' @@ -43,9 +45,11 @@ permissions: - 'administer paragraph display' - 'administer paragraph fields' - 'administer paragraph form display' + - 'administer protected pages configuration' - 'administer taxonomy' - 'administer twig templates' - 'administer views' + - 'bypass pages password protection' - 'create html_code block content' - 'delete any html_code block content' - 'load twig templates from file system' diff --git a/web/modules/custom/features/herbie_roles/herbie_roles.info.yml b/web/modules/custom/features/herbie_roles/herbie_roles.info.yml index 25eddbc73..b1024f402 100644 --- a/web/modules/custom/features/herbie_roles/herbie_roles.info.yml +++ b/web/modules/custom/features/herbie_roles/herbie_roles.info.yml @@ -42,6 +42,7 @@ dependencies: - 'menu_admin_per_menu:menu_admin_per_menu' - 'metatag:metatag' - 'paragraphs:paragraphs' + - 'protected_pages:protected_pages' - 'rabbit_hole:rabbit_hole' - 'redirect:redirect' - 'replicate_ui:replicate_ui' @@ -53,5 +54,5 @@ dependencies: - 'webform:webform' - 'webform:webform_node' - 'webform:webform_submission_log' -version: 1.4.0 +version: 1.4.1 package: Herbie