Skip to content
Snippets Groups Projects
Commit e9ab73e6 authored by Moreau Elise's avatar Moreau Elise
Browse files

resolve conflicts in files

parent 1751a270
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ class AddUserGroupAction extends GroupAction ...@@ -35,7 +35,7 @@ class AddUserGroupAction extends GroupAction
->withHeader('Location', '/groups/' . $groupId) ->withHeader('Location', '/groups/' . $groupId)
->withStatus(302); ->withStatus(302);
} }
$currentUser->addGroup($group); $currentUser->addGroup($group);
$this->em->persist($group); $this->em->persist($group);
$this->em->flush(); $this->em->flush();
......
...@@ -23,12 +23,12 @@ class CreateGroupAction extends GroupAction ...@@ -23,12 +23,12 @@ class CreateGroupAction extends GroupAction
->withHeader('Location', '/login') ->withHeader('Location', '/login')
->withStatus(302); ->withStatus(302);
} }
$currentUser = $this->em->getRepository('App\Domain\User\User')->find($_SESSION['userId']); $currentUser = $this->em->getRepository('App\Domain\User\User')->find($_SESSION['userId']);
$groupname = $parsedRequestBody['name']; $groupname = $parsedRequestBody['name'];
$description = $parsedRequestBody['description']; $description = $parsedRequestBody['description'];
$private = isset($parsedRequestBody['private']) ? 1 : 0; $private = isset($parsedRequestBody['private']) ? 1 : 0;
if ($this->groupRepository->findOneBy(array('name' => $groupname))){ if ($this->groupRepository->findOneBy(array('name' => $groupname))){
return $this->twig->render( return $this->twig->render(
$this->response, "/group/create_group.twig", $this->response, "/group/create_group.twig",
...@@ -41,9 +41,9 @@ class CreateGroupAction extends GroupAction ...@@ -41,9 +41,9 @@ class CreateGroupAction extends GroupAction
) )
); );
} }
$group = new Group(null, $groupname, $description, $currentUser, $private); $group = new Group(null, $groupname, $description, $currentUser, $private);
$currentUser->addGroup($group); $currentUser->addGroup($group);
$this->em->persist($group); $this->em->persist($group);
$this->em->flush(); $this->em->flush();
......
...@@ -12,7 +12,7 @@ class ViewModifyGroupForm extends GroupAction ...@@ -12,7 +12,7 @@ class ViewModifyGroupForm extends GroupAction
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function action(): Response protected function action(): Response
{ {
if(!isset($_SESSION['userId'])){ if(!isset($_SESSION['userId'])){
$this->flash->addMessage('login', 'Please log in or sign up.'); $this->flash->addMessage('login', 'Please log in or sign up.');
...@@ -20,12 +20,12 @@ class ViewModifyGroupForm extends GroupAction ...@@ -20,12 +20,12 @@ class ViewModifyGroupForm extends GroupAction
->withHeader('Location', '/login') ->withHeader('Location', '/login')
->withStatus(302); ->withStatus(302);
} }
$parsedRequestBody = (array)$this->request->getParsedBody(); $parsedRequestBody = (array)$this->request->getParsedBody();
$groupId = (int) $this->resolveArg('id'); $groupId = (int) $this->resolveArg('id');
$group = $this->groupRepository->find($groupId); $group = $this->groupRepository->find($groupId);
if (!isset($group)) { if (!isset($group)) {
throw new GroupNotFoundException(); throw new GroupNotFoundException();
} }
...@@ -35,7 +35,7 @@ class ViewModifyGroupForm extends GroupAction ...@@ -35,7 +35,7 @@ class ViewModifyGroupForm extends GroupAction
->withHeader('Location', '/account') ->withHeader('Location', '/account')
->withStatus(302); ->withStatus(302);
} }
return $this->twig->render($this->response, "/group/modify_group.twig", ["group" => $group, "session" => $_SESSION]); return $this->twig->render($this->response, "/group/modify_group.twig", ["group" => $group, "session" => $_SESSION]);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment