From 0c7a703841e7ed72058527792f1d4d35a85493ae Mon Sep 17 00:00:00 2001 From: John Houser <90853393+john-c-houser@users.noreply.github.com> Date: Wed, 21 Feb 2024 09:58:11 -0800 Subject: [PATCH] Patron password reset bug fix --- src/Libilsws.php | 4 ++-- test/reset_patron_password.php | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Libilsws.php b/src/Libilsws.php index 46ba3f5..68f6c92 100644 --- a/src/Libilsws.php +++ b/src/Libilsws.php @@ -1304,7 +1304,7 @@ public function change_patron_password ($token = null, $json = null, $role = 'PA $client_id = $this->config['ilsws']['client_id']; } - return $this->send_query("$this->base_url/user/patron/changeMyPassword", $token, $json, $role, $client_id); + return $this->send_query("$this->base_url/user/patron/changeMyPassword", $token, $json, 'POST', $role, $client_id); } /** @@ -1339,7 +1339,7 @@ public function reset_patron_password ($token = null, $patron_id = null, $url = $json = json_encode($data); - return $this->send_query("$this->base_url/user/patron/resetMyPassword", $token, $json, 'POST', 'STAFF'); + return $this->send_query("$this->base_url/user/patron/resetMyPassword", $token, $json, 'POST'); } /** diff --git a/test/reset_patron_password.php b/test/reset_patron_password.php index 722aa9d..5e6b974 100644 --- a/test/reset_patron_password.php +++ b/test/reset_patron_password.php @@ -2,14 +2,13 @@ require_once 'vendor/autoload.php'; -if ( count($argv) < 4 ) { - print "Syntax: php $argv[0] BARCODE CALLBACK_URL EMAIL\n"; +if ( count($argv) < 3 ) { + print "Syntax: php $argv[0] BARCODE CALLBACK_URL\n"; exit; } $barcode = $argv[1]; $url = $argv[2]; -$email = $argv[3]; # Example callback URL: 'https://multcolib.io/contact/reset_password?token=' // Initialize @@ -18,10 +17,7 @@ // Connect and get token $token = $ilsws->connect(); -$role = 'PATRON'; // Used in the SD-Preferred-Role HTTP header -$client_id = 'QUIPU'; // Used in the x-sirs-clientID HTTP header - -$response = $ilsws->reset_patron_password($token, $barcode, $url, $email, $role, $client_id); +$response = $ilsws->reset_patron_password($token, $barcode, $url); $json = json_encode($response, JSON_PRETTY_PRINT); print "$json\n\n";