--- loncom/interface/portfolio.pm 2017/05/19 23:41:52 1.254.2.2 +++ loncom/interface/portfolio.pm 2018/09/14 21:01:02 1.254.2.3 @@ -1,7 +1,7 @@ # The LearningOnline Network # portfolio browser # -# $Id: portfolio.pm,v 1.254.2.2 2017/05/19 23:41:52 raeburn Exp $ +# $Id: portfolio.pm,v 1.254.2.3 2018/09/14 21:01:02 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2598,6 +2598,45 @@ STATE return $state; } +sub valid_container { + my ($uname,$udom,$group) = @_; + my $container_prefix; + if ($group ne '') { + $container_prefix = "/uploaded/$udom/$uname/groups/$group/portfolio"; + } else { + $container_prefix = "/uploaded/$udom/$uname/portfolio"; + } + if ($env{'form.currentpath'}) { + $container_prefix .= $env{'form.currentpath'}; + } else { + $container_prefix .= '/'; + } + if ($env{'form.container'} =~ m{^\Q$container_prefix\E(.+)$}) { + my $filename = $1; + if ($filename eq &Apache::lonnet::clean_filename($filename)) { + return 1; + } + } + return; +} + +sub invalid_parms { + my ($r,$url,$currentpath) = @_; + my $escpath = &HTML::Entities::encode($currentpath,'&<>"'); + my $rtnlink = ''.&mt('Return to directory').''; + $r->print('