--- loncom/lonnet/perl/lonnet.pm 2024/12/27 02:32:55 1.1532
+++ loncom/lonnet/perl/lonnet.pm 2025/03/19 14:44:04 1.1537
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.1532 2024/12/27 02:32:55 raeburn Exp $
+# $Id: lonnet.pm,v 1.1537 2025/03/19 14:44:04 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3019,6 +3019,9 @@ sub get_domain_defaults {
last if ($domdefaults{'userapprovals'});
}
}
+ if (ref($domconfig{'privacy'}{'othdom'}) eq 'HASH') {
+ $domdefaults{'privacyothdom'} = $domconfig{'privacy'}{'othdom'};
+ }
}
&do_cache_new('domdefaults',$domain,\%domdefaults,$cachetime);
return %domdefaults;
@@ -3731,6 +3734,7 @@ sub ssi_body {
$output=~s|//(\s*)?\s||gs;
$output=~s/^.*?\
]*\>//si;
$output=~s/\<\/body\s*\>.*?$//si;
+ $output=~s{\Q\E}{
}gs;
if (wantarray) {
return ($output, $response);
} else {
@@ -6749,7 +6753,7 @@ sub store {
# -------------------------------------------------------------- Critical Store
sub cstore {
- my ($storehash,$symb,$namespace,$domain,$stuname,$laststore,$ip,$nolog) = @_;
+ my ($storehash,$symb,$namespace,$domain,$stuname,$laststore) = @_;
my $home='';
if ($stuname) { $home=&homeserver($stuname,$domain); }
@@ -6774,11 +6778,7 @@ sub cstore {
}
if (!$home) { $home=$env{'user.home'}; }
- if ($ip ne '') {
- $$storehash{'ip'} = $ip;
- } else {
- $$storehash{'ip'} = &get_requestor_ip();
- }
+ $$storehash{'ip'} = &get_requestor_ip();
$$storehash{'host'}=$perlvar{'lonHostID'};
my $namevalue='';
@@ -6786,9 +6786,7 @@ sub cstore {
$namevalue.=&escape($key).'='.&freeze_escape($$storehash{$key}).'&';
}
$namevalue=~s/\&$//;
- unless ($nolog) {
- &courselog($symb.':'.$stuname.':'.$domain.':CSTORE:'.$namevalue);
- }
+ &courselog($symb.':'.$stuname.':'.$domain.':CSTORE:'.$namevalue);
return critical
("store:$domain:$stuname:$namespace:$symb:$namevalue:$laststore","$home");
}
@@ -7530,6 +7528,27 @@ sub set_adhoc_privileges {
if (&allowed('adv') eq 'F') { $tadv=1; }
&appenv({'request.role.adv' => $tadv});
}
+ if ($role eq 'ca') {
+ my @ca_settings = ('authoreditors','coauthorlist');
+ my %info = &userenvironment($dcdom,$pickedcourse,@ca_settings);
+ foreach my $item (@ca_settings) {
+ if (exists($info{$item})) {
+ my $name = $item;
+ if ($item eq 'authoreditors') {
+ $name = 'editors';
+ unless ($info{'authoreditors'}) {
+ my %domdefs = &get_domain_defaults($dcdom);
+ if ($domdefs{$name} ne '') {
+ $info{'authoreditors'} = $domdefs{$name};
+ } else {
+ $info{'authoreditors'} = 'edit,xml';
+ }
+ }
+ }
+ &appenv({"environment.internal.$name./$dcdom/$pickedcourse" => $info{$item}});
+ }
+ }
+ }
}
# --------------------------------------------------------------- get interface
@@ -11690,7 +11709,7 @@ sub is_course {
}
sub store_userdata {
- my ($storehash,$datakey,$namespace,$udom,$uname) = @_;
+ my ($storehash,$datakey,$namespace,$udom,$uname,$ip) = @_;
my $result;
if ($datakey ne '') {
if (ref($storehash) eq 'HASH') {
@@ -11702,7 +11721,11 @@ sub store_userdata {
if (($uhome eq '') || ($uhome eq 'no_host')) {
$result = 'error: no_host';
} else {
- $storehash->{'ip'} = &get_requestor_ip();
+ if ($ip ne '') {
+ $storehash->{'ip'} = $ip;
+ } else {
+ $storehash->{'ip'} = &get_requestor_ip();
+ }
$storehash->{'host'} = $perlvar{'lonHostID'};
my $namevalue='';
@@ -15094,6 +15117,9 @@ sub whichuser {
$courseid=$tmp_courseid;
($domain)=&get_env_multiple('form.grade_domain');
($name)=&get_env_multiple('form.grade_username');
+ if ($name eq 'public' && $domain eq 'public') {
+ $publicuser = 1;
+ }
return ($symb,$courseid,$domain,$name,$publicuser);
}
}
@@ -15110,6 +15136,7 @@ sub whichuser {
$env{'form.username'}.=time.rand(10000000);
}
$name.=$env{'form.username'};
+ $publicuser = 1;
}
return ($symb,$courseid,$domain,$name,$publicuser);