[LON-CAPA-cvs] cvs: loncom /auth lonlogout.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 05 Sep 2006 20:16:49 -0000


albertel		Tue Sep  5 16:16:49 2006 EDT

  Modified files:              
    /loncom/auth	lonlogout.pm 
  Log:
  - switch to using the stndard means of loading the env
  
  
Index: loncom/auth/lonlogout.pm
diff -u loncom/auth/lonlogout.pm:1.20 loncom/auth/lonlogout.pm:1.21
--- loncom/auth/lonlogout.pm:1.20	Tue Aug 29 16:34:39 2006
+++ loncom/auth/lonlogout.pm	Tue Sep  5 16:16:49 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Logout Handler
 #
-# $Id: lonlogout.pm,v 1.20 2006/08/29 20:34:39 albertel Exp $
+# $Id: lonlogout.pm,v 1.21 2006/09/05 20:16:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -59,23 +59,13 @@
 
     #we've got a valid user
     my @profile;
-    my %sessionhash;
-    {
-	my $idf=Apache::File->new("$lonidsdir/$handle.id");
-	@profile=<$idf>;
-    }
-    my $envi;
-    for ($envi=0;$envi<=$#profile;$envi++) {
-	chomp($profile[$envi]);
-	my ($envname,$envvalue)=split(/=/,$profile[$envi]);
-	$sessionhash{$envname}=$envvalue;
-    }
+    &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle);
     unlink("$lonidsdir/$handle.id");
     my %temp=('logout' => time);
     &Apache::lonnet::put('email_status',\%temp);
-    &Apache::lonnet::log($sessionhash{'user.domain'},
-			 $sessionhash{'user.name'},
-			 $sessionhash{'user.home'},
+    &Apache::lonnet::log($env{'user.domain'},
+			 $env{'user.name'},
+			 $env{'user.home'},
 			 "Logout $ENV{'REMOTE_ADDR'}");
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
@@ -108,7 +98,7 @@
 	$relogmessage=(<<ENDRELOG);
 	<h1>$lt{'gb'}!</h1>
 	    $lt{'pe'} <a href="javascript:self.close();">$lt{'cw'}</a> $lt{'or'}
-	<a href="$login_url?domain=$sessionhash{'user.domain'}">$lt{'li'}</a>.
+	<a href="$login_url?domain=$env{'user.domain'}">$lt{'li'}</a>.
 ENDRELOG
 
         if ($env{'request.sso.login'}