--- loncom/lond 2006/02/07 05:08:27 1.317 +++ loncom/lond 2006/02/09 20:48:40 1.318.2.3 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.317 2006/02/07 05:08:27 raeburn Exp $ +# $Id: lond,v 1.318.2.3 2006/02/09 20:48:40 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -61,7 +61,7 @@ my $status=''; my $lastlog=''; my $lond_max_wait_time = 13; -my $VERSION='$Revision: 1.317 $'; #' stupid emacs +my $VERSION='$Revision: 1.318.2.3 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -2915,11 +2915,22 @@ sub dump_profile_database { while (my ($key,$value) = each(%$hashref)) { my ($v,$symb,$param) = split(/:/,$key); next if ($v eq 'version' || $symb eq 'keys'); - next if (exists($data{$symb}) && - exists($data{$symb}->{$param}) && - $data{$symb}->{'v.'.$param} > $v); - $data{$symb}->{$param}=$value; - $data{$symb}->{'v.'.$param}=$v; + if (!defined($param)) { + foreach my $pair (split(/\&/,$value)) { + my ($param,$value)=split(/=/,$pair); + next if (exists($data{$symb}) && + exists($data{$symb}->{$param}) && + $data{$symb}->{'v.'.$param} > $v); + $data{$symb}->{$param}=$value; + $data{$symb}->{'v.'.$param}=$v; + } + } else { + next if (exists($data{$symb}) && + exists($data{$symb}->{$param}) && + $data{$symb}->{'v.'.$param} > $v); + $data{$symb}->{$param}=$value; + $data{$symb}->{'v.'.$param}=$v; + } } if (&untie_user_hash($hashref)) { while (my ($symb,$param_hash) = each(%data)) { @@ -3068,11 +3079,10 @@ sub store_handler { my $version=$hashref->{"version:$rid"}; my $allkeys=''; foreach my $pair (@pairs) { - my ($key,$value)=split(/=/,$pair); + my ($key)=split(/=/,$pair); $allkeys.=$key.':'; - $hashref->{"$version:$rid:$key"}=$value; } - $hashref->{"$version:$rid:timestamp"}=$now; + $hashref->{"$version:$rid"}=$what."\×tamp=$now"; $allkeys.='timestamp'; $hashref->{"$version:keys:$rid"}=$allkeys; if (&untie_user_hash($hashref)) { @@ -3138,9 +3148,17 @@ sub restore_handler { my @keys=split(/:/,$vkeys); my $key; $qresult.="$scope:keys=$vkeys&"; - foreach $key (@keys) { - $qresult.="$scope:$key=".$hashref->{"$scope:$rid:$key"}."&"; - } + if (exists($hashref->{"$scope:$rid"})) { + my $what=$hashref->{"$scope:$rid"}; + foreach my $pair (split(/\&/,$hashref->{"$scope:$rid"})) { + my ($key,$value)=split(/=/,$pair); + $qresult.="$scope:".$pair."&"; + } + } else { + foreach $key (@keys) { + $qresult.="$scope:$key=".$hashref->{"$scope:$rid:$key"}."&"; + } + } } if (&untie_user_hash($hashref)) { $qresult=~s/\&$//; @@ -4349,9 +4367,9 @@ sub photo_permission_handler { my $cdom = $tail; my ($perm_reqd,$conditions); my $outcome = &localenroll::photo_permission($cdom,\$perm_reqd, - \$conditions); + \$conditions); &Reply($client, &escape($outcome.':'.$perm_reqd.':'. $conditions)."\n", - $userinput); + $userinput); } ®ister_handler("autophotopermission",\&photo_permission_handler,0,1,0);