version 1.174, 2022/06/18 02:10:18
|
version 1.177, 2022/08/24 20:58:50
|
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 179 sub success {
|
Line 179 sub success {
|
$destination .= 'source=login';
|
$destination .= 'source=login';
|
}
|
}
|
|
|
|
my $brcrum = [{'href' => '',
|
|
'text' => 'Successful Login'},];
|
|
my $args = {'no_inline_link' => 1,
|
|
'bread_crumbs' => $brcrum,};
|
if (($env{'request.deeplink.login'} eq $lowerurl) &&
|
if (($env{'request.deeplink.login'} eq $lowerurl) &&
|
(($env{'request.linkprot'}) || ($env{'request.linkkey'} ne ''))) {
|
(($env{'request.linkprot'}) || ($env{'request.linkkey'} ne ''))) {
|
my %info;
|
my %info;
|
if ($env{'request.linkprot'}) {
|
if ($env{'request.linkprot'}) {
|
$info{'linkprot'} = $env{'request.linkprot'};
|
$info{'linkprot'} = $env{'request.linkprot'};
|
|
foreach my $item ('linkprotuser','linkprotexit') {
|
|
if ($form->{$item}) {
|
|
$info{$item} = $form->{$item};
|
|
}
|
|
}
|
|
$args = {'only_body' => 1,};
|
} elsif ($env{'request.linkkey'} ne '') {
|
} elsif ($env{'request.linkkey'} ne '') {
|
$info{'linkkey'} = $env{'request.linkkey'};
|
$info{'linkkey'} = $env{'request.linkkey'};
|
}
|
}
|
Line 200 sub success {
|
Line 210 sub success {
|
$windowname .= 'lti';
|
$windowname .= 'lti';
|
}
|
}
|
my $windowinfo = Apache::lonhtmlcommon::scripttag('self.name="'.$windowname.'";');
|
my $windowinfo = Apache::lonhtmlcommon::scripttag('self.name="'.$windowname.'";');
|
my $brcrum = [{'href' => '',
|
|
'text' => 'Successful Login'},];
|
|
my $args = {'bread_crumbs' => $brcrum,};
|
|
unless ((defined($form->{role})) || (defined($form->{symb}))) {
|
unless ((defined($form->{role})) || (defined($form->{symb}))) {
|
my $update=$env{'user.update.time'};
|
my $update=$env{'user.update.time'};
|
if (!$update) {
|
if (!$update) {
|
Line 273 ENDJS
|
Line 280 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'}) {
|
my %lt=&Apache::lonlocal::texthash(
|
my %lt=&Apache::lonlocal::texthash(
|
'wel' => 'Welcome',
|
'wel' => 'Welcome',
|
'pro' => 'Login problems?',
|
'pro' => 'Login problems?',
|
);
|
);
|
$pagebody = "<h1>$lt{'wel'}</h1>\n".
|
$pagebody = "<h1>$lt{'wel'}</h1>\n".
|
&mt('Welcome to the Learning[_1]Online[_2] Network with CAPA. Please wait while your session is being set up.','<i>','</i>');
|
&mt('Welcome to the Learning[_1]Online[_2] Network with CAPA. Please wait while your session is being set up.','<i>','</i>');
|
my $loginhelp = &loginhelpdisplay($domain);
|
my $loginhelp = &loginhelpdisplay($domain);
|
if ($loginhelp) {
|
if ($loginhelp) {
|
$pagebody .= '<p><a href="'.$loginhelp.'">'.$lt{'pro'}.'</a></p>';
|
$pagebody .= '<p><a href="'.$loginhelp.'">'.$lt{'pro'}.'</a></p>';
|
|
}
|
}
|
}
|
}
|
}
|
$end_page = &Apache::loncommon::end_page();
|
$end_page = &Apache::loncommon::end_page();
|
$r->print(<<ENDSUCCESS);
|
$r->print(<<ENDSUCCESS);
|
$start_page
|
$start_page
|
Line 365 sub failed {
|
Line 373 sub failed {
|
my %info = (
|
my %info = (
|
'linkprot' => $form->{'linkprot'},
|
'linkprot' => $form->{'linkprot'},
|
);
|
);
|
if ($form->{linkprotuser} ne '') {
|
foreach my $item ('linkprotuser','linkprotexit') {
|
$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 809 sub handler {
|
Line 819 sub handler {
|
}
|
}
|
if ($form{'linkprot'}) {
|
if ($form{'linkprot'}) {
|
$env{'request.linkprot'} = $form{'linkprot'};
|
$env{'request.linkprot'} = $form{'linkprot'};
|
|
foreach my $item ('linkprotuser','linkprotexit') {
|
|
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'};
|
}
|
}
|
Line 840 sub handler {
|
Line 855 sub handler {
|
}
|
}
|
if ($form{'linkprot'}) {
|
if ($form{'linkprot'}) {
|
$env{'request.linkprot'} = $form{'linkprot'};
|
$env{'request.linkprot'} = $form{'linkprot'};
|
|
foreach my $item ('linkprotuser','linkprotexit') {
|
|
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'};
|
}
|
}
|
Line 923 sub handler {
|
Line 943 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'};
|
|
}
|
} 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 1011 sub set_retry_token {
|
Line 1034 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');
|
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});
|