version 1.16, 2022/06/30 21:04:13
|
version 1.17, 2022/09/17 23:38:50
|
Line 202 information, and the destination is a de
|
Line 202 information, and the destination is a de
|
then the LTI number, type (c or d), and tiny URL will be saved as the |
then the LTI number, type (c or d), and tiny URL will be saved as the |
linkprot item in a token file. |
linkprot item in a token file. |
|
|
|
=item set_mailtoken() |
|
|
|
Inputs: 2 |
|
$r - request object |
|
$lonhost - hostID of current server |
|
|
|
Output: 1 |
|
$querystring - query string to append to URL |
|
when redirecting. |
|
|
|
Called if requested URL is /adm/email, dual SSO and non-SSO login |
|
are supported by /adm/login and original query string contains values |
|
for elements: display, username and domain, which will then be |
|
stored in the token file on the server to support direct access |
|
to a specific message sent to the user. |
|
|
=back |
=back |
|
|
=cut |
=cut |
Line 239 sub handler {
|
Line 255 sub handler {
|
} |
} |
my $dest = $protocol.'://'.$hostname.$target; |
my $dest = $protocol.'://'.$hostname.$target; |
if ($target eq '/adm/login') { |
if ($target eq '/adm/login') { |
my $querystring = &set_token($r,$lonhost); |
my $uri = $r->uri; |
|
my $querystring; |
|
if (($uri eq '/adm/email') && ($r->args ne '')) { |
|
$querystring = &set_mailtoken($r,$lonhost); |
|
} else { |
|
$querystring = &set_token($r,$lonhost); |
|
} |
if ($querystring ne '') { |
if ($querystring ne '') { |
$dest .= '?'.$querystring; |
$dest .= '?'.$querystring; |
} |
} |
Line 250 sub handler {
|
Line 272 sub handler {
|
if ($querystring ne '') { |
if ($querystring ne '') { |
$dest .= '?'.$querystring; |
$dest .= '?'.$querystring; |
} |
} |
|
} elsif ((&Apache::lonnet::get_saml_landing()) && |
|
($uri eq '/adm/email') && ($r->args ne '')) { |
|
my $querystring = &set_mailtoken($r,$lonhost); |
|
if ($querystring ne '') { |
|
$dest .= '?'.$querystring; |
|
} |
} else { |
} else { |
if ($r->args ne '') { |
if ($r->args ne '') { |
$dest .= (($dest=~/\?/)?'&':'?').$r->args; |
$dest .= (($dest=~/\?/)?'&':'?').$r->args; |
Line 332 sub set_token {
|
Line 360 sub set_token {
|
$querystring .= '&'.$name.'='.$env{$key}; |
$querystring .= '&'.$name.'='.$env{$key}; |
} |
} |
} |
} |
|
} |
|
return $querystring; |
|
} |
|
|
|
sub set_mailtoken { |
|
my ($r,$lonhost) = @_; |
|
my $firsturl = $r->uri; |
|
my ($querystring,$ssotoken,$extras); |
|
&Apache::loncommon::get_unprocessed_cgi($r->args); |
|
my $extras; |
|
if (($env{'form.display'} ne '') && |
|
($env{'form.username'} =~ /^$match_username$/) && |
|
($env{'form.domain'} =~ /^$match_domain$/)) { |
|
$extras .= '&display='.&escape($env{'form.display'}). |
|
'&mailrecip='.&escape($env{'form.username'}.':'.$env{'form.domain'}); |
|
} |
|
if (($firsturl ne '') || ($extras ne '')) { |
|
$extras .= ':sso'; |
|
$ssotoken = &Apache::lonnet::reply('tmpput:'.&escape($firsturl). |
|
$extras,$lonhost); |
|
$querystring = 'sso='.$ssotoken; |
|
} |
|
if ($r->args ne '') { |
|
foreach my $key (sort(keys(%env))) { |
|
if ($key =~ /^form\.(.+)$/) { |
|
my $name = $1; |
|
next if (($name eq 'display') || ($name eq 'username') || ($name eq 'domain')); |
|
$querystring .= '&'.$name.'='.$env{$key}; |
|
} |
|
} |
} |
} |
return $querystring; |
return $querystring; |
} |
} |