[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm roles.tab /html index.html /interface lonindexer.pm lonmeta.pm lonmsg.pm lonsource.pm lonwhatsnew.pm /xml lonxml.pm

www lon-capa-cvs@mail.lon-capa.org
Fri, 08 Jul 2005 10:39:52 -0000


This is a MIME encoded message

--www1120819192
Content-Type: text/plain

www		Fri Jul  8 06:39:52 2005 EDT

  Modified files:              
    /loncom/auth	lonroles.pm roles.tab 
    /loncom/html	index.html 
    /loncom/interface	lonindexer.pm lonmeta.pm lonmsg.pm lonsource.pm 
                     	lonwhatsnew.pm 
    /loncom/xml	lonxml.pm 
  Log:
  Back in town.
  
  
  
--www1120819192
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20050708063952.txt"

Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.125 loncom/auth/lonroles.pm:1.126
--- loncom/auth/lonroles.pm:1.125	Sat Jun 18 20:41:32 2005
+++ loncom/auth/lonroles.pm	Fri Jul  8 06:39:49 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.125 2005/06/19 00:41:32 www Exp $
+# $Id: lonroles.pm,v 1.126 2005/07/08 10:39:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -343,7 +343,7 @@
 # --------------------------------------------------------------- Error Header?
     if ($error) {
 	$r->print("<h1>LON-CAPA Access Control</h1>");
-        $r->print("<hr><pre>Access  : ".
+        $r->print("<!-- LONCAPAACCESSCONTROLERRORSCREEN --><hr /><pre>Access  : ".
                   Apache::lonnet::plaintext($priv)."\n");
         $r->print("Resource: ".&Apache::lonenc::check_encrypt($fn)."\n");
         $r->print("Action  : $msg\n</pre><hr />");
@@ -387,7 +387,7 @@
                       ($env{'user.name'},$env{'user.domain'})}.
 		      "<br />\n");
 	    $r->print(&mt(
-      "Author and Co-Author roles may not be available on servers other than your home server."));
+      "Author and Co-Author roles are not available on servers other than their respective home servers."));
         }
         if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) {
     	    $fn.='?'.$ENV{'REDIRECT_QUERY_STRING'};
@@ -430,28 +430,34 @@
 		$tstatus='selected';
             }
             my $tbg;
