version 1.121.2.24.2.4, 2022/07/08 15:40:03
|
version 1.121.2.24.2.6, 2023/01/23 00:38:50
|
Line 46 use CGI::Cookie();
|
Line 46 use CGI::Cookie();
|
# ------------------------------------------------------------ Successful login |
# ------------------------------------------------------------ Successful login |
sub success { |
sub success { |
my ($r, $username, $domain, $authhost, $lowerurl, $extra_env, |
my ($r, $username, $domain, $authhost, $lowerurl, $extra_env, |
$form,$cid,$expirepub) = @_; |
$form,$cid,$expirepub,$write_to_opener) = @_; |
|
|
# ------------------------------------------------------------ Get cookie ready |
# ------------------------------------------------------------ Get cookie ready |
my $cookie = |
my $cookie = |
Line 116 sub success {
|
Line 116 sub success {
|
$destination .= 'selectrole=1&'.$newrole.'=1'; |
$destination .= 'selectrole=1&'.$newrole.'=1'; |
} |
} |
} |
} |
|
} elsif (defined($form->{display})) { |
|
if ($destination =~ m{^/adm/email($|\?)}) { |
|
$destination .= ($destination =~ /\?/) ? '&' : '?' .'display='.&escape($form->{display}); |
|
} |
} |
} |
if (defined($form->{symb})) { |
if (defined($form->{symb})) { |
my $destsymb = $form->{symb}; |
my $destsymb = $form->{symb}; |
Line 178 sub success {
|
Line 182 sub success {
|
&Apache::lonnet::appenv({'environment.remote' => 'off'}); |
&Apache::lonnet::appenv({'environment.remote' => 'off'}); |
} |
} |
} |
} |
|
my $startupremote; |
|
if ($write_to_opener) { |
|
if ($env{'environment.remote'} eq 'on') { |
|
&Apache::lonnet::appenv({'environment.remote' => 'off'}); |
|
} |
|
$args->{'redirect'} = [0,$destination,'',$write_to_opener]; |
|
} else { |
|
$startupremote=&Apache::lonmenu::startupremote($destination); |
|
} |
|
|
my $windowinfo=&Apache::lonmenu::open($env{'browser.os'}); |
my $windowinfo=&Apache::lonmenu::open($env{'browser.os'}); |
my $startupremote=&Apache::lonmenu::startupremote($destination); |
|
my $remoteinfo=&Apache::lonmenu::load_remote_msg($lowerurl); |
my $remoteinfo=&Apache::lonmenu::load_remote_msg($lowerurl); |
my $setflags=&Apache::lonmenu::setflags(); |
my $setflags=&Apache::lonmenu::setflags(); |
my $maincall=&Apache::lonmenu::maincall(); |
my $maincall=&Apache::lonmenu::maincall(); |
Line 190 sub success {
|
Line 202 sub success {
|
|
|
my $continuelink; |
my $continuelink; |
if ($env{'environment.remote'} eq 'off') { |
if ($env{'environment.remote'} eq 'off') { |
$continuelink='<a href="'.$destination.'">'.&mt('Continue').'</a>'; |
unless ($write_to_opener) { |
|
$continuelink='<a href="'.$destination.'">'.&mt('Continue').'</a>'; |
|
} |
} |
} |
# ------------------------------------------------- Output for successful login |
# ------------------------------------------------- Output for successful login |
|
|
Line 749 sub handler {
|
Line 763 sub handler {
|
} |
} |
if ($form{'firsturl'} =~ m{^/tiny/$match_domain/\w+$}) { |
if ($form{'firsturl'} =~ m{^/tiny/$match_domain/\w+$}) { |
&set_deeplink_login(%form); |
&set_deeplink_login(%form); |
|
} elsif ($firsturl eq '/adm/email') { |
|
if ($form{'display'} && ($form{'mailrecip'} eq "$form{'uname'}:$form{'udom'}")) { |
|
$env{'request.display'} = $form{'display'}; |
|
$env{'request.mailrecip'} = $form{'mailrecip'}; |
|
} |
} |
} |
$r->internal_redirect($switchto); |
$r->internal_redirect($switchto); |
} else { |
} else { |
Line 785 sub handler {
|
Line 804 sub handler {
|
} |
} |
if ($form{'firsturl'} =~ m{^/tiny/$match_domain/\w+$}) { |
if ($form{'firsturl'} =~ m{^/tiny/$match_domain/\w+$}) { |
&set_deeplink_login(%form); |
&set_deeplink_login(%form); |
|
} elsif ($firsturl eq '/adm/email') { |
|
if ($form{'display'} && ($form{'mailrecip'} eq "$form{'uname'}:$form{'udom'}")) { |
|
$env{'request.display'} = $form{'display'}; |
|
$env{'request.mailrecip'} = $form{'mailrecip'}; |
|
} |
} |
} |
$r->internal_redirect($switchto); |
$r->internal_redirect($switchto); |
} else { |
} else { |
Line 824 sub handler {
|
Line 848 sub handler {
|
} |
} |
if ($form{'firsturl'} =~ m{^/tiny/$match_domain/\w+$}) { |
if ($form{'firsturl'} =~ m{^/tiny/$match_domain/\w+$}) { |
&set_deeplink_login(%form); |
&set_deeplink_login(%form); |
|
} elsif ($firsturl eq '/adm/email') { |
|
if ($form{'display'} && ($form{'mailrecip'} eq "$form{'uname'}:$form{'udom'}")) { |
|
$env{'request.display'} = $form{'display'}; |
|
$env{'request.mailrecip'} = $form{'mailrecip'}; |
|
} |
} |
} |
$r->internal_redirect('/adm/switchserver?otherserver='.$unloaded.'&origurl='.$firsturl); |
$r->internal_redirect('/adm/switchserver?otherserver='.$unloaded.'&origurl='.$firsturl); |
return OK; |
return OK; |
Line 843 sub handler {
|
Line 872 sub handler {
|
$form{$item} = $sessiondata{$item}; |
$form{$item} = $sessiondata{$item}; |
} |
} |
} |
} |
|
if ($sessiondata{'origurl'} eq '/adm/email') { |
|
if (($sessiondata{'display'}) && ($sessiondata{'mailrecip'})) { |
|
if (&unescape($sessiondata{'mailrecip'}) eq "$form{'uname'}:$form{'udom'}") { |
|
$form{'display'} = &unescape($sessiondata{'display'}); |
|
$form{'mailrecip'} = &unescape($sessiondata{'mailrecip'}); |
|
} |
|
} |
|
} |
} |
} |
} |
} |
if ($form{'linkprot'}) { |
if ($form{'linkprot'}) { |
Line 1041 sub check_can_host {
|
Line 1078 sub check_can_host {
|
$form); |
$form); |
if ($form->{'firsturl'} =~ m{^/tiny/$match_domain/\w+$}) { |
if ($form->{'firsturl'} =~ m{^/tiny/$match_domain/\w+$}) { |
$env{'request.deeplink.login'} = $form->{'firsturl'}; |
$env{'request.deeplink.login'} = $form->{'firsturl'}; |
|
} elsif ($form->{'firsturl'} eq '/adm/email') { |
|
if ($form->{'display'} && ($form->{'mailrecip'} eq $form->{'uname'}.':'.$form->{'udom'})) { |
|
$env{'request.display'} = $form->{'mailrecip'}; |
|
$env{'request.mailrecip'} = $form->{'mailrecip'}; |
|
} |
} |
} |
if ($form->{'linkprot'}) { |
if ($form->{'linkprot'}) { |
$env{'request.linkprot'} = $form->{'linkprot'}; |
$env{'request.linkprot'} = $form->{'linkprot'}; |