--- loncom/lond 2005/01/01 02:31:05 1.272 +++ loncom/lond 2005/01/26 12:13:58 1.276 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.272 2005/01/01 02:31:05 raeburn Exp $ +# $Id: lond,v 1.276 2005/01/26 12:13:58 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -58,7 +58,7 @@ my $DEBUG = 0; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.272 $'; #' stupid emacs +my $VERSION='$Revision: 1.276 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -1799,10 +1799,11 @@ sub change_authentication_handler { # to take ownership of the construction space back to www:www # - if( ($oldauth =~ /^unix/) && ($umode eq "internal")) { # unix -> internal + if( (($oldauth =~ /^unix/) && ($umode eq "internal")) || + (($oldauth =~ /^internal/) && ($umode eq "unix")) ) { if(&is_author($udom, $uname)) { &Debug(" Need to manage author permissions..."); - &manage_permissions("/$udom/_au", $udom, $uname, "internal:"); + &manage_permissions("/$udom/_au", $udom, $uname, "$umode:"); } } @@ -3140,12 +3141,12 @@ sub put_course_id_handler { my ($key,$courseinfo) = split(/=/,$pair,2); $courseinfo =~ s/=/:/g; - my @current_items = split/:/,$hashref->{$key}; - shift @current_items; # remove description - pop @current_items; # remove last access + my @current_items = split(/:/,$hashref->{$key}); + shift(@current_items); # remove description + pop(@current_items); # remove last access my $numcurrent = scalar(@current_items); - my @new_items = split/:/,$courseinfo; + my @new_items = split(/:/,$courseinfo); my $numnew = scalar(@new_items); if ($numcurrent > 0) { if ($numnew == 1) { # flushcourselogs() from 1.1 or earlier @@ -3198,8 +3199,9 @@ sub put_course_id_handler { # owner - optional supplied username of owner to filter # the dump. Only courses for which the course # owner matches the supplied username will be -# returned. Implicit assumption that owner is a user -# in the domain in which the course database is defined. +# returned. Implicit assumption that owner +# is a user in the domain in which the +# course database is defined. # $client - The socket open on the client. # Returns: # 1 - Continue processing. @@ -3233,15 +3235,9 @@ sub dump_course_id_handler { if ($hashref) { while (my ($key,$value) = each(%$hashref)) { my ($descr,$lasttime,$inst_code,$owner); - my @courseitems = split/:/,$value; - $descr = shift @courseitems; - $lasttime = pop @courseitems; - if (@courseitems > 0) { - $inst_code = shift @courseitems; - } - if (@courseitems > 0) { - $owner = shift @courseitems; - } + my @courseitems = split(/:/,$value); + $lasttime = pop(@courseitems); + ($descr,$inst_code,$owner)=@courseitems; if ($lasttime<$since) { next; } my $match = 1; unless ($description eq '.') { @@ -4471,7 +4467,7 @@ sub logstatus { flock(LOG,LOCK_EX); print LOG $$."\t".$clientname."\t".$currenthostid."\t" .$status."\t".$lastlog."\t $keymode\n"; - flock(DB,LOCK_UN); + flock(LOG,LOCK_UN); close(LOG); } &status("Finished logging");