--- loncom/interface/lonchat.pm	2006/03/29 19:56:28	1.12
+++ loncom/interface/lonchat.pm	2006/07/17 16:10:57	1.15
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Chat
 #
-# $Id: lonchat.pm,v 1.12 2006/03/29 19:56:28 raeburn Exp $
+# $Id: lonchat.pm,v 1.15 2006/07/17 16:10:57 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -44,8 +44,9 @@ sub handler {
     if (defined($env{'form.group'})) {
         $group = $env{'form.group'};
         $group_elem = '<input type="hidden" name="group" value="'.$group.'" />'; 
-        if (! &Apache::lonnet::allowed('pgc',$env{'request.course.id'}.'/'.
-                                                                    $group) ) {
+        if ((! &Apache::lonnet::allowed('pgc',$env{'request.course.id'}.'/'.
+                                                                    $group))
+            && (! &Apache::lonnet::allowed('vcg',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')))) {
             return HTTP_NOT_ACCEPTABLE;
         }
     } else {
@@ -61,11 +62,11 @@ sub handler {
     }
 # --------------------------------------------------- Print login screen header
     my $latexHelp = Apache::loncommon::helpLatexCheatsheet();
-    my $loaditems = 'onLoad="this.document.chatentry.newchat.focus();"';
+    my %loaditems = (onload => 'this.document.chatentry.newchat.focus();');
     my $start_page = 
 	&Apache::loncommon::start_page('Chat',undef,
 				       {'only_body'   => 1,
-					'add_entries' => $loaditems,});
+					'add_entries' => \%loaditems,});
     my $end_page = &Apache::loncommon::end_page();
     $r->print(<<ENDDOCUMENT);
 $start_page