Commit b758841b authored by Moreau Elise's avatar Moreau Elise
Browse files

add messages and redirection if current user not logged

parent fe4cac7f
......@@ -15,7 +15,7 @@ class AddUserGroupAction extends GroupAction
protected function action(): Response
{
if(!isset($_SESSION['userId'])){
$this->flash->addMessage('login', 'Please log in or sign up.');
$this->flash->addMessage('message', 'Please log in or sign up.');
return $this->response
->withHeader('Location', '/login')
......
......@@ -17,7 +17,7 @@ class CreateGroupAction extends GroupAction
$parsedRequestBody = (array)$this->request->getParsedBody();
if(!isset($_SESSION['userId'])){
$this->flash->addMessage('login', 'Please log in or sign up.');
$this->flash->addMessage('message', 'Please log in or sign up.');
return $this->response
->withHeader('Location', '/login')
......
......@@ -15,7 +15,7 @@ class DeleteGroupAction extends GroupAction
protected function action(): Response
{
if(!isset($_SESSION['userId'])){
$this->flash->addMessage('login', 'Please log in or sign up.');
$this->flash->addMessage('message', 'Please log in or sign up.');
return $this->response
->withHeader('Location', '/login')
......
......@@ -14,7 +14,7 @@ class ViewModifyGroupForm extends GroupAction
protected function action(): Response
{
if(!isset($_SESSION['userId'])){
$this->flash->addMessage('login', 'Please log in or sign up.');
$this->flash->addMessage('message', 'Please log in or sign up.');
return $this->response
->withHeader('Location', '/login')
......
......@@ -89,7 +89,7 @@ class CreateUserAction extends UserAction
$this->logger->info("User has been created.");
$this->flash->addMessage('creation', 'Your account has been created. Please log in.');
$this->flash->addMessage('message', 'Your account has been created. Please log in.');
return $this->response
->withHeader('Location', '/login')
->withStatus(302);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment