Index: comment.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/glossary/comment.php,v
retrieving revision 1.31.2.1
diff -u -r1.31.2.1 comment.php
--- comment.php	18 Oct 2006 20:20:18 -0000	1.31.2.1
+++ comment.php	2 Feb 2007 05:17:02 -0000
@@ -113,7 +113,7 @@
             print_simple_box_end();
         }
     } else {
-        if (!$glossary->allowcomments && !has_capability('mod/glossary:comment', $context)) {
+        if (!$glossary->allowcomments || !has_capability('mod/glossary:comment', $context)) {
             error('You can\'t add/edit comments to this glossary!');
         }
         if ( $action == 'edit' ) {
Index: lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/glossary/lib.php,v
retrieving revision 1.154.2.2
diff -u -r1.154.2.2 lib.php
--- lib.php	31 Oct 2006 20:33:25 -0000	1.154.2.2
+++ lib.php	2 Feb 2007 05:17:03 -0000
@@ -797,7 +797,7 @@
     }
     $return .= glossary_print_entry_commentslink($course, $cm, $glossary, $entry,$mode,$hook,'html');
     
-    if (has_capability('mod/glossary:comment', $context)) {
+    if (has_capability('mod/glossary:comment', $context) and $glossary->allowcomments) {
         $output = true;
         $return .= ' <a title="' . get_string('addcomment','glossary') . '" href="comment.php?id='.$cm->id.'&amp;eid='.$entry->id.'"><img src="comment.gif" height="11" width="11" border="0" alt="'.get_string('addcomment','glossary').'" /></a>';
     }
