version 1.1521, 2023/12/28 15:57:28
|
version 1.1525, 2024/04/14 17:12:29
|
Line 2858 sub get_domain_defaults {
|
Line 2858 sub get_domain_defaults {
|
} else { |
} else { |
$domdefaults{$type.'crsauthor'} = 1; |
$domdefaults{$type.'crsauthor'} = 1; |
} |
} |
|
if (ref($domconfig{'coursedefaults'}{'crseditors'}) eq 'ARRAY') { |
|
$domdefaults{'crseditors'}=join(',',@{$domconfig{'coursedefaults'}{'crseditors'}}); |
|
} |
} |
} |
if (ref($domconfig{'coursedefaults'}{'canclone'}) eq 'HASH') { |
if (ref($domconfig{'coursedefaults'}{'canclone'}) eq 'HASH') { |
if (ref($domconfig{'coursedefaults'}{'canclone'}{'instcode'}) eq 'ARRAY') { |
if (ref($domconfig{'coursedefaults'}{'canclone'}{'instcode'}) eq 'ARRAY') { |
Line 2975 sub get_domain_defaults {
|
Line 2978 sub get_domain_defaults {
|
$domdefaults{'ltiprivhosts'} = $domconfig{'ltisec'}{'private'}{'keys'}; |
$domdefaults{'ltiprivhosts'} = $domconfig{'ltisec'}{'private'}{'keys'}; |
} |
} |
} |
} |
|
if (ref($domconfig{'ltisec'}{'suggested'}) eq 'HASH') { |
|
my %suggestions = %{$domconfig{'ltisec'}{'suggested'}}; |
|
foreach my $item (keys(%{$domconfig{'ltisec'}{'suggested'}})) { |
|
unless (ref($domconfig{'ltisec'}{'suggested'}{$item}) eq 'HASH') { |
|
delete($suggestions{$item}); |
|
} |
|
} |
|
if (keys(%suggestions)) { |
|
$domdefaults{'linkprotsuggested'} = \%suggestions; |
|
} |
|
} |
} |
} |
if (ref($domconfig{'toolsec'}) eq 'HASH') { |
if (ref($domconfig{'toolsec'}) eq 'HASH') { |
if (ref($domconfig{'toolsec'}{'encrypt'}) eq 'HASH') { |
if (ref($domconfig{'toolsec'}{'encrypt'}) eq 'HASH') { |
Line 6998 sub rolesinit {
|
Line 7012 sub rolesinit {
|
my %allroles=(); |
my %allroles=(); |
my %allgroups=(); |
my %allgroups=(); |
my %gotcoauconfig=(); |
my %gotcoauconfig=(); |
|
my %domdefaults=(); |
|
|
for my $area (grep { ! /^rolesdef_/ } keys(%rolesdump)) { |
for my $area (grep { ! /^rolesdef_/ } keys(%rolesdump)) { |
my $role = $rolesdump{$area}; |
my $role = $rolesdump{$area}; |
Line 7060 sub rolesinit {
|
Line 7075 sub rolesinit {
|
my $name = $item; |
my $name = $item; |
if ($item eq 'authoreditors') { |
if ($item eq 'authoreditors') { |
$name = 'editors'; |
$name = 'editors'; |
|
unless ($info{'authoreditors'}) { |
|
my %domdefs; |
|
if (ref($domdefaults{$audom}) eq 'HASH') { |
|
%domdefs = %{$domdefaults{$audom}}; |
|
} else { |
|
%domdefs = &get_domain_defaults($audom); |
|
$domdefaults{$audom} = \%domdefs; |
|
} |
|
if ($domdefs{$name} ne '') { |
|
$info{'authoreditors'} = $domdefs{$name}; |
|
} else { |
|
$info{'authoreditors'} = 'edit,xml'; |
|
} |
|
} |
} |
} |
$coauthorenv{"environment.internal.$name.$area"} = $info{$item}; |
$coauthorenv{"environment.internal.$name.$area"} = $info{$item}; |
} |
} |
Line 8004 sub get_portfolio_access {
|
Line 8033 sub get_portfolio_access {
|
$portaccess = &usertools_access($unum,$udom,'portaccess',undef,'tools'); |
$portaccess = &usertools_access($unum,$udom,'portaccess',undef,'tools'); |
} |
} |
|
|
my ($public,$guest,@domains,@users,@courses,@groups,@ips); |
my ($public,$guest,@domains,@users,@courses,@groups,@ips,@userips); |
my $now = time; |
my $now = time; |
if (ref($access_hash) eq 'HASH') { |
if (ref($access_hash) eq 'HASH') { |
foreach my $key (keys(%{$access_hash})) { |
foreach my $key (keys(%{$access_hash})) { |
Line 8031 sub get_portfolio_access {
|
Line 8060 sub get_portfolio_access {
|
push(@groups,$key); |
push(@groups,$key); |
} elsif ($scope eq 'ip') { |
} elsif ($scope eq 'ip') { |
push(@ips,$key); |
push(@ips,$key); |
|
} elsif ($scope eq 'userip') { |
|
push(@userips,$key); |
} |
} |
} |
} |
if ($public) { |
if ($public) { |
Line 8045 sub get_portfolio_access {
|
Line 8076 sub get_portfolio_access {
|
} |
} |
} |
} |
} |
} |
|
if ($allowed) { |
|
return 'ok'; |
|
} |
|
} elsif (@userips > 0) { |
|
my $allowed; |
|
foreach my $useripkey (@userips) { |
|
if (ref($access_hash->{$useripkey}{'ip'}) eq 'ARRAY') { |
|
if (&Apache::loncommon::check_ip_acc(join(',',@{$access_hash->{$useripkey}{'ip'}}),$clientip)) { |
|
$allowed = 1; |
|
last; |
|
} |
|
} |
|
} |
if ($allowed) { |
if ($allowed) { |
return 'ok'; |
return 'ok'; |
} |
} |