--- loncom/auth/lonacc.pm 2022/07/08 15:36:32 1.159.2.21.2.2 +++ loncom/auth/lonacc.pm 2022/08/30 11:58:44 1.159.2.21.2.3 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.159.2.21.2.2 2022/07/08 15:36:32 raeburn Exp $ +# $Id: lonacc.pm,v 1.159.2.21.2.3 2022/08/30 11:58:44 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -308,7 +308,7 @@ sub sso_login { if ($query) { my @items = ('role','symb','iptoken','origurl','ttoken', - 'ltoken','linkkey','logtoken','sso'); + 'ltoken','linkkey','logtoken','sso','lcssowin'); &Apache::loncommon::get_unprocessed_cgi($query,\@items); foreach my $item (@items) { if (defined($env{'form.'.$item})) { @@ -458,6 +458,9 @@ sub sso_login { linkprotuser => $linkprotuser, linkprotexit => $linkprotexit, ); + if ($env{'form.lcssowin'}) { + $data{'lcssowin'} = $env{'form.lcssowin'}; + } my $token = &Apache::lonnet::tmpput(\%data,$r->dir_config('lonHostID'),'link'); unless (($token eq 'con_lost') || ($token eq 'refused') || ($token =~ /^error:/) || ($token eq 'unknown_cmd') || ($token eq 'no_such_host')) { @@ -539,6 +542,9 @@ sub sso_login { if ($otherserver ne '') { $redirecturl .= '?otherserver='.$otherserver; } + if ($form{'lcssowin'}) { + $redirecturl .= (($redirecturl=~/\?/)?'&':'?') . 'lcssowin=1'; + } $r->internal_redirect($redirecturl); $r->set_handlers('PerlHandler'=> undef); } else { @@ -551,7 +557,7 @@ sub sso_login { 'server' => $r->dir_config('lonHostID'), 'sso.login' => 1 ); - foreach my $item ('role','symb','iptoken','origurl') { + foreach my $item ('role','symb','iptoken','origurl','lcssowin') { if (exists($form{$item})) { $info{$item} = $form{$item}; } elsif ($sessiondata{$item} ne '') { @@ -617,7 +623,7 @@ sub sso_login { $r->subprocess_env->set('SSOUserDomain' => $domain); if (grep(/^sso$/,@cancreate)) { #FIXME - need to preserve origurl, role and symb, or linkprot or linkkey for use after account -# creation +# creation. If lcssowin is 1, createaccount needs to close pop-up and display in main window. $r->set_handlers('PerlHandler'=> [\&Apache::createaccount::handler]); $r->handler('perl-script'); } else {