]> git.mjollnir.org Git - moodle.git/commitdiff
Undoing one of the less then brilliant changes I did earlier today to Eloy's code
authormoodler <moodler>
Mon, 25 Aug 2003 15:47:37 +0000 (15:47 +0000)
committermoodler <moodler>
Mon, 25 Aug 2003 15:47:37 +0000 (15:47 +0000)
backup/restorelib.php

index 375d0fb949e0ca04d9fd9012bc15609053d50b7c..1d20d2b481f5b620aac99a8f000dc36dd10048ae 100644 (file)
                     $data = backup_getid($restore->backup_unique_code,"user",$userid);
                     $newid = $data->new_id;
                     $currinfo = $data->info.",";
+
                     //Now, depending of the role, create records in user_studentes and user_teacher 
                     //and/or mark it in backup_ids
-                    //
-                    // Martin commented this out 25/8/03 ... I don't think it makes sense to 
-                    // recreate admins and course creators when restoring a course - this could 
-                    // be a security problem when restoring courses from one site to another...
-                    //
-                    //if ($is_admin) {
-                    //    //If the record (user_admins) doesn't exists
-                    //    if (!record_exists("user_admins","userid",$newid)) {
-                    //        //Only put status in backup_ids
-                    //        $currinfo = $currinfo."admin,";
-                    //        $status = backup_putid($restore->backup_unique_code,"user",$userid,$newid,$currinfo);
-                    //    }
-                    //} 
-                    //if ($is_coursecreator) {
-                    //    //If the record (user_coursecreators) doesn't exists
-                    //    if (!record_exists("user_coursecreators","userid",$newid)) {
-                    //        //Only put status in backup_ids
-                    //        $currinfo = $currinfo."coursecreator,";
-                    //        $status = backup_putid($restore->backup_unique_code,"user",$userid,$newid,$currinfo);
-                    //    }
-                    //} 
+                    
+                    if ($is_admin) {
+                        //If the record (user_admins) doesn't exists
+                        if (!record_exists("user_admins","userid",$newid)) {
+                            //Only put status in backup_ids
+                            $currinfo = $currinfo."admin,";
+                            $status = backup_putid($restore->backup_unique_code,"user",$userid,$newid,$currinfo);
+                        }
+                    } 
+                    if ($is_coursecreator) {
+                        //If the record (user_coursecreators) doesn't exists
+                        if (!record_exists("user_coursecreators","userid",$newid)) {
+                            //Only put status in backup_ids
+                            $currinfo = $currinfo."coursecreator,";
+                            $status = backup_putid($restore->backup_unique_code,"user",$userid,$newid,$currinfo);
+                        }
+                    } 
                     if ($is_teacher) {
                         //If the record (teacher) doesn't exists
                         if (!record_exists("user_teachers","userid",$newid,"course", $restore->course_id)) {