From 1759b79b289f84874ba3cec70f4215bfcab67862 Mon Sep 17 00:00:00 2001 From: Masayuki Nii Date: Sun, 23 Jun 2024 16:03:27 +0900 Subject: [PATCH] getProxy method can work without any dummy db operation. --- samples/Auth_Support/User_Enrollment/confirm.php | 5 ++--- spec/Manual-Tests/SAML-Test.md | 4 ++++ src/php/DB/Proxy_ExtSupport.php | 3 ++- src/php/DB/Support/DB_Auth_Handler_FileMaker_DataAPI.php | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/samples/Auth_Support/User_Enrollment/confirm.php b/samples/Auth_Support/User_Enrollment/confirm.php index 71391fc18..e48ecffee 100644 --- a/samples/Auth_Support/User_Enrollment/confirm.php +++ b/samples/Auth_Support/User_Enrollment/confirm.php @@ -48,10 +48,8 @@ public function getTargetUserId(string $password): ?string "records" => 1, ], ]; - $this->dbInit($dSource, [], ["db-class" => "PDO"], 2); - $this->dbRead('mailtemplate'); // Dummy read for setting up the Proxy object. - $proxy = $this->getExtProxy(); + $this->dbInit($dSource, [], ["db-class" => "PDO"], 2); $result = $proxy->userEnrollmentActivateUser($_GET['c'], $password, 'initialPassword'); return $result; } @@ -59,6 +57,7 @@ public function getTargetUserId(string $password): ?string public function updateUserRecord(string $userId): void { $this->dbRead('authuser', ["id" => $userId]); + // For additional processing after creating user record. } } diff --git a/spec/Manual-Tests/SAML-Test.md b/spec/Manual-Tests/SAML-Test.md index 805e012df..0f3d3b17c 100644 --- a/spec/Manual-Tests/SAML-Test.md +++ b/spec/Manual-Tests/SAML-Test.md @@ -10,6 +10,10 @@ which just have test accounts. After someone tests the SAML features, the result The format of below is: [commit code from git log], [Version from composer.json], [Checker name], [Result] +- commit 1f0eca34f4e4e859a5533cf3a7c9a3306f0903f0 (Wed Jun 19 12:19:35 2024 +0900), + INTER-Mediator Ver.13(2024-04-26) with SimpleSAMLphp Ver.2.2.2, + by Masayuki Nii(2024-06-22 11:00), OK + - commit d1f52043b2670c518c7bd5c81e9997d5007afbc8 (Fri May 3 09:20:41 2024 +0900), INTER-Mediator Ver.13(2024-04-26) with SimpleSAMLphp Ver.2.2.2, by Masayuki Nii(2024-05-03 12:30), OK diff --git a/src/php/DB/Proxy_ExtSupport.php b/src/php/DB/Proxy_ExtSupport.php index f0e43016c..599da2fbd 100644 --- a/src/php/DB/Proxy_ExtSupport.php +++ b/src/php/DB/Proxy_ExtSupport.php @@ -47,7 +47,8 @@ trait Proxy_ExtSupport public function getExtProxy(): ?Proxy { if(!$this->extProxy){ - throw new Exception("The proxy object doesn't instanciate so far."); + $this->dbInit(); + $this->initializeSpec("", null); } return $this->extProxy; } diff --git a/src/php/DB/Support/DB_Auth_Handler_FileMaker_DataAPI.php b/src/php/DB/Support/DB_Auth_Handler_FileMaker_DataAPI.php index 2f6a633a2..2b8a7fecf 100644 --- a/src/php/DB/Support/DB_Auth_Handler_FileMaker_DataAPI.php +++ b/src/php/DB/Support/DB_Auth_Handler_FileMaker_DataAPI.php @@ -895,7 +895,7 @@ public function authSupportUserEnrollmentEnrollingUser(string $hash): ?string } $this->fmdb->setupFMDataAPIforAuth($hashTable, 1); $conditions = array( - array('hasu' => $hash, 'clienthost' => '=', 'expired' => IMUtil::currentDTStringFMS(3600) . '...') + array('hash' => $hash, 'clienthost' => '=', 'expired' => IMUtil::currentDTStringFMS(3600) . '...') ); $result = null; // For PHPStan level 1 try {