version 1.11, 2021/10/26 15:52:54
|
version 1.12, 2021/11/03 01:04:02
|
Line 98 sub handler {
|
Line 98 sub handler {
|
} |
} |
} else { |
} else { |
my $uri = $r->uri; |
my $uri = $r->uri; |
if ($r->args ne '') { |
|
$dest .= (($dest=~/\?/)?'&':'?').$r->args; |
|
} |
|
unless (($uri eq '/adm/roles') || ($uri eq '/adm/logout')) { |
|
unless ($r->args =~ /origurl=/) { |
|
$dest.=(($dest=~/\?/)?'&':'?').'origurl='.$uri; |
|
} |
|
} |
|
if ($uri =~ m{^/tiny/$match_domain/\w+$}) { |
if ($uri =~ m{^/tiny/$match_domain/\w+$}) { |
unless (($r->args =~ /ltoken=/) || ($r->args =~ /linkkey=/)) { |
my $querystring = &set_token($r,$lonhost); |
&Apache::lonacc::get_posted_cgi($r,['linkkey']); |
if ($querystring ne '') { |
if ($env{'form.linkkey'} ne '') { |
$dest .= '?'.$querystring; |
$dest.=(($dest=~/\?/)?'&':'?').'linkkey='.$env{'form.linkkey'}; |
} |
|
} else { |
|
if ($r->args ne '') { |
|
$dest .= (($dest=~/\?/)?'&':'?').$r->args; |
|
} |
|
unless (($uri eq '/adm/roles') || ($uri eq '/adm/logout')) { |
|
unless ($r->args =~ /origurl=/) { |
|
$dest.=(($dest=~/\?/)?'&':'?').'origurl='.$uri; |
} |
} |
} |
} |
} |
} |
Line 134 sub set_token {
|
Line 133 sub set_token {
|
&Apache::loncommon::get_unprocessed_cgi($r->args); |
&Apache::loncommon::get_unprocessed_cgi($r->args); |
} |
} |
if ($r->uri =~ m{^/tiny/$match_domain/\w+$}) { |
if ($r->uri =~ m{^/tiny/$match_domain/\w+$}) { |
unless (($env{'form.ltoken'}) || ($env{'form.linkkey'})) { |
if ($env{'form.ttoken'}) { |
&Apache::lonacc::get_posted_cgi($r,['linkkey']); |
my %info = &Apache::lonnet::tmpget($env{'form.ttoken'}); |
|
&Apache::lonnet::tmpdel($env{'form.ttoken'}); |
|
if ($info{'ltoken'}) { |
|
$env{'form.ltoken'} = $info{'ltoken'}; |
|
} elsif ($info{'linkkey'} ne '') { |
|
$env{'form.linkkey'} = $info{'linkkey'}; |
|
} |
|
} else { |
|
unless (($env{'form.ltoken'}) || ($env{'form.linkkey'})) { |
|
&Apache::lonacc::get_posted_cgi($r,['linkkey']); |
|
} |
} |
} |
} |
} |
my $extras; |
my $extras; |
Line 143 sub set_token {
|
Line 152 sub set_token {
|
if ($env{'form.'.$name} ne '') { |
if ($env{'form.'.$name} ne '') { |
if ($name eq 'ltoken') { |
if ($name eq 'ltoken') { |
my %info = &Apache::lonnet::tmpget($env{'form.ltoken'}); |
my %info = &Apache::lonnet::tmpget($env{'form.ltoken'}); |
|
&Apache::lonnet::tmpdel($env{'form.ltoken'}); |
if ($info{'linkprot'}) { |
if ($info{'linkprot'}) { |
$extras .= '&linkprot='.&escape($info{'linkprot'}); |
$extras .= '&linkprot='.&escape($info{'linkprot'}); |
last; |
last; |
Line 162 sub set_token {
|
Line 172 sub set_token {
|
foreach my $key (sort(keys(%env))) { |
foreach my $key (sort(keys(%env))) { |
if ($key =~ /^form\.(.+)$/) { |
if ($key =~ /^form\.(.+)$/) { |
my $name = $1; |
my $name = $1; |
next if ($token{$name}); |
next if (($token{$name}) || ($name eq 'ttoken')); |
$querystring .= '&'.$name.'='.$env{$key}; |
$querystring .= '&'.$name.'='.$env{$key}; |
} |
} |
} |
} |