diff --git a/NetBiblio.php b/NetBiblio.php index 8985213..ba0d464 100644 --- a/NetBiblio.php +++ b/NetBiblio.php @@ -22,8 +22,6 @@ class NetBiblio extends WebService */ private function CheckSession() { - $_SESSION["user"]["login"] = 35; - if (! isset ($_SESSION["user"]["login"])) { return; } @@ -49,8 +47,7 @@ class NetBiblio extends WebService $this->checkSession(); - // $user = User::find($this->login); - $user = new User(array('login' => 35, 'id' => 511389)); + $user = User::find($this->login); if (!$user) { throw new AuthenticationException("UserNotFound", "No user found for '{$this->login}'.", AuthenticationException::USER_NOT_FOUND); @@ -508,6 +505,7 @@ class NetBiblio extends WebService $bs = new BookSearch(); $bs->addSortField('random_'.$seed); + $bs->addQuery(1, 'visible'); $results = $bs->getResults(0, $number); return $this->AddBookData($results['books']); } @@ -628,6 +626,9 @@ class NetBiblio extends WebService } } + // we only want visible books in search results + $bs->addQuery(1, 'visible'); + $count = isset($queryArray['count']) ? (int) $queryArray['count'] : Configuration::get('solr.result_count'); $start = isset($queryArray['page']) ? $queryArray['page'] * $count : 0;