Skip to content

Commit

Permalink
Merge pull request #144 from multnomah-county-it/dev
Browse files Browse the repository at this point in the history
Patron password reset bug fix
  • Loading branch information
john-c-houser authored Feb 21, 2024
2 parents ebac45d + 0c7a703 commit 897506c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Libilsws.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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');
}

/**
Expand Down
10 changes: 3 additions & 7 deletions test/reset_patron_password.php
Original file line number Diff line number Diff line change
Expand Up @@ -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=<RESET_PASSWORD_TOKEN>'

// Initialize
Expand All @@ -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";

Expand Down

0 comments on commit 897506c

Please sign in to comment.