Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86234a9
)
backup MDL-23437 Restore now locks the course_startdate setting if the user doesn...
author
Sam Hemelryk
<sam@moodle.com>
Fri, 10 Sep 2010 07:54:15 +0000
(07:54 +0000)
committer
Sam Hemelryk
<sam@moodle.com>
Fri, 10 Sep 2010 07:54:15 +0000
(07:54 +0000)
backup/util/checks/restore_check.class.php
patch
|
blob
|
blame
|
history
diff --git
a/backup/util/checks/restore_check.class.php
b/backup/util/checks/restore_check.class.php
index
c799837
..
20e1f94
100644
(file)
--- a/
backup/util/checks/restore_check.class.php
+++ b/
backup/util/checks/restore_check.class.php
@@
-167,6
+167,16
@@
abstract class restore_check {
}
}
+ // Ensure the user has the rolldates capability. If not we want to lock this
+ // settings so that they cannot change it.
+ $hasrolldatescap = has_capability('moodle/restore:rolldates', $coursectx, $userid);
+ if ($type == backup::TYPE_1COURSE && !$hasrolldatescap) {
+ $datesetting = $restore_controller->get_plan()->get_setting('course_startdate');
+ if ($datesetting) {
+ $datesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
+ }
+ }
+
return true;
}
}