mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
relacing deprecated functions with capability checks
This commit is contained in:
parent
0dde27bb52
commit
9ce384ba1e
10 changed files with 17 additions and 20 deletions
|
@ -184,7 +184,8 @@ class resource_ims extends resource_base {
|
|||
|
||||
/// If teacheredit, make, hash check. It's the md5 of the name of the file
|
||||
/// plus its size and modification date
|
||||
if (isteacheredit($course->id)) {
|
||||
/// not sure if this capability is suitable
|
||||
if (has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $course->id))) {
|
||||
if (!$this->checkpackagehash($file, $course, $resource)) {
|
||||
return 4;
|
||||
}
|
||||
|
@ -360,7 +361,7 @@ class resource_ims extends resource_base {
|
|||
print_simple_box_start('center', '60%');
|
||||
echo '<p align="center">'.$errortext.'</p>';
|
||||
/// If errors were 3 or 4 and isteacheredit(), show the deploy button
|
||||
if (isteacheredit($course->id) && ($errorcode == 3 || $errorcode == 4)) {
|
||||
if (has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $course->id)) && ($errorcode == 3 || $errorcode == 4)) {
|
||||
$link = 'type/ims/deploy.php';
|
||||
$options['courseid'] = $course->id;
|
||||
$options['cmid'] = $cm->id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue