version 1.356, 2019/04/26 20:22:18
|
version 1.357, 2019/04/26 23:46:19
|
Line 219 sub handler {
|
Line 219 sub handler {
|
'serverstatuses','requestcourses','helpsettings', |
'serverstatuses','requestcourses','helpsettings', |
'coursedefaults','usersessions','loadbalancing', |
'coursedefaults','usersessions','loadbalancing', |
'requestauthor','selfenrollment','inststatus', |
'requestauthor','selfenrollment','inststatus', |
'ltitools','ssl','trust','lti','passwords'],$dom); |
'ltitools','ssl','trust','lti','privacy','passwords'],$dom); |
my %encconfig = |
my %encconfig = |
&Apache::lonnet::get_dom('encconfig',['ltitools','lti'],$dom); |
&Apache::lonnet::get_dom('encconfig',['ltitools','lti'],$dom); |
if (ref($domconfig{'ltitools'}) eq 'HASH') { |
if (ref($domconfig{'ltitools'}) eq 'HASH') { |
Line 247 sub handler {
|
Line 247 sub handler {
|
} |
} |
} |
} |
my @prefs_order = ('rolecolors','login','defaults','passwords','quotas','autoenroll', |
my @prefs_order = ('rolecolors','login','defaults','passwords','quotas','autoenroll', |
'autoupdate','autocreate','directorysrch','contacts', |
'autoupdate','autocreate','directorysrch','contacts','privacy', |
'usercreation','selfcreation','usermodification','scantron', |
'usercreation','selfcreation','usermodification','scantron', |
'requestcourses','requestauthor','coursecategories', |
'requestcourses','requestauthor','coursecategories', |
'serverstatuses','helpsettings','coursedefaults', |
'serverstatuses','helpsettings','coursedefaults', |
Line 497 sub handler {
|
Line 497 sub handler {
|
modify => \&modify_selfenrollment, |
modify => \&modify_selfenrollment, |
}, |
}, |
'privacy' => |
'privacy' => |
{text => 'User Privacy', |
{text => 'Availability of User Information', |
help => 'Domain_Configuration_User_Privacy', |
help => 'Domain_Configuration_User_Privacy', |
header => [{col1 => 'Setting', |
header => [{col1 => 'Role assigned in different domain', |
col2 => 'Value',}], |
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'}], |
print => \&print_privacy, |
print => \&print_privacy, |
modify => \&modify_privacy, |
modify => \&modify_privacy, |
}, |
}, |
Line 771 sub process_changes {
|
Line 777 sub process_changes {
|
$output = &modify_trust($dom,$lastactref,%domconfig); |
$output = &modify_trust($dom,$lastactref,%domconfig); |
} elsif ($action eq 'lti') { |
} elsif ($action eq 'lti') { |
$output = &modify_lti($r,$dom,$action,$lastactref,%domconfig); |
$output = &modify_lti($r,$dom,$action,$lastactref,%domconfig); |
|
} elsif ($action eq 'privacy') { |
|
$output = &modify_privacy($dom,%domconfig); |
} elsif ($action eq 'passwords') { |
} elsif ($action eq 'passwords') { |
$output = &modify_passwords($r,$dom,$confname,$lastactref,%domconfig); |
$output = &modify_passwords($r,$dom,$confname,$lastactref,%domconfig); |
} |
} |
Line 844 sub print_config_box {
|
Line 852 sub print_config_box {
|
($action eq 'usermodification') || ($action eq 'defaults') || ($action eq 'coursedefaults') || |
($action eq 'usermodification') || ($action eq 'defaults') || ($action eq 'coursedefaults') || |
($action eq 'selfenrollment') || ($action eq 'usersessions') || ($action eq 'ssl') || |
($action eq 'selfenrollment') || ($action eq 'usersessions') || ($action eq 'ssl') || |
($action eq 'directorysrch') || ($action eq 'trust') || ($action eq 'helpsettings') || |
($action eq 'directorysrch') || ($action eq 'trust') || ($action eq 'helpsettings') || |
($action eq 'contacts')) { |
($action eq 'contacts') || ($action eq 'privacy')) { |
$output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'passwords') { |
} elsif ($action eq 'passwords') { |
$output .= $item->{'print'}->('top',$dom,$confname,$settings,\$rowtotal); |
$output .= $item->{'print'}->('top',$dom,$confname,$settings,\$rowtotal); |
Line 879 sub print_config_box {
|
Line 887 sub print_config_box {
|
if (($action eq 'autoupdate') || ($action eq 'usercreation') || |
if (($action eq 'autoupdate') || ($action eq 'usercreation') || |
($action eq 'selfcreation') || ($action eq 'selfenrollment') || |
($action eq 'selfcreation') || ($action eq 'selfenrollment') || |
($action eq 'usersessions') || ($action eq 'coursecategories') || |
($action eq 'usersessions') || ($action eq 'coursecategories') || |
($action eq 'trust') || ($action eq 'contacts') || ($action eq 'passwords')) { |
($action eq 'trust') || ($action eq 'contacts') || |
|
($action eq 'privacy') || ($action eq 'passwords')) { |
if ($action eq 'coursecategories') { |
if ($action eq 'coursecategories') { |
$output .= &print_coursecategories('middle',$dom,$item,$settings,\$rowtotal); |
$output .= &print_coursecategories('middle',$dom,$item,$settings,\$rowtotal); |
$colspan = ' colspan="2"'; |
$colspan = ' colspan="2"'; |
Line 932 sub print_config_box {
|
Line 941 sub print_config_box {
|
</tr>'."\n"; |
</tr>'."\n"; |
if ($action eq 'coursecategories') { |
if ($action eq 'coursecategories') { |
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal); |
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal); |
} elsif (($action eq 'contacts') || ($action eq 'passwords')) { |
} elsif (($action eq 'contacts') || ($action eq 'privacy') || ($action eq 'passwords')) { |
if ($action eq 'passwords') { |
if ($action eq 'passwords') { |
$output .= $item->{'print'}->('lower',$dom,$confname,$settings,\$rowtotal); |
$output .= $item->{'print'}->('lower',$dom,$confname,$settings,\$rowtotal); |
} else { |
} else { |
Line 5800 sub print_validation_rows {
|
Line 5809 sub print_validation_rows {
|
return $datatable; |
return $datatable; |
} |
} |
|
|
|
sub print_privacy { |
|
my ($position,$dom,$settings,$rowtotal) = @_; |
|
my ($datatable,$css_class,$numinrow,@items,%names,$othertitle,$usertypes,$types); |
|
my $itemcount = 0; |
|
unless ($position eq 'top') { |
|
@items = ('domain','author','course','community'); |
|
%names = &Apache::lonlocal::texthash ( |
|
domain => 'Assigned domain role(s)', |
|
author => 'Assigned co-author role(s)', |
|
course => 'Assigned course role(s)', |
|
community => 'Assigned community role', |
|
); |
|
$numinrow = 4; |
|
($othertitle,$usertypes,$types) = |
|
&Apache::loncommon::sorted_inst_types($dom); |
|
} |
|
if (($position eq 'top') || ($position eq 'middle')) { |
|
my (%by_ip,%by_location,@intdoms,@instdoms); |
|
&build_location_hashes(\@intdoms,\%by_ip,\%by_location,\@instdoms); |
|
if ($position eq 'top') { |
|
my %curr; |
|
my @options = ('none','user','domain','auto'); |
|
my %titles = &Apache::lonlocal::texthash ( |
|
none => 'Not allowed', |
|
user => 'User authorizes', |
|
domain => 'DC authorizes', |
|
auto => 'Unrestricted', |
|
instdom => 'Other domain shares institution/provider', |
|
extdom => 'Other domain has different institution/provider', |
|
); |
|
my %names = &Apache::lonlocal::texthash ( |
|
domain => 'Domain role', |
|
author => 'Co-author role', |
|
course => 'Course role', |
|
community => 'Community role', |
|
); |
|
my $primary_id = &Apache::lonnet::domain($dom,'primary'); |
|
my $intdom = &Apache::lonnet::internet_dom($primary_id); |
|
foreach my $domtype ('instdom','extdom') { |
|
my (%checked,$skip); |
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
|
$datatable .= '<tr'.$css_class.'><td>'.$titles{$domtype}.'</td>'. |
|
'<td class="LC_left_item">'; |
|
if ($domtype eq 'instdom') { |
|
unless (@instdoms > 1) { |
|
$datatable .= &mt('Nothing to set, as no domains besides [_1] are hosted by [_2]',$dom,$intdom); |
|
$skip = 1; |
|
} |
|
} elsif ($domtype eq 'extdom') { |
|
if (keys(%by_location) == 0) { |
|
$datatable .= &mt('Nothing to set, as no other hosts besides [_1]',$intdom); |
|
$skip = 1; |
|
} |
|
} |
|
unless ($skip) { |
|
foreach my $roletype ('domain','author','course','community') { |
|
$checked{'auto'} = ' checked="checked"'; |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{approval}) eq 'HASH') { |
|
if (ref($settings->{approval}->{$domtype}) eq 'HASH') { |
|
if ($settings->{approval}->{$domtype}->{$roletype}=~ /^(none|user|domain)$/) { |
|
$checked{$1} = ' checked="checked"'; |
|
$checked{'auto'} = ''; |
|
} |
|
} |
|
} |
|
} |
|
$datatable .= '<fieldset><legend>'.$names{$roletype}.'</legend>'; |
|
foreach my $option (@options) { |
|
$datatable .= '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="privacy_approval_'.$domtype.'_'.$roletype.'" '. |
|
'value="'.$option.'"'.$checked{$option}.' />'.$titles{$option}. |
|
'</label></span> '; |
|
} |
|
$datatable .= '</fieldset>'; |
|
} |
|
} |
|
$datatable .= '</td></tr>'; |
|
$itemcount ++; |
|
} |
|
} elsif ($position eq 'middle') { |
|
if ((@instdoms > 1) || (keys(%by_location) > 0)) { |
|
if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) { |
|
foreach my $item (@{$types}) { |
|
$datatable .= &modifiable_userdata_row('privacy','othdom_'.$item,$settings, |
|
$numinrow,$itemcount,'','','','','', |
|
'',$usertypes->{$item}); |
|
$itemcount ++; |
|
} |
|
} |
|
$datatable .= &modifiable_userdata_row('privacy','othdom_default',$settings, |
|
$numinrow,$itemcount,'','','','','', |
|
'',$othertitle); |
|
$itemcount ++; |
|
} else { |
|
$datatable .= &mt('Nothing to set here, as there are no other domains'); |
|
} |
|
} |
|
} 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; |
|
} |
|
return $datatable; |
|
} |
|
|
sub print_passwords { |
sub print_passwords { |
my ($position,$dom,$confname,$settings,$rowtotal) = @_; |
my ($position,$dom,$confname,$settings,$rowtotal) = @_; |
my ($datatable,$css_class); |
my ($datatable,$css_class); |
Line 9366 sub build_category_rows {
|
Line 9493 sub build_category_rows {
|
|
|
sub modifiable_userdata_row { |
sub modifiable_userdata_row { |
my ($context,$item,$settings,$numinrow,$rowcount,$usertypes,$fieldsref,$titlesref, |
my ($context,$item,$settings,$numinrow,$rowcount,$usertypes,$fieldsref,$titlesref, |
$rowid,$customcss,$rowstyle) = @_; |
$rowid,$customcss,$rowstyle,$itemdesc) = @_; |
my ($role,$rolename,$statustype); |
my ($role,$rolename,$statustype); |
$role = $item; |
$role = $item; |
if ($context eq 'cancreate') { |
if ($context eq 'cancreate') { |
Line 9389 sub modifiable_userdata_row {
|
Line 9516 sub modifiable_userdata_row {
|
} |
} |
} elsif ($context eq 'lti') { |
} elsif ($context eq 'lti') { |
$rolename = &mt('Institutional data used (if available)'); |
$rolename = &mt('Institutional data used (if available)'); |
|
} elsif ($context eq 'privacy') { |
|
$rolename = $itemdesc; |
} else { |
} else { |
if ($role eq 'cr') { |
if ($role eq 'cr') { |
$rolename = &mt('Custom role'); |
$rolename = &mt('Custom role'); |
Line 9438 sub modifiable_userdata_row {
|
Line 9567 sub modifiable_userdata_row {
|
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
$hashref = $settings->{'instdata'}; |
$hashref = $settings->{'instdata'}; |
} |
} |
|
} elsif ($context eq 'privacy') { |
|
my ($key,$inner) = split(/_/,$role); |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{$key}) eq 'HASH') { |
|
$hashref = $settings->{$key}->{$inner}; |
|
} |
|
} |
} elsif (ref($settings->{$context}) eq 'HASH') { |
} elsif (ref($settings->{$context}) eq 'HASH') { |
if (ref($settings->{$context}->{$role}) eq 'HASH') { |
if (ref($settings->{$context}->{$role}) eq 'HASH') { |
$hashref = $settings->{'lti_instdata'}; |
$hashref = $settings->{'lti_instdata'}; |
Line 9476 sub modifiable_userdata_row {
|
Line 9612 sub modifiable_userdata_row {
|
unless ($role eq 'emailusername') { |
unless ($role eq 'emailusername') { |
if (exists($checks{$fields[$i]})) { |
if (exists($checks{$fields[$i]})) { |
$check = $checks{$fields[$i]}; |
$check = $checks{$fields[$i]}; |
|
} elsif ($context eq 'privacy') { |
|
if ($role =~ /^priv_(domain|course)$/) { |
|
if (ref($settings) ne 'HASH') { |
|
$check = ' checked="checked" '; |
|
} |
|
} elsif ($role =~ /^priv_(author|community)$/) { |
|
if (ref($settings) ne 'HASH') { |
|
unless ($fields[$i] eq 'id') { |
|
$check = ' checked="checked" '; |
|
} |
|
} |
|
} elsif ($role =~ /^(unpriv|othdom)_/) { |
|
if (ref($settings) ne 'HASH') { |
|
if (($fields[$i] eq 'lastname') || ($fields[$i] eq 'firstname')) { |
|
$check = ' checked="checked" '; |
|
} |
|
} |
|
} |
} elsif ($context ne 'lti') { |
} elsif ($context ne 'lti') { |
if ($role eq 'st') { |
if ($role eq 'st') { |
if (ref($settings) ne 'HASH') { |
if (ref($settings) ne 'HASH') { |
Line 9504 sub modifiable_userdata_row {
|
Line 9658 sub modifiable_userdata_row {
|
} else { |
} else { |
if ($context eq 'lti') { |
if ($context eq 'lti') { |
$prefix = 'lti'; |
$prefix = 'lti'; |
|
} elsif ($context eq 'privacy') { |
|
$prefix = 'privacy'; |
} |
} |
$output .= '<label>'. |
$output .= '<label>'. |
'<input type="checkbox" name="'.$prefix.'_'.$role.'" '. |
'<input type="checkbox" name="'.$prefix.'_'.$role.'" '. |
Line 13968 sub modify_contacts {
|
Line 14124 sub modify_contacts {
|
} |
} |
return $resulttext; |
return $resulttext; |
} |
} |
|
|
|
sub modify_privacy { |
|
my ($dom,%domconfig) = @_; |
|
my ($resulttext,%current,%changes); |
|
if (ref($domconfig{'privacy'}) eq 'HASH') { |
|
%current = %{$domconfig{'privacy'}}; |
|
} |
|
my @fields = ('lastname','firstname','middlename','generation','permanentemail','id'); |
|
my @items = ('domain','author','course','community'); |
|
my %names = &Apache::lonlocal::texthash ( |
|
domain => 'Assigned domain role(s)', |
|
author => 'Assigned co-author role(s)', |
|
course => 'Assigned course role(s)', |
|
community => 'Assigned community role', |
|
); |
|
my %roles = &Apache::lonlocal::texthash ( |
|
domain => 'Domain role', |
|
author => 'Co-author role', |
|
course => 'Course role', |
|
community => 'Community role', |
|
); |
|
my %titles = &Apache::lonlocal::texthash ( |
|
approval => 'Approval for role in different domain', |
|
othdom => 'User information available in other domain', |
|
priv => 'Information viewable by privileged user in same domain', |
|
unpriv => 'Information viewable by unprivileged user in same domain', |
|
instdom => 'Other domain shares institution/provider', |
|
extdom => 'Other domain has different institution/provider', |
|
none => 'Not allowed', |
|
user => 'User authorizes', |
|
domain => 'Domain Coordinator authorizes', |
|
auto => 'Unrestricted', |
|
); |
|
my %fieldnames = &Apache::lonlocal::texthash ( |
|
id => 'Student/Employee ID', |
|
permanentemail => 'E-mail address', |
|
lastname => 'Last Name', |
|
firstname => 'First Name', |
|
middlename => 'Middle Name', |
|
generation => 'Generation', |
|
); |
|
my ($othertitle,$usertypes,$types) = |
|
&Apache::loncommon::sorted_inst_types($dom); |
|
my (%by_ip,%by_location,@intdoms,@instdoms); |
|
&build_location_hashes(\@intdoms,\%by_ip,\%by_location,\@instdoms); |
|
|
|
my %privacyhash = ( |
|
'approval' => { |
|
instdom => {}, |
|
extdom => {}, |
|
}, |
|
'othdom' => {}, |
|
'priv' => {}, |
|
'unpriv' => {}, |
|
); |
|
foreach my $item (@items) { |
|
if (@instdoms > 1) { |
|
if ($env{'form.privacy_approval_instdom'.$item} =~ /^(none|user|domain|auto)$/) { |
|
$privacyhash{'approval'}{'instdom'}{$item} = $env{'form.privacy_approval_instdom_'.$item}; |
|
} |
|
if (ref($current{'approval'}) eq 'HASH') { |
|
if (ref($current{'approval'}{'instdom'}) eq 'HASH') { |
|
unless ($privacyhash{'approval'}{'instdom'}{$item} eq $current{'approval'}{'instdom'}{$item}) { |
|
$changes{'approval'} = 1; |
|
} |
|
} |
|
} elsif ($privacyhash{'approval'}{'instdom'}{$item} ne 'auto') { |
|
$changes{'approval'} = 1; |
|
} |
|
} |
|
if (keys(%by_location) > 0) { |
|
if ($env{'form.privacy_approval_extdom_'.$item} =~ /^(none|user|domain|auto)$/) { |
|
$privacyhash{'approval'}{'extdom'}{$item} = $env{'form.privacy_approval_extdom_'.$item}; |
|
} |
|
if (ref($current{'approval'}) eq 'HASH') { |
|
if (ref($current{'approval'}{'extdom'}) eq 'HASH') { |
|
unless ($privacyhash{'approval'}{'extdom'}{$item} eq $current{'approval'}{'extdom'}{$item}) { |
|
$changes{'approval'} = 1; |
|
} |
|
} |
|
} elsif ($privacyhash{'approval'}{'extdom'}{$item} ne 'auto') { |
|
$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; |
|
if (ref($types) eq 'ARRAY') { |
|
@statuses = @{$types}; |
|
} |
|
foreach my $type (@statuses,'default') { |
|
my @possfields = &Apache::loncommon::get_env_multiple('form.privacy_othdom_'.$type); |
|
my @newvalues; |
|
foreach my $field (sort(@possfields)) { |
|
if (grep(/^\Q$field\E$/,@fields)) { |
|
$privacyhash{'othdom'}{$type}{$field} = 1; |
|
push(@newvalues,$field); |
|
} |
|
} |
|
@newvalues = sort(@newvalues); |
|
if (ref($current{'othdom'}) eq 'HASH') { |
|
if (ref($current{'othdom'}{$type}) eq 'HASH') { |
|
my @currvalues = sort(keys(%{$current{'othdom'}{$type}})); |
|
my @diffs = &Apache::loncommon::compare_arrays(\@currvalues,\@newvalues); |
|
if (@diffs > 0) { |
|
$changes{'othdom'} = 1; |
|
} |
|
} |
|
} else { |
|
my @stdfields = ('lastname','firstname','middlename','generation','permanentemail'); |
|
my @diffs = &Apache::loncommon::compare_arrays(\@stdfields,\@newvalues); |
|
if (@diffs > 0) { |
|
$changes{'othdom'} = 1; |
|
} |
|
} |
|
} |
|
} |
|
my %confighash = ( |
|
privacy => \%privacyhash, |
|
); |
|
my $putresult = &Apache::lonnet::put_dom('configuration',\%confighash,$dom); |
|
if ($putresult eq 'ok') { |
|
if (keys(%changes) > 0) { |
|
$resulttext = &mt('Changes made: ').'<ul>'; |
|
foreach my $key ('approval','othdom','priv','unpriv') { |
|
if ($changes{$key}) { |
|
$resulttext .= '<li>'.$titles{$key}.':<ul>'; |
|
if ($key eq 'approval') { |
|
if (keys(%{$privacyhash{$key}{instdom}})) { |
|
$resulttext .= '<li>'.$titles{'instdom'}.'<ul>'; |
|
foreach my $item (@items) { |
|
$resulttext .= '<li>'.$roles{$item}.': '.$titles{$privacyhash{$key}{instdom}{$item}}.'</li>'; |
|
} |
|
$resulttext .= '</ul></li>'; |
|
} |
|
if (keys(%{$privacyhash{$key}{extdom}})) { |
|
$resulttext .= '<li>'.$titles{'extdom'}.'<ul>'; |
|
foreach my $item (@items) { |
|
$resulttext .= '<li>'.$roles{$item}.': '.$titles{$privacyhash{$key}{extdom}{$item}}.'</li>'; |
|
} |
|
$resulttext .= '</ul></li>'; |
|
} |
|
} elsif ($key eq 'othdom') { |
|
my @statuses; |
|
if (ref($types) eq 'ARRAY') { |
|
@statuses = @{$types}; |
|
} |
|
if (ref($privacyhash{$key}) eq 'HASH') { |
|
foreach my $status (@statuses,'default') { |
|
if ($status eq 'default') { |
|
$resulttext .= '<li>'.$othertitle.': '; |
|
} elsif (ref($usertypes) eq 'HASH') { |
|
$resulttext .= '<li>'.$usertypes->{$status}.': '; |
|
} else { |
|
next; |
|
} |
|
if (ref($privacyhash{$key}{$status}) eq 'HASH') { |
|
if (keys(%{$privacyhash{$key}{$status}})) { |
|
$resulttext .= join(', ', map { $fieldnames{$_}; } (sort(keys(%{$privacyhash{$key}{$status}})))); |
|
} else { |
|
$resulttext .= &mt('none'); |
|
} |
|
} |
|
$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>'; |
|
} |
|
} |
|
} else { |
|
$resulttext = &mt('No changes made to user information settings'); |
|
} |
|
} else { |
|
$resulttext = '<span class="LC_error">'. |
|
&mt('An error occurred: [_1]',$putresult).'</span>'; |
|
} |
|
return $resulttext; |
|
} |
|
|
sub modify_passwords { |
sub modify_passwords { |
my ($r,$dom,$confname,$lastactref,%domconfig) = @_; |
my ($r,$dom,$confname,$lastactref,%domconfig) = @_; |