Skip to content
Snippets Groups Projects
Commit a2d85805 authored by Dorian Merz's avatar Dorian Merz
Browse files

refs #12463:

* adds changeUserPin function to LiberoDingTrait
* changes relevant for finc-master
parent c6423eee
No related merge requests found
...@@ -386,6 +386,43 @@ trait LiberoDingTrait ...@@ -386,6 +386,43 @@ trait LiberoDingTrait
} }
/**
* This method sends a PIN changing request to the LiberoDing.
*
* @param array $patron Patron array returned by patronLogin method.
*
* @return array An associative array
*/
public function changeUserPin($newPin,$patron)
{
$params = $this->_getLiberoDingRequestParams();
$params['memberCode'] = $patron['cat_username'];
$params['password'] = $patron['cat_password'];
$params['newPin'] = $newPin;
try {
$result = $this->httpService->get(
$this->getWebScraperUrl() .'changeUserPin.jsp',
$params,
null,
$this->_getLiberoDingRequestHeaders()
);
} catch (\Exception $e) {
throw new ILSException($e->getMessage());
}
if (!$result->isSuccess()) {
// log error for debugging
$this->debug(
'HTTP status ' . $result->getStatusCode() .
' received'
);
return false;
}
return $this->_getLiberoDingResult($result, 'changeUserPinOk');
}
/** /**
* Get a mapping table to exchange general terms * Get a mapping table to exchange general terms
* of Libero and VuFind. * of Libero and VuFind.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment