version 1.160.6.121, 2022/01/19 20:56:06
|
version 1.160.6.122, 2022/02/27 02:42:30
|
Line 268 sub handler {
|
Line 268 sub handler {
|
header => [{col1 => 'Setting', |
header => [{col1 => 'Setting', |
col2 => 'Value'}, |
col2 => 'Value'}, |
{col1 => 'Institutional user types', |
{col1 => 'Institutional user types', |
col2 => 'Name displayed'}], |
col2 => 'Name displayed'}, |
|
{col1 => 'Mapping for missing usernames via standard log-in', |
|
col2 => 'Rules in use'}], |
print => \&print_defaults, |
print => \&print_defaults, |
modify => \&modify_defaults, |
modify => \&modify_defaults, |
}, |
}, |
Line 822 sub print_config_box {
|
Line 824 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 'contacts') || ($action eq 'passwords')) { |
($action eq 'contacts') || ($action eq 'passwords') || ($action eq 'defaults')) { |
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 876 sub print_config_box {
|
Line 878 sub print_config_box {
|
} |
} |
$rowtotal ++; |
$rowtotal ++; |
} elsif (($action eq 'usermodification') || ($action eq 'coursedefaults') || |
} elsif (($action eq 'usermodification') || ($action eq 'coursedefaults') || |
($action eq 'defaults') || ($action eq 'directorysrch') || |
($action eq 'directorysrch') || ($action eq 'helpsettings') || |
($action eq 'helpsettings') || ($action eq 'wafproxy')) { |
($action eq 'wafproxy')) { |
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'scantron') { |
} elsif ($action eq 'scantron') { |
$output .= $item->{'print'}->($r,'bottom',$dom,$confname,$settings,\$rowtotal); |
$output .= $item->{'print'}->($r,'bottom',$dom,$confname,$settings,\$rowtotal); |
Line 7424 sub user_formats_row {
|
Line 7426 sub user_formats_row {
|
'username' => 'new usernames', |
'username' => 'new usernames', |
'id' => 'IDs', |
'id' => 'IDs', |
); |
); |
unless ($type eq 'email') { |
unless (($type eq 'email') || ($type eq 'unamemap')) { |
my $css_class = $rowcount%2?' class="LC_odd_row"':''; |
my $css_class = $rowcount%2?' class="LC_odd_row"':''; |
$output = '<tr '.$css_class.'>'. |
$output = '<tr '.$css_class.'>'. |
'<td><span class="LC_nobreak">'. |
'<td><span class="LC_nobreak">'. |
Line 7479 sub user_formats_row {
|
Line 7481 sub user_formats_row {
|
} elsif ($colsleft == 1) { |
} elsif ($colsleft == 1) { |
$output .= '<td class="LC_left_item"> </td>'; |
$output .= '<td class="LC_left_item"> </td>'; |
} |
} |
$output .= '</tr></table>'; |
$output .= '</tr>'; |
unless ($type eq 'email') { |
unless (($type eq 'email') || ($type eq 'unamemap')) { |
$output .= '</td></tr>'; |
$output .= '</table></td></tr>'; |
} |
} |
return $output; |
return $output; |
} |
} |
Line 7622 sub print_defaults {
|
Line 7624 sub print_defaults {
|
$datatable .= '</td></tr>'; |
$datatable .= '</td></tr>'; |
$rownum ++; |
$rownum ++; |
} |
} |
} else { |
} elsif ($position eq 'middle') { |
my %defaults; |
my %defaults; |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) { |
if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) { |
Line 7672 sub print_defaults {
|
Line 7674 sub print_defaults {
|
$rownum ++; |
$rownum ++; |
} |
} |
} |
} |
|
} else { |
|
my ($unamemaprules,$ruleorder) = |
|
&Apache::lonnet::inst_userrules($dom,'unamemap'); |
|
$css_class = $rownum%2?' class="LC_odd_row"':''; |
|
if ((ref($unamemaprules) eq 'HASH') && (ref($ruleorder) eq 'ARRAY')) { |
|
my $numinrow = 2; |
|
$datatable .= '<tr'.$css_class.'><td>'.&mt('Available conversions').'</td><td><table>'. |
|
&user_formats_row('unamemap',$settings,$unamemaprules, |
|
$ruleorder,$numinrow). |
|
'</table></td></tr>'; |
|
} |
|
if ($datatable eq '') { |
|
$datatable .= '<tr'.$css_class.'><td colspan="2">'. |
|
&mt('No rules set for domain in customized localenroll.pm'). |
|
'</td></tr>'; |
|
} |
} |
} |
$$rowtotal += $rownum; |
$$rowtotal += $rownum; |
return $datatable; |
return $datatable; |
Line 14583 sub modify_defaults {
|
Line 14601 sub modify_defaults {
|
$newvalues{$item} = $staticdefaults{$item}; |
$newvalues{$item} = $staticdefaults{$item}; |
} |
} |
} |
} |
|
my ($unamemaprules,$ruleorder); |
|
my @possunamemaprules = &Apache::loncommon::get_env_multiple('form.unamemap_rule'); |
|
if (@possunamemaprules) { |
|
($unamemaprules,$ruleorder) = |
|
&Apache::lonnet::inst_userrules($dom,'unamemap'); |
|
if ((ref($unamemaprules) eq 'HASH') && (ref($ruleorder) eq 'ARRAY')) { |
|
if (@{$ruleorder} > 0) { |
|
my %possrules; |
|
map { $possrules{$_} = 1; } @possunamemaprules; |
|
foreach my $rule (@{$ruleorder}) { |
|
if ($possrules{$rule}) { |
|
push(@{$newvalues{'unamemap_rule'}},$rule); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (ref($domdefaults{'unamemap_rule'}) eq 'ARRAY') { |
|
if (ref($newvalues{'unamemap_rule'}) eq 'ARRAY') { |
|
my @rulediffs = &Apache::loncommon::compare_arrays($domdefaults{'unamemap_rule'}, |
|
$newvalues{'unamemap_rule'}); |
|
if (@rulediffs) { |
|
$changes{'unamemap_rule'} = 1; |
|
$domdefaults{'unamemap_rule'} = $newvalues{'unamemap_rule'}; |
|
} |
|
} elsif (@{$domdefaults{'unamemap_rule'}} > 0) { |
|
$changes{'unamemap_rule'} = 1; |
|
delete($domdefaults{'unamemap_rule'}); |
|
} |
|
} elsif (ref($newvalues{'unamemap_rule'}) eq 'ARRAY') { |
|
if (@{$newvalues{'unamemap_rule'}} > 0) { |
|
$changes{'unamemap_rule'} = 1; |
|
$domdefaults{'unamemap_rule'} = $newvalues{'unamemap_rule'}; |
|
} |
|
} |
my %defaults_hash = ( |
my %defaults_hash = ( |
defaults => \%newvalues, |
defaults => \%newvalues, |
); |
); |
Line 14699 sub modify_defaults {
|
Line 14752 sub modify_defaults {
|
$resulttext .= '<li>'.&mt('Institutional user status types deleted').'</li>'; |
$resulttext .= '<li>'.&mt('Institutional user status types deleted').'</li>'; |
} |
} |
} |
} |
|
} elsif ($item eq 'unamemap_rule') { |
|
if (ref($newvalues{'unamemap_rule'}) eq 'ARRAY') { |
|
my @rulenames; |
|
if (ref($unamemaprules) eq 'HASH') { |
|
foreach my $rule (@{$newvalues{'unamemap_rule'}}) { |
|
if (ref($unamemaprules->{$rule}) eq 'HASH') { |
|
push(@rulenames,$unamemaprules->{$rule}->{'name'}); |
|
} |
|
} |
|
} |
|
if (@rulenames) { |
|
$resulttext .= '<li>'.&mt('Mapping for missing usernames includes: [_1]', |
|
'<ul><li>'.join('</li><li>',@rulenames).'</li></ul>'). |
|
'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('No mapping for missing usernames via standard log-in').'</li>'; |
|
} |
|
} else { |
|
$resulttext .= '<li>'.&mt('Mapping for missing usernames via standard log-in deleted').'</li>'; |
|
} |
} else { |
} else { |
my $value = $env{'form.'.$item}; |
my $value = $env{'form.'.$item}; |
if ($value eq '') { |
if ($value eq '') { |