IPN-Vorschlagslogik um Konfiguration erweitert

This commit is contained in:
Marcel Diegelmann 2025-09-25 10:26:34 +02:00
parent 3100c83246
commit a2f53290f4
14 changed files with 163 additions and 51 deletions

View file

@ -9,7 +9,6 @@ parameters:
# This is used as workaround for places where we can not access the settings directly (like the 2FA application names)
partdb.title: '%env(string:settings:customization:instanceName)%' # The title shown inside of Part-DB (e.g. in the navbar and on homepage)
partdb.locale_menu: ['en', 'de', 'it', 'fr', 'ru', 'ja', 'cs', 'da', 'zh', 'pl'] # The languages that are shown in user drop down menu
partdb.autocomplete_part_digits: '%env(trim:string:AUTOCOMPLETE_PART_DIGITS)%' # The number of digits used for the incremental numbering of parts in the IPN (Internal Part Number) autocomplete system.
partdb.default_uri: '%env(string:DEFAULT_URI)%' # The default URI to use for the Part-DB instance (e.g. https://part-db.example.com/). This is used for generating links in emails
@ -20,7 +19,6 @@ parameters:
######################################################################################################################
partdb.gdpr_compliance: true # If this option is activated, IP addresses are anonymized to be GDPR compliant
partdb.users.email_pw_reset: '%env(bool:ALLOW_EMAIL_PW_RESET)%' # Config if users are able, to reset their password by email. By default this enabled, when a mail server is configured.
partdb.users.enforce_unique_ipn: '%env(bool:ENFORCE_UNIQUE_IPN)%' # Config if users are able, to enter an already available IPN. In this case a unique increment is appended to the user input.
######################################################################################################################
# Mail settings

View file

@ -231,28 +231,16 @@ services:
tags:
- { name: 'doctrine.fixtures.purger_factory', alias: 'reset_autoincrement_purger' }
App\Controller\PartController:
bind:
$autocompletePartDigits: '%partdb.autocomplete_part_digits%'
App\Controller\TypeaheadController:
bind:
$autocompletePartDigits: '%partdb.autocomplete_part_digits%'
App\Repository\PartRepository:
arguments:
$translator: '@translator'
tags: ['doctrine.repository_service']
App\EventSubscriber\UserSystem\PartUniqueIpnSubscriber:
arguments:
$enforceUniqueIpn: '%partdb.users.enforce_unique_ipn%'
tags:
- { name: doctrine.event_subscriber }
App\Validator\Constraints\UniquePartIpnValidator:
arguments:
$enforceUniqueIpn: '%partdb.users.enforce_unique_ipn%'
tags: [ 'validator.constraint_validator' ]
# We are needing this service inside a migration, where only the container is injected. So we need to define it as public, to access it from the container.