--- loncom/auth/lonauth.pm 2019/06/16 22:32:04 1.158 +++ loncom/auth/lonauth.pm 2020/03/15 23:04:10 1.159 @@ -1,7 +1,7 @@ # The LearningOnline Network # User Authentication Module # -# $Id: lonauth.pm,v 1.158 2019/06/16 22:32:04 raeburn Exp $ +# $Id: lonauth.pm,v 1.159 2020/03/15 23:04:10 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,7 +46,7 @@ use Digest::MD5; # ------------------------------------------------------------ Successful login sub success { my ($r, $username, $domain, $authhost, $lowerurl, $extra_env, - $form,$skipcritical) = @_; + $form,$skipcritical,$cid) = @_; # ------------------------------------------------------------ Get cookie ready my $cookie = @@ -148,16 +148,26 @@ sub success { } 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; }