Browse Source

installed password policy, retype password contraint instructions

bach 2 years ago
parent
commit
cdee9e41a3

+ 1 - 0
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",

+ 62 - 1
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",

+ 17 - 0
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:

+ 5 - 0
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

+ 5 - 0
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

+ 18 - 0
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

+ 4 - 0
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

+ 29 - 0
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

+ 29 - 0
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

+ 25 - 0
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

+ 23 - 0
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

+ 24 - 0
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

+ 3 - 0
config/sync/password_policy.settings.yml

@@ -0,0 +1,3 @@
+cron_threshold: 250
+_core:
+  default_config_hash: ylS3vsh8Ssk63Wrb_g1Np12zqe2qfK0NX4AOV1OYgLQ

+ 17 - 0
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

+ 1 - 1
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'],

File diff suppressed because it is too large
+ 1 - 1
web/themes/custom/materiotheme/assets/dist/report.html


Some files were not shown because too many files changed in this diff