]> git.mjollnir.org Git - moodle.git/commitdiff
merged, corrected bug with teacger rights
authorurs_hunkler <urs_hunkler>
Fri, 21 Jul 2006 05:00:02 +0000 (05:00 +0000)
committerurs_hunkler <urs_hunkler>
Fri, 21 Jul 2006 05:00:02 +0000 (05:00 +0000)
theme/chameleon/ui/chameleon.php
theme/chameleon/ui/css.php

index e5f2676132382983501b78ca15254eaf6ae4100c..779c0ddc0b3120cbe9d70b3e9cdcc1e1b41f307d 100644 (file)
@@ -7,13 +7,13 @@ if (isset($THEME->chameleonenabled) && $THEME->chameleonenabled) {
     if (isset($course->id)) {
         $chameleon_courseparam = '?id=' . $course->id;
         if (!$chameleon_isadmin) {
-            $chameleon_isteacher = (isteacher($course->id) && isset($CFG->coursetheme));
+            $chameleon_isteacher = (isteacheredit($course->id) && isset($CFG->coursetheme));
         }
     } else {
         $chameleon_courseparam = '';
     }
-
-    if ($chameleon_isadmin || $chameleon_isteacher) { 
+    
+    if ($chameleon_isadmin || ($chameleon_isteacher && !empty($CFG->allowcoursethemes) && !empty($THEME->chameleonteachereditenabled))) { 
         // either we're an admin or we're a teacher and this is being used as the course theme
         // if we're on a page using a course theme edit that, otherwise edit the main chameleon theme
         // $chameleon_theme = (isset($CFG->coursetheme)) ? $CFG->coursetheme : $CFG->theme;
index 1f73cf9768f0f6822bc9a79663a3d34e6a5aa1a4..ee73c892b09ec53f3252249afcd5c2872ec6d566 100644 (file)
@@ -11,7 +11,7 @@ if (empty($THEME->chameleonenabled)) {
 
 $chameleon_id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
 if ($chameleon_id != 0 && !empty($CFG->allowcoursethemes) && !empty($THEME->chameleonteachereditenabled)) {
-    if (!isteacher($chameleon_id)) {
+    if (!isteacheredit($chameleon_id)) {
         die('CHAMELEON_ERROR Either you are not logged in or you are not allowed to edit this theme');
     }
 } else if (!isadmin()) {