--- loncom/interface/domainprefs.pm 2025/01/12 18:26:16 1.447.2.2 +++ loncom/interface/domainprefs.pm 2025/01/14 13:20:29 1.447.2.4 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.447.2.2 2025/01/12 18:26:16 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 @@ sub handler { 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 @@ sub print_config_box { ($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 @@ sub print_config_box { '."\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 @@ sub print_config_box { $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 @@ sub print_privacy { ($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,@intdoms,@instdoms); &build_location_hashes(\@intdoms,\%by_ip,\%by_location,\@instdoms); if ($position eq 'top') { @@ -7876,7 +7872,7 @@ sub print_privacy { $datatable .= &mt('Nothing to set here, as there are no other domains'); } $datatable .=''; - } 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 @@ sub print_privacy { } } } - } 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 @@ sub modify_privacy { extdom => {}, }, 'othdom' => {}, - 'priv' => {}, - 'unpriv' => {}, ); foreach my $item (@items) { if (@instdoms > 1) { @@ -17942,39 +17923,6 @@ sub modify_privacy { $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$/,@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; - } - } - } 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; @@ -17998,6 +17946,8 @@ sub modify_privacy { if (@diffs > 0) { $changes{'othdom'} = 1; } + } elsif (@newvalues > 0) { + $changes{'othdom'} = 1; } } else { my @stdfields = ('lastname','firstname','middlename','generation','permanentemail'); @@ -18027,7 +17977,7 @@ sub modify_privacy { if ($putresult eq 'ok') { if (keys(%changes) > 0) { $resulttext = &mt('Changes made: ').'