Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
02d8c8ca
Commit
02d8c8ca
authored
Nov 06, 2015
by
John Okely
Committed by
Andrew Nicols
Nov 06, 2015
Browse files
MDL-51569 mod_choice: Prevent users from updating choices with curl
parent
11d4f442
Changes
1
Hide whitespace changes
Inline
Side-by-side
mod/choice/lib.php
View file @
02d8c8ca
...
...
@@ -852,6 +852,7 @@ function choice_page_type_list($pagetype, $parentcontext, $currentcontext) {
* @return array status (available or not and possible warnings)
*/
function
choice_get_availability_status
(
$choice
)
{
global
$DB
,
$USER
;
$available
=
true
;
$warnings
=
array
();
...
...
@@ -866,6 +867,10 @@ function choice_get_availability_status($choice) {
$warnings
[
'expired'
]
=
userdate
(
$choice
->
timeclose
);
}
}
if
(
!
$choice
->
allowupdate
&&
$DB
->
get_records
(
'choice_answers'
,
array
(
'choiceid'
=>
$choice
->
id
,
'userid'
=>
$USER
->
id
)))
{
$available
=
false
;
$warnings
[
'choicesaved'
]
=
''
;
}
// Choice is available.
return
array
(
$available
,
$warnings
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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