fix return on API call and fix id in clear for user

This commit is contained in:
Nicolas Lœuillet 2015-02-09 22:40:20 +01:00
parent 2a94b1d1b7
commit d29bfaf139
2 changed files with 4 additions and 7 deletions

View file

@ -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());

View file

@ -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);
}
}