Skip to content

Commit

Permalink
Fixed history for posts uploaded anonymously
Browse files Browse the repository at this point in the history
Until now posts uploaded anonymously were not so anonymous - the author
was clearly visible in post history (and tag history if the upload has
led to creation of any new tags). Both of these are fixed now.
  • Loading branch information
Marcin Kurczewski committed Dec 14, 2014
1 parent 8a33b95 commit 839e97b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Services/PostService.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,13 @@ public function createPost(UploadFormData $formData)
{
$formData->validate($this->validator);

if ($formData->anonymous)
$this->authService->loginAnonymous();

$post = new Post();
$post->setUploadTime($this->timeService->getCurrentTime());
$post->setLastEditTime($this->timeService->getCurrentTime());
$post->setUser($formData->anonymous ? null : $this->authService->getLoggedInUser());
$post->setUser($this->authService->getLoggedInUser());
$post->setOriginalFileName($formData->contentFileName);
$post->setName($this->getUniqueRandomPostName());

Expand Down

0 comments on commit 839e97b

Please sign in to comment.