diff --git a/composer.json b/composer.json index ed93fe57..d8910196 100644 --- a/composer.json +++ b/composer.json @@ -65,6 +65,7 @@ "drupal/migrate_tools": "5.x-dev@dev", "drupal/mimemail": "^1.x-dev", "drupal/modules_weight": "^1.8", + "drupal/password_policy": "^3.0", "drupal/payment": "^2.1", "drupal/payment_commerce": "2.x-dev@dev", "drupal/permissions_filter": "^1.1", diff --git a/composer.lock b/composer.lock index f5a3efa0..befc979e 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": "dc55edf4f15740641dc0903f68085726", + "content-hash": "9f0bf06238a3485d7d627092ce483e3d", "packages": [ { "name": "alchemy/zippy", @@ -9921,6 +9921,67 @@ "source": "https://git.drupalcode.org/project/pagerer" } }, + { + "name": "drupal/password_policy", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/password_policy.git", + "reference": "8.x-3.0" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/password_policy-8.x-3.0.zip", + "reference": "8.x-3.0", + "shasum": "6fbc4fe40ab26ec19e5ca37aaaa676348dc7fddb" + }, + "require": { + "drupal/core": "^8 || ^9", + "drupal/ctools": "^3.1" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-3.0", + "datestamp": "1625082607", + "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": "AohRveTPV", + "homepage": "https://www.drupal.org/user/2760115" + }, + { + "name": "deekayen", + "homepage": "https://www.drupal.org/user/972" + }, + { + "name": "miglius", + "homepage": "https://www.drupal.org/user/18741" + }, + { + "name": "nerdstein", + "homepage": "https://www.drupal.org/user/1557710" + }, + { + "name": "shrop", + "homepage": "https://www.drupal.org/user/14767" + } + ], + "description": "Sets up constraints and expiration of passwords.", + "homepage": "https://www.drupal.org/project/password_policy", + "support": { + "source": "https://git.drupalcode.org/project/password_policy" + } + }, { "name": "drupal/path_alias_xt", "version": "dev-1.x", diff --git a/config/sync/core.entity_form_display.user.user.default.yml b/config/sync/core.entity_form_display.user.user.default.yml index ea8003de..f2605990 100644 --- a/config/sync/core.entity_form_display.user.user.default.yml +++ b/config/sync/core.entity_form_display.user.user.default.yml @@ -5,10 +5,14 @@ dependencies: config: - field.field.user.user.commerce_remote_id - field.field.user.user.field_company + - field.field.user.user.field_last_password_reset - field.field.user.user.field_member_type - field.field.user.user.field_memo + - field.field.user.user.field_password_expiration - field.field.user.user.field_showroom module: + - datetime + - path - user id: user.user.default targetEntityType: user @@ -30,6 +34,12 @@ content: third_party_settings: { } type: entity_reference_autocomplete region: content + field_last_password_reset: + type: datetime_default + weight: 4 + settings: { } + third_party_settings: { } + region: content field_member_type: weight: 4 settings: { } @@ -44,6 +54,13 @@ content: third_party_settings: { } type: string_textarea region: content + field_password_expiration: + type: boolean_checkbox + weight: 3 + settings: + display_label: true + third_party_settings: { } + region: content field_showroom: weight: 2 settings: diff --git a/config/sync/core.entity_form_display.user.user.modal.yml b/config/sync/core.entity_form_display.user.user.modal.yml index ba53dbe5..4f0a2df3 100644 --- a/config/sync/core.entity_form_display.user.user.modal.yml +++ b/config/sync/core.entity_form_display.user.user.modal.yml @@ -6,10 +6,13 @@ dependencies: - core.entity_form_mode.user.modal - field.field.user.user.commerce_remote_id - field.field.user.user.field_company + - field.field.user.user.field_last_password_reset - field.field.user.user.field_member_type - field.field.user.user.field_memo + - field.field.user.user.field_password_expiration - field.field.user.user.field_showroom module: + - path - user id: user.user.modal targetEntityType: user @@ -33,8 +36,10 @@ hidden: contact_company_profiles: true customer_profiles: true field_company: true + field_last_password_reset: true field_member_type: true field_memo: true + field_password_expiration: true field_showroom: true langcode: true language: true diff --git a/config/sync/core.entity_form_display.user.user.register.yml b/config/sync/core.entity_form_display.user.user.register.yml index 24f8e890..e02fba6a 100644 --- a/config/sync/core.entity_form_display.user.user.register.yml +++ b/config/sync/core.entity_form_display.user.user.register.yml @@ -6,10 +6,13 @@ dependencies: - core.entity_form_mode.user.register - field.field.user.user.commerce_remote_id - field.field.user.user.field_company + - field.field.user.user.field_last_password_reset - field.field.user.user.field_member_type - field.field.user.user.field_memo + - field.field.user.user.field_password_expiration - field.field.user.user.field_showroom module: + - path - user id: user.user.register targetEntityType: user @@ -81,5 +84,7 @@ hidden: contact: true contact_company_profiles: true customer_profiles: true + field_last_password_reset: true + field_password_expiration: true langcode: true member_profiles: true diff --git a/config/sync/core.entity_view_display.user.user.default.yml b/config/sync/core.entity_view_display.user.user.default.yml index 5ce6b80c..e26fd54e 100644 --- a/config/sync/core.entity_view_display.user.user.default.yml +++ b/config/sync/core.entity_view_display.user.user.default.yml @@ -5,8 +5,10 @@ dependencies: config: - field.field.user.user.commerce_remote_id - field.field.user.user.field_company + - field.field.user.user.field_last_password_reset - field.field.user.user.field_member_type - field.field.user.user.field_memo + - field.field.user.user.field_password_expiration - field.field.user.user.field_showroom module: - options @@ -51,10 +53,26 @@ content: region: content settings: { } third_party_settings: { } + user_email_verification_verified: + weight: 100 + settings: { } + third_party_settings: { } + region: content + user_email_verification_verified_date: + weight: 100 + settings: { } + third_party_settings: { } + region: content hidden: commerce_remote_id: true + contact_company_profiles: true + customer_profiles: true + field_last_password_reset: true + field_password_expiration: true langcode: true + member_profiles: true profile_contact_company: true profile_customer: true profile_member: true + search_api_excerpt: true simplenews: true diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index bf985fd0..a4e84715 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -140,6 +140,9 @@ module: options: 0 page_cache: 0 pagerer: 0 + password_policy_character_types: 0 + password_policy_characters: 0 + password_policy_length: 0 path: 0 path_alias: 0 path_alias_xt: 0 @@ -211,6 +214,7 @@ module: menu_link_content: 1 pathauto: 1 content_translation: 10 + password_policy: 10 views: 10 materio_id: 11 figli_starter_kit: 1000 diff --git a/config/sync/field.field.user.user.field_last_password_reset.yml b/config/sync/field.field.user.user.field_last_password_reset.yml new file mode 100644 index 00000000..e842e612 --- /dev/null +++ b/config/sync/field.field.user.user.field_last_password_reset.yml @@ -0,0 +1,29 @@ +uuid: 73d3ed49-160c-40c8-a311-2871335f8f51 +langcode: en +status: true +dependencies: + config: + - field.storage.user.field_last_password_reset + enforced: + module: + - password_policy + module: + - datetime + - user +_core: + default_config_hash: 9KNibQftQSQkxINz3CmNcDC0f6rp2Krw6lkJ2en-G7g +id: user.user.field_last_password_reset +field_name: field_last_password_reset +entity_type: user +bundle: user +label: 'Last Password Reset' +description: '' +required: false +translatable: false +default_value: + - + default_date_type: now + default_date: now +default_value_callback: '' +settings: { } +field_type: datetime diff --git a/config/sync/field.field.user.user.field_password_expiration.yml b/config/sync/field.field.user.user.field_password_expiration.yml new file mode 100644 index 00000000..56891926 --- /dev/null +++ b/config/sync/field.field.user.user.field_password_expiration.yml @@ -0,0 +1,29 @@ +uuid: 79063e66-e4d1-483a-b332-9456f7900381 +langcode: en +status: true +dependencies: + config: + - field.storage.user.field_password_expiration + enforced: + module: + - password_policy + module: + - user +_core: + default_config_hash: VmJSEF3eJIf_XB2mvMElbf3Z85-EXT87lFe_B7YdLKE +id: user.user.field_password_expiration +field_name: field_password_expiration +entity_type: user +bundle: user +label: 'Password Expiration' +description: 'The password will expire based on the number of days defined in the policy' +required: false +translatable: false +default_value: + - + value: 0 +default_value_callback: '' +settings: + on_label: 'Expired Password' + off_label: 'Non-expired Password' +field_type: boolean diff --git a/config/sync/field.storage.user.field_last_password_reset.yml b/config/sync/field.storage.user.field_last_password_reset.yml new file mode 100644 index 00000000..3f20e3e3 --- /dev/null +++ b/config/sync/field.storage.user.field_last_password_reset.yml @@ -0,0 +1,25 @@ +uuid: 7330ac5f-fe00-4d25-999c-7a2d5d4f089a +langcode: en +status: true +dependencies: + enforced: + module: + - password_policy + module: + - datetime + - user +_core: + default_config_hash: fe_vhJzBU4DNfc97fsLUU54pydpOw-caxcFMckk-UA4 +id: user.field_last_password_reset +field_name: field_last_password_reset +entity_type: user +type: datetime +settings: + datetime_type: datetime +module: datetime +locked: true +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/field.storage.user.field_password_expiration.yml b/config/sync/field.storage.user.field_password_expiration.yml new file mode 100644 index 00000000..f96534e6 --- /dev/null +++ b/config/sync/field.storage.user.field_password_expiration.yml @@ -0,0 +1,23 @@ +uuid: 44f6f9bc-d05a-439f-98f1-199867276f4b +langcode: en +status: true +dependencies: + enforced: + module: + - password_policy + module: + - user +_core: + default_config_hash: hZ92ctP_IPOvYwFWeh-8cu0xIcJJXuJ0nV-6IbQT3vM +id: user.field_password_expiration +field_name: field_password_expiration +entity_type: user +type: boolean +settings: { } +module: core +locked: true +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/password_policy.password_policy.default.yml b/config/sync/password_policy.password_policy.default.yml new file mode 100644 index 00000000..5081dccc --- /dev/null +++ b/config/sync/password_policy.password_policy.default.yml @@ -0,0 +1,24 @@ +uuid: 7935d18e-3e1a-4291-8c02-51b77205526d +langcode: fr +status: true +dependencies: { } +id: default +label: default +password_reset: 0 +policy_constraints: + - + id: character_types + character_types: 4 + - + id: password_length + character_length: 8 + character_operation: minimum +roles: + unverified: unverified + free_user: free_user + contact_company: contact_company + alpha_testeur: alpha_testeur + student: student + adherent: adherent + translator: translator + admin_showroom: admin_showroom diff --git a/config/sync/password_policy.settings.yml b/config/sync/password_policy.settings.yml new file mode 100644 index 00000000..5a66ca29 --- /dev/null +++ b/config/sync/password_policy.settings.yml @@ -0,0 +1,3 @@ +cron_threshold: 250 +_core: + default_config_hash: ylS3vsh8Ssk63Wrb_g1Np12zqe2qfK0NX4AOV1OYgLQ diff --git a/config/sync/ultimate_cron.job.password_policy_cron.yml b/config/sync/ultimate_cron.job.password_policy_cron.yml new file mode 100644 index 00000000..29c7f483 --- /dev/null +++ b/config/sync/ultimate_cron.job.password_policy_cron.yml @@ -0,0 +1,17 @@ +uuid: bc909506-6bc6-43f7-986e-990df8efa78f +langcode: en +status: true +dependencies: + module: + - password_policy +title: 'Default cron handler' +id: password_policy_cron +weight: 0 +module: password_policy +callback: password_policy_cron +scheduler: + id: simple +launcher: + id: serial +logger: + id: database diff --git a/web/modules/custom/materio_user/materio_user.module b/web/modules/custom/materio_user/materio_user.module index dbda3605..0c1277d7 100644 --- a/web/modules/custom/materio_user/materio_user.module +++ b/web/modules/custom/materio_user/materio_user.module @@ -82,7 +82,7 @@ function materio_user_form_user_modal_form_alter(&$form, FormStateInterface $for function _materio_user_process_password_confirm($element){ // ksm($element); - $element['pass1']['#description'] = t('Password must contains Lowercase and Uppercase Letters, numbers, and punctuation.'); + $element['pass1']['#description'] = t('Password must contains lowercase, uppercase, digits and special characters.'); $element['pass1']['#attributes'] += array( "v-model" => "pass1", "placeholder" => $element['pass1']['#title'], diff --git a/web/themes/custom/materiotheme/assets/dist/report.html b/web/themes/custom/materiotheme/assets/dist/report.html index af14958a..7d5c7b34 100644 --- a/web/themes/custom/materiotheme/assets/dist/report.html +++ b/web/themes/custom/materiotheme/assets/dist/report.html @@ -3,7 +3,7 @@
-