[LON-CAPA-cvs] cvs: loncom /auth migrateuser.pm /lonnet/perl lonnet.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 28 Dec 2005 19:26:22 -0000


albertel		Wed Dec 28 14:26:22 2005 EDT

  Modified files:              
    /loncom/auth	migrateuser.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - del the tmp file after migrating the user
  
  
Index: loncom/auth/migrateuser.pm
diff -u loncom/auth/migrateuser.pm:1.3 loncom/auth/migrateuser.pm:1.4
--- loncom/auth/migrateuser.pm:1.3	Fri Oct 28 17:51:43 2005
+++ loncom/auth/migrateuser.pm	Wed Dec 28 14:26:02 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Starts a user off based of an existing token.
 #
-# $Id: migrateuser.pm,v 1.3 2005/10/28 21:51:43 albertel Exp $
+# $Id: migrateuser.pm,v 1.4 2005/12/28 19:26:02 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -60,7 +60,12 @@
     my ($r) = @_;
     
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['token']);
-    my %data = &Apache::lonnet::tmpget($env{'form.token'});
+    my %data =   &Apache::lonnet::tmpget($env{'form.token'});
+    my $delete = &Apache::lonnet::tmpdel($env{'form.token'});
+
+    if ($delete ne 'ok') {
+	return &goto_login($r);
+    }
 
     if ($data{'ip'} ne $ENV{'REMOTE_ADDR'} || !defined($data{'username'}) ||
 	!defined($data{'domain'}) ) {
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.687 loncom/lonnet/perl/lonnet.pm:1.688
--- loncom/lonnet/perl/lonnet.pm:1.687	Thu Dec 22 15:56:28 2005
+++ loncom/lonnet/perl/lonnet.pm	Wed Dec 28 14:26:19 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.687 2005/12/22 20:56:28 albertel Exp $
+# $Id: lonnet.pm,v 1.688 2005/12/28 19:26:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3017,8 +3017,9 @@
 
 # ------------------------------------------------------------ tmpget interface
 sub tmpget {
-    my ($token)=@_;
-    my $rep=&reply("tmpget:$token",$perlvar{'lonHostID'});
+    my ($token,$server)=@_;
+    if (!defined($server)) { $server = $perlvar{'lonHostID'}; }
+    my $rep=&reply("tmpget:$token",$server);
     my %returnhash;
     foreach my $item (split(/\&/,$rep)) {
 	my ($key,$value)=split(/=/,$item);
@@ -3027,6 +3028,13 @@
     return %returnhash;
 }
 
+# ------------------------------------------------------------ tmpget interface
+sub tmpdel {
+    my ($token,$server)=@_;
+    if (!defined($server)) { $server = $perlvar{'lonHostID'}; }
+    return &reply("tmpdel:$token",$server);
+}
+
 # ---------------------------------------------- Custom access rule evaluation
 
 sub customaccess {