From e43806a018ccab9e55c98305630c50408f3c58e7 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 19 May 2009 10:35:59 +0000 Subject: [PATCH] MDL-19163 - Fixed problem when cancreatecourse users were restoring to sites with only 1 course ; merged from 19_STABLE --- backup/restore_check.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backup/restore_check.html b/backup/restore_check.html index f3026d46d8..0b9b3e16bd 100644 --- a/backup/restore_check.html +++ b/backup/restore_check.html @@ -228,7 +228,7 @@ // put $restore->course_id and $restore->deleting (true), create the restore object. // 1-Existing course, adding: Select the destination course and launch the check again, then // put $restore->course_id and $restore->deleting (false), create the restore object. - // B) Else, if user cannot create courses or he is restoring from within SITEID: + // B) Else, if user has 'moodle/site:restore' in only 1 course or cannot create courses or he is restoring from within SITEID: // 0-Current course, deleting: Put $restore->course_id and $restore->deleting (true), create the restore object // 1-Current course, adding: Put $restore->course_id and $restore->deleting (false), create the restore object // C) If the user is a creator: @@ -240,12 +240,12 @@ // NOTE: SITEID is prevented as a source for restoring because it's public area and we must encourage admins // to avoid using it as a "repository" for courses storage. - // A) If user has 'moodle/site:restore' in more than one course, cannot create courses and he isn't restoring from SITEID + // A) If user has 'moodle/site:restore' in more than one course and cannot create courses and he isn't restoring from SITEID if (count($mycourses) > 1 && !$cancreatecourses && $id != SITEID) { /// Nothing to do, process continues and C) will show the list of courses - // B) Else, if the user is a teacher and not a creator or we are restoring from within SITEID - } else if (!$cancreatecourses || $id == SITEID) { + // B) Else, if user has 'moodle/site:restore' is only 1 course or cannot create courses or he is restoring from within SITEID + } else if (count($mycourses) == 1 || !$cancreatecourses || $id == SITEID) { $restore->course_id = $id; /// Force restore to current course, disabling pick course from list } -- 2.39.5