[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm /interface lonparmset.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 14 Dec 2006 20:49:23 -0000


albertel		Thu Dec 14 15:49:23 2006 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
    /loncom/auth	lonroles.pm 
  Log:
  - BUG#5011 when initing a course if the bighash .db file is gone can get ISE warn and ask for reinit
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.354 loncom/interface/lonparmset.pm:1.355
--- loncom/interface/lonparmset.pm:1.354	Thu Dec 14 15:34:33 2006
+++ loncom/interface/lonparmset.pm	Thu Dec 14 15:49:22 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.354 2006/12/14 20:34:33 albertel Exp $
+# $Id: lonparmset.pm,v 1.355 2006/12/14 20:49:22 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3861,6 +3861,12 @@
     $r->print(&Apache::loncommon::end_page());
 }
 
+sub check_for_course_info {
+    my $navmap = Apache::lonnavmaps::navmap->new();
+    return 1 if ($navmap);
+    return 0;
+}
+
 ##################################################
 ##################################################
 
@@ -3904,7 +3910,9 @@
 	(&Apache::lonnet::allowed('opa',$env{'request.course.id'}) ||
 	 &Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'.
 				  $env{'request.course.sec'}));
-    if ($env{'request.course.id'} &&  $parm_permission) {
+    my $exists = &check_for_course_info();
+
+    if ($env{'request.course.id'} &&  $parm_permission && $exists) {
 
         # Start Page
         &Apache::loncommon::content_type($r,'text/html');
@@ -3974,8 +3982,13 @@
 	}       
     } else {
 # ----------------------------- Not in a course, or not allowed to modify parms
-	$env{'user.error.msg'}=
-	    "/adm/parmset:opa:0:0:Cannot modify assessment parameters";
+	if ($exists) {
+	    $env{'user.error.msg'}=
+		"/adm/parmset:opa:0:0:Cannot modify assessment parameters";
+	} else {
+	    $env{'user.error.msg'}=
+		"/adm/parmset::0:1:Course environment gone, reinitialize the course";
+	}
 	return HTTP_NOT_ACCEPTABLE;
     }
     return OK;
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.173 loncom/auth/lonroles.pm:1.174
--- loncom/auth/lonroles.pm:1.173	Mon Dec 11 16:56:53 2006
+++ loncom/auth/lonroles.pm	Thu Dec 14 15:49:23 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.173 2006/12/11 21:56:53 albertel Exp $
+# $Id: lonroles.pm,v 1.174 2006/12/14 20:49:23 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -407,10 +407,17 @@
 # --------------------------------------------------------------- Error Header?
     if ($error) {
 	$r->print("<h1>LON-CAPA Access Control</h1>");
-        $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 />");
+	$r->print("<!-- LONCAPAACCESSCONTROLERRORSCREEN --><hr /><pre>");
+	if ($priv ne '') {
+	    $r->print("Access  : ".&Apache::lonnet::plaintext($priv)."\n");
+	}
+	if ($fn ne '') {
+	    $r->print("Resource: ".&Apache::lonenc::check_encrypt($fn)."\n");
+	}
+	if ($msg ne '') {
+	    $r->print("Action  : $msg\n");
+	}
+	$r->print("</pre><hr />");
 	my $url=$fn;
 	my $last;
 	if (tie(my %hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db',