[LON-CAPA-cvs] cvs: loncom(version_2_12_X) /interface domainprefs.pm
raeburn
raeburn at source.lon-capa.org
Tue Jan 14 08:20:29 EST 2025
raeburn Tue Jan 14 13:20:30 2025 EDT
Modified files: (Branch: version_2_12_X)
/loncom/interface domainprefs.pm
Log:
- For 2.12
Domain configuration for availability of "directory" and "non-directory"
user information. Settings for information for privileged and unprivileged
users with a role assigned in user's domain not included in 2.12.0
-------------- next part --------------
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.447.2.3 loncom/interface/domainprefs.pm:1.447.2.4
--- loncom/interface/domainprefs.pm:1.447.2.3 Tue Jan 14 13:06:01 2025
+++ loncom/interface/domainprefs.pm Tue Jan 14 13:20:29 2025
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.447.2.3 2025/01/14 13:06:01 raeburn Exp $
+# $Id: domainprefs.pm,v 1.447.2.4 2025/01/14 13:20:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -563,11 +563,7 @@
header => [{col1 => 'Role assigned in different domain',
col2 => 'Approval options'},
{col1 => 'Role assigned in different domain to user of type',
- col2 => 'User information available in that domain'},
- {col1 => "Role assigned in user's domain",
- col2 => 'Information viewable by privileged user'},
- {col1 => "Role assigned in user's domain",
- col2 => 'Information viewable by unprivileged user'}],
+ col2 => 'User information available in that domain'}],
print => \&print_privacy,
modify => \&modify_privacy,
},
@@ -1008,8 +1004,8 @@
($action eq 'selfcreation') || ($action eq 'selfenrollment') ||
($action eq 'usersessions') || ($action eq 'coursecategories') ||
($action eq 'trust') || ($action eq 'contacts') || ($action eq 'defaults') ||
- ($action eq 'privacy') || ($action eq 'passwords') || ($action eq 'lti') ||
- ($action eq 'ltitools') || ($action eq 'usermodification')) {
+ ($action eq 'passwords') || ($action eq 'lti') || ($action eq 'ltitools') ||
+ ($action eq 'usermodification')) {
if ($action eq 'coursecategories') {
$output .= &print_coursecategories('middle',$dom,$item,$settings,\$rowtotal);
$colspan = ' colspan="2"';
@@ -1079,8 +1075,8 @@
</tr>'."\n";
if ($action eq 'coursecategories') {
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal);
- } elsif (($action eq 'contacts') || ($action eq 'privacy') ||
- ($action eq 'passwords') || ($action eq 'lti')) {
+ } elsif (($action eq 'contacts') || ($action eq 'passwords') ||
+ ($action eq 'lti')) {
if ($action eq 'passwords') {
$output .= $item->{'print'}->('lower',$dom,$confname,$settings,\$rowtotal);
} else {
@@ -1115,7 +1111,7 @@
$rowtotal ++;
} elsif (($action eq 'coursedefaults') || ($action eq 'authordefaults') ||
($action eq 'directorysrch') || ($action eq 'helpsettings') ||
- ($action eq 'wafproxy')) {
+ ($action eq 'wafproxy') || ($action eq 'privacy')) {
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
} elsif ($action eq 'scantron') {
$output .= $item->{'print'}->($r,'bottom',$dom,$confname,$settings,\$rowtotal);
@@ -7789,7 +7785,7 @@
($othertitle,$usertypes,$types) =
&Apache::loncommon::sorted_inst_types($dom);
}
- if (($position eq 'top') || ($position eq 'middle')) {
+ if (($position eq 'top') || ($position eq 'bottom')) {
my (%by_ip,%by_location, at intdoms, at instdoms);
&build_location_hashes(\@intdoms,\%by_ip,\%by_location,\@instdoms);
if ($position eq 'top') {
@@ -7876,7 +7872,7 @@
$datatable .= &mt('Nothing to set here, as there are no other domains');
}
$datatable .='</td></tr>';
- } elsif ($position eq 'middle') {
+ } elsif ($position eq 'bottom') {
if ((@instdoms > 1) || (keys(%by_location) > 0)) {
if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) {
foreach my $item (@{$types}) {
@@ -7913,19 +7909,6 @@
}
}
}
- } else {
- my $prefix;
- if ($position eq 'lower') {
- $prefix = 'priv';
- } else {
- $prefix = 'unpriv';
- }
- foreach my $item (@items) {
- $datatable .= &modifiable_userdata_row('privacy',$prefix.'_'.$item,$settings,
- $numinrow,$itemcount,'','','','','',
- '',$names{$item});
- $itemcount ++;
- }
}
if (ref($rowtotal)) {
$$rowtotal += $itemcount;
@@ -17910,8 +17893,6 @@
extdom => {},
},
'othdom' => {},
- 'priv' => {},
- 'unpriv' => {},
);
foreach my $item (@items) {
if (@instdoms > 1) {
@@ -17942,41 +17923,6 @@
$changes{'approval'} = 1;
}
}
- foreach my $status ('priv','unpriv') {
- my @possibles = sort(&Apache::loncommon::get_env_multiple('form.privacy_'.$status.'_'.$item));
- my @newvalues;
- foreach my $field (@possibles) {
- if (grep(/^\Q$field\E$/, at fields)) {
- $privacyhash{$status}{$item}{$field} = 1;
- push(@newvalues,$field);
- }
- }
- @newvalues = sort(@newvalues);
- if (ref($current{$status}) eq 'HASH') {
- if (ref($current{$status}{$item}) eq 'HASH') {
- my @currvalues = sort(keys(%{$current{$status}{$item}}));
- my @diffs = &Apache::loncommon::compare_arrays(\@currvalues,\@newvalues);
- if (@diffs > 0) {
- $changes{$status} = 1;
- }
- } elsif (@newvalues > 0) {
- $changes{$status} = 1;
- }
- } else {
- my @stdfields;
- foreach my $field (@fields) {
- if ($field eq 'id') {
- next if ($status eq 'unpriv');
- next if (($status eq 'priv') && ($item eq 'community'));
- }
- push(@stdfields,$field);
- }
- my @diffs = &Apache::loncommon::compare_arrays(\@stdfields,\@newvalues);
- if (@diffs > 0) {
- $changes{$status} = 1;
- }
- }
- }
}
if ((@instdoms > 1) || (keys(%by_location) > 0)) {
my @statuses;
@@ -18031,7 +17977,7 @@
if ($putresult eq 'ok') {
if (keys(%changes) > 0) {
$resulttext = &mt('Changes made: ').'<ul>';
- foreach my $key ('approval','notify','othdom','priv','unpriv') {
+ foreach my $key ('approval','notify','othdom') {
if ($changes{$key}) {
$resulttext .= '<li>'.$titles{$key}.':<ul>';
if ($key eq 'approval') {
@@ -18082,18 +18028,6 @@
$resulttext .= '</li>';
}
}
- } else {
- foreach my $item (@items) {
- if (ref($privacyhash{$key}{$item}) eq 'HASH') {
- $resulttext .= '<li>'.$names{$item}.': ';
- if (keys(%{$privacyhash{$key}{$item}})) {
- $resulttext .= join(', ', map { $fieldnames{$_}; } (sort(keys(%{$privacyhash{$key}{$item}}))));
- } else {
- $resulttext .= &mt('none');
- }
- $resulttext .= '</li>';
- }
- }
}
$resulttext .= '</ul></li>';
}
More information about the LON-CAPA-cvs
mailing list