--- loncom/lonnet/perl/lonnet.pm 2004/07/02 21:14:36 1.518 +++ loncom/lonnet/perl/lonnet.pm 2004/07/02 21:34:55 1.519 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.518 2004/07/02 21:14:36 albertel Exp $ +# $Id: lonnet.pm,v 1.519 2004/07/02 21:34:55 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3585,17 +3585,20 @@ sub revokecustomrole { # ------------------------------------------------------------ Portfolio Director Lister +# returns listing of contents of user's /userfiles/portfolio/ directory +# + sub portfoliolist { -#FIXME us the ls: command instead please -#FIXME uhome should never be an argument to any lonnet functions - # returns listing of contents of user's /userfiles/portfolio/ directory - # - my ($udom,$uname,$uhome); - $uname=$ENV{'user.name'}; + my ($currentPath, $currentFile) = @_; + my ($udom, $uname, $portfolioRoot); + $uname=$ENV{'user.name'}; $udom=$ENV{'user.domain'}; - $uhome=$ENV{'user.home'}; - my $listing = &reply('portls:'.$uname.':'.$udom, $uhome); - return $listing; + # really should interrogate the system for home directory information, but . . . + $portfolioRoot = '/home/httpd/lonUsers/'.$udom.'/'; + $uname =~ /^(.?)(.?)(.?)/; + $portfolioRoot = $portfolioRoot.$1.'/'.$2.'/'.$3.'/'.$uname.'/userfiles/portfolio'; + my $listing = &reply('ls:'.$portfolioRoot.$currentPath, homeserver($uname,$udom)); + return $listing; } sub portfoliomanage {