From 255f821e8dc4ef6a65433c48c7319616eab76ca2 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Sun, 30 Nov 2025 08:45:58 +0200 Subject: [PATCH] PasswordAuthenticator --- .../Transmogrify/config/schema/tables.json | 25 +++++++++++++++++++ .../src/Lib/Traits/RowTransformationTrait.php | 1 + .../src/Lib/Traits/TypeMapperTrait.php | 12 +++++---- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/app/plugins/Transmogrify/config/schema/tables.json b/app/plugins/Transmogrify/config/schema/tables.json index 264ec440..6fc39279 100644 --- a/app/plugins/Transmogrify/config/schema/tables.json +++ b/app/plugins/Transmogrify/config/schema/tables.json @@ -372,6 +372,21 @@ "cache": ["authenticator_id"], "addChangelog": true }, + "password_authenticators": { + "source": "cm_password_authenticators", + "displayField": "id", + "plugin": "PasswordAuthenticator", + "cache": ["authenticator_id"], + "booleans": [ + "format_crypt_php", + "format_plaintext", + "format_sha1_ldap" + ], + "fieldMap": { + "password_source": "source_mode" + }, + "addChangelog": true + }, "__NOTES__": "DATA MIGRATIONS", "authentication_events": { "source": "cm_authentication_events", @@ -407,6 +422,16 @@ "co_person_id": "person_id" } }, + "passwords": { + "source": "cm_passwords", + "displayField": "id", + "plugin": "PasswordAuthenticator", + "cache": ["person_id", "password_authenticator_id"], + "fieldMap": { + "co_person_id": "person_id", + "password_type": "type" + } + }, "person_roles": { "source": "cm_co_person_roles", "sqlSelect": "roleSqlSelect", diff --git a/app/plugins/Transmogrify/src/Lib/Traits/RowTransformationTrait.php b/app/plugins/Transmogrify/src/Lib/Traits/RowTransformationTrait.php index 9e0bae45..ae0c71ea 100644 --- a/app/plugins/Transmogrify/src/Lib/Traits/RowTransformationTrait.php +++ b/app/plugins/Transmogrify/src/Lib/Traits/RowTransformationTrait.php @@ -608,6 +608,7 @@ private function performFunctionMapping(array &$row, string $oldname, string $fu } } + /** * Apply a default value only when the current value is strictly null. * diff --git a/app/plugins/Transmogrify/src/Lib/Traits/TypeMapperTrait.php b/app/plugins/Transmogrify/src/Lib/Traits/TypeMapperTrait.php index 0688267f..016c4c20 100644 --- a/app/plugins/Transmogrify/src/Lib/Traits/TypeMapperTrait.php +++ b/app/plugins/Transmogrify/src/Lib/Traits/TypeMapperTrait.php @@ -102,7 +102,7 @@ trait TypeMapperTrait ]; - /** + /** * Map match attribute types to corresponding model names * * @var array @@ -201,7 +201,7 @@ protected function mapAffiliationType(array $row, ?int $coId = null): ?int return $this->mapType( $row, 'PersonRoles.affiliation_type', - $coId ?? $this->findCoId($row), + $coId ?? $this->findCoId($row), $type ); } @@ -231,13 +231,13 @@ protected function mapCoIdFromApiUserId(array $row): ?int { */ protected function mapApiIdFromCache(array $row): ?int { $apis = $this->cache['apis'] ?? null; - + if ($apis === null) { return null; } - + $orgIdentitySourceId = $row['org_identity_source_id'] ?? $row["external_identity_source_id"] ?? null; - + if ($orgIdentitySourceId === null) { null; } @@ -597,6 +597,7 @@ protected function mapLoginIdentifiers(array $origRow, array &$row): void { } } + /** * Map name type to corresponding type ID * @@ -760,6 +761,7 @@ protected function mapPetitionStatus(array $row): ?string }; } + /** * Get a default Pronoun type ID *