version 1.175, 2022/06/26 04:03:47
|
version 1.179, 2023/06/02 01:20:26
|
Line 47 use CGI::Cookie();
|
Line 47 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,$skipcritical,$cid,$expirepub) = @_;
|
$form,$skipcritical,$cid,$expirepub,$write_to_opener) = @_;
|
|
|
# ------------------------------------------------------------ Get cookie ready
|
# ------------------------------------------------------------ Get cookie ready
|
my $cookie =
|
my $cookie =
|
Line 147 sub success {
|
Line 147 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 188 sub success {
|
Line 192 sub success {
|
my %info;
|
my %info;
|
if ($env{'request.linkprot'}) {
|
if ($env{'request.linkprot'}) {
|
$info{'linkprot'} = $env{'request.linkprot'};
|
$info{'linkprot'} = $env{'request.linkprot'};
|
if ($form->{'linkprotuser'}) {
|
foreach my $item ('linkprotuser','linkprotexit','linkprotpbid','linkprotpburl') {
|
$info{'linkprotuser'} = $form->{'linkprotuser'};
|
if ($form->{$item}) {
|
|
$info{$item} = $form->{$item};
|
|
}
|
}
|
}
|
$args = {'only_body' => 1,};
|
$args = {'only_body' => 1,};
|
} elsif ($env{'request.linkkey'} ne '') {
|
} elsif ($env{'request.linkkey'} ne '') {
|
Line 278 ENDJS
|
Line 284 ENDJS
|
}
|
}
|
$start_page=&Apache::loncommon::start_page('',$js,$args);
|
$start_page=&Apache::loncommon::start_page('',$js,$args);
|
} else {
|
} else {
|
$args->{'redirect'} = [0,$destination];
|
$args->{'redirect'} = [0,$destination,'',$write_to_opener];
|
$start_page=&Apache::loncommon::start_page('Successful Login',
|
$start_page=&Apache::loncommon::start_page('Successful Login',
|
$js,$args);
|
$js,$args);
|
unless ($env{'request.linkprot'}) {
|
unless ($env{'request.linkprot'}) {
|
Line 371 sub failed {
|
Line 377 sub failed {
|
my %info = (
|
my %info = (
|
'linkprot' => $form->{'linkprot'},
|
'linkprot' => $form->{'linkprot'},
|
);
|
);
|
if ($form->{linkprotuser} ne '') {
|
foreach my $item ('linkprotuser','linkprotexit','linkprotpbid','linkprotpburl') {
|
$info{'linkprotuser'} = $form->{linkprotuser};
|
if ($form->{$item} ne '') {
|
|
$info{$item} = $form->{$item};
|
|
}
|
}
|
}
|
my $ltoken = &Apache::lonnet::tmpput(\%info,
|
my $ltoken = &Apache::lonnet::tmpput(\%info,
|
$r->dir_config('lonHostID'),'retry');
|
$r->dir_config('lonHostID'),'retry');
|
Line 815 sub handler {
|
Line 823 sub handler {
|
}
|
}
|
if ($form{'linkprot'}) {
|
if ($form{'linkprot'}) {
|
$env{'request.linkprot'} = $form{'linkprot'};
|
$env{'request.linkprot'} = $form{'linkprot'};
|
if ($form{'linkprotuser'}) {
|
foreach my $item ('linkprotuser','linkprotexit','linkprotpbid','linkprotpburl') {
|
$env{'request.linkprotuser'} = $form{'linkprotuser'};
|
if ($form{$item}) {
|
|
$env{'request.'.$item} = $form{$item};
|
|
}
|
}
|
}
|
} elsif ($form{'linkkey'} ne '') {
|
} elsif ($form{'linkkey'} ne '') {
|
$env{'request.linkkey'} = $form{'linkkey'};
|
$env{'request.linkkey'} = $form{'linkkey'};
|
}
|
}
|
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 849 sub handler {
|
Line 864 sub handler {
|
}
|
}
|
if ($form{'linkprot'}) {
|
if ($form{'linkprot'}) {
|
$env{'request.linkprot'} = $form{'linkprot'};
|
$env{'request.linkprot'} = $form{'linkprot'};
|
if ($form{'linkprotuser'}) {
|
foreach my $item ('linkprotuser','linkprotexit','linkprotpbid','linkprotpburl') {
|
$env{'request.linkprotuser'} = $form{'linkprotuser'};
|
if ($form{$item}) {
|
|
$env{'request.'.$item} = $form{$item};
|
|
}
|
}
|
}
|
} elsif ($form{'linkkey'} ne '') {
|
} elsif ($form{'linkkey'} ne '') {
|
$env{'request.linkkey'} = $form{'linkkey'};
|
$env{'request.linkkey'} = $form{'linkkey'};
|
}
|
}
|
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 896 sub handler {
|
Line 918 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 915 sub handler {
|
Line 942 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 935 sub handler {
|
Line 970 sub handler {
|
} else {
|
} else {
|
$extra_env = {'request.linkprot' => $form{'linkprot'}};
|
$extra_env = {'request.linkprot' => $form{'linkprot'}};
|
}
|
}
|
|
if ($form{'linkprotexit'}) {
|
|
$extra_env->{'request.linkprotexit'} = $form{'linkprotexit'};
|
|
}
|
|
if ($form{'linkprotpbid'}) {
|
|
$extra_env->{'request.linkprotpbid'} = $form{'linkprotpbid'};
|
|
}
|
|
if ($form{'linkprotpburl'}) {
|
|
$extra_env->{'request.linkprotpburl'} = $form{'linkprotpburl'};
|
|
}
|
} elsif ($form{'linkkey'} ne '') {
|
} elsif ($form{'linkkey'} ne '') {
|
if (ref($extra_env) eq 'HASH') {
|
if (ref($extra_env) eq 'HASH') {
|
%{$extra_env} = ( %{$extra_env}, 'request.linkkey' => $form{'linkkey'} );
|
%{$extra_env} = ( %{$extra_env}, 'request.linkkey' => $form{'linkkey'} );
|
Line 1023 sub set_retry_token {
|
Line 1067 sub set_retry_token {
|
my ($form,$lonhost,$querystr) = @_;
|
my ($form,$lonhost,$querystr) = @_;
|
if (ref($form) eq 'HASH') {
|
if (ref($form) eq 'HASH') {
|
my ($firsturl,$token,$extras,@names);
|
my ($firsturl,$token,$extras,@names);
|
@names = ('role','symb','linkprotuser','linkprot','linkkey','iptoken');
|
@names = ('role','symb','linkprotuser','linkprotexit','linkprot','linkkey','iptoken','linkprotpbid','linkprotpburl');
|
foreach my $name (@names) {
|
foreach my $name (@names) {
|
if ($form->{$name} ne '') {
|
if ($form->{$name} ne '') {
|
$extras .= '&'.$name.'='.&escape($form->{$name});
|
$extras .= '&'.$name.'='.&escape($form->{$name});
|
Line 1110 sub check_can_host {
|
Line 1154 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'};
|