[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm /interface lonpreferences.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 14 Oct 2002 20:41:07 -0000


albertel		Mon Oct 14 16:41:07 2002 EDT

  Modified files:              
    /loncom/interface	lonpreferences.pm 
    /loncom/homework	lonhomework.pm 
  Log:
  - better control over when debug messages show and when they don't
  
  
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.14 loncom/interface/lonpreferences.pm:1.15
--- loncom/interface/lonpreferences.pm:1.14	Fri Sep 13 15:32:09 2002
+++ loncom/interface/lonpreferences.pm	Mon Oct 14 16:41:07 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.14 2002/09/13 19:32:09 www Exp $
+# $Id: lonpreferences.pm,v 1.15 2002/10/14 20:41:07 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -378,8 +378,7 @@
 			 "Password data was blank.\n</p>");
 	return;
     }
-    # Get the keys
-    my $lonhost = $r->dir_config('lonHostID');
+    # Get the keysecen my $lonhost = $r->dir_config('lonHostID');
     my $tmpinfo = Apache::lonnet::reply('tmpget:'.$logtoken,$lonhost);
     if (($tmpinfo=~/^error/) || ($tmpinfo eq 'con_lost')) {
         # I do not a have a better idea about how to handle this
@@ -478,6 +477,14 @@
         &msgforwardchanger($r);
     } elsif ($ENV{'form.action'} eq 'verify_and_change_msgforward') {
         &verify_and_change_msgforward($r);
+    } elsif ($ENV{'form.action'} eq 'debugtoggle') {
+	if ($ENV{'user.name'} eq 'albertel' ) {
+	    if ($ENV{'user.debug'}) {
+		&Apache::lonnet::delenv('user\.debug');
+	    } else {
+		&Apache::lonnet::appenv('user.debug' => 1);
+	    }
+	}
     } else {
 	$r->print(<<ENDHEADER);
 <html>
@@ -511,15 +518,24 @@
 </form>
 ENDMSGFORWARDFORM
 # The "about me" page
-            my $aboutmeaction=
-        '/adm/'.$ENV{'user.domain'}.'/'.$ENV{'user.name'}.'/aboutme';
-	    $r->print(<<ENDABOUTME);
+	my $aboutmeaction=
+	    '/adm/'.$ENV{'user.domain'}.'/'.$ENV{'user.name'}.'/aboutme';
+	$r->print(<<ENDABOUTME);
 <form name="client" action="$aboutmeaction" method="post">
 <input type="hidden" name="action" value="changescreenname" />
 <input type="submit" value="Edit the 'About Me' Personal Information Screen" />
 </form>
 ENDABOUTME
-            # Other preference setting code should be added here
+	if ($ENV{'user.name'} eq 'albertel') {
+	    $r->print(<<ENDDEBUG);
+<form name="client" action="/adm/preferences" method="post">
+<input type="hidden" name="action" value="debugtoggle" />
+<input type="submit" value="Toggle Debug" />
+Current Debug status is -$ENV{'user.debug'}-.
+</form>
+ENDDEBUG
+	}
+	# Other preference setting code should be added here
     }
     $r->print(<<ENDFOOTER);
 </body>
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.94 loncom/homework/lonhomework.pm:1.95
--- loncom/homework/lonhomework.pm:1.94	Mon Oct 14 12:46:42 2002
+++ loncom/homework/lonhomework.pm	Mon Oct 14 16:41:07 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.94 2002/10/14 16:46:42 bowersj2 Exp $
+# $Id: lonhomework.pm,v 1.95 2002/10/14 20:41:07 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -506,7 +506,8 @@
   #my $t0 = [&gettimeofday()];
   my $request=$_[0];
 
-  #if ( $ENV{'user.name'} eq 'albertel' ) {$Apache::lonxml::debug=1;}
+#  if ( $ENV{'user.name'} eq 'albertel' ) {$Apache::lonxml::debug=1;}
+  $Apache::lonxml::debug=$ENV{'user.debug'};
 
   if (&setupheader($request)) { return OK; }
   $ENV{'request.uri'}=$request->uri;