--- loncom/auth/lonacc.pm 2022/08/30 11:58:44 1.159.2.21.2.3 +++ loncom/auth/lonacc.pm 2023/01/23 00:32:03 1.159.2.21.2.4 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.159.2.21.2.3 2022/08/30 11:58:44 raeburn Exp $ +# $Id: lonacc.pm,v 1.159.2.21.2.4 2023/01/23 00:32:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -387,6 +387,8 @@ sub sso_login { if ($firsturl =~ m{^/tiny/$match_domain/\w+$}) { $form{'origurl'} = $firsturl; $deeplinkurl = $firsturl; + } elsif ($firsturl eq '/adm/email') { + $form{'origurl'} = $firsturl; } if ($form{'linkprot'}) { $linkprot = $form{'linkprot'}; @@ -533,6 +535,12 @@ sub sso_login { $env{'request.linkkey'} = $linkkey; } } + if (($r->uri eq '/adm/sso') && ($form{'origurl'} eq '/adm/email')) { + if ($form{'display'} && ($env{'form.mailrecip'} eq $user.':'.$domain)) { + $env{'request.display'} = $form{'display'}; + $env{'request.mailrecip'} = $env{'form.mailrecip'}; + } + } $env{'request.sso.login'} = 1; if (defined($r->dir_config("lonSSOReloginServer"))) { $env{'request.sso.reloginserver'} = @@ -587,6 +595,12 @@ sub sso_login { $info{'linkkey'} = $linkkey; } } + if (($r->uri eq '/adm/sso') && ($form{'origurl'} eq '/adm/email')) { + if ($form{'display'} && ($form{'mailrecip'} eq $user.':'.$domain)) { + $info{'display'} = &escape($form{'display'}); + $info{'mailrecip'} = &escape($form{'mailrecip'}); + } + } if ($r->dir_config("ssodirecturl") == 1) { $info{'origurl'} = $r->uri; }