Skip to content
Snippets Groups Projects
Commit b654b029 authored by Demian Katz's avatar Demian Katz
Browse files

Added simulated user management to Demo ILS driver.

parent 2a9c664a
No related merge requests found
......@@ -16,4 +16,12 @@ ILLRequests = true
source = VuFind
; Query to use for record retrieval
query = "*:*"
\ No newline at end of file
query = "*:*"
; This section can be used to create a set of fake users recognized by the
; Demo driver. If it is uncommented, only usernames and passwords listed here
; will be recognized for ILS login. If it is commented out, all username/password
; combinations will be accepted.
;[Users]
;user1 = "password1"
;user2 = "password2"
\ No newline at end of file
......@@ -573,6 +573,13 @@ class Demo extends AbstractBase
*/
public function patronLogin($barcode, $password)
{
if (isset($this->config['Users'])) {
if (!isset($this->config['Users'][$barcode])
|| $password !== $this->config['Users'][$barcode]
) {
return null;
}
}
$user = [];
$user['id'] = trim($barcode);
......@@ -599,7 +606,7 @@ class Demo extends AbstractBase
public function getMyProfile($patron)
{
$patron = [
'firstname' => 'Lib',
'firstname' => 'Lib-' . $patron['cat_username'],
'lastname' => 'Rarian',
'address1' => 'Somewhere...',
'address2' => 'Over the Rainbow',
......
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