[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /auth lonauth.pm

raeburn raeburn at source.lon-capa.org
Sun Jan 5 06:38:43 EST 2014


raeburn		Sun Jan  5 11:38:43 2014 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/auth	lonauth.pm 
  Log:
  - For 2.11
    - Backport 1.130, 1.131.
  
  
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.121.2.7 loncom/auth/lonauth.pm:1.121.2.8
--- loncom/auth/lonauth.pm:1.121.2.7	Fri Dec 20 15:03:55 2013
+++ loncom/auth/lonauth.pm	Sun Jan  5 11:38:43 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonauth.pm,v 1.121.2.7 2013/12/20 15:03:55 raeburn Exp $
+# $Id: lonauth.pm,v 1.121.2.8 2014/01/05 11:38:43 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -108,11 +108,11 @@
             }
             $desturl = &HTML::Entities::encode($desturl,'"<>&');
             $destsymb = &HTML::Entities::encode($destsymb,'"<>&');
-            $destination .= '&destinationurl='.$desturl.
+            $destination .= 'destinationurl='.$desturl.
                             '&destsymb='.$destsymb;
         } else {
             $destsymb = &HTML::Entities::encode($destsymb,'"<>&');
-            $destination .= '&destinationurl='.$destsymb;
+            $destination .= 'destinationurl='.$destsymb;
         }
     }
     if ($destination =~ m{^/adm/roles}) {
@@ -482,7 +482,17 @@
         if ($otherserver) {
             &success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect',undef,
                      \%form);
-	    $r->internal_redirect('/adm/switchserver?otherserver='.$otherserver.'&origurl='.$firsturl);
+            my $switchto = '/adm/switchserver?otherserver='.$otherserver;
+            if (($firsturl) && ($firsturl ne '/adm/switchserver') && ($firsturl ne '/adm/roles')) {
+                $switchto .= '&origurl='.$firsturl;
+            }
+            if ($form{'role'}) {
+                $switchto .= '&role='.$form{'role'};
+            }
+            if ($form{'symb'}) {
+                $switchto .= '&symb='.$form{'symb'};
+            }
+            $r->internal_redirect($switchto);
         } else {
             $r->print(&noswitch());
         }
@@ -493,7 +503,17 @@
             if ($otherserver) {
                 &success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect',undef,
                          \%form);
-                $r->internal_redirect('/adm/switchserver?otherserver='.$otherserver.'&origurl='.$firsturl);
+                my $switchto = '/adm/switchserver?otherserver='.$otherserver;
+                if (($firsturl) && ($firsturl ne '/adm/switchserver') && ($firsturl ne '/adm/roles')) {
+                    $switchto .= '&origurl='.$firsturl;
+                }
+                if ($form{'role'}) {
+                    $switchto .= '&role='.$form{'role'};
+                }
+                if ($form{'symb'}) {
+                    $switchto .= '&symb='.$form{'symb'};
+                }
+                $r->internal_redirect($switchto);
             } else {
                 $r->print(&noswitch());
             }




More information about the LON-CAPA-cvs mailing list