From 3b1bb96902276a46c456d2c33a0be6979b727225 Mon Sep 17 00:00:00 2001 From: moodler Date: Sun, 17 Aug 2003 13:06:10 +0000 Subject: [PATCH] Slight regression in policy (to bring it back to exactly how it all is in 1.0.9). Only course creators can assign teacher to courses UNLESS the config variable teacherassignteachers is true (by default it will be off). --- course/lib.php | 15 ++++++++++----- course/teacher.php | 5 +++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/course/lib.php b/course/lib.php index 274251074c..362f840934 100644 --- a/course/lib.php +++ b/course/lib.php @@ -747,13 +747,19 @@ function print_course_admin_links($course, $width=180) { } $admindata[]="id\">".get_string("settings")."..."; $adminicon[]="\"\""; - if (!$course->teachers) { - $course->teachers = get_string("defaultcourseteachers"); + + if (iscreator() or !empty($CFG->teacherassignteachers)) { + if (!$course->teachers) { + $course->teachers = get_string("defaultcourseteachers"); + } + $admindata[]="id\">$course->teachers..."; + $adminicon[]="\"\""; } - $admindata[]="id\">$course->teachers..."; - $adminicon[]="\"\""; } + if (!$course->teachers) { + $course->teachers = get_string("defaultcourseteachers"); + } $admindata[]="id\">$course->students..."; $adminicon[]="\"\""; @@ -779,7 +785,6 @@ function print_course_admin_links($course, $width=180) { $admindata[]="wwwroot/files/index.php?id=$course->id\">".get_string("files")."..."; $adminicon[]="\"\""; - $admindata[]="wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."..."; $adminicon[]="\"\""; diff --git a/course/teacher.php b/course/teacher.php index 4da64353e2..cfbb7656d7 100644 --- a/course/teacher.php +++ b/course/teacher.php @@ -3,7 +3,7 @@ require_once("../config.php"); - define("MAX_USERS_PER_PAGE", 30); + define("MAX_USERS_PER_PAGE", 40); require_variable($id); // course id optional_variable($add, ""); @@ -16,7 +16,8 @@ error("Course ID was incorrect (can't find it)"); } - if (!isteacheredit($course->id)) { + if (!(isteacheredit($course->id) and iscreator()) and + !(isteacheredit($course->id) and !empty($CFG->teacheraddteachers) ) ) { error("You must be an administrator or course creator to use this page."); } -- 2.39.5