[LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf /auth loncacc.pm lonroles.pm /html/adm/help/tex About_Bombs.tex /interface lonhtmlcommon.pm lonmeta.pm /publisher lonpubdir.pm doc/loncapafiles loncapafiles.lpml

www lon-capa-cvs@mail.lon-capa.org
Thu, 15 Jan 2004 20:22:47 -0000


This is a MIME encoded message

--www1074198167
Content-Type: text/plain

www		Thu Jan 15 15:22:47 2004 EDT

  Added files:                 
    /loncom/html/adm/help/tex	About_Bombs.tex 

  Modified files:              
    /doc/loncapafiles	loncapafiles.lpml 
    /loncom	loncapa_apache.conf 
    /loncom/auth	loncacc.pm lonroles.pm 
    /loncom/interface	lonhtmlcommon.pm lonmeta.pm 
    /loncom/publisher	lonpubdir.pm 
  Log:
  Even better handling of bombs.
  
  
--www1074198167
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20040115152247.txt"

Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.320 doc/loncapafiles/loncapafiles.lpml:1.321
--- doc/loncapafiles/loncapafiles.lpml:1.320	Wed Jan 14 20:43:43 2004
+++ doc/loncapafiles/loncapafiles.lpml	Thu Jan 15 15:22:47 2004
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.320 2004/01/15 01:43:43 www Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.321 2004/01/15 20:22:47 www Exp $ -->
 
 <!--
 
@@ -1987,6 +1987,7 @@
 </description>
 <filenames>
 About_Authors_Manual.tex;
+About_Bombs.tex;
 About_Communication.tex;
 About_Developers_Manual.tex;
 About_Numerical_and_Formula_Response.tex;
Index: loncom/loncapa_apache.conf
diff -u loncom/loncapa_apache.conf:1.70 loncom/loncapa_apache.conf:1.71
--- loncom/loncapa_apache.conf:1.70	Wed Jan 14 20:43:43 2004
+++ loncom/loncapa_apache.conf	Thu Jan 15 15:22:47 2004
@@ -1,7 +1,7 @@
 ##
 ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file
 ##
-## $Id: loncapa_apache.conf,v 1.70 2004/01/15 01:43:43 www Exp $
+## $Id: loncapa_apache.conf,v 1.71 2004/01/15 20:22:47 www Exp $
 ##
 
 #
@@ -190,22 +190,30 @@
 PerlHandler Apache::lontex
 </LocationMatch>
 
-<LocationMatch "^/+res/.*\.page$>
+<LocationMatch "^/+res/.*\.page$">
 SetHandler perl-script
 PerlHandler Apache::lonpage
 </LocationMatch>
 
-<LocationMatch "^/+res/.*\.sequence$>
+<LocationMatch "^/+res/.*\.sequence$">
 SetHandler perl-script
 PerlHandler Apache::lonsequence
 </LocationMatch>
 
-<LocationMatch "^/+(res|\~|public|uploaded|adm).*\.meta$>
+<LocationMatch "^/+(res|\~|public|uploaded|adm).*\.meta$">
 SetHandler perl-script
 PerlHandler Apache::lonmeta
 </LocationMatch>
 
-<LocationMatch "^/+(res|\~).*\.rights$>
+<LocationMatch "^/adm/bombs/">
+SetHandler perl-script
+PerlAccessHandler Apache::lonacc
+PerlHandler Apache::lonmeta
+</LocationMatch>
+
+
+
+<LocationMatch "^/+(res|\~).*\.rights$">
 SetHandler perl-script
 PerlHandler Apache::lonrights
 </LocationMatch>
Index: loncom/auth/loncacc.pm
diff -u loncom/auth/loncacc.pm:1.31 loncom/auth/loncacc.pm:1.32
--- loncom/auth/loncacc.pm:1.31	Sat Sep 20 13:44:22 2003
+++ loncom/auth/loncacc.pm	Thu Jan 15 15:22:47 2004
@@ -2,7 +2,7 @@
 # Cookie Based Access Handler for Construction Area
 # (lonacc: 5/21/99,5/22,5/29,5/31 Gerd Kortemeyer)
 #
-# $Id: loncacc.pm,v 1.31 2003/09/20 17:44:22 www Exp $
+# $Id: loncacc.pm,v 1.32 2004/01/15 20:22:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -46,7 +46,7 @@
 
 sub constructaccess {
     my ($url,$ownerdomain)=@_;
-    my ($ownername)=($url=~/\/(?:\~|priv\/|home\/)(\w+)/);
+    my ($ownername)=($url=~/\/(?:\~|priv\/|home\/)(\w+)\//);
     unless (($ownername) && ($ownerdomain)) { return ''; }
     # We do not allow editing of previous versions of files.
     if ($url=~/\.(\d+)\.(\w+)$/) { return ''; }
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.81 loncom/auth/lonroles.pm:1.82
--- loncom/auth/lonroles.pm:1.81	Tue Dec 30 17:45:59 2003
+++ loncom/auth/lonroles.pm	Thu Jan 15 15:22:47 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.81 2003/12/30 22:45:59 www Exp $
+# $Id: lonroles.pm,v 1.82 2004/01/15 20:22:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -77,17 +77,6 @@
     return;
 }
 
-sub authorbombs {
-    my ($uname,$udom)=@_;
-    my %bombs=&Apache::lonmsg::all_url_author_res_msg($uname,$udom);
-    foreach (keys %bombs) {
-	if ($_=~/^$udom\/$uname\//) {
-	    return '<img src="/adm/lonMisc/bomb.gif" />';
-	}
-    }
-    return '';
-}
-
 sub handler {
 
     my $r = shift;
@@ -248,8 +237,10 @@
 
     my $swinfo=&Apache::lonmenu::rawconfig();
     my $bodytag=&Apache::loncommon::bodytag('User Roles');
-    my $helptag=&Apache::loncommon::help_open_topic
-     ("General_Intro",&mt("Click here for help"));
+    my $helptag='<table><tr><td>'.&Apache::loncommon::help_open_topic
+     ("General_Intro",&mt("Click here for help")).'</td><td>'.
+      &Apache::loncommon::help_open_faq(1,&mt('Click here for FAQ')).'</td><td>'.
+      &Apache::loncommon::help_open_bug('',&mt('Click here to report bugs')).'</td></tr></table>';
     $r->print(<<ENDHEADER);
 <html>
 <head>
@@ -428,7 +419,7 @@
 			': '.$tdom.'<br />'.
                         ' '.&mt('Server').':&nbsp;'.$home;
                     $ENV{'course.'.$tdom.'_'.$trest.'.description'}='ca';
-		    $tremark.=&authorbombs($trest,$tdom);
+		    $tremark.=&Apache::lonhtmlcommon::authorbombs('/res/'.$tdom.'/'.$trest.'/');
 		    $sortkey=$role."$trest:$tdom";
                 } elsif ($role eq 'au') {
                     # Authors
@@ -448,7 +439,7 @@
                     $twhere=&mt('Domain').': '.$tdom.'<br />'.&mt('Server').
 			':&nbsp;'.$home;
                     $ENV{'course.'.$tdom.'_'.$trest.'.description'}='ca';
-		    $tremark.=&authorbombs($ENV{'user.name'},$tdom);
+		    $tremark.=&Apache::lonhtmlcommon::authorbombs('/res/'.$tdom.'/'.$ENV{'user.name'}.'/');
 		    $sortkey=$role;
                 } elsif ($trest) {
                     $ttype='Course';
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.39 loncom/interface/lonhtmlcommon.pm:1.40
--- loncom/interface/lonhtmlcommon.pm:1.39	Fri Jan  2 11:34:03 2004
+++ loncom/interface/lonhtmlcommon.pm	Thu Jan 15 15:22:47 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.39 2004/01/02 16:34:03 www Exp $
+# $Id: lonhtmlcommon.pm,v 1.40 2004/01/15 20:22:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -59,6 +59,33 @@
 use Apache::lonlocal;
 use strict;
 
+
+##############################################
+##############################################
+
+=pod
+
+=item authorbombs
+
+=cut
+
+##############################################
+##############################################
+
+sub authorbombs {
+    my $url=shift;
+    $url=&Apache::lonnet::declutter($url);
+    my ($udom,$uname)=($url=~/^(\w+)\/(\w+)\//);
+    my %bombs=&Apache::lonmsg::all_url_author_res_msg($uname,$udom);
+    foreach (keys %bombs) {
+	if ($_=~/^$udom\/$uname\//) {
+	    return '<a href="/adm/bombs/'.$url.
+		'"><img src="/adm/lonMisc/bomb.gif" border="0" /></a>'.
+		&Apache::loncommon::help_open_topic('About_Bombs');
+	}
+    }
+    return '';
+}
 
 ##############################################
 ##############################################
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.58 loncom/interface/lonmeta.pm:1.59
--- loncom/interface/lonmeta.pm:1.58	Thu Jan 15 10:12:31 2004
+++ loncom/interface/lonmeta.pm	Thu Jan 15 15:22:47 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.58 2004/01/15 15:12:31 www Exp $
+# $Id: lonmeta.pm,v 1.59 2004/01/15 20:22:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -434,7 +434,30 @@
 
     my $uri=$r->uri;
 
-  unless ($uri=~/^\/\~/) { 
+# ====================================================== Looking for all bombs?
+  if ($uri=~/\/adm\/bombs\/(.*)$/) {
+# ----------------------------------------------------------- Set document type
+      $uri=&Apache::lonnet::declutter($1);
+      &Apache::loncommon::content_type($r,'text/html');
+      $r->send_http_header;
+      
+      return OK if $r->header_only;
+      $r->print(&Apache::loncommon::bodytag('Error Messages'));
+      $r->print('<h1>'.&Apache::lonnet::clutter($uri).'</h1>');
+      my ($domain,$author)=($uri=~/^(\w+)\/(\w+)\//);
+      if (&Apache::loncacc::constructaccess('/~'.$author.'/',$domain)) {
+	  my %brokenurls=&Apache::lonmsg::all_url_author_res_msg($author,$domain);
+	  foreach (sort keys %brokenurls) {
+	      if ($_=~/^\Q$uri\E/) {
+		  $r->print(&Apache::lonhtmlcommon::crumbs(&Apache::lonnet::clutter($_)).
+		    &Apache::lonmsg::retrieve_author_res_msg($_).'<hr />');
+	      }
+	  }
+      } else {
+	  $r->print(&mt('Not authorized'));
+      }
+      $r->print('</body></html>');
+  } elsif ($uri!~/^\/\~/) { 
 # =========================================== This is not in construction space
     my ($resdomain,$resuser)=
            (&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//);
@@ -610,27 +633,21 @@
   $target=~s/\.meta$//;
   my $bombs=&Apache::lonmsg::retrieve_author_res_msg($target);
   if ($bombs) {
-      my $del='';
-      if ($target=~/allbombs$/) {
-	  $disuri='All Error Messages';
-      } else {
-	  if ($ENV{'form.delmsg'}) {
-	      if (&Apache::lonmsg::del_url_author_res_msg($target) eq 'ok') {
-		  $bombs=&mt('Messages deleted.');
-	      } else {
-		  $bombs=&mt('Error deleting messages');
-	      }
+      if ($ENV{'form.delmsg'}) {
+	  if (&Apache::lonmsg::del_url_author_res_msg($target) eq 'ok') {
+	      $bombs=&mt('Messages deleted.');
+	  } else {
+	      $bombs=&mt('Error deleting messages');
 	  }
-	  $del='<input type="submit" name="delmsg" value="'.
-	      &mt('Delete Messages').'" />';
       }
       my $bodytag=&Apache::loncommon::bodytag('Error Messages');
+      my $del=&mt('Delete Messages');
       $r->print(<<ENDBOMBS);
 <html><head><title>Edit Catalog Information</title></head>
 $bodytag
 <h1>$disuri</h1>
 <form method="post" name="defaultmeta">
-$del
+<input type="submit" name="delmsg" value="$del" />
 <br />$bombs
 </form>
 </body>
@@ -704,9 +721,9 @@
       $r->print(
 		'<br /><input type="submit" name="store" value="'.
 		&mt('Store Catalog Information').'"></form></body></html>');
+   }
   }
-    return OK;
- }
+  return OK;
 }
 
 # ================================================================= BEGIN Block
Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.57 loncom/publisher/lonpubdir.pm:1.58
--- loncom/publisher/lonpubdir.pm:1.57	Mon Jan  5 21:15:12 2004
+++ loncom/publisher/lonpubdir.pm	Thu Jan 15 15:22:47 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construction Space Directory Lister
 #
-# $Id: lonpubdir.pm,v 1.57 2004/01/06 02:15:12 www Exp $
+# $Id: lonpubdir.pm,v 1.58 2004/01/15 20:22:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -286,7 +286,7 @@
 		  '<td>'.&mt('Go to ...').'</td>'.
 		  '<td><font face="arial"><a href="'.$here.'/'.$dirname.'/" target="_top">'.
 		  $disfilename.'</a></font></td>'.
-		        '<td colspan="2">'.($kaputt?'<img src="/adm/lonMisc/bomb.gif" />':'').$Apache::lonpublisher::metadatafields{'title'}.' <i>'.
+		        '<td colspan="2">'.($kaputt?&Apache::lonhtmlcommon::authorbombs($resdir.'/'.$disfilename.'/'):'').$Apache::lonpublisher::metadatafields{'title'}.' <i>'.
 		  $Apache::lonpublisher::metadatafields{'subject'}.'</i> '.
 		  $Apache::lonpublisher::metadatafields{'keywords'}.'</td>'.
 		  '<td>'.&Apache::lonlocal::locallocaltime($modtime).'</td>'.

Index: loncom/html/adm/help/tex/About_Bombs.tex
+++ loncom/html/adm/help/tex/About_Bombs.tex
\label{About_Bombs}
The bomb symbol indicates that there was a runtime error in one of your
resources, i.e., somebody tried to use it and it did not work.

Click on the bomb to see details.

--www1074198167--