version 1.128, 2001/06/01 19:32:40
|
version 1.129, 2001/07/26 17:22:19
|
Line 45
|
Line 45
|
# del(namesp,array) : deletes keys out of array from namesp |
# del(namesp,array) : deletes keys out of array from namesp |
# put(namesp,hash) : stores hash in namesp |
# put(namesp,hash) : stores hash in namesp |
# cput(namesp,hash) : critical put |
# cput(namesp,hash) : critical put |
# dump(namesp) : dumps the complete namespace into a hash |
# dump(namesp,udom,uname) : dumps the complete namespace into a hash |
|
# if supplied uses udom as the domain and uname |
|
# as the username for the dump (supply a courseid |
|
# for the uname if you want a course database) |
# ssi(url,hash) : does a complete request cycle on url to localhost, posts |
# ssi(url,hash) : does a complete request cycle on url to localhost, posts |
# hash |
# hash |
# coursedescription(id) : returns and caches course description for id |
# coursedescription(id) : returns and caches course description for id |
Line 784 sub coursedescription {
|
Line 787 sub coursedescription {
|
$courseid=~s/^\///; |
$courseid=~s/^\///; |
$courseid=~s/\_/\//g; |
$courseid=~s/\_/\//g; |
my ($cdomain,$cnum)=split(/\//,$courseid); |
my ($cdomain,$cnum)=split(/\//,$courseid); |
my $chome=homeserver($cnum,$cdomain); |
my $chome=&homeserver($cnum,$cdomain); |
if ($chome ne 'no_host') { |
if ($chome ne 'no_host') { |
my $rep=reply("dump:$cdomain:$cnum:environment",$chome); |
my %returnhash=&dump('environment',$cdomain,$cnum); |
if ($rep ne 'con_lost') { |
if (!exists($returnhash{'con_lost'})) { |
my $normalid=$cdomain.'_'.$cnum; |
my $normalid=$cdomain.'_'.$cnum; |
my %envhash=(); |
my %envhash=(); |
my %returnhash=('home' => $chome, |
$returnhash{'home'}= $chome; |
'domain' => $cdomain, |
$returnhash{'domain'} = $cdomain; |
'num' => $cnum); |
$returnhash{'num'} = $cnum; |
map { |
while (my ($name,$value) = each %ENV) { |
my ($name,$value)=split(/\=/,$_); |
|
$name=&unescape($name); |
|
$value=&unescape($value); |
|
$returnhash{$name}=$value; |
|
$envhash{'course.'.$normalid.'.'.$name}=$value; |
$envhash{'course.'.$normalid.'.'.$name}=$value; |
} split(/\&/,$rep); |
} |
$returnhash{'url'}='/res/'.declutter($returnhash{'url'}); |
$returnhash{'url'}='/res/'.declutter($returnhash{'url'}); |
$returnhash{'fn'}=$perlvar{'lonDaemons'}.'/tmp/'. |
$returnhash{'fn'}=$perlvar{'lonDaemons'}.'/tmp/'. |
$ENV{'user.name'}.'_'.$cdomain.'_'.$cnum; |
$ENV{'user.name'}.'_'.$cdomain.'_'.$cnum; |
Line 950 sub del {
|
Line 949 sub del {
|
# -------------------------------------------------------------- dump interface |
# -------------------------------------------------------------- dump interface |
|
|
sub dump { |
sub dump { |
my $namespace=shift; |
my ($namespace,$udomain,$uname)=@_; |
my $rep=reply("dump:$ENV{'user.domain'}:$ENV{'user.name'}:$namespace", |
if (!$udomain) { $udomain=$ENV{'user.domain'}; } |
$ENV{'user.home'}); |
if (!$uname) { $uname=$ENV{'user.name'}; } |
|
my $uhome=&homeserver($uname,$udomain); |
|
my $rep=reply("dump:$udomain:$uname:$namespace",$uhome); |
my @pairs=split(/\&/,$rep); |
my @pairs=split(/\&/,$rep); |
my %returnhash=(); |
my %returnhash=(); |
map { |
map { |