[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm /lonnet/perl lonnet.pm /xml lonxml.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 03 Apr 2003 22:25:49 -0000


albertel		Thu Apr  3 17:25:49 2003 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
    /loncom/xml	lonxml.pm 
    /loncom/homework	structuretags.pm 
  Log:
  - Apache::lonxml::whichuser, no says if the user is public
  - inhibit 'ambiguous' message for public users, they can't be anything but.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.359 loncom/lonnet/perl/lonnet.pm:1.360
--- loncom/lonnet/perl/lonnet.pm:1.359	Thu Apr  3 17:17:09 2003
+++ loncom/lonnet/perl/lonnet.pm	Thu Apr  3 17:25:49 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.359 2003/04/03 22:17:09 albertel Exp $
+# $Id: lonnet.pm,v 1.360 2003/04/03 22:25:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3096,8 +3096,8 @@
     my $courseid;
     my $publicuser;
     if (!($uname && $udom)) {
-      (my $cursymb,$courseid,$udom,$uname)=&Apache::lonxml::whichuser();
-      if ($udom eq 'public' and $uname =~ /^public/) { $publicuser='1'; }
+      (my $cursymb,$courseid,$udom,$uname,$publicuser)=
+	  &Apache::lonxml::whichuser();
       if (!$symbparm) {	$symbparm=$cursymb; }
     } else {
 	$courseid=$ENV{'request.course.id'};
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.244 loncom/xml/lonxml.pm:1.245
--- loncom/xml/lonxml.pm:1.244	Thu Apr  3 16:58:09 2003
+++ loncom/xml/lonxml.pm	Thu Apr  3 17:25:49 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.244 2003/04/03 21:58:09 albertel Exp $
+# $Id: lonxml.pm,v 1.245 2003/04/03 22:25:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1391,7 +1391,7 @@
 # calls to lonnet functions for this setup.
 # - looks for form.grade_ parameters
 sub whichuser {
-  my ($symb,$courseid,$domain,$name);
+  my ($symb,$courseid,$domain,$name,$publicuser);
   if (defined($ENV{'form.grade_symb'})) {
     my $tmp_courseid=$ENV{'form.grade_courseid'};
     my $allowed=&Apache::lonnet::allowed('mgr',$tmp_courseid);
@@ -1413,7 +1413,7 @@
 	  $name.=$ENV{'form.username'};
       }
   }
-  return ($symb,$courseid,$domain,$name);
+  return ($symb,$courseid,$domain,$name,$publicuser);
 }
 
 1;
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.164 loncom/homework/structuretags.pm:1.165
--- loncom/homework/structuretags.pm:1.164	Thu Apr  3 16:58:09 2003
+++ loncom/homework/structuretags.pm	Thu Apr  3 17:25:49 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.164 2003/04/03 21:58:09 albertel Exp $
+# $Id: structuretags.pm,v 1.165 2003/04/03 22:25:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -104,8 +104,9 @@
 	}
 	$body_tag_start.='>'.&Apache::lonmenu::menubuttons(undef,$target,1);
 	if ($target eq 'web' && $ENV{'request.state'} ne 'construct') {
-	    my ($symb)=&Apache::lonxml::whichuser();
-	    if ($symb eq '') {
+	    my ($symb,undef,undef,undef,$publicuser)=
+		&Apache::lonxml::whichuser();
+	    if ($symb eq '' && !$publicuser) {
 		my $help = &Apache::loncommon::help_open_topic("Ambiguous_Reference");
 		$help="Browsing resource, all submissions are temporary.<br />";
 		$body_tag_start.=$help;