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
MilderJoghurt
rlf-server
Commits
a09e441b
Commit
a09e441b
authored
May 27, 2015
by
Fjen Undso
Browse files
Controllers: check if session is open when adding votes/questions
parent
eef1b57e
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/controllers/QuestionController.java
View file @
a09e441b
...
...
@@ -12,10 +12,14 @@ import play.mvc.Result;
public
class
QuestionController
extends
Controller
{
public
static
Result
createAnswer
(
String
sid
)
{
// TODO: open check
Session
session
=
Session
.
find
.
byId
(
sid
);
if
(
session
==
null
)
{
return
notFound
(
"session not found"
);
}
if
(!
session
.
open
)
{
return
forbidden
(
"session not open"
);
}
JsonNode
json
=
request
().
body
().
asJson
();
if
(
json
==
null
)
{
...
...
app/controllers/VoteController.java
View file @
a09e441b
...
...
@@ -15,6 +15,9 @@ public class VoteController extends Controller {
if
(
session
==
null
)
{
return
notFound
(
"session not found"
);
}
if
(!
session
.
open
)
{
return
forbidden
(
"session not open"
);
}
JsonNode
json
=
request
().
body
().
asJson
();
if
(
json
==
null
)
{
...
...
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