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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 09 Aug 2002 17:43:30 -0000


albertel		Fri Aug  9 13:43:30 2002 EDT

  Modified files:              
    /loncom	lond 
  Log:
  - mkdir needs 2 arguments 
  
  
Index: loncom/lond
diff -u loncom/lond:1.87 loncom/lond:1.88
--- loncom/lond:1.87	Fri Aug  9 06:05:00 2002
+++ loncom/lond	Fri Aug  9 13:43:30 2002
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.87 2002/08/09 10:05:00 www Exp $
+# $Id: lond,v 1.88 2002/08/09 17:43:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -952,7 +952,7 @@
                       my ($cmd,$fname)=split(/:/,$userinput);
 		      my ($udom,$uname,$ufile)=split(/\//,$fname);
                       my $udir=propath($udom,$uname).'/userfiles';
-                      unless (-e $udir) { mkdir($udir); }
+                      unless (-e $udir) { mkdir($udir,0770); }
                        if (-e $udir) {
                        $ufile=~s/^[\.\~]+//;
                        $ufile=~s/\///g;
@@ -1573,44 +1573,42 @@
     my %hash;
     my $proname=&propath($cdom,$cname);
     my @entries=();
-    if 
-     (tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db",&GDBM_READER(),0640))
-    {
-	 @entries=map { $_.':'.$hash{$_} } sort keys %hash;
-         untie %hash;
+    if (tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db",
+	    &GDBM_READER(),0640)) {
+	@entries=map { $_.':'.$hash{$_} } sort keys %hash;
+	untie %hash;
     }
     return @entries;
 }
 
 sub chatadd {
-  my ($cdom,$cname,$newchat)=@_;
-  my %hash;
-  my $proname=&propath($cdom,$cname);
-  my @entries=();
-  if 
-  (tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db",&GDBM_WRCREAT(),0640))
-   {
-    @entries=map { $_.':'.$hash{$_} } sort keys %hash;
-    my $time=time;
-    my ($lastid)=($entries[$#entries]=~/^(\w+)\:/);
-    my ($thentime,$idnum)=split(/\_/,$lastid);
-    my $newid=$time.'_000000';
-    if ($thentime==$time) {
-	$idnum=~s/^0+//;
-        $idnum++;
-        $idnum=substr('000000'.$idnum,-6,6);
-        $newid=$time.'_'.$idnum;
-    }
-    $hash{$newid}=$newchat;
-    my $expired=$time-3600;
-    foreach (keys %hash) {
-        my ($thistime)=($_=~/(\d+)\_/);
-        if ($thistime<$expired) {
-	   undef $hash{$_};
-        }
+    my ($cdom,$cname,$newchat)=@_;
+    my %hash;
+    my $proname=&propath($cdom,$cname);
+    my @entries=();
+    if (tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db",
+	    &GDBM_WRCREAT(),0640)) {
+	@entries=map { $_.':'.$hash{$_} } sort keys %hash;
+	my $time=time;
+	my ($lastid)=($entries[$#entries]=~/^(\w+)\:/);
+	my ($thentime,$idnum)=split(/\_/,$lastid);
+	my $newid=$time.'_000000';
+	if ($thentime==$time) {
+	    $idnum=~s/^0+//;
+	    $idnum++;
+	    $idnum=substr('000000'.$idnum,-6,6);
+	    $newid=$time.'_'.$idnum;
+	}
+	$hash{$newid}=$newchat;
+	my $expired=$time-3600;
+	foreach (keys %hash) {
+	    my ($thistime)=($_=~/(\d+)\_/);
+	    if ($thistime<$expired) {
+		undef $hash{$_};
+	    }
+	}
+	untie %hash;
     }
-    untie %hash;
-   }
 }
 
 sub unsub {