diff --git a/src/Application/Actions/Group/AddUserGroupAction.php b/src/Application/Actions/Group/AddUserGroupAction.php index 1a7fe7b3254477cee9f8e1d7ec93449e266534bc..ee30f0eb993853f41d9f2fc068bb4ae01ca73b8b 100755 --- a/src/Application/Actions/Group/AddUserGroupAction.php +++ b/src/Application/Actions/Group/AddUserGroupAction.php @@ -35,7 +35,7 @@ class AddUserGroupAction extends GroupAction ->withHeader('Location', '/groups/' . $groupId) ->withStatus(302); } - $currentUser->addGroup($group); + $currentUser->addGroup($group); $this->em->persist($group); $this->em->flush(); diff --git a/src/Application/Actions/Group/CreateGroupAction.php b/src/Application/Actions/Group/CreateGroupAction.php index 058a3cd2f40ce7e349f20013bf78adef9de9b484..bd86d84d2728a777ebc2a972cba4ce2260e03290 100755 --- a/src/Application/Actions/Group/CreateGroupAction.php +++ b/src/Application/Actions/Group/CreateGroupAction.php @@ -23,12 +23,12 @@ class CreateGroupAction extends GroupAction ->withHeader('Location', '/login') ->withStatus(302); } - + $currentUser = $this->em->getRepository('App\Domain\User\User')->find($_SESSION['userId']); $groupname = $parsedRequestBody['name']; $description = $parsedRequestBody['description']; $private = isset($parsedRequestBody['private']) ? 1 : 0; - + if ($this->groupRepository->findOneBy(array('name' => $groupname))){ return $this->twig->render( $this->response, "/group/create_group.twig", @@ -41,9 +41,9 @@ class CreateGroupAction extends GroupAction ) ); } - + $group = new Group(null, $groupname, $description, $currentUser, $private); - $currentUser->addGroup($group); + $currentUser->addGroup($group); $this->em->persist($group); $this->em->flush(); diff --git a/src/Application/Actions/Group/ViewModifyGroupForm.php b/src/Application/Actions/Group/ViewModifyGroupForm.php index e961c8375faaacdeb40a27f98c80284c172209ea..1ff41cbcb09dbb3f4b9647b9836b9416061ec499 100644 --- a/src/Application/Actions/Group/ViewModifyGroupForm.php +++ b/src/Application/Actions/Group/ViewModifyGroupForm.php @@ -12,7 +12,7 @@ class ViewModifyGroupForm extends GroupAction * {@inheritdoc} */ protected function action(): Response - { + { if(!isset($_SESSION['userId'])){ $this->flash->addMessage('login', 'Please log in or sign up.'); @@ -20,12 +20,12 @@ class ViewModifyGroupForm extends GroupAction ->withHeader('Location', '/login') ->withStatus(302); } - + $parsedRequestBody = (array)$this->request->getParsedBody(); $groupId = (int) $this->resolveArg('id'); $group = $this->groupRepository->find($groupId); - + if (!isset($group)) { throw new GroupNotFoundException(); } @@ -35,7 +35,7 @@ class ViewModifyGroupForm extends GroupAction ->withHeader('Location', '/account') ->withStatus(302); } - + return $this->twig->render($this->response, "/group/modify_group.twig", ["group" => $group, "session" => $_SESSION]); } }