From 39cac7b6c0b9f1f14c2a6ac068afb0ccfaf21d38 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 23 Sep 2004 11:34:47 +0000 Subject: [PATCH] Merged fixes from STABLE that allow creator to restore to any course --- backup/restore_check.html | 14 +++++++------- backup/restore_form.html | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/backup/restore_check.html b/backup/restore_check.html index bd5b5726c55..05f04b4324a 100644 --- a/backup/restore_check.html +++ b/backup/restore_check.html @@ -116,18 +116,18 @@ } //Depending the selected restoreto: - // If user is a teacher (and nor admin): + // If user is a teacher (and not creator): // 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 - // If the uses is an admin: + // If the uses is a creator: // 0-Existing course, deleting: Select the destination course and launch the check again, then // 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. // 2-New course: Create the restore object and launch the execute. - //If the user is a teacher and not an admin - if (isteacher($id) and !isadmin()) { + //If the user is a teacher and not a creator + if (isteacheredit($id) and !iscreator()) { $restore->course_id = $id; if ($restore->restoreto == 0) { $restore->deleting = true; @@ -136,8 +136,8 @@ } } - //If the user is an admin - if (isadmin()) { + //If the user is a creator (or admin) + if (iscreator()) { //Set restore->deleting as needed if ($restore->restoreto == 0) { $restore->deleting = true; @@ -147,7 +147,7 @@ } //Now, select the course if needed - if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0) and (isadmin())) { + if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0) and (iscreator())) { if ($courses = get_courses("all","c.fullname")) { print_heading(get_string("choosecourse")); print_simple_box_start("center"); diff --git a/backup/restore_form.html b/backup/restore_form.html index 795b90d06e0..14b4749e5d6 100644 --- a/backup/restore_form.html +++ b/backup/restore_form.html @@ -123,11 +123,11 @@ function selectItemInMenuByName(formId, menuName, selectIndex ) { echo "

"; echo get_string("restoreto").":"; echo ""; - if (isteacheredit($id) and !isadmin()) { + if (isteacheredit($id) and !iscreator()) { $restore_restoreto_options[0] = get_string("currentcoursedeleting"); $restore_restoreto_options[1] = get_string("currentcourseadding"); } - if (isadmin()) { + if (iscreator()) { $restore_restoreto_options[0] = get_string("existingcoursedeleting"); $restore_restoreto_options[1] = get_string("existingcourseadding"); $restore_restoreto_options[2] = get_string("newcourse");