[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lon-capa-cvs
Subject:    [LON-CAPA-cvs] cvs: loncom /auth switchserver.pm
From:       raeburn <raeburn () source ! lon-capa ! org>
Date:       2015-01-08 21:18:29
Message-ID: cvsraeburn1420751909 () cvsserver
[Download RAW message or body]

raeburn		Thu Jan  8 21:18:29 2015 EDT

  Modified files:              
    /loncom/auth	switchserver.pm 
  Log:
  - Replace two instances of protocols statically defined as http with 
    protocol retrieved from value for key for target host, as defined in 
    %Apache::lonnet::protocol.
  
  
Index: loncom/auth/switchserver.pm
diff -u loncom/auth/switchserver.pm:1.32 loncom/auth/switchserver.pm:1.33
--- loncom/auth/switchserver.pm:1.32	Sun Sep 29 00:49:24 2013
+++ loncom/auth/switchserver.pm	Thu Jan  8 21:18:29 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Switch Servers Handler
 #
-# $Id: switchserver.pm,v 1.32 2013/09/29 00:49:24 raeburn Exp $
+# $Id: switchserver.pm,v 1.33 2015/01/08 21:18:29 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -96,9 +96,16 @@
 
     if (!defined($switch_to)) { return FORBIDDEN; }
 
+    my $protocol = 'http';
+    if ($env{'form.otherserver'}) {
+        if ($Apache::lonnet::protocol{$env{'form.otherserver'}} eq 'https') {
+            $protocol = $Apache::lonnet::protocol{$env{'form.otherserver'}};
+        }
+    } 
+
     if ($env{'user.name'} eq 'public'
 	&& $env{'user.domain'} eq 'public') {
-	my $url = 'http://'.$switch_to.$r->uri;
+	my $url = $protocol.'://'.$switch_to.$r->uri;
 	return &do_redirect($r,$url,1)
     }
 
@@ -193,7 +200,7 @@
         $info{'sso.reloginserver'} = $env{'request.sso.reloginserver'};
     }
     my $token = &Apache::lonnet::tmpput(\%info,$env{'form.otherserver'});
-    my $url ='http://'.$switch_to.'/adm/login?'.
+    my $url =$protocol.'://'.$switch_to.'/adm/login?'.
 	'domain='.$env{'user.domain'}.
 	'&amp;username='.$env{'user.name'}.
 	'&amp;token='.$token;


_______________________________________________
LON-CAPA-cvs mailing list
LON-CAPA-cvs@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic