diff --git a/course/category.php b/course/category.php index bac0ae985ea..b48c05f39e8 100644 --- a/course/category.php +++ b/course/category.php @@ -36,19 +36,20 @@ } -/// Rename the category if requested - - if (!empty($_GET['rename'])) { - $category->name = $rename; - if (! set_field("course_categories", "name", $category->name, "id", $category->id)) { - notify("An error occurred while renaming the category"); + if (isadmin()) { + /// Rename the category if requested + if (!empty($_POST['rename'])) { + $category->name = $_POST['rename']; + if (! set_field("course_categories", "name", $category->name, "id", $category->id)) { + notify("An error occurred while renaming the category"); + } } - } -/// Resort the category if requested + /// Resort the category if requested - if (!empty($_GET['resort'])) { - fix_course_sortorder($category->id, "fullname ASC"); + if (!empty($_GET['resort'])) { + fix_course_sortorder($category->id, "fullname ASC"); + } } @@ -197,7 +198,6 @@ /// Print out all the courses - if (!$courses = get_courses($category->id)) { print_heading(get_string("nocoursesyet")); @@ -292,8 +292,14 @@ echo ""; } else { echo "
$strallowguests
$strrequireskey
| ";
+ echo " \n";
+ foreach ($teachers as $teacher) {
+ if ($teacher->authority > 0) {
+ if (!$teacher->role) {
+ $teacher->role = $course->teacher;
+ }
+ echo "$teacher->role: wwwroot/user/view.php?id=$teacher->id&course=$site->id\">$teacher->firstname $teacher->lastname |