+	    my $tbghigh;
             if (($tstatus eq 'is') || ($tstatus eq 'selected') ||
                 ($env{'form.showall'})) {
                 if ($tstatus eq 'is') {
                     $tbg='#77FF77';
+		    $tbghigh='#99CC77';
                     $tfont='#003300';
 		    $possiblerole=$trolecode;
 		    $countactive++;
                 } elsif ($tstatus eq 'future') {
                     $tbg='#FFFF77';
+                    $tbghigh='#DDDD55';
                     $button=0;
                 } elsif ($tstatus eq 'will') {
                     $tbg='#FFAA77';
                     $tremark.=&mt('Active at next login. ');
                 } elsif ($tstatus eq 'expired') {
                     $tbg='#FF7777';
+                    $tbghigh='#EE9955';
                     $tfont='#330000';
                     $button=0;
                 } elsif ($tstatus eq 'will_not') {
                     $tbg='#AAFF77';
+                    $tbghigh='#BBDD55';
                     $tremark.=&mt('Expired after logout. ');
                 } elsif ($tstatus eq 'selected') {
                     $tbg='#11CC55';
+                    $tbghigh='339944';
                     $tfont='#002200';
 		    $inrole=1;
 		    $countactive++;
@@ -460,7 +466,7 @@
                 my $trole;
                 if ($role =~ /^cr\//) {
                     my ($rdummy,$rdomain,$rauthor,$rrole)=split(/\//,$role);
-                    $tremark.='<br>'.&mt('Defined by ').$rauthor.
+                    $tremark.='<br />'.&mt('Defined by ').$rauthor.
 			&mt(' at ').$rdomain.'.';
                     $trole=$rrole;
                 } else {
@@ -557,7 +563,7 @@
 		    $sortkey=$role.$twhere;
                 }
  
-                $roletext.=&build_roletext($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tfont,$trole,$ttype,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver);
+                $roletext.=&build_roletext($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tbghigh,$tfont,$trole,$ttype,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver);
 		$roletext{$envkey}=$roletext;
 		if (!$sortkey) {$sortkey=$twhere."\0".$envkey;}
 		$sortrole{$sortkey}=$envkey;
@@ -619,8 +625,8 @@
             } 
 	}
 	if ($output) {
-	    $r->print("<tr bgcolor='#BBffBB'><td align='center' colspan='6'>".
-		      &mt('Recent Roles')."</td>");
+	    $r->print("<tr><td colspan='6'><font face='arial'>".
+		      &mt('Recent Roles')."</font></td>");
 	    $r->print($output);
 	    $r->print("</tr>");
             $doheaders ++;
@@ -645,8 +651,8 @@
 	}
 	if ($output) {
 	    if ($doheaders > 0) {
-		$r->print("<tr bgcolor='#BBffBB'>".
-			  "<td align='center' colspan='6'>".&mt($type)."</td></tr>");
+		$r->print("<tr>".
+			  "<td colspan='6'><font face='arial'>".&mt($type)."</font></td></tr>");
 	    }
 	    $r->print($output);	
 	}
@@ -766,8 +772,8 @@
 }
 
 sub build_roletext {
-    my ($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tfont,$trole,$ttype,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver) = @_;
-    my $roletext='<tr bgcolor="'.$tbg.'">';
+    my ($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tbghigh,$tfont,$trole,$ttype,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver) = @_;
+    my $roletext='<tr bgcolor="'.$tbg.'" onMouseOver="javascript:style.backgroundColor=\''.$tbghigh.'\'" onMouseOut="javascript:style.backgroundColor=\''.$tbg.'\'" >';
     unless ($nochoose) {
         if (!$button) {
             if ($switchserver) {
@@ -932,6 +938,7 @@
             my $trole = Apache::lonnet::plaintext('cc');
             my $twhere;
             my $tbg='#77FF77';
+	    my $tbghigh='#99CC77';
             my $tfont='#003300';
             my %newhash=&Apache::lonnet::coursedescription($tcourseid);
             if (%newhash) {
@@ -944,7 +951,7 @@
                 $env{'course.'.$tcourseid.'.description'}=$twhere;
             }
             $twhere.="<br />".&mt('Domain').":".$1;
-            $roletext = &build_roletext($trolecode,$1,$2,'is',$tryagain,$advanced,'',$tbg,$tfont,$trole,&mt('Course'),$twhere,'','','',1,'');
+            $roletext = &build_roletext($trolecode,$1,$2,'is',$tryagain,$advanced,'',$tbg,$tbghigh,$tfont,$trole,&mt('Course'),$twhere,'','','',1,'');
         }
     }
     return $roletext;
@@ -954,7 +961,7 @@
     my $dcdom = shift;
     my $ccrole = Apache::lonnet::plaintext('cc');
     my $selectlink = &courselink($dcdom);
-    my $output = '<tr bgcolor="#77FF77">'.
+    my $output = '<tr bgcolor="#99FF99" onMouseOver="javascript:style.backgroundColor=\'#BBEE99\'"  onMouseOut="javascript:style.backgroundColor=\'#99FF99\'" >'.
               '<td><input type="button" value="'.
               &mt('Select').'" name="ccpick_'.$dcdom.'"'.
               'onClick="verifyCoursePick(this)">'.
Index: loncom/auth/roles.tab
diff -u loncom/auth/roles.tab:1.37 loncom/auth/roles.tab:1.38
--- loncom/auth/roles.tab:1.37	Thu Jun 23 17:56:12 2005
+++ loncom/auth/roles.tab	Fri Jul  8 06:39:49 2005
@@ -20,12 +20,12 @@
 ad:c bre:gan:vgr:srm
 li:s gan:sma:adv
 li:d mme
-au:s gan:sma:bre:adv
-au:d are:cre:ere:cca&IK:caa&IK
-ca:s gan:sma:bre:adv
-ca:d are:cre:ere
+au:s gan:sma:bre:cre:adv
+au:d are:ere:cca&IK:caa&IK
+ca:s gan:sma:bre:cre:adv
+ca:d are:ere
 aa:s sma
-aa:d are:cre:ere
+aa:d are:ere
 dg:d bre&R
 sc:d usc
 
Index: loncom/html/index.html
diff -u loncom/html/index.html:1.5 loncom/html/index.html:1.6
--- loncom/html/index.html:1.5	Tue Sep 16 16:43:18 2003
+++ loncom/html/index.html	Fri Jul  8 06:39:49 2005
@@ -1,11 +1,13 @@
 <html>
  <head>
   <title>Welcome to the LearningOnline Network with CAPA</title>
-  <meta HTTP-EQUIV="Refresh" CONTENT="0.5; url=/adm/roles">
+  <meta HTTP-EQUIV="Refresh" CONTENT="0; url=/adm/roles">
   <meta name="keywords" content="LON-CAPA,lon-capa,LONCAPA,loncapa">
   <meta name="description" content="The LearningOnline Network with CAPA (LON-CAPA) Learning Content Management and Assessment System">
  </head>
- <body bgcolor="#006600" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>
-  <img src="/adm/lonIcons/header.gif" />
+ <body bgcolor="#FFFFFF" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>
+<font face="arial">The LearningOnline Network with CAPA
+<br />
+<a href="/adm/roles">Continue</a></font>
  </body>
 </html>
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.135 loncom/interface/lonindexer.pm:1.136
--- loncom/interface/lonindexer.pm:1.135	Fri Jun 17 16:15:51 2005
+++ loncom/interface/lonindexer.pm	Fri Jul  8 06:39:49 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.135 2005/06/17 20:15:51 www Exp $
+# $Id: lonindexer.pm,v 1.136 2005/07/08 10:39:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1073,9 +1073,13 @@
 		    close(FH);
 		} else {
 		    $output=&Apache::lonnet::ssi_body($filelink);
-		    open(FH,">$cache");
-		    print FH $output;
-		    close(FH);
+		    if ($output=~/LONCAPAACCESSCONTROLERRORSCREEN/) {
+			$output='';
+		    } else {
+			open(FH,">$cache");
+			print FH $output;
+			close(FH);
+		    }
 		}
 		$output='<font size="-2">'.$output.'</font>';
 	   } elsif ($embstyle eq 'img') {
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.97 loncom/interface/lonmeta.pm:1.98
--- loncom/interface/lonmeta.pm:1.97	Sun May  8 21:51:44 2005
+++ loncom/interface/lonmeta.pm	Fri Jul  8 06:39:49 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.97 2005/05/09 01:51:44 banghart Exp $
+# $Id: lonmeta.pm,v 1.98 2005/07/08 10:39:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -578,6 +578,15 @@
     $r->print('<h1>'.&Apache::lonnet::clutter($uri).'</h1>');
     my ($domain,$author)=($uri=~/^(\w+)\/(\w+)\//);
     if (&Apache::loncacc::constructaccess('/~'.$author.'/',$domain)) {
+	if ($env{'form.clearbombs'}) {
+	    &Apache::lonmsg::clear_author_res_msg($uri);
+	}
+        my $clear=&mt('Clear all Messages in Subdirectory');
+	$r->print(<<ENDCLEAR);
+<form method="post">
+<input type="submit" name="clearbombs" value="$clear" />
+</form>
+ENDCLEAR
         my %brokenurls = 
             &Apache::lonmsg::all_url_author_res_msg($author,$domain);
         foreach (sort(keys(%brokenurls))) {
@@ -901,11 +910,22 @@
                 $bombs=&mt('Error deleting messages');
             }
         }
-        my $del=&mt('Delete Messages');
+        if ($env{'form.clearmsg'}) {
+	    my $cleardir=$target;
+	    $cleardir=~s/\/[^\/]+$/\//;
+            if (&Apache::lonmsg::clear_author_res_msg($cleardir) eq 'ok') {
+                $bombs=&mt('Messages cleared.');
+            } else {
+                $bombs=&mt('Error clearing messages');
+            }
+        }
+        my $del=&mt('Delete Messages for this Resource');
+	my $clear=&mt('Clear all Messages in Subdirectory');
         $r->print(<<ENDBOMBS);
 <h1>$disuri</h1>
 <form method="post" name="defaultmeta">
 <input type="submit" name="delmsg" value="$del" />
+<input type="submit" name="clearmsg" value="$clear" />
 <br />$bombs
 ENDBOMBS
     } else {
@@ -1025,4 +1045,4 @@
 1;
 __END__
 
-     
\ No newline at end of file
+     
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.151 loncom/interface/lonmsg.pm:1.152
--- loncom/interface/lonmsg.pm:1.151	Tue Jun  7 14:19:32 2005
+++ loncom/interface/lonmsg.pm	Fri Jul  8 06:39:49 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.151 2005/06/07 18:19:32 www Exp $
+# $Id: lonmsg.pm,v 1.152 2005/07/08 10:39:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -337,7 +337,20 @@
     }
     return &Apache::lonnet::del('nohist_res_msgs',\@delmsgs,$domain,$author);
 }
