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 bfa19766 authored by Jiří Kozlovský's avatar Jiří Kozlovský Committed by Demian Katz
Browse files

Enable saving also home_library to Library Card

- Implemented saving/creating new user_card with home_library attribute
parent 3bbc6d04
No related merge requests found
......@@ -543,12 +543,14 @@ class User extends RowGateway implements \VuFind\Db\Table\DbTableAwareInterface,
* @param string $cardName Card name
* @param string $username Username
* @param string $password Password
* @param string $homeLib Home Library
*
* @return int Card ID
* @throws \VuFind\Exception\LibraryCard
*/
public function saveLibraryCard($id, $cardName, $username, $password)
{
public function saveLibraryCard($id, $cardName, $username,
$password, $homeLib = ''
) {
if (!$this->libraryCardsEnabled()) {
throw new \VuFind\Exception\LibraryCard('Library Cards Disabled');
}
......@@ -576,6 +578,9 @@ class User extends RowGateway implements \VuFind\Db\Table\DbTableAwareInterface,
}
$row->card_name = $cardName;
$row->cat_username = $username;
if (!empty($homeLib)) {
$row->home_library = $homeLib;
}
if ($this->passwordEncryptionEnabled()) {
$row->cat_password = null;
$row->cat_pass_enc = $this->encryptOrDecrypt($password, true);
......
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