Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MOREAU Elise
project-covid
Commits
b758841b
Commit
b758841b
authored
Oct 31, 2020
by
Moreau Elise
Browse files
add messages and redirection if current user not logged
parent
fe4cac7f
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/Application/Actions/Group/AddUserGroupAction.php
View file @
b758841b
...
...
@@ -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'
)
...
...
src/Application/Actions/Group/CreateGroupAction.php
View file @
b758841b
...
...
@@ -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'
)
...
...
src/Application/Actions/Group/DeleteGroupAction.php
View file @
b758841b
...
...
@@ -15,13 +15,13 @@ 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'
)
->
withStatus
(
302
);
}
$groupId
=
(
int
)
$this
->
resolveArg
(
'id'
);
$group
=
$this
->
groupRepository
->
find
(
$groupId
);
...
...
@@ -34,7 +34,7 @@ class DeleteGroupAction extends GroupAction
->
withHeader
(
'Location'
,
'/account'
)
->
withStatus
(
302
);
}
$this
->
em
->
remove
(
$group
);
$this
->
em
->
flush
();
...
...
src/Application/Actions/Group/ViewModifyGroupForm.php
View file @
b758841b
...
...
@@ -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'
)
...
...
src/Application/Actions/User/CreateUserAction.php
View file @
b758841b
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment