--- loncom/lonnet/perl/lonnet.pm 2005/04/25 17:18:15 1.629 +++ loncom/lonnet/perl/lonnet.pm 2005/05/05 20:50:38 1.633 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.629 2005/04/25 17:18:15 banghart Exp $ +# $Id: lonnet.pm,v 1.633 2005/05/05 20:50:38 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2614,8 +2614,23 @@ sub put { return &reply("put:$udomain:$uname:$namespace:$items",$uhome); } -# ---------------------------------------------------------- putstore interface - +# ------------------------------------------------------------ newput interface + +sub newput { + my ($namespace,$storehash,$udomain,$uname)=@_; + if (!$udomain) { $udomain=$env{'user.domain'}; } + if (!$uname) { $uname=$env{'user.name'}; } + my $uhome=&homeserver($uname,$udomain); + my $items=''; + foreach my $key (keys(%$storehash)) { + $items.=&escape($key).'='.&freeze_escape($$storehash{$key}).'&'; + } + $items=~s/\&$//; + return &reply("newput:$udomain:$uname:$namespace:$items",$uhome); +} + +# --------------------------------------------------------- putstore interface + sub putstore { my ($namespace,$storehash,$udomain,$uname)=@_; if (!$udomain) { $udomain=$env{'user.domain'}; } @@ -3898,8 +3913,9 @@ sub unmark_as_readonly { my @del_keys; if (ref($current_locks) eq "ARRAY"){ foreach my $locker (@{$current_locks}) { - &logthis("$$locker[0].$$locker[1] eq $symb_crs"); - if ($$locker[0].$$locker[1] eq $symb_crs) { + my $compare=$locker; + if (ref($locker)) { $compare=join('',@{$locker}) }; + if ($compare eq $symb_crs) { if (defined($file_name) && ($file_name ne $file)) { push(@new_locks, $what); } @@ -4129,6 +4145,12 @@ sub get_courseresdata { return $result; } +sub devalidateuserresdata { + my ($uname,$udom)=@_; + my $hashid="$udom:$uname"; + &devalidate_cache_new('userres',$hashid); +} + sub get_userresdata { my ($uname,$udom)=@_; #most student don\'t have any data set, check if there is some data @@ -4152,7 +4174,8 @@ sub get_userresdata { $uname." at ".$udom.": ". $tmp.""); } elsif ($tmp=~/error: 2 /) { - &EXT_cache_set($udom,$uname); + #&EXT_cache_set($udom,$uname); + &do_cache_new('userres',$hashid,undef,600); } return $tmp; } @@ -4196,7 +4219,7 @@ sub EXT_cache_status { sub EXT_cache_set { my ($target_domain,$target_user) = @_; my $cachename = 'cache.EXT.'.$target_user.'.'.$target_domain; - &appenv($cachename => time); + #&appenv($cachename => time); } # --------------------------------------------------------- Value of a Variable @@ -5332,7 +5355,6 @@ sub receipt { sub getfile { my ($file) = @_; - &Apache::lonnet::logthis("file name is $file"); if ($file =~ m -^/*(uploaded|editupload)/-) { $file=&filelocation("",$file); } &repcopy($file); return &readfile($file); @@ -6180,7 +6202,10 @@ revokecustomrole($udom,$uname,$url,$role =item * -coursedescription($courseid) : course description +coursedescription($courseid) : returns a hash of information about the +specified course id, including all environment settings for the +course, the description of the course will be in the hash under the +key 'description' =item *