[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
banghart
lon-capa-cvs@mail.lon-capa.org
Fri, 02 Jul 2004 21:34:55 -0000
banghart Fri Jul 2 17:34:55 2004 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
Corrects sub portfoliolist to use ls routine in lond
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.518 loncom/lonnet/perl/lonnet.pm:1.519
--- loncom/lonnet/perl/lonnet.pm:1.518 Fri Jul 2 17:14:36 2004
+++ loncom/lonnet/perl/lonnet.pm Fri Jul 2 17:34:55 2004
@@ -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 @@
# ------------------------------------------------------------ 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 {