aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-09 22:40:20 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-09 22:40:20 +0100
commitd29bfaf139975fae71b73ebb316da4ce2205fc92 (patch)
tree10970e77e8478b90fe8d0c55f06d90d4443b8a91 /src/Wallabag/CoreBundle
parent2a94b1d1b74b4e776e76a522621b67b45d115fe7 (diff)
downloadwallabag-d29bfaf139975fae71b73ebb316da4ce2205fc92.tar.gz
wallabag-d29bfaf139975fae71b73ebb316da4ce2205fc92.tar.zst
wallabag-d29bfaf139975fae71b73ebb316da4ce2205fc92.zip
fix return on API call and fix id in clear for user
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r--src/Wallabag/CoreBundle/Controller/WallabagRestController.php4
-rw-r--r--src/Wallabag/CoreBundle/Security/Firewall/WsseListener.php7
2 files changed, 4 insertions, 7 deletions
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
43 $entries = $this 43 $entries = $this
44 ->getDoctrine() 44 ->getDoctrine()
45 ->getRepository('WallabagCoreBundle:Entry') 45 ->getRepository('WallabagCoreBundle:Entry')
46 ->findEntries(1, $isArchived, $isStarred, $isDeleted, $sort, $order); 46 ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $isDeleted, $sort, $order);
47 47
48 if (!is_array($entries)) { 48 if (!is_array($entries)) {
49 throw $this->createNotFoundException(); 49 throw $this->createNotFoundException();
@@ -86,7 +86,7 @@ class WallabagRestController extends Controller
86 86
87 $content = Extractor::extract($url); 87 $content = Extractor::extract($url);
88 $entry = new Entry(); 88 $entry = new Entry();
89 $entry->setUserId(1); 89 $entry->setUserId($this->getUser()->getId());
90 $entry->setUrl($url); 90 $entry->setUrl($url);
91 $entry->setTitle($request->request->get('title') ?: $content->getTitle()); 91 $entry->setTitle($request->request->get('title') ?: $content->getTitle());
92 $entry->setContent($content->getBody()); 92 $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
44 $authToken = $this->authenticationManager->authenticate($token); 44 $authToken = $this->authenticationManager->authenticate($token);
45 45
46 $this->securityContext->setToken($authToken); 46 $this->securityContext->setToken($authToken);
47
48 return;
47 } catch (AuthenticationException $failed) { 49 } catch (AuthenticationException $failed) {
48 $failedMessage = 'WSSE Login failed for '.$token->getUsername().'. Why ? '.$failed->getMessage(); 50 $failedMessage = 'WSSE Login failed for '.$token->getUsername().'. Why ? '.$failed->getMessage();
49 $this->logger->err($failedMessage); 51 $this->logger->err($failedMessage);
@@ -56,10 +58,5 @@ class WsseListener implements ListenerInterface
56 58
57 return; 59 return;
58 } 60 }
59
60 // By default deny authorization
61 $response = new Response();
62 $response->setStatusCode(403);
63 $event->setResponse($response);
64 } 61 }
65} 62}