/**
  * Save alert schedule for a saved search into DB
  *
  * @return mixed
  */
 public function savesearchAction()
 {
     $user = $this->getUser();
     if ($user == false) {
         return $this->forceLogin();
     }
     $schedule = $this->params()->fromQuery('schedule', false);
     $sid = $this->params()->fromQuery('searchid', false);
     if ($schedule !== false && $sid !== false) {
         $search = $this->getTable('Search');
         $baseurl = rtrim($this->getServerUrl('home'), '/');
         $row = $search->select(['id' => $sid, 'user_id' => $user->id])->current();
         if ($row) {
             $row->setSchedule($schedule, $baseurl);
         }
         return $this->redirect()->toRoute('search-history');
     } else {
         parent::savesearchAction();
     }
 }
 /**
  * User login action -- clear any previous follow-up information prior to
  * triggering a login process. This is used for explicit login links within
  * the UI to differentiate them from contextual login links that are triggered
  * by attempting to access protected actions.
  *
  * @return mixed
  */
 public function userloginAction()
 {
     $forward = parent::userloginAction();
     if ($this->inLightbox()) {
         $this->clearFollowupUrl();
     }
     return $forward;
 }
 /**
  * Send list of fines to view
  *
  * @return mixed
  */
 public function finesAction()
 {
     // Stop now if the user does not have valid catalog credentials available:
     if (!is_array($patron = $this->catalogLogin())) {
         return $patron;
     }
     $view = $this->createViewIfUnsupported('getMyFines');
     if ($view === false) {
         $view = parent::finesAction();
         $view->profile = $this->getCatalogProfile();
         if (isset($patron['source'])) {
             $result = $this->handleOnlinePayment($patron, $view->fines, $view);
         }
     }
     return $view;
 }
 /**
  * Login Action
  *
  * @return mixed
  */
 public function loginAction()
 {
     return parent::loginAction();
 }
 public function profileAction()
 {
     // Stop now if the user does not have valid catalog credentials available:
     if (!is_array($patron = $this->catalogLogin())) {
         return $patron;
     }
     $view = parent::profileAction();
     if ($view) {
         $catalog = $this->getILS();
         $view->profileChange = $catalog->checkCapability('changeUserRequest');
     }
     $this->flashExceptions($this->flashMessenger());
     return $view;
 }