From: moodler Date: Sat, 16 Aug 2003 03:28:56 +0000 (+0000) Subject: Hold the presses ... I hate doing this but after going into detail X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5fcd1b52aa527ebf226dd8a81f631d3a3614b316;p=moodle.git Hold the presses ... I hate doing this but after going into detail changing the course creator account like this is the wrong way to do this. Instead, I'm going to be adding new fields to user_teachers Stay tuned --- diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 4e3ddf65f3..9ee9564079 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -441,24 +441,24 @@ function main_upgrade($oldversion=0) { } if ($oldversion < 2003081500) { - print_simple_box("Some important changes have been made to how course creators work. Formerly, they could create new courses and assign teachers, and teachers could edit courses. Now, ordinary teachers can no longer edit courses - they need to be a teacher of a course AND a course creator. A new site-wide configuration variable allows you to choose whether to allow course creators to create new courses as well (by default this is off).

The following update will automatically convert all your existing teachers into course creators, to maintain backward compatibility. Make sure you look at your upgraded site carefully and understand these new changes.", "center", "50%", "$THEME->cellheading", "20", "noticebox"); +// print_simple_box("Some important changes have been made to how course creators work. Formerly, they could create new courses and assign teachers, and teachers could edit courses. Now, ordinary teachers can no longer edit courses - they need to be a teacher of a course AND a course creator. A new site-wide configuration variable allows you to choose whether to allow course creators to create new courses as well (by default this is off).

The following update will automatically convert all your existing teachers into course creators, to maintain backward compatibility. Make sure you look at your upgraded site carefully and understand these new changes.", "center", "50%", "$THEME->cellheading", "20", "noticebox"); - $count = 0; - $errorcount = 0; - if ($teachers = get_records("user_teachers")) { - foreach ($teachers as $teacher) { - if (! record_exists("user_coursecreators", "userid", $teacher->userid)) { - $creator = NULL; - $creator->userid = $teacher->userid; - if (!insert_record("user_coursecreators", $creator)) { - $errorcount++; - } else { - $count++; - } - } - } - } - print_simple_box("$count teachers were upgraded to course creators (with $errorcount errors)", "center", "50%", "$THEME->cellheading", "20", "noticebox"); +// $count = 0; +// $errorcount = 0; +// if ($teachers = get_records("user_teachers")) { +// foreach ($teachers as $teacher) { +// if (! record_exists("user_coursecreators", "userid", $teacher->userid)) { +// $creator = NULL; +// $creator->userid = $teacher->userid; +// if (!insert_record("user_coursecreators", $creator)) { +// $errorcount++; +// } else { +// $count++; +// } +// } +// } +// } +// print_simple_box("$count teachers were upgraded to course creators (with $errorcount errors)", "center", "50%", "$THEME->cellheading", "20", "noticebox"); }