Permalink
Browse files

MDL-44140 badges: Prevent non-owners to change visibility of issued b…

…adges

Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
  • Loading branch information...
1 parent 052b8c8 commit 100ec861820ce763d4f25a9f98649bb1ae17e7a5 @ybozhko ybozhko committed with damyon Feb 13, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 badges/mybadges.php
View
@@ -63,10 +63,10 @@
if ($hide) {
require_sesskey();
- $DB->set_field('badge_issued', 'visible', 0, array('id' => $hide));
+ $DB->set_field('badge_issued', 'visible', 0, array('id' => $hide, 'userid' => $USER->id));
} else if ($show) {
require_sesskey();
- $DB->set_field('badge_issued', 'visible', 1, array('id' => $show));
+ $DB->set_field('badge_issued', 'visible', 1, array('id' => $show, 'userid' => $USER->id));
} else if ($download && $hash) {
require_sesskey();
$badge = new badge($download);

0 comments on commit 100ec86

Please sign in to comment.