version 1.715, 2006/03/04 01:00:15
|
version 1.716, 2006/03/04 04:25:31
|
Line 3005 sub putstore {
|
Line 3005 sub putstore {
|
$items.= &escape($key).'='.&freeze_escape($storehash->{$key}).'&'; |
$items.= &escape($key).'='.&freeze_escape($storehash->{$key}).'&'; |
} |
} |
$items=~s/\&$//; |
$items=~s/\&$//; |
$symb=&escape($symb); |
my $esc_symb=&escape($symb); |
$version=&escape($version); |
my $esc_v=&escape($version); |
my $reply = |
my $reply = |
&reply("putstore:$udomain:$uname:$namespace:$symb:$version:$items", |
&reply("putstore:$udomain:$uname:$namespace:$esc_symb:$esc_v:$items", |
$uhome); |
$uhome); |
if ($reply eq 'unknown_cmd') { |
if ($reply eq 'unknown_cmd') { |
|
# gfall back to way things use to be done |
return &old_putstore($namespace,$symb,$version,$storehash,$udomain, |
return &old_putstore($namespace,$symb,$version,$storehash,$udomain, |
$uname); |
$uname); |
} |
} |
Line 3018 sub putstore {
|
Line 3019 sub putstore {
|
} |
} |
|
|
sub old_putstore { |
sub old_putstore { |
|
my ($namespace,$symb,$version,$storehash,$udomain,$uname)=@_; |
|
if (!$udomain) { $udomain=$env{'user.domain'}; } |
|
if (!$uname) { $uname=$env{'user.name'}; } |
|
my $uhome=&homeserver($uname,$udomain); |
|
my %newstorehash; |
|
foreach (keys %$storehash) { |
|
my $key = $version.':'.&escape($symb).':'.$_; |
|
$newstorehash{$key} = $storehash->{$_}; |
|
} |
|
my $items=''; |
|
my %allitems = (); |
|
foreach (keys %newstorehash) { |
|
if ($_ =~ m/^([^\:]+):([^\:]+):([^\:]+)$/) { |
|
my $key = $1.':keys:'.$2; |
|
$allitems{$key} .= $3.':'; |
|
} |
|
$items.=$_.'='.&freeze_escape($newstorehash{$_}).'&'; |
|
} |
|
foreach (keys %allitems) { |
|
$allitems{$_} =~ s/\:$//; |
|
$items.= $_.'='.$allitems{$_}.'&'; |
|
} |
|
$items=~s/\&$//; |
|
return &reply("put:$udomain:$uname:$namespace:$items",$uhome); |
} |
} |
|
|
# ------------------------------------------------------ critical put interface |
# ------------------------------------------------------ critical put interface |
Line 7279 put($namespace,$storehash,$udom,$uname)
|
Line 7303 put($namespace,$storehash,$udom,$uname)
|
|
|
=item * |
=item * |
|
|
putstore($namespace,$storehash,$udomain,$uname) : stores hash in namesp |
putstore($namespace,$symb,$version,$storehash,$udomain,$uname) : |
keys used in storehash include version information (e.g., 1:$symb:message etc.) as |
replaces a &store() version of data with a replacement set of data |
used in records written by &store and retrieved by &restore. This function |
for a particular resource in a namespace passed in the $storehash hash |
was created for use in editing discussion posts, without incrementing the |
reference |
version number included in the key for a particular post. The colon |
|
separated list of attribute names (e.g., the value associated with the key |
|
1:keys:$symb) is also generated and passed in the ampersand separated |
|
items sent to lonnet::reply(). |
|
|
|
=item * |
=item * |
|
|