Skip to content

Commit

Permalink
LibraryCardController: use entity interfaces. (#3588)
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Apr 17, 2024
1 parent 8137f22 commit 97ed402
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -100,15 +100,15 @@ public function editCardAction()
$card = $user->getLibraryCard($id == 'NEW' ? null : $id);

$target = null;
$username = $card->cat_username;
$username = $card->getCatUsername();

$loginSettings = $this->getILSLoginSettings();
// Split target and username if multiple login targets are available:
if ($loginSettings['targets'] && strstr($username, '.')) {
[$target, $username] = explode('.', $username, 2);
}

$cardName = $this->params()->fromPost('card_name', $card->card_name);
$cardName = $this->params()->fromPost('card_name', $card->getCardName());
$username = $this->params()->fromPost('username', $username);
$target = $this->params()->fromPost('target', $target);

Expand Down Expand Up @@ -203,7 +203,7 @@ public function selectCardAction()
try {
$catalog = $this->getILS();
$patron = $catalog->patronLogin(
$user->cat_username,
$user->getCatUsername(),
$this->getILSAuthenticator()->getCatPasswordForUser($user)
);
if (!$patron) {
Expand Down Expand Up @@ -290,7 +290,7 @@ protected function processEditLibraryCard($user)
// Check the credentials if the username is changed or a new password is
// entered:
$card = $user->getLibraryCard($id == 'NEW' ? null : $id);
if ($card->cat_username !== $username || trim($password)) {
if ($card->getCatUsername() !== $username || trim($password)) {
// Connect to the ILS and check that the credentials are correct:
$loginMethod = $this->getILSLoginMethod($target);
if (
Expand Down

0 comments on commit 97ed402

Please sign in to comment.