From d29bfaf139975fae71b73ebb316da4ce2205fc92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 9 Feb 2015 22:40:20 +0100 Subject: fix return on API call and fix id in clear for user --- src/Wallabag/CoreBundle/Controller/WallabagRestController.php | 4 ++-- src/Wallabag/CoreBundle/Security/Firewall/WsseListener.php | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php index 1df18247..75e5204e 100644 --- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php @@ -43,7 +43,7 @@ class WallabagRestController extends Controller $entries = $this ->getDoctrine() ->getRepository('WallabagCoreBundle:Entry') - ->findEntries(1, $isArchived, $isStarred, $isDeleted, $sort, $order); + ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $isDeleted, $sort, $order); if (!is_array($entries)) { throw $this->createNotFoundException(); @@ -86,7 +86,7 @@ class WallabagRestController extends Controller $content = Extractor::extract($url); $entry = new Entry(); - $entry->setUserId(1); + $entry->setUserId($this->getUser()->getId()); $entry->setUrl($url); $entry->setTitle($request->request->get('title') ?: $content->getTitle()); $entry->setContent($content->getBody()); diff --git a/src/Wallabag/CoreBundle/Security/Firewall/WsseListener.php b/src/Wallabag/CoreBundle/Security/Firewall/WsseListener.php index d815d536..1296cb1f 100644 --- a/src/Wallabag/CoreBundle/Security/Firewall/WsseListener.php +++ b/src/Wallabag/CoreBundle/Security/Firewall/WsseListener.php @@ -44,6 +44,8 @@ class WsseListener implements ListenerInterface $authToken = $this->authenticationManager->authenticate($token); $this->securityContext->setToken($authToken); + + return; } catch (AuthenticationException $failed) { $failedMessage = 'WSSE Login failed for '.$token->getUsername().'. Why ? '.$failed->getMessage(); $this->logger->err($failedMessage); @@ -56,10 +58,5 @@ class WsseListener implements ListenerInterface return; } - - // By default deny authorization - $response = new Response(); - $response->setStatusCode(403); - $event->setResponse($response); } } -- cgit v1.2.3