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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 28 Dec 2005 16:46:47 -0000


albertel		Wed Dec 28 11:46:47 2005 EDT

  Modified files:              
    /loncom/auth	switchserver.pm lonlogin.pm 
  Log:
  - BUG #4524 swtchserver works in a backward to 2.0 and before manner
  
  
Index: loncom/auth/switchserver.pm
diff -u loncom/auth/switchserver.pm:1.5 loncom/auth/switchserver.pm:1.6
--- loncom/auth/switchserver.pm:1.5	Tue Nov 29 15:59:37 2005
+++ loncom/auth/switchserver.pm	Wed Dec 28 11:46:47 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Switch Servers Handler
 #
-# $Id: switchserver.pm,v 1.5 2005/11/29 20:59:37 albertel Exp $
+# $Id: switchserver.pm,v 1.6 2005/12/28 16:46:47 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -104,7 +104,7 @@
 	      'role'     => $env{'form.role'},
 	      'server'   => $r->dir_config('lonHostID'));
     my $token = &Apache::lonnet::tmpput(\%info,$env{'form.otherserver'});
-    my $switch='<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url=http://'.$switch_to.'/adm/migrateuser?token='.$token.'">';
+    my $switch='<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url=http://'.$switch_to.'/adm/login?domain='.$env{'user.domain'}.'&username='.$env{'user.name'}.'&token='.$token.'">';
     my $bodytag=&Apache::loncommon::bodytag('Switching Server ...');
 # --------------------------------------------------------------- Screen Output
     $r->print(<<ENDDOCUMENT);
Index: loncom/auth/lonlogin.pm
diff -u loncom/auth/lonlogin.pm:1.70 loncom/auth/lonlogin.pm:1.71
--- loncom/auth/lonlogin.pm:1.70	Wed Nov 23 15:58:31 2005
+++ loncom/auth/lonlogin.pm	Wed Dec 28 11:46:47 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Login Screen
 #
-# $Id: lonlogin.pm,v 1.70 2005/11/23 20:58:31 www Exp $
+# $Id: lonlogin.pm,v 1.71 2005/12/28 16:46:47 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -36,9 +36,21 @@
 use Apache::loncommon();
 use Apache::lonauth();
 use Apache::lonlocal;
+use Apache::migrateuser();
 
 sub handler {
     my $r = shift;
+
+    &Apache::loncommon::get_unprocessed_cgi
+	($ENV{'QUERY_STRING'}.'&'.$env{'request.querystring'},
+	 ['interface','username','domain','firsturl','localpath','localres',
+	  'token']);
+
+# -- check if they are a migrating user
+    if (defined($env{'form.token'})) {
+	return &Apache::migrateuser::handler($r);
+    }
+
     &Apache::loncommon::no_cache($r);
     &Apache::lonlocal::get_language_handle($r);
     &Apache::loncommon::content_type($r,'text/html');
@@ -52,6 +64,7 @@
 	return OK;
     }
 
+
 # -------------------------------- Prevent users from attempting to login twice
     my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));
     my $lonid=$cookies{'lonID'};
@@ -89,10 +102,6 @@
 
 # ---------------------------------------------------- No valid token, continue
 
-    &Apache::loncommon::get_unprocessed_cgi
-     ($ENV{'QUERY_STRING'}.'&'.$env{'request.querystring'},
-      ['interface','username','domain','firsturl','localpath','localres']);
-
  # ---------------------------- Not possible to really login to domain "public"
     if ($env{'form.domain'} eq 'public') {
 	$env{'form.domain'}='';