[LON-CAPA-cvs] cvs: loncom(Refactoring) / lond

foxr lon-capa-cvs@mail.lon-capa.org
Mon, 26 Apr 2004 10:37:47 -0000


foxr		Mon Apr 26 06:37:47 2004 EDT

  Modified files:              (Branch: Refactoring)
    /loncom	lond 
  Log:
  Fixed some typos in rolesput
  
  
Index: loncom/lond
diff -u loncom/lond:1.178.2.18 loncom/lond:1.178.2.19
--- loncom/lond:1.178.2.18	Mon Apr 19 07:32:35 2004
+++ loncom/lond	Mon Apr 26 06:37:47 2004
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.178.2.18 2004/04/19 11:32:35 foxr Exp $
+# $Id: lond,v 1.178.2.19 2004/04/26 10:37:47 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -53,7 +53,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.178.2.18 $'; #' stupid emacs
+my $VERSION='$Revision: 1.178.2.19 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid;
 my $currentdomainid;
@@ -1410,9 +1410,9 @@
     my $client     = shift;
     my $userinput  = "$cmd:$tail";
 
-    my ($exedom,$exeuser,$udom,$uname,$what)   =split(/:/,$tail);
-    &Debug("cmd = ".$cmd." exedom= ".$exedom."user = ".$exeuser." udom=".$udom.
-	   "what = ".$what);
+    my ( $exedom, $exeuser, $udom, $uname,  $what) = split(/:/,$tail);
+    
+
     my $namespace='roles';
     chomp($what);
     my $hashref = TieUserHash($udom, $uname, $namespace,
@@ -2496,10 +2496,15 @@
 
     my $userinput = "$cmd:$ulsdir";
 
+    chomp($ulsdir);
+
     my $ulsout='';
     my $ulsfn;
+    logthis("ls for '$ulsdir'");
     if (-e $ulsdir) {
+	logthis("ls - directory exists");
 	if(-d $ulsdir) {
+	    logthis("ls  $ulsdir is a file");
 	    if (opendir(LSDIR,$ulsdir)) {
 		while ($ulsfn=readdir(LSDIR)) {
 		    my @ulsstats=stat($ulsdir.'/'.$ulsfn);
@@ -2683,6 +2688,8 @@
     # Split off the request keyword from the rest of the stuff.
    
     my ($command, $tail) = split(/:/, $userinput, 2);
+    chomp($command);
+    chomp($tail);
 
     Debug("Command received: $command, encoded = $wasenc");
 
@@ -2724,7 +2731,7 @@
 	    $KeepGoing = &$Handler($command, $tail, $client);
 	} else {
 	    Debug("Refusing to dispatch because ok is false");
-	    Failure($client, "refused", $userinput);
+	    Failure($client, "refused\n", $userinput);
 	}
 
 
@@ -4039,7 +4046,7 @@
     my $authtype= shift;
 
     # See if the request is of the form /$domain/_au
-    &logthis("ruequest is $request");
+    &logthis("request is $request");
     if($request =~ /^(\/$domain\/_au)$/) { # It's an author rolesput...
 	my $execdir = $perlvar{'lonDaemons'};
 	my $userhome= "/home/$user" ;
@@ -4533,8 +4540,10 @@
 
 sub sethost {
     my ($remotereq) = @_;
+    Debug("sethost got $remotereq");
     my (undef,$hostid)=split(/:/,$remotereq);
     if (!defined($hostid)) { $hostid=$perlvar{'lonHostID'}; }
+    Debug("sethost attempting to set host $hostid");
     if ($hostip{$perlvar{'lonHostID'}} eq $hostip{$hostid}) {
 	$currenthostid=$hostid;
 	$currentdomainid=$hostdom{$hostid};