[LON-CAPA-cvs] cvs: loncom / lond

foxr lon-capa-cvs@mail.lon-capa.org
Tue, 14 Sep 2004 10:27:22 -0000


foxr		Tue Sep 14 06:27:22 2004 EDT

  Modified files:              
    /loncom	lond 
  Log:
  - Add missing portls handler.
  
  
Index: loncom/lond
diff -u loncom/lond:1.253 loncom/lond:1.254
--- loncom/lond:1.253	Tue Sep 14 05:30:07 2004
+++ loncom/lond	Tue Sep 14 06:27:22 2004
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.253 2004/09/14 09:30:07 foxr Exp $
+# $Id: lond,v 1.254 2004/09/14 10:27:22 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -57,7 +57,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.253 $'; #' stupid emacs
+my $VERSION='$Revision: 1.254 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -3799,6 +3799,41 @@
 		  0,1,0);
 
 #
+#    Portofolio directory list:
+#
+# Parameters:
+#    cmd     - Command request that got us called.
+#    tail    - the remainder of the command line.  In this case this is a colon
+#              separated list containing the username and domain.
+#              used to locate their portfolio.
+#    client  - Socket openon the client.
+# Returns:
+#    1 indicating processing should continue.
+#
+sub list_portfolio {
+    my ($cmd, $tail, $client) = @_;
+    my ($uname, $udom)        = split(/:/, $tail);
+    my $userinput             = "$cmd:$tail";
+    
+    my $udir=propath($udom,$uname).'/userfiles/portfolio';
+    my $dirLine='';
+    my $dirContents='';
+    if (opendir(LSDIR,$udir.'/')){
+	while ($dirLine = readdir(LSDIR)){
+	    $dirContents = $dirContents.$dirLine.'<br />';
+	}
+    } else {
+	$dirContents = "No directory found\n";
+    }
+    &Reply( $client, $dirContents."\n", $userinput);
+    
+
+
+    return 1;
+}
+&register_handler("portls", \&list_portfolio, 0,1,0);
+
+#
 #
 #
 #