version 1.177, 2018/12/26 20:10:21
|
version 1.179, 2019/01/27 16:02:43
|
Line 47 sub handler {
|
Line 47 sub handler {
|
(join('&',$ENV{'QUERY_STRING'},$env{'request.querystring'},
|
(join('&',$ENV{'QUERY_STRING'},$env{'request.querystring'},
|
$ENV{'REDIRECT_QUERY_STRING'}),
|
$ENV{'REDIRECT_QUERY_STRING'}),
|
['interface','username','domain','firsturl','localpath','localres',
|
['interface','username','domain','firsturl','localpath','localres',
|
'token','role','symb','iptoken','btoken','ltoken']);
|
'token','role','symb','iptoken','btoken','ltoken','linkkey']);
|
if (!defined($env{'form.firsturl'})) {
|
if (!defined($env{'form.firsturl'})) {
|
&Apache::lonacc::get_posted_cgi($r,['firsturl']);
|
&Apache::lonacc::get_posted_cgi($r,['firsturl']);
|
}
|
}
|
Line 56 sub handler {
|
Line 56 sub handler {
|
$env{'form.firsturl'} = $ENV{'REDIRECT_URL'};
|
$env{'form.firsturl'} = $ENV{'REDIRECT_URL'};
|
}
|
}
|
}
|
}
|
|
if (($env{'form.firsturl'} =~ m{^/+tiny/+$LONCAPA::match_domain/+\w+$}) &&
|
|
(!$env{'form.ltoken'}) && (!$env{'form.linkkey'})) {
|
|
&Apache::lonacc::get_posted_cgi($r,['linkkey']);
|
|
}
|
|
|
# -- check if they are a migrating user
|
# -- check if they are a migrating user
|
if (defined($env{'form.token'})) {
|
if (defined($env{'form.token'})) {
|
Line 131 sub handler {
|
Line 135 sub handler {
|
}
|
}
|
&Apache::lonnet::tmpdel($env{'form.ltoken'});
|
&Apache::lonnet::tmpdel($env{'form.ltoken'});
|
delete($env{'form.ltoken'});
|
delete($env{'form.ltoken'});
|
|
} elsif ($env{'form.linkkey'}) {
|
|
$info{'linkkey'} = $env{'form.linkkey'};
|
|
delete($env{'form.linkkey'});
|
}
|
}
|
my $balancer_token = &Apache::lonnet::tmpput(\%info,$found_server);
|
my $balancer_token = &Apache::lonnet::tmpput(\%info,$found_server);
|
if ($balancer_token) {
|
if ($balancer_token) {
|
Line 151 sub handler {
|
Line 158 sub handler {
|
# it a balancer cookie for an active session on this server.
|
# it a balancer cookie for an active session on this server.
|
#
|
#
|
|
|
my ($balcookie,$linkprot);
|
my ($balcookie,$linkprot,$linkkey);
|
if ($env{'form.btoken'}) {
|
if ($env{'form.btoken'}) {
|
my %info = &Apache::lonnet::tmpget($env{'form.btoken'});
|
my %info = &Apache::lonnet::tmpget($env{'form.btoken'});
|
$balcookie = $info{'balcookie'};
|
$balcookie = $info{'balcookie'};
|
if ($balcookie) {
|
if ($balcookie) {
|
if ($info{'linkprot'}) {
|
if ($info{'linkprot'}) {
|
$linkprot = $info{'linkprot'};
|
$linkprot = $info{'linkprot'};
|
|
} elsif ($info{'linkkey'}) {
|
|
$linkkey = $info{'linkkey'};
|
}
|
}
|
}
|
}
|
&Apache::lonnet::tmpdel($env{'form.btoken'});
|
&Apache::lonnet::tmpdel($env{'form.btoken'});
|
Line 213 sub handler {
|
Line 222 sub handler {
|
}
|
}
|
if ($env{'user.linkproturi'}) {
|
if ($env{'user.linkproturi'}) {
|
my @proturis = split(/,/,$env{'user.linkproturi'});
|
my @proturis = split(/,/,$env{'user.linkproturi'});
|
unless(grep(/^\Q$deeplink\E$/,@proturis)) {
|
unless (grep(/^\Q$deeplink\E$/,@proturis)) {
|
push(@proturis,$deeplink);
|
push(@proturis,$deeplink);
|
@proturis = sort @proturis;
|
@proturis = sort @proturis;
|
&Apache::lonnet::appenv({'user.linkproturi' => join(',',@proturis)});
|
&Apache::lonnet::appenv({'user.linkproturi' => join(',',@proturis)});
|
Line 222 sub handler {
|
Line 231 sub handler {
|
&Apache::lonnet::appenv({'user.linkproturi' => $deeplink});
|
&Apache::lonnet::appenv({'user.linkproturi' => $deeplink});
|
}
|
}
|
}
|
}
|
|
} elsif (($env{'form.linkkey'}) || ($linkkey)) {
|
|
if ($env{'form.firsturl'} =~ m{^/tiny/$match_domain/\w+$}) {
|
|
if ($linkkey eq '') {
|
|
$linkkey = $env{'form.linkkey'};
|
|
}
|
|
if ($env{'user.deeplinkkey'}) {
|
|
my @linkkeys = split(/,/,$env{'user.deeplinkkey'});
|
|
unless (grep(/^\Q$linkkey\E$/,@linkkeys)) {
|
|
push(@linkkeys,$linkkey);
|
|
&Apache::lonnet::appenv({'user.deeplinkkey' => join(',',sort(@linkkeys))});
|
|
}
|
|
} else {
|
|
&Apache::lonnet::appenv({'user.deeplinkkey' => $linkkey});
|
|
}
|
|
my $deeplink = $env{'form.firsturl'};
|
|
if ($env{'user.keyedlinkuri'}) {
|
|
my @keyeduris = split(/,/,$env{'user.keyedlinkuri'});
|
|
unless (grep(/^\Q$deeplink\E$/,@keyeduris)) {
|
|
push(@keyeduris,$deeplink);
|
|
&Apache::lonnet::appenv({'user.keyedlinkuri' => join(',',sort(@keyeduris))});
|
|
}
|
|
} else {
|
|
&Apache::lonnet::appenv({'user.keyedlinkuri' => $deeplink});
|
|
}
|
|
}
|
}
|
}
|
$r->print(
|
$r->print(
|
$start_page
|
$start_page
|
Line 373 sub handler {
|
Line 407 sub handler {
|
}
|
}
|
$tokenextras .= '&linkprot='.&escape($info{'linkprot'});
|
$tokenextras .= '&linkprot='.&escape($info{'linkprot'});
|
}
|
}
|
|
} elsif ($env{'form.linkkey'}) {
|
|
if (!$tokenextras) {
|
|
$tokenextras = '&&&';
|
|
}
|
|
$tokenextras .= '&linkkey='.&escape($env{'form.linkkey'});
|
}
|
}
|
my $logtoken=Apache::lonnet::reply(
|
my $logtoken=Apache::lonnet::reply(
|
'tmpput:'.$ukey.$lkey.'&'.$firsturl.$tokenextras,
|
'tmpput:'.$ukey.$lkey.'&'.$firsturl.$tokenextras,
|
Line 852 sub check_loginvia {
|
Line 891 sub check_loginvia {
|
|
|
sub redirect_page {
|
sub redirect_page {
|
my ($desthost,$path,$linkprot) = @_;
|
my ($desthost,$path,$linkprot) = @_;
|
|
my $hostname = &Apache::lonnet::hostname($desthost);
|
my $protocol = $Apache::lonnet::protocol{$desthost};
|
my $protocol = $Apache::lonnet::protocol{$desthost};
|
$protocol = 'http' if ($protocol ne 'https');
|
$protocol = 'http' if ($protocol ne 'https');
|
unless ($path =~ m{^/}) {
|
unless ($path =~ m{^/}) {
|
$path = '/'.$path;
|
$path = '/'.$path;
|
}
|
}
|
my $url = $protocol.'://'.&Apache::lonnet::hostname($desthost).$path;
|
my $url = $protocol.'://'.$hostname.$path;
|
if ($env{'form.firsturl'} ne '') {
|
if ($env{'form.firsturl'} ne '') {
|
$url .='?firsturl='.$env{'form.firsturl'};
|
$url .='?firsturl='.$env{'form.firsturl'};
|
}
|
}
|