+# =================================== Clear out all author messages in URL path
 
+sub clear_author_res_msg {
+    my $url=shift;
+    $url=&Apache::lonnet::declutter($url);
+    my ($domain,$author)=($url=~/^(\w+)\/(\w+)\//);
+    my @delmsgs=();
+    foreach (&Apache::lonnet::getkeys('nohist_res_msgs',$domain,$author)) {
+	if ($_=~/^\Q$url\E/) {
+	    push (@delmsgs,$_);
+	}
+    }
+    return &Apache::lonnet::del('nohist_res_msgs',\@delmsgs,$domain,$author);
+}
 # ================= Return hash with URLs for which there is a resource message
 
 sub all_url_author_res_msg {
@@ -564,13 +577,14 @@
     my ($start,$maxdis,$first,$finish,$total)=@_;
     unless ($total>0) { return ''; }
     $start++; $maxdis++;$first++;$finish++;
-    return 
+    return
+   &mt('Page').': '. 
    '<input type="submit" name="firstview" value="'.&mt('First').'" />'.
    '<input type="submit" name="prevview" value="'.&mt('Previous').'" />'.
    '<input type="text" size="5" name="startdis" value="'.$start.'" onChange="this.form.submit()" /> of '.$maxdis.
    '<input type="submit" name="nextview" value="'.&mt('Next').'" />'.
    '<input type="submit" name="lastview" value="'.&mt('Last').'" /><br />'.
-   &mt('Messages [_1] through [_2] of [_3]',$first,$finish,$total).'</form>';
+   &mt('Showing messages [_1] through [_2] of [_3]',$first,$finish,$total).'</form>';
 }
 
 # =============================================================== Folder suffix
@@ -872,7 +886,8 @@
 TABLEHEAD
         foreach my $msg (@newmsgs) {
             $r->print(<<"ENDLINK");
-<tr bgcolor="#FFBB77">
+<tr class="new" bgcolor="#FFBB77" onMouseOver="javascript:style.backgroundColor='#DD9955'" 
+onMouseOut="javascript:style.backgroundColor='#FFBB77'">
 <td><a href="/adm/email?dismode=new&display=$msg->{'msgid'}">$lt{'op'}</a></td>
 ENDLINK
             foreach ('sendtime','from','fromdom','shortsub') {
@@ -999,13 +1014,13 @@
 	my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID)= @{$temp[$n]};
 	if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) {
 	    if ($status eq 'new') {
-		$r->print('<tr bgcolor="#FFBB77">');
+		$r->print('<tr bgcolor="#FFBB77" onMouseOver="javascript:style.backgroundColor=\'#DD9955\'"  onMouseOut="javascript:style.backgroundColor=\'#FFBB77\'">');
 	    } elsif ($status eq 'read') {
-		$r->print('<tr bgcolor="#BBBB77">');
+		$r->print('<tr bgcolor="#BBBB77" onMouseOver="javascript:style.backgroundColor=\'#999944\'"  onMouseOut="javascript:style.backgroundColor=\'#BBBB77\'">');
 	    } elsif ($status eq 'replied') {
-		$r->print('<tr bgcolor="#AAAA88">'); 
+		$r->print('<tr bgcolor="#AAAA88" onMouseOver="javascript:style.backgroundColor=\'#888855\'"  onMouseOut="javascript:style.backgroundColor=\'#AAAA88\'">'); 
 	    } else {
-		$r->print('<tr bgcolor="#99BBBB">');
+		$r->print('<tr bgcolor="#99BBBB" onMouseOver="javascript:style.backgroundColor=\'#669999\'"  onMouseOut="javascript:style.backgroundColor=\'#99BBBB\'">');
 	    }
 	    $r->print('<td><input type="checkbox" name="delmark_'.$origID.'" /></td><td><a href="/adm/email?display='.$origID.$sqs. 
 		      '">'.&mt('Open').'</a></td><td>'.
Index: loncom/interface/lonsource.pm
diff -u loncom/interface/lonsource.pm:1.14 loncom/interface/lonsource.pm:1.15
--- loncom/interface/lonsource.pm:1.14	Thu Jun 23 19:51:32 2005
+++ loncom/interface/lonsource.pm	Fri Jul  8 06:39:49 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Souce Code handler
 #
-# $Id: lonsource.pm,v 1.14 2005/06/23 23:51:32 www Exp $
+# $Id: lonsource.pm,v 1.15 2005/07/08 10:39:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -214,7 +214,8 @@
         $env{'user.error.msg'}="$filename:cre:1:1:Source code not available";
         return HTTP_NOT_ACCEPTABLE;
     } 
-    unless (&Apache::lonnet::allowed('bre',$filename)) {
+    unless ((&Apache::lonnet::allowed('bre',$filename)) &&
+	    (&Apache::lonnet::allowed('cre','/'))) {
         $env{'user.error.msg'}="$filename:bre:1:1:Access to resource denied";
         return HTTP_NOT_ACCEPTABLE;
     } 
Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.21 loncom/interface/lonwhatsnew.pm:1.22
--- loncom/interface/lonwhatsnew.pm:1.21	Thu Jun  9 14:41:08 2005
+++ loncom/interface/lonwhatsnew.pm	Fri Jul  8 06:39:49 2005
@@ -1,5 +1,5 @@
 #
-# $Id: lonwhatsnew.pm,v 1.21 2005/06/09 18:41:08 albertel Exp $
+# $Id: lonwhatsnew.pm,v 1.22 2005/07/08 10:39:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -178,9 +178,9 @@
     }
 
     my %threshold = (
-                      av_attempts => 0,
-                      degdiff => 0.01,
-                      numstudents => 0,
+                      av_attempts => 2,
+                      degdiff => 0.5,
+                      numstudents => 2,
                      );
 
     my $pgbg=&Apache::loncommon::designparm($function.'.pgbg',$domain);
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.379 loncom/xml/lonxml.pm:1.380
--- loncom/xml/lonxml.pm:1.379	Wed Jun 29 15:02:14 2005
+++ loncom/xml/lonxml.pm	Fri Jul  8 06:39:49 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.379 2005/06/29 19:02:14 albertel Exp $
+# $Id: lonxml.pm,v 1.380 2005/07/08 10:39:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -818,7 +818,7 @@
 
 sub endredirection {
     if (!$Apache::lonxml::redirection) {
-	&Apache::lonxml::error("Endredirection was called, before a startredirection, perhaps you have unbalanced tags. Some debuging information:".join ":",caller);
+	&Apache::lonxml::error("Endredirection was called before a startredirection, perhaps you have unbalanced tags. Some debugging information:".join ":",caller);
 	return '';
     }
     $Apache::lonxml::redirection--;
@@ -1432,14 +1432,26 @@
 	&Apache::lonmsg::author_res_msg($env{'request.filename'},join('<br />',@_));
 	#notify course
 	if ( $symb && $env{'request.course.id'} ) {
+	    my $cnum=$env{'course.'.$env{'request.course.id'}.'.num'};
+	    my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'};
 	    my (undef,%users)=&Apache::lonfeedback::decide_receiver(undef,0,1,1,1);
 	    my $declutter=&Apache::lonnet::declutter($env{'request.filename'});
 	    my @userlist;
 	    foreach (keys %users) {
 		my ($user,$domain) = split(/:/, $_);
 		push(@userlist,"$user\@$domain");
-		&Apache::lonmsg::user_normal_msg($user,$domain,
+		my $key=$declutter.'_'.$user.'_'.$domain;
+		my %lastnotified=&Apache::lonnet::get('nohist_xmlerrornotifications',
+						      [$key],
+						      $cdom,$cnum);
+		my $now=time;
+		if ($now-$lastnotified{$key}>86400) {
+		    &Apache::lonmsg::user_normal_msg($user,$domain,
 						 "Error [$declutter]",join('<br />',@_));
+		    &Apache::lonnet::put('nohist_xmlerrornotifications',
+					 {$key => $now},
+					 $cdom,$cnum);		
+		}
 	    }
 	    if ($env{'request.role.adv'}) {
 		$errormsg=&mt("An error occured while processing this resource. The course personnel ([_1]) and the author have been notified.",join(', ',@userlist));

--www1120819192--