]> git.mjollnir.org Git - moodle.git/commitdiff
Guests should not see comment boxes
authormoodler <moodler>
Tue, 11 Apr 2006 12:32:23 +0000 (12:32 +0000)
committermoodler <moodler>
Tue, 11 Apr 2006 12:32:23 +0000 (12:32 +0000)
mod/data/lib.php

index a3077e892fd648c474b2094b72c337c36668fee8..8198bd258f80333fce891a7a3b1c5d98b8851783 100755 (executable)
@@ -1113,15 +1113,17 @@ function data_print_comments($data, $record, $page=0) {
         }
     }
     
-    echo '<div class="newcomment" align="center"><form method="post" action="'.$CFG->wwwroot.'/mod/data/comment.php">';
-    echo '<input type="hidden" name="mode" value="add" />';
-    echo '<input type="hidden" name="page" value="'.$page.'" />';
-    echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
-    echo '<input type="hidden" name="rid" value="'.$record->id.'" />';
-
-    echo '<textarea rows="8" cols="50" name="commentcontent"></textarea>';
-    echo '<br /><input type="submit" value="'.get_string('addcomment','data').'" />';
-    echo '</form></div>';
+    if (isloggedin() and !isguest()) {
+        echo '<div class="newcomment" align="center"><form method="post" action="'.$CFG->wwwroot.'/mod/data/comment.php">';
+        echo '<input type="hidden" name="mode" value="add" />';
+        echo '<input type="hidden" name="page" value="'.$page.'" />';
+        echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
+        echo '<input type="hidden" name="rid" value="'.$record->id.'" />';
+    
+        echo '<textarea rows="8" cols="50" name="commentcontent"></textarea>';
+        echo '<br /><input type="submit" value="'.get_string('addcomment','data').'" />';
+        echo '</form></div>';
+    }
 }
 
 //prints a single comment entry