The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

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 ...@@ -16,4 +16,12 @@ ILLRequests = true
source = VuFind source = VuFind
; Query to use for record retrieval ; Query to use for record retrieval
query = "*:*" query = "*:*"
\ No newline at end of file
; 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 ...@@ -573,6 +573,13 @@ class Demo extends AbstractBase
*/ */
public function patronLogin($barcode, $password) 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 = [];
$user['id'] = trim($barcode); $user['id'] = trim($barcode);
...@@ -599,7 +606,7 @@ class Demo extends AbstractBase ...@@ -599,7 +606,7 @@ class Demo extends AbstractBase
public function getMyProfile($patron) public function getMyProfile($patron)
{ {
$patron = [ $patron = [
'firstname' => 'Lib', 'firstname' => 'Lib-' . $patron['cat_username'],
'lastname' => 'Rarian', 'lastname' => 'Rarian',
'address1' => 'Somewhere...', 'address1' => 'Somewhere...',
'address2' => 'Over the Rainbow', '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