[LON-CAPA-cvs] cvs: loncom(version_2_10_X) /auth switchserver.pm

raeburn raeburn@source.lon-capa.org
Mon, 06 Sep 2010 15:45:08 -0000


raeburn		Mon Sep  6 15:45:08 2010 EDT

  Modified files:              (Branch: version_2_10_X)
    /loncom/auth	switchserver.pm 
  Log:
  - Backport 1.30.
  
  
Index: loncom/auth/switchserver.pm
diff -u loncom/auth/switchserver.pm:1.28.2.2 loncom/auth/switchserver.pm:1.28.2.3
--- loncom/auth/switchserver.pm:1.28.2.2	Wed Aug 18 19:40:23 2010
+++ loncom/auth/switchserver.pm	Mon Sep  6 15:45:08 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Switch Servers Handler
 #
-# $Id: switchserver.pm,v 1.28.2.2 2010/08/18 19:40:23 raeburn Exp $
+# $Id: switchserver.pm,v 1.28.2.3 2010/09/06 15:45:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -63,10 +63,18 @@
 					'only_body'      => $only_body,});
     my $end_page   = &Apache::loncommon::end_page();
     $r->print($start_page.$extra_text.$end_page);
+    unless ($env{'user.name'} eq 'public' && ($env{'user.domain'} eq 'public')) {
+        $r->register_cleanup(\&flush_course_logs);
+    }
     return OK;
 
 }
 
+sub flush_course_logs {
+    &Apache::lonnet::flushcourselogs();
+    return OK;
+}
+
 sub handler {
     my ($r) = @_;
     
@@ -193,7 +201,6 @@
 	'&username='.$env{'user.name'}.
 	'&token='.$token;
 # --------------------------------------------------------------- Screen Output
-    &Apache::lonnet::flushcourselogs();
     return &do_redirect($r,$url,0,$windowinfo);
 }