--- loncom/lonnet/perl/lonnet.pm 2004/06/30 12:33:47 1.517
+++ 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.517 2004/06/30 12:33:47 albertel Exp $
+# $Id: lonnet.pm,v 1.519 2004/07/02 21:34:55 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1600,7 +1600,7 @@ sub getannounce {
if ($announcement=~/\w/) {
return
'
';
+ ''.$announcement.' |
';
} else {
return '';
}
@@ -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 {
@@ -4913,7 +4916,7 @@ sub getfile {
my @parts = ($cdom,$cnum);
if ($filename =~ m|^(.+)/[^/]+$|) {
push @parts, split(/\//,$1);
- }
+ }
foreach my $part (@parts) {
$path .= '/'.$part;
if (!-e $path) {