version 1.122, 2001/04/16 23:16:31
|
version 1.125, 2001/05/28 16:38:14
|
Line 28
|
Line 28
|
# revokecustomrole (udom,uname,url,rdom,rnam,rolename) : Revoke a custom role |
# revokecustomrole (udom,uname,url,rdom,rnam,rolename) : Revoke a custom role |
# appenv(hash) : adds hash to session environment |
# appenv(hash) : adds hash to session environment |
# delenv(varname) : deletes all environment entries starting with varname |
# delenv(varname) : deletes all environment entries starting with varname |
# store(hashref,symb,courseid,udom,uname,homeserver) |
# store(hashref,symb,courseid,udom,uname) |
# : stores hash permanently for this url |
# : stores hash permanently for this url |
# hashref needs to be given, and should be a \%hashname |
# hashref needs to be given, and should be a \%hashname |
# the remaining args aren't required and if they aren't |
# the remaining args aren't required and if they aren't |
# passed or are '' they will be derived from the ENV |
# passed or are '' they will be derived from the ENV |
# cstore(hashref,symb,courseid,udom,uname,homeserver) |
# cstore(hashref,symb,courseid,udom,uname) |
# : same as store but uses the critical interface to |
# : same as store but uses the critical interface to |
# guarentee a store |
# guarentee a store |
# restore(symb,courseid,udom,uname,homeserver) |
# restore(symb,courseid,udom,uname) |
# : returns hash for this symb, all args are optional |
# : returns hash for this symb, all args are optional |
# if they aren't given they will be derived from the current |
# if they aren't given they will be derived from the |
# enviroment |
# current enviroment |
# eget(namesp,array) : returns hash with keys from array filled in from namesp |
# eget(namesp,array) : returns hash with keys from array filled in from namesp |
# get(namesp,array) : returns hash with keys from array filled in from namesp |
# get(namesp,array) : returns hash with keys from array filled in from namesp |
# del(namesp,array) : deletes keys out of array from namesp |
# del(namesp,array) : deletes keys out of array from namesp |
Line 102
|
Line 102
|
# 3/2 Gerd Kortemeyer |
# 3/2 Gerd Kortemeyer |
# 3/15,3/19 Scott Harrison |
# 3/15,3/19 Scott Harrison |
# 3/19,3/20 Gerd Kortemeyer |
# 3/19,3/20 Gerd Kortemeyer |
# 3/22,3/27 Scott Harrison |
# 3/22,3/27,4/2,4/16,4/17 Scott Harrison |
|
# 5/26,5/28 Gerd Kortemeyer |
|
# |
package Apache::lonnet; |
package Apache::lonnet; |
|
|
use strict; |
use strict; |
Line 686 sub devalidate {
|
Line 687 sub devalidate {
|
# ----------------------------------------------------------------------- Store |
# ----------------------------------------------------------------------- Store |
|
|
sub store { |
sub store { |
my ($storehash,$symb,$namespace,$domain,$stuname,$home) = @_; |
my ($storehash,$symb,$namespace,$domain,$stuname) = @_; |
|
my $home=''; |
|
|
|
if ($stuname) { |
|
$home=&homeserver($stuname,$domain); |
|
} |
|
|
if (!$symb) { unless ($symb=&symbread()) { return ''; } } |
if (!$symb) { unless ($symb=&symbread()) { return ''; } } |
|
|
&devalidate($symb); |
&devalidate($symb); |
Line 701 sub store {
|
Line 708 sub store {
|
$namevalue.=escape($_).'='.escape($$storehash{$_}).'&'; |
$namevalue.=escape($_).'='.escape($$storehash{$_}).'&'; |
} keys %$storehash; |
} keys %$storehash; |
$namevalue=~s/\&$//; |
$namevalue=~s/\&$//; |
return critical("store:$domain:$stuname:$namespace:$symb:$namevalue","$home"); |
return reply("store:$domain:$stuname:$namespace:$symb:$namevalue","$home"); |
} |
} |
|
|
# -------------------------------------------------------------- Critical Store |
# -------------------------------------------------------------- Critical Store |
|
|
sub cstore { |
sub cstore { |
my ($storehash,$symb,$namespace,$domain,$stuname,$home) = @_; |
my ($storehash,$symb,$namespace,$domain,$stuname) = @_; |
|
my $home=''; |
|
|
|
if ($stuname) { |
|
$home=&homeserver($stuname,$domain); |
|
} |
|
|
if (!$symb) { unless ($symb=&symbread()) { return ''; } } |
if (!$symb) { unless ($symb=&symbread()) { return ''; } } |
|
|
&devalidate($symb); |
&devalidate($symb); |
Line 729 sub cstore {
|
Line 742 sub cstore {
|
# --------------------------------------------------------------------- Restore |
# --------------------------------------------------------------------- Restore |
|
|
sub restore { |
sub restore { |
my ($symb,$namespace,$domain,$stuname,$home) = @_; |
my ($symb,$namespace,$domain,$stuname) = @_; |
|
my $home=''; |
|
|
|
if ($stuname) { |
|
$home=&homeserver($stuname,$domain); |
|
} |
|
|
if (!$symb) { |
if (!$symb) { |
unless ($symb=escape(&symbread())) { return ''; } |
unless ($symb=escape(&symbread())) { return ''; } |
} else { |
} else { |
Line 862 sub rolesinit {
|
Line 881 sub rolesinit {
|
} |
} |
} |
} |
} split(/&/,$rolesdump); |
} split(/&/,$rolesdump); |
|
my $adv=0; |
map { |
map { |
%thesepriv=(); |
%thesepriv=(); |
|
if ($_ ne 'st') { $adv=1; } |
map { |
map { |
if ($_ ne '') { |
if ($_ ne '') { |
my ($privilege,$restrictions)=split(/&/,$_); |
my ($privilege,$restrictions)=split(/&/,$_); |
Line 880 sub rolesinit {
|
Line 901 sub rolesinit {
|
map { $thesestr.=':'.$_.'&'.$thesepriv{$_}; } keys %thesepriv; |
map { $thesestr.=':'.$_.'&'.$thesepriv{$_}; } keys %thesepriv; |
$userroles.='user.priv.'.$_.'='.$thesestr."\n"; |
$userroles.='user.priv.'.$_.'='.$thesestr."\n"; |
} keys %allroles; |
} keys %allroles; |
|
$userroles.='user.adv='.$adv."\n"; |
} |
} |
return $userroles; |
return $userroles; |
} |
} |
Line 1259 sub metadata_query {
|
Line 1281 sub metadata_query {
|
my ($query,$custom,$customshow)=@_; |
my ($query,$custom,$customshow)=@_; |
# need to put in a library server loop here and return a hash |
# need to put in a library server loop here and return a hash |
my %rhash; |
my %rhash; |
# for my $server (keys %libserv) { |
for my $server (keys %libserv) { |
for my $server ('msul3') { |
|
unless ($custom or $customshow) { |
unless ($custom or $customshow) { |
my $reply=&reply("querysend:".&escape($query),$server); |
my $reply=&reply("querysend:".&escape($query),$server); |
$rhash{$server}=$reply; |
$rhash{$server}=$reply; |