--- loncom/auth/lonroles.pm 2022/07/08 15:45:20 1.269.2.39.2.5 +++ loncom/auth/lonroles.pm 2022/10/05 23:05:24 1.269.2.39.2.6 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.269.2.39.2.5 2022/07/08 15:45:20 raeburn Exp $ +# $Id: lonroles.pm,v 1.269.2.39.2.6 2022/10/05 23:05:24 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1114,6 +1114,12 @@ ENDCLOSE $redirect_url .= $where; } $redirect_url .= '/'; + if ($env{'form.orgurl'} =~ /^\Q$redirect_url\E/) { + my ($path) = ($env{'form.orgurl'} =~ m{^(.+)/[^/]+$}); + if (($path ne '') && (-e $Apache::lonnet::perlvar{'lonDocRoot'}.$path)) { + $redirect_url = $env{'form.orgurl'}; + } + } &redirect_user($r,&mt('Entering Authoring Space'), $redirect_url); return OK;