[LON-CAPA-cvs] cvs: loncom / lond
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 31 Jan 2006 04:26:43 -0000
albertel Mon Jan 30 23:26:43 2006 EDT
Modified files:
/loncom lond
Log:
- making restore: user the tie_user_hash croutine
Index: loncom/lond
diff -u loncom/lond:1.308 loncom/lond:1.309
--- loncom/lond:1.308 Fri Jan 27 18:04:27 2006
+++ loncom/lond Mon Jan 30 23:26:41 2006
@@ -2,7 +2,7 @@
# The LearningOnline Network
# lond "LON Daemon" Server (port "LOND" 5663)
#
-# $Id: lond,v 1.308 2006/01/27 23:04:27 albertel Exp $
+# $Id: lond,v 1.309 2006/01/31 04:26:41 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -59,7 +59,7 @@
my $status='';
my $lastlog='';
-my $VERSION='$Revision: 1.308 $'; #' stupid emacs
+my $VERSION='$Revision: 1.309 $'; #' stupid emacs
my $remoteVERSION;
my $currenthostid="default";
my $currentdomainid;
@@ -3061,24 +3061,22 @@
$namespace=~s/\//\_/g;
$namespace=~s/\W//g;
chomp($rid);
- my $proname=&propath($udom,$uname);
my $qresult='';
- my %hash;
- if (tie(%hash,'GDBM_File',"$proname/$namespace.db",
- &GDBM_READER(),0640)) {
- my $version=$hash{"version:$rid"};
+ my $hashref = &tie_user_hash($udom, $uname, $namespace, &GDBM_READER());
+ if ($hashref) {
+ my $version=$hashref->{"version:$rid"};
$qresult.="version=$version&";
my $scope;
for ($scope=1;$scope<=$version;$scope++) {
- my $vkeys=$hash{"$scope:keys:$rid"};
+ my $vkeys=$hashref->{"$scope:keys:$rid"};
my @keys=split(/:/,$vkeys);
my $key;
$qresult.="$scope:keys=$vkeys&";
foreach $key (@keys) {
- $qresult.="$scope:$key=".$hash{"$scope:$rid:$key"}."&";
+ $qresult.="$scope:$key=".$hashref->{"$scope:$rid:$key"}."&";
}
}
- if (untie(%hash)) {
+ if (untie(%$hashref)) {
$qresult=~s/\&$//;
&Reply( $client, "$qresult\n", $userinput);
} else {