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

raeburn raeburn at source.lon-capa.org
Sat May 2 11:29:41 EDT 2020


raeburn		Sat May  2 15:29:41 2020 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/auth	lonauth.pm 
  Log:
  - For 2.11
    Backport 1.159
  
  
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.121.2.18 loncom/auth/lonauth.pm:1.121.2.19
--- loncom/auth/lonauth.pm:1.121.2.18	Sat Aug  3 22:45:30 2019
+++ loncom/auth/lonauth.pm	Sat May  2 15:29:40 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonauth.pm,v 1.121.2.18 2019/08/03 22:45:30 raeburn Exp $
+# $Id: lonauth.pm,v 1.121.2.19 2020/05/02 15:29:40 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -45,7 +45,7 @@
 # ------------------------------------------------------------ Successful login
 sub success {
     my ($r, $username, $domain, $authhost, $lowerurl, $extra_env,
-	$form) = @_;
+	$form,$cid) = @_;
 
 # ------------------------------------------------------------ Get cookie ready
     my $cookie =
@@ -117,16 +117,26 @@
     }
     if (defined($form->{symb})) {
         my $destsymb = $form->{symb};
+        my $encrypted;
+        if ($destsymb =~ m{^/enc/}) {
+            $encrypted = 1;
+            if ($cid) {
+                $destsymb = &Apache::lonenc::unencrypted($destsymb,$cid);
+            }
+        }
         $destination  .= ($destination =~ /\?/) ? '&' : '?';
         if ($destsymb =~ /___/) {
-            # FIXME Need to deal with encrypted symbs and urls as needed.
             my ($map,$resid,$desturl)=split(/___/,$destsymb);
             $desturl = &Apache::lonnet::clutter($desturl);
+            if ($encrypted) {
+                $desturl = &Apache::lonenc::encrypted($desturl,1,$cid);
+                $destsymb = $form->{symb};
+            }
             $desturl = &HTML::Entities::encode($desturl,'"<>&');
             $destsymb = &HTML::Entities::encode($destsymb,'"<>&');
             $destination .= 'destinationurl='.$desturl.
                             '&destsymb='.$destsymb;
-        } else {
+        } elsif (!$encrypted) {
             $destsymb = &HTML::Entities::encode($destsymb,'"<>&');
             $destination .= 'destinationurl='.$destsymb;
         }




More information about the LON-CAPA-cvs mailing list