version 1.160.6.98, 2019/08/21 20:31:37
|
version 1.160.6.111, 2021/03/06 19:55:58
|
Line 335 sub handler {
|
Line 335 sub handler {
|
col2 => 'Value',}, |
col2 => 'Value',}, |
{col1 => 'Recipient(s) for notifications', |
{col1 => 'Recipient(s) for notifications', |
col2 => 'Value',}, |
col2 => 'Value',}, |
|
{col1 => 'Nightly status check e-mail', |
|
col2 => 'Settings',}, |
{col1 => 'Ask helpdesk form settings', |
{col1 => 'Ask helpdesk form settings', |
col2 => 'Value',},], |
col2 => 'Value',},], |
print => \&print_contacts, |
print => \&print_contacts, |
Line 718 sub print_config_box {
|
Line 720 sub print_config_box {
|
if ($numheaders > 1) { |
if ($numheaders > 1) { |
my $colspan = ''; |
my $colspan = ''; |
my $rightcolspan = ''; |
my $rightcolspan = ''; |
|
my $leftnobr = ''; |
if (($action eq 'rolecolors') || ($action eq 'defaults') || |
if (($action eq 'rolecolors') || ($action eq 'defaults') || |
($action eq 'directorysrch') || |
($action eq 'directorysrch') || |
(($action eq 'login') && ($numheaders < 4))) { |
(($action eq 'login') && ($numheaders < 4))) { |
Line 726 sub print_config_box {
|
Line 729 sub print_config_box {
|
if ($action eq 'usersessions') { |
if ($action eq 'usersessions') { |
$rightcolspan = ' colspan="3"'; |
$rightcolspan = ' colspan="3"'; |
} |
} |
|
if ($action eq 'passwords') { |
|
$leftnobr = ' LC_nobreak'; |
|
} |
$output .= ' |
$output .= ' |
<tr> |
<tr> |
<td> |
<td> |
<table class="LC_nested"> |
<table class="LC_nested"> |
<tr class="LC_info_row"> |
<tr class="LC_info_row"> |
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[0]->{'col1'}).'</td> |
<td class="LC_left_item'.$leftnobr.'"'.$colspan.'>'.&mt($item->{'header'}->[0]->{'col1'}).'</td> |
<td class="LC_right_item"'.$rightcolspan.'>'.&mt($item->{'header'}->[0]->{'col2'}).'</td> |
<td class="LC_right_item"'.$rightcolspan.'>'.&mt($item->{'header'}->[0]->{'col2'}).'</td> |
</tr>'; |
</tr>'; |
$rowtotal ++; |
$rowtotal ++; |
Line 790 sub print_config_box {
|
Line 796 sub print_config_box {
|
<td> |
<td> |
<table class="LC_nested"> |
<table class="LC_nested"> |
<tr class="LC_info_row"> |
<tr class="LC_info_row"> |
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td> |
<td class="LC_left_item'.$leftnobr.'"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td> |
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> |
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> |
</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 'passwords') { |
} elsif (($action eq 'contacts') || ($action eq 'passwords')) { |
$output .= $item->{'print'}->('lower',$dom,$confname,$settings,\$rowtotal).' |
if ($action eq 'passwords') { |
|
$output .= $item->{'print'}->('lower',$dom,$confname,$settings,\$rowtotal); |
|
} else { |
|
$output .= $item->{'print'}->('lower',$dom,$settings,\$rowtotal); |
|
} |
|
$output .= ' |
</tr> |
</tr> |
</table> |
</table> |
</td> |
</td> |
Line 806 sub print_config_box {
|
Line 817 sub print_config_box {
|
<table class="LC_nested"> |
<table class="LC_nested"> |
<tr class="LC_info_row"> |
<tr class="LC_info_row"> |
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</td> |
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</td> |
<td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col2'}).'</td></tr>'."\n". |
<td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col2'}).'</td></tr>'."\n"; |
$item->{'print'}->('bottom',$dom,$confname,$settings,\$rowtotal).' |
if ($action eq 'passwords') { |
|
$output .= $item->{'print'}->('bottom',$dom,$confname,$settings,\$rowtotal); |
|
} else { |
|
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
|
} |
|
$output .= ' |
</table> |
</table> |
</td> |
</td> |
</tr> |
</tr> |
Line 2855 sub print_contacts {
|
Line 2871 sub print_contacts {
|
my $datatable; |
my $datatable; |
my @contacts = ('adminemail','supportemail'); |
my @contacts = ('adminemail','supportemail'); |
my (%checked,%to,%otheremails,%bccemails,%includestr,%includeloc,%currfield, |
my (%checked,%to,%otheremails,%bccemails,%includestr,%includeloc,%currfield, |
$maxsize,$fields,$fieldtitles,$fieldoptions,$possoptions,@mailings); |
$maxsize,$fields,$fieldtitles,$fieldoptions,$possoptions,@mailings,%lonstatus); |
if ($position eq 'top') { |
if ($position eq 'top') { |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
foreach my $item (@contacts) { |
foreach my $item (@contacts) { |
Line 2870 sub print_contacts {
|
Line 2886 sub print_contacts {
|
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
$otheremails{$type} = ''; |
$otheremails{$type} = ''; |
} |
} |
|
} elsif ($position eq 'lower') { |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{'lonstatus'}) eq 'HASH') { |
|
%lonstatus = %{$settings->{'lonstatus'}}; |
|
} |
|
} |
} else { |
} else { |
@mailings = ('helpdeskmail','otherdomsmail'); |
@mailings = ('helpdeskmail','otherdomsmail'); |
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
Line 2882 sub print_contacts {
|
Line 2904 sub print_contacts {
|
($fields,$fieldtitles,$fieldoptions,$possoptions) = &helpform_fields(); |
($fields,$fieldtitles,$fieldoptions,$possoptions) = &helpform_fields(); |
} |
} |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
unless ($position eq 'top') { |
unless (($position eq 'top') || ($position eq 'lower')) { |
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
if (exists($settings->{$type})) { |
if (exists($settings->{$type})) { |
if (ref($settings->{$type}) eq 'HASH') { |
if (ref($settings->{$type}) eq 'HASH') { |
Line 2968 sub print_contacts {
|
Line 2990 sub print_contacts {
|
$to{$item}.'" /></td></tr>'; |
$to{$item}.'" /></td></tr>'; |
$rownum ++; |
$rownum ++; |
} |
} |
} else { |
} elsif ($position eq 'bottom') { |
|
$css_class = $rownum%2?' class="LC_odd_row"':''; |
|
$datatable .= '<tr'.$css_class.'>'. |
|
'<td>'.&mt('Extra helpdesk form fields:').'<br />'. |
|
&mt('(e-mail, subject, and description always shown)'). |
|
'</td><td class="LC_left_item">'; |
|
if ((ref($fields) eq 'ARRAY') && (ref($fieldtitles) eq 'HASH') && |
|
(ref($fieldoptions) eq 'HASH') && (ref($possoptions) eq 'HASH')) { |
|
$datatable .= '<table><tr><th>'.&mt('Field').'</th><th>'.&mt('Status').'</th></tr>'; |
|
foreach my $field (@{$fields}) { |
|
$datatable .= '<tr><td>'.$fieldtitles->{$field}; |
|
if (($field eq 'screenshot') || ($field eq 'cc')) { |
|
$datatable .= ' '.&mt('(logged-in users)'); |
|
} |
|
$datatable .='</td><td>'; |
|
my $clickaction; |
|
if ($field eq 'screenshot') { |
|
$clickaction = ' onclick="screenshotSize(this);"'; |
|
} |
|
if (ref($possoptions->{$field}) eq 'ARRAY') { |
|
foreach my $option (@{$possoptions->{$field}}) { |
|
my $checked; |
|
if ($currfield{$field} eq $option) { |
|
$checked = ' checked="checked"'; |
|
} |
|
$datatable .= '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="helpform_'.$field.'" '. |
|
'value="'.$option.'"'.$checked.$clickaction.' />'.$fieldoptions->{$option}. |
|
'</label></span>'.(' 'x2); |
|
} |
|
} |
|
if ($field eq 'screenshot') { |
|
my $display; |
|
if ($currfield{$field} eq 'no') { |
|
$display = ' style="display:none"'; |
|
} |
|
$datatable .= '</td></tr><tr id="help_screenshotsize"'.$display.'>'. |
|
'<td>'.&mt('Maximum size for upload (MB)').'</td><td>'. |
|
'<input type="text" size="5" name="helpform_maxsize" value="'.$maxsize.'" />'; |
|
} |
|
$datatable .= '</td></tr>'; |
|
} |
|
$datatable .= '</table>'; |
|
} |
|
$datatable .= '</td></tr>'."\n"; |
|
$rownum ++; |
|
} |
|
unless (($position eq 'top') || ($position eq 'lower')) { |
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
$css_class = $rownum%2?' class="LC_odd_row"':''; |
$css_class = $rownum%2?' class="LC_odd_row"':''; |
$datatable .= '<tr'.$css_class.'>'. |
$datatable .= '<tr'.$css_class.'>'. |
Line 3015 sub print_contacts {
|
Line 3084 sub print_contacts {
|
} |
} |
if ($position eq 'middle') { |
if ($position eq 'middle') { |
my %choices; |
my %choices; |
$choices{'reporterrors'} = &mt('E-mail error reports to [_1]', |
my $corelink = &core_link_msu(); |
&Apache::loncommon::modal_link('http://loncapa.org/core.html', |
$choices{'reporterrors'} = &mt('E-mail error reports to [_1]',$corelink); |
&mt('LON-CAPA core group - MSU'),600,500)); |
|
$choices{'reportupdates'} = &mt('E-mail record of completed LON-CAPA updates to [_1]', |
$choices{'reportupdates'} = &mt('E-mail record of completed LON-CAPA updates to [_1]', |
&Apache::loncommon::modal_link('http://loncapa.org/core.html', |
$corelink); |
&mt('LON-CAPA core group - MSU'),600,500)); |
$choices{'reportstatus'} = &mt('E-mail status if errors above threshold to [_1]',$corelink); |
my @toggles = ('reporterrors','reportupdates'); |
my @toggles = ('reporterrors','reportupdates','reportstatus'); |
my %defaultchecked = ('reporterrors' => 'on', |
my %defaultchecked = ('reporterrors' => 'on', |
'reportupdates' => 'on'); |
'reportupdates' => 'on', |
|
'reportstatus' => 'on'); |
(my $reports,$rownum) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
(my $reports,$rownum) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
\%choices,$rownum); |
\%choices,$rownum); |
$datatable .= $reports; |
$datatable .= $reports; |
} elsif ($position eq 'bottom') { |
} elsif ($position eq 'lower') { |
|
my (%current,%excluded,%weights); |
|
my ($defaults,$names) = &Apache::loncommon::lon_status_items(); |
|
if ($lonstatus{'threshold'} =~ /^\d+$/) { |
|
$current{'errorthreshold'} = $lonstatus{'threshold'}; |
|
} else { |
|
$current{'errorthreshold'} = $defaults->{'threshold'}; |
|
} |
|
if ($lonstatus{'sysmail'} =~ /^\d+$/) { |
|
$current{'errorsysmail'} = $lonstatus{'sysmail'}; |
|
} else { |
|
$current{'errorsysmail'} = $defaults->{'sysmail'}; |
|
} |
|
if (ref($lonstatus{'weights'}) eq 'HASH') { |
|
foreach my $type ('E','W','N','U') { |
|
if ($lonstatus{'weights'}{$type} =~ /^\d+$/) { |
|
$weights{$type} = $lonstatus{'weights'}{$type}; |
|
} else { |
|
$weights{$type} = $defaults->{$type}; |
|
} |
|
} |
|
} else { |
|
foreach my $type ('E','W','N','U') { |
|
$weights{$type} = $defaults->{$type}; |
|
} |
|
} |
|
if (ref($lonstatus{'excluded'}) eq 'ARRAY') { |
|
if (@{$lonstatus{'excluded'}} > 0) { |
|
map {$excluded{$_} = 1; } @{$lonstatus{'excluded'}}; |
|
} |
|
} |
|
foreach my $item ('errorthreshold','errorsysmail') { |
|
$css_class = $rownum%2?' class="LC_odd_row"':''; |
|
$datatable .= '<tr'.$css_class.'>'. |
|
'<td class="LC_left_item"><span class="LC_nobreak">'. |
|
$titles->{$item}. |
|
'</span></td><td class="LC_left_item">'. |
|
'<input type="text" name="'.$item.'" value="'. |
|
$current{$item}.'" size="5" /></td></tr>'; |
|
$rownum ++; |
|
} |
$css_class = $rownum%2?' class="LC_odd_row"':''; |
$css_class = $rownum%2?' class="LC_odd_row"':''; |
$datatable .= '<tr'.$css_class.'>'. |
$datatable .= '<tr'.$css_class.'>'. |
'<td>'.&mt('Extra helpdesk form fields:').'<br />'. |
'<td class="LC_left_item">'. |
&mt('(e-mail, subject, and description always shown)'). |
'<span class="LC_nobreak">'.$titles->{'errorweights'}. |
'</td><td class="LC_left_item">'; |
'</span></td><td class="LC_left_item"><table><tr>'; |
if ((ref($fields) eq 'ARRAY') && (ref($fieldtitles) eq 'HASH') && |
foreach my $type ('E','W','N','U') { |
(ref($fieldoptions) eq 'HASH') && (ref($possoptions) eq 'HASH')) { |
$datatable .= '<td>'.$names->{$type}.'<br />'. |
$datatable .= '<table><tr><th>'.&mt('Field').'</th><th>'.&mt('Status').'</th></tr>'; |
'<input type="text" name="errorweights_'.$type.'" value="'. |
foreach my $field (@{$fields}) { |
$weights{$type}.'" size="5" /></td>'; |
$datatable .= '<tr><td>'.$fieldtitles->{$field}; |
} |
if (($field eq 'screenshot') || ($field eq 'cc')) { |
$datatable .= '</tr></table></tr>'; |
$datatable .= ' '.&mt('(logged-in users)'); |
$rownum ++; |
} |
$css_class = $rownum%2?' class="LC_odd_row"':''; |
$datatable .='</td><td>'; |
$datatable .= '<tr'.$css_class.'><td class="LC_left_item">'. |
my $clickaction; |
$titles->{'errorexcluded'}.'</td>'. |
if ($field eq 'screenshot') { |
'<td class="LC_left_item"><table>'; |
$clickaction = ' onclick="screenshotSize(this);"'; |
my $numinrow = 4; |
|
my @ids = sort(values(%Apache::lonnet::serverhomeIDs)); |
|
for (my $i=0; $i<@ids; $i++) { |
|
my $rem = $i%($numinrow); |
|
if ($rem == 0) { |
|
if ($i > 0) { |
|
$datatable .= '</tr>'; |
} |
} |
if (ref($possoptions->{$field}) eq 'ARRAY') { |
$datatable .= '<tr>'; |
foreach my $option (@{$possoptions->{$field}}) { |
} |
my $checked; |
my $check; |
if ($currfield{$field} eq $option) { |
if ($excluded{$ids[$i]}) { |
$checked = ' checked="checked"'; |
$check = ' checked="checked" '; |
|
} |
|
$datatable .= '<td class="LC_left_item">'. |
|
'<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="errorexcluded" '. |
|
'value="'.$ids[$i].'"'.$check.' />'. |
|
$ids[$i].'</label></span></td>'; |
|
} |
|
my $colsleft = $numinrow - @ids%($numinrow); |
|
if ($colsleft > 1 ) { |
|
$datatable .= '<td colspan="'.$colsleft.'" class="LC_left_item">'. |
|
' </td>'; |
|
} elsif ($colsleft == 1) { |
|
$datatable .= '<td class="LC_left_item"> </td>'; |
|
} |
|
$datatable .= '</tr></table></td></tr>'; |
|
$rownum ++; |
|
} elsif ($position eq 'bottom') { |
|
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
|
my (@posstypes,%usertypeshash); |
|
if (ref($types) eq 'ARRAY') { |
|
@posstypes = @{$types}; |
|
} |
|
if (@posstypes) { |
|
if (ref($usertypes) eq 'HASH') { |
|
%usertypeshash = %{$usertypes}; |
|
} |
|
my @overridden; |
|
my $numinrow = 4; |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{'overrides'}) eq 'HASH') { |
|
foreach my $key (sort(keys(%{$settings->{'overrides'}}))) { |
|
if (ref($settings->{'overrides'}{$key}) eq 'HASH') { |
|
push(@overridden,$key); |
|
foreach my $item (@contacts) { |
|
if ($settings->{'overrides'}{$key}{$item}) { |
|
$checked{'override_'.$key}{$item} = ' checked="checked" '; |
|
} |
|
} |
|
$otheremails{'override_'.$key} = $settings->{'overrides'}{$key}{'others'}; |
|
$bccemails{'override_'.$key} = $settings->{'overrides'}{$key}{'bcc'}; |
|
$includeloc{'override_'.$key} = ''; |
|
$includestr{'override_'.$key} = ''; |
|
if ($settings->{'overrides'}{$key}{'include'} ne '') { |
|
($includeloc{'override_'.$key},$includestr{'override_'.$key}) = |
|
split(/:/,$settings->{'overrides'}{$key}{'include'},2); |
|
$includestr{'override_'.$key} = &unescape($includestr{'override_'.$key}); |
|
} |
} |
} |
$datatable .= '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="helpform_'.$field.'" '. |
|
'value="'.$option.'"'.$checked.$clickaction.' />'.$fieldoptions->{$option}. |
|
'</label></span>'.(' 'x2); |
|
} |
} |
} |
} |
if ($field eq 'screenshot') { |
} |
my $display; |
my $customclass = 'LC_helpdesk_override'; |
if ($currfield{$field} eq 'no') { |
my $optionsprefix = 'LC_options_helpdesk_'; |
$display = ' style="display:none"'; |
|
} |
my $onclicktypes = "toggleHelpdeskRow(this.form,'overrides','$customclass','$optionsprefix');"; |
$datatable .= '</td></tr><tr id="help_screenshotsize"'.$display.'>'. |
|
'<td>'.&mt('Maximum size for upload (MB)').'</td><td>'. |
$datatable .= &insttypes_row($settings,$types,$usertypes,$dom, |
'<input type="text" size="5" name="helpform_maxsize" value="'.$maxsize.'" />'; |
$numinrow,$othertitle,'overrides', |
|
\$rownum,$onclicktypes,$customclass); |
|
$rownum ++; |
|
$usertypeshash{'default'} = $othertitle; |
|
foreach my $status (@posstypes) { |
|
my $css_class; |
|
if ($rownum%2) { |
|
$css_class = 'LC_odd_row '; |
|
} |
|
$css_class .= $customclass; |
|
my $rowid = $optionsprefix.$status; |
|
my $hidden = 1; |
|
my $currstyle = 'display:none'; |
|
if (grep(/^\Q$status\E$/,@overridden)) { |
|
$currstyle = 'display:table-row'; |
|
$hidden = 0; |
|
} |
|
my $key = 'override_'.$status; |
|
$datatable .= &overridden_helpdesk($checked{$key},$otheremails{$key},$bccemails{$key}, |
|
$includeloc{$key},$includestr{$key},$status,$rowid, |
|
$usertypeshash{$status},$css_class,$currstyle, |
|
\@contacts,$short_titles); |
|
unless ($hidden) { |
|
$rownum ++; |
} |
} |
$datatable .= '</td></tr>'; |
|
} |
} |
$datatable .= '</table>'; |
|
} |
} |
$datatable .= '</td></tr>'."\n"; |
|
$rownum ++; |
|
} |
} |
$$rowtotal += $rownum; |
$$rowtotal += $rownum; |
return $datatable; |
return $datatable; |
} |
} |
|
|
|
sub core_link_msu { |
|
return &Apache::loncommon::modal_link('http://loncapa.org/core.html', |
|
&mt('LON-CAPA core group - MSU'),600,500); |
|
} |
|
|
|
sub overridden_helpdesk { |
|
my ($checked,$otheremails,$bccemails,$includeloc,$includestr,$type,$rowid, |
|
$typetitle,$css_class,$rowstyle,$contacts,$short_titles) = @_; |
|
my $class = 'LC_left_item'; |
|
if ($css_class) { |
|
$css_class = ' class="'.$css_class.'"'; |
|
} |
|
if ($rowid) { |
|
$rowid = ' id="'.$rowid.'"'; |
|
} |
|
if ($rowstyle) { |
|
$rowstyle = ' style="'.$rowstyle.'"'; |
|
} |
|
my ($output,$description); |
|
$description = &mt('Helpdesk requests from: [_1] in this domain (overrides default)',"<b>$typetitle</b>"); |
|
$output = '<tr'.$css_class.$rowid.$rowstyle.'>'. |
|
"<td>$description</td>\n". |
|
'<td class="'.$class.'" colspan="2">'. |
|
'<fieldset><legend>'.&mt('E-mail recipient(s)').'</legend>'. |
|
'<span class="LC_nobreak">'; |
|
if (ref($contacts) eq 'ARRAY') { |
|
foreach my $item (@{$contacts}) { |
|
my $check; |
|
if (ref($checked) eq 'HASH') { |
|
$check = $checked->{$item}; |
|
} |
|
my $title; |
|
if (ref($short_titles) eq 'HASH') { |
|
$title = $short_titles->{$item}; |
|
} |
|
$output .= '<label>'. |
|
'<input type="checkbox" name="override_'.$type.'"'.$check. |
|
' value="'.$item.'" />'.$title.'</label> '; |
|
} |
|
} |
|
$output .= '</span><br />'.&mt('Others').': '. |
|
'<input type="text" name="override_'.$type.'_others" '. |
|
'value="'.$otheremails.'" />'; |
|
my %locchecked; |
|
foreach my $loc ('s','b') { |
|
if ($includeloc eq $loc) { |
|
$locchecked{$loc} = ' checked="checked"'; |
|
last; |
|
} |
|
} |
|
$output .= '<br />'.&mt('Bcc:').(' 'x6). |
|
'<input type="text" name="override_'.$type.'_bcc" '. |
|
'value="'.$bccemails.'" /></fieldset>'. |
|
'<fieldset><legend>'.&mt('Optional added text').'</legend>'. |
|
&mt('Text automatically added to e-mail:').' '. |
|
'<input type="text" name="override_'.$type.'_includestr" value="'.$includestr.'" /><br />'. |
|
'<span class="LC_nobreak">'.&mt('Location:').' '. |
|
'<label><input type="radio" name="override_'.$type.'_includeloc" value="s"'.$locchecked{'s'}.' />'.&mt('in subject').'</label>'. |
|
(' 'x2). |
|
'<label><input type="radio" name="override_'.$type.'_includeloc" value="b"'.$locchecked{'b'}.' />'.&mt('in body').'</label>'. |
|
'</span></fieldset>'. |
|
'</td></tr>'."\n"; |
|
return $output; |
|
} |
|
|
sub contacts_javascript { |
sub contacts_javascript { |
return <<"ENDSCRIPT"; |
return <<"ENDSCRIPT"; |
|
|
Line 3095 function screenshotSize(field) {
|
Line 3337 function screenshotSize(field) {
|
return; |
return; |
} |
} |
|
|
|
function toggleHelpdeskRow(form,checkbox,target,prefix,docount) { |
|
if (form.elements[checkbox].length != undefined) { |
|
var count = 0; |
|
if (docount) { |
|
for (var i=0; i<form.elements[checkbox].length; i++) { |
|
if (form.elements[checkbox][i].checked) { |
|
count ++; |
|
} |
|
} |
|
} |
|
for (var i=0; i<form.elements[checkbox].length; i++) { |
|
var type = form.elements[checkbox][i].value; |
|
if (document.getElementById(prefix+type)) { |
|
if (form.elements[checkbox][i].checked) { |
|
document.getElementById(prefix+type).style.display = 'table-row'; |
|
if (count % 2 == 1) { |
|
document.getElementById(prefix+type).className = target+' LC_odd_row'; |
|
} else { |
|
document.getElementById(prefix+type).className = target; |
|
} |
|
count ++; |
|
} else { |
|
document.getElementById(prefix+type).style.display = 'none'; |
|
} |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
// ]]> |
// ]]> |
</script> |
</script> |
|
|
Line 3608 sub print_coursedefaults {
|
Line 3880 sub print_coursedefaults {
|
my $currcanclone = 'none'; |
my $currcanclone = 'none'; |
my $onclick; |
my $onclick; |
my @cloneoptions = ('none','domain'); |
my @cloneoptions = ('none','domain'); |
my %clonetitles = ( |
my %clonetitles = &Apache::lonlocal::texthash ( |
none => 'No additional course requesters', |
none => 'No additional course requesters', |
domain => "Any course requester in course's domain", |
domain => "Any course requester in course's domain", |
instcode => 'Course requests for official courses ...', |
instcode => 'Course requests for official courses ...', |
Line 4110 sub print_passwords {
|
Line 4382 sub print_passwords {
|
$casesens{$item} = 1; |
$casesens{$item} = 1; |
$postlink{$item} = ['username','email']; |
$postlink{$item} = ['username','email']; |
} |
} |
} |
|
} |
} |
$casesens{'default'} = 1; |
$casesens{'default'} = 1; |
$postlink{'default'} = ['username','email']; |
$postlink{'default'} = ['username','email']; |
Line 4141 sub print_passwords {
|
Line 4412 sub print_passwords {
|
$datatable .= '<span class="LC_nobreak"><label>'. |
$datatable .= '<span class="LC_nobreak"><label>'. |
'<input type="checkbox" name="passwords_case_sensitive" value="'. |
'<input type="checkbox" name="passwords_case_sensitive" value="'. |
$item.'"'.$checkedcase.' />'.$usertypes->{$item}.'</label>'. |
$item.'"'.$checkedcase.' />'.$usertypes->{$item}.'</label>'. |
'<span> '; |
'</span> '; |
} |
} |
} |
} |
my $checkedcase; |
my $checkedcase; |
Line 4245 sub print_passwords {
|
Line 4516 sub print_passwords {
|
&mt('(If you use the same account ... reset a password from this page.)').'</span><br /><br />'. |
&mt('(If you use the same account ... reset a password from this page.)').'</span><br /><br />'. |
&mt('Include custom text:'); |
&mt('Include custom text:'); |
if ($customurl) { |
if ($customurl) { |
my $link = &Apache::loncommon::modal_link($customurl,&mt('Custom text file'),600,500, |
my $link = &Apache::loncommon::modal_link($customurl,&mt('custom text'),600,500, |
undef,undef,undef,undef,'background-color:#ffffff'); |
undef,undef,undef,undef,'background-color:#ffffff'); |
$datatable .= '<span class="LC_nobreak"> '.$link. |
$datatable .= '<span class="LC_nobreak"> '.$link. |
'<label><input type="checkbox" name="passwords_custom_del"'. |
'<label><input type="checkbox" name="passwords_custom_del"'. |
Line 4341 sub print_passwords {
|
Line 4612 sub print_passwords {
|
} |
} |
} elsif ($position eq 'lower') { |
} elsif ($position eq 'lower') { |
my ($min,$max,%chars,$numsaved); |
my ($min,$max,%chars,$numsaved); |
|
$min = $Apache::lonnet::passwdmin; |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ($settings->{min}) { |
if ($settings->{min}) { |
$min = $settings->{min}; |
$min = $settings->{min}; |
Line 4354 sub print_passwords {
|
Line 4626 sub print_passwords {
|
if ($settings->{numsaved}) { |
if ($settings->{numsaved}) { |
$numsaved = $settings->{numsaved}; |
$numsaved = $settings->{numsaved}; |
} |
} |
} else { |
|
$min = '7'; |
|
} |
} |
my %rulenames = &Apache::lonlocal::texthash( |
my %rulenames = &Apache::lonlocal::texthash( |
uc => 'At least one upper case letter', |
uc => 'At least one upper case letter', |
Line 4366 sub print_passwords {
|
Line 4636 sub print_passwords {
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
$datatable .= '<tr'.$css_class.'><td>'.$titles{'min'}.'</td>'. |
$datatable .= '<tr'.$css_class.'><td>'.$titles{'min'}.'</td>'. |
'<td class="LC_left_item"><span class="LC_nobreak">'. |
'<td class="LC_left_item"><span class="LC_nobreak">'. |
'<input type="text" name="passwords_min" value="'.$min.'" size="3" />'. |
'<input type="text" name="passwords_min" value="'.$min.'" size="3" '. |
'<span class="LC_fontsize_small"> '.&mt('(Leave blank for no minimum)').'</span>'. |
'onblur="javascript:warnIntPass(this);" />'. |
|
'<span class="LC_fontsize_small"> '.&mt('(Enter an integer: 7 or larger)').'</span>'. |
'</span></td></tr>'; |
'</span></td></tr>'; |
$itemcount ++; |
$itemcount ++; |
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
$datatable .= '<tr'.$css_class.'><td>'.$titles{'max'}.'</td>'. |
$datatable .= '<tr'.$css_class.'><td>'.$titles{'max'}.'</td>'. |
'<td class="LC_left_item"><span class="LC_nobreak">'. |
'<td class="LC_left_item"><span class="LC_nobreak">'. |
'<input type="text" name="passwords_max" value="'.$max.'" size="3" />'. |
'<input type="text" name="passwords_max" value="'.$max.'" size="3" '. |
|
'onblur="javascript:warnIntPass(this);" />'. |
'<span class="LC_fontsize_small"> '.&mt('(Leave blank for no maximum)').'</span>'. |
'<span class="LC_fontsize_small"> '.&mt('(Leave blank for no maximum)').'</span>'. |
'</span></td></tr>'; |
'</span></td></tr>'; |
$itemcount ++; |
$itemcount ++; |
Line 4413 sub print_passwords {
|
Line 4685 sub print_passwords {
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
$datatable .= '<tr'.$css_class.'><td>'.$titles{'numsaved'}.'</td>'. |
$datatable .= '<tr'.$css_class.'><td>'.$titles{'numsaved'}.'</td>'. |
'<td class="LC_left_item"><span class="LC_nobreak">'. |
'<td class="LC_left_item"><span class="LC_nobreak">'. |
'<input type="text" name="passwords_numsaved" value="'.$numsaved.'" size="3" />'. |
'<input type="text" name="passwords_numsaved" value="'.$numsaved.'" size="3" '. |
|
'onblur="javascript:warnIntPass(this);" />'. |
'<span class="LC_fontsize_small"> '.&mt('(Leave blank to not save previous passwords)').'</span>'. |
'<span class="LC_fontsize_small"> '.&mt('(Leave blank to not save previous passwords)').'</span>'. |
'</span></td></tr>'; |
'</span></td></tr>'; |
} else { |
} else { |
Line 4459 sub print_passwords {
|
Line 4732 sub print_passwords {
|
$datatable .= '<span class="LC_nobreak"><label>'. |
$datatable .= '<span class="LC_nobreak"><label>'. |
'<input type="checkbox" name="passwords_crsowner_'.$item.'" value="'. |
'<input type="checkbox" name="passwords_crsowner_'.$item.'" value="'. |
$type.'"'.$checked.' />'.$usertypes->{$type}.'</label>'. |
$type.'"'.$checked.' />'.$usertypes->{$type}.'</label>'. |
'<span> '; |
'</span> '; |
} |
} |
} |
} |
my $checked; |
my $checked; |
Line 4489 sub print_usersessions {
|
Line 4762 sub print_usersessions {
|
if ($position eq 'top') { |
if ($position eq 'top') { |
if (keys(%serverhomes) > 1) { |
if (keys(%serverhomes) > 1) { |
my %spareid = ¤t_offloads_to($dom,$settings,\%servers); |
my %spareid = ¤t_offloads_to($dom,$settings,\%servers); |
my $curroffloadnow; |
my ($curroffloadnow,$curroffloadoth); |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if (ref($settings->{'offloadnow'}) eq 'HASH') { |
if (ref($settings->{'offloadnow'}) eq 'HASH') { |
$curroffloadnow = $settings->{'offloadnow'}; |
$curroffloadnow = $settings->{'offloadnow'}; |
} |
} |
|
if (ref($settings->{'offloadoth'}) eq 'HASH') { |
|
$curroffloadoth = $settings->{'offloadoth'}; |
|
} |
} |
} |
$datatable .= &spares_row($dom,\%servers,\%spareid,\%serverhomes,\%altids,$curroffloadnow,$rowtotal); |
my $other_insts = scalar(keys(%by_location)); |
|
$datatable .= &spares_row($dom,\%servers,\%spareid,\%serverhomes,\%altids, |
|
$other_insts,$curroffloadnow,$curroffloadoth,$rowtotal); |
} else { |
} else { |
$datatable .= '<tr'.$css_class.'><td colspan="2">'. |
$datatable .= '<tr'.$css_class.'><td colspan="2">'. |
&mt('Nothing to set here, as the cluster to which this domain belongs only contains one server.'); |
&mt('Nothing to set here, as the cluster to which this domain belongs only contains one server.'); |
Line 4745 sub current_offloads_to {
|
Line 5023 sub current_offloads_to {
|
} |
} |
|
|
sub spares_row { |
sub spares_row { |
my ($dom,$servers,$spareid,$serverhomes,$altids,$curroffloadnow,$rowtotal) = @_; |
my ($dom,$servers,$spareid,$serverhomes,$altids,$other_insts, |
|
$curroffloadnow,$curroffloadoth,$rowtotal) = @_; |
my $css_class; |
my $css_class; |
my $numinrow = 4; |
my $numinrow = 4; |
my $itemcount = 1; |
my $itemcount = 1; |
Line 4765 sub spares_row {
|
Line 5044 sub spares_row {
|
} |
} |
} |
} |
next unless (ref($spareid->{$server}) eq 'HASH'); |
next unless (ref($spareid->{$server}) eq 'HASH'); |
my $checkednow; |
my ($checkednow,$checkedoth); |
if (ref($curroffloadnow) eq 'HASH') { |
if (ref($curroffloadnow) eq 'HASH') { |
if ($curroffloadnow->{$server}) { |
if ($curroffloadnow->{$server}) { |
$checkednow = ' checked="checked"'; |
$checkednow = ' checked="checked"'; |
} |
} |
} |
} |
|
if (ref($curroffloadoth) eq 'HASH') { |
|
if ($curroffloadoth->{$server}) { |
|
$checkedoth = ' checked="checked"'; |
|
} |
|
} |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$datatable .= '<tr'.$css_class.'> |
$datatable .= '<tr'.$css_class.'> |
<td rowspan="2"> |
<td rowspan="2"> |
Line 4779 sub spares_row {
|
Line 5063 sub spares_row {
|
,'<b>'.$server.'</b>').'</span><br />'. |
,'<b>'.$server.'</b>').'</span><br />'. |
'<span class="LC_nobreak">'."\n". |
'<span class="LC_nobreak">'."\n". |
'<label><input type="checkbox" name="offloadnow" value="'.$server.'"'.$checkednow.' />'. |
'<label><input type="checkbox" name="offloadnow" value="'.$server.'"'.$checkednow.' />'. |
' '.&mt('Switch active users on next access').'</label></span>'. |
' '.&mt('Switch any active user on next access').'</label></span>'. |
|
"\n"; |
|
if ($other_insts) { |
|
$datatable .= '<br />'. |
|
'<span class="LC_nobreak">'."\n". |
|
'<label><input type="checkbox" name="offloadoth" value="'.$server.'"'.$checkedoth.' />'. |
|
' '.&mt('Switch other institutions on next access').'</label></span>'. |
"\n"; |
"\n"; |
|
} |
my (%current,%canselect); |
my (%current,%canselect); |
my @choices = |
my @choices = |
&possible_newspares($server,$spareid->{$server},$serverhomes,$altids); |
&possible_newspares($server,$spareid->{$server},$serverhomes,$altids); |
Line 5292 sub contact_titles {
|
Line 5583 sub contact_titles {
|
'adminemail' => 'Default Server Admin E-mail address', |
'adminemail' => 'Default Server Admin E-mail address', |
'errormail' => 'Error reports to be e-mailed to', |
'errormail' => 'Error reports to be e-mailed to', |
'packagesmail' => 'Package update alerts to be e-mailed to', |
'packagesmail' => 'Package update alerts to be e-mailed to', |
'helpdeskmail' => "Helpdesk requests for this domain's users", |
'helpdeskmail' => "Helpdesk requests from all users in this domain", |
'otherdomsmail' => 'Helpdesk requests for other (unconfigured) domains', |
'otherdomsmail' => 'Helpdesk requests from users in other (unconfigured) domains', |
'lonstatusmail' => 'E-mail from nightly status check (warnings/errors)', |
'lonstatusmail' => 'E-mail from nightly status check (warnings/errors)', |
'requestsmail' => 'E-mail from course requests requiring approval', |
'requestsmail' => 'E-mail from course requests requiring approval', |
'updatesmail' => 'E-mail from nightly check of LON-CAPA module integrity/updates', |
'updatesmail' => 'E-mail from nightly check of LON-CAPA module integrity/updates', |
'idconflictsmail' => 'E-mail from bi-nightly check for multiple users sharing same student/employee ID', |
'idconflictsmail' => 'E-mail from bi-nightly check for multiple users sharing same student/employee ID', |
'hostipmail' => 'E-mail from nightly check of hostname/IP network changes', |
'hostipmail' => 'E-mail from nightly check of hostname/IP network changes', |
|
'errorthreshold' => 'Error count threshold for status e-mail to admin(s)', |
|
'errorsysmail' => 'Error count threshold for e-mail to developer group', |
|
'errorweights' => 'Weights used to compute error count', |
|
'errorexcluded' => 'Servers with unsent updates excluded from count', |
); |
); |
my %short_titles = &Apache::lonlocal::texthash ( |
my %short_titles = &Apache::lonlocal::texthash ( |
adminemail => 'Admin E-mail address', |
adminemail => 'Admin E-mail address', |
Line 6341 sub print_defaults {
|
Line 6636 sub print_defaults {
|
$datatable .= '</select> '.&mt('Internal ID:').' <b>'.$item.'</b> '. |
$datatable .= '</select> '.&mt('Internal ID:').' <b>'.$item.'</b> '. |
'<input type="checkbox" name="inststatus_delete" value="'.$item.'" />'. |
'<input type="checkbox" name="inststatus_delete" value="'.$item.'" />'. |
&mt('delete').'</span></td>'. |
&mt('delete').'</span></td>'. |
'<td class="LC_left_item"><span class="LC_nobreak">'.&mt('Name displayed:'). |
'<td class="LC_left_item"><span class="LC_nobreak">'.&mt('Name displayed'). |
'<input type="text" size="20" name="inststatus_title_'.$item.'" value="'.$title.'" />'. |
'<input type="text" size="20" name="inststatus_title_'.$item.'" value="'.$title.'" />'. |
'</span></td></tr>'; |
'</span></td></tr>'; |
} |
} |
Line 6361 sub print_defaults {
|
Line 6656 sub print_defaults {
|
'<input type="text" size="10" name="addinststatus" value="" />'. |
'<input type="text" size="10" name="addinststatus" value="" />'. |
' '.&mt('(new)'). |
' '.&mt('(new)'). |
'</span></td><td class="LC_left_item"><span class="LC_nobreak">'. |
'</span></td><td class="LC_left_item"><span class="LC_nobreak">'. |
&mt('Name displayed:'). |
&mt('Name displayed'). |
'<input type="text" size="20" name="addinststatus_title" value="" /></span></td>'. |
'<input type="text" size="20" name="addinststatus_title" value="" /></span></td>'. |
'</tr>'."\n"; |
'</tr>'."\n"; |
$rownum ++; |
$rownum ++; |
Line 7135 ENDSCRIPT
|
Line 7430 ENDSCRIPT
|
} |
} |
|
|
sub passwords_javascript { |
sub passwords_javascript { |
my $intauthcheck = &mt('Warning: disallowing login for an authenticated user if the stored cost is less than the default will require a password reset by/for the user.'); |
my %intalert = &Apache::lonlocal::texthash ( |
my $intauthcost = &mt('Warning: bcrypt encryption cost for internal authentication must be an integer.'); |
authcheck => 'Warning: disallowing login for an authenticated user if the stored cost is less than the default will require a password reset by/for the user.', |
&js_escape(\$intauthcheck); |
authcost => 'Warning: bcrypt encryption cost for internal authentication must be an integer.', |
&js_escape(\$intauthcost); |
passmin => 'Warning: minimum password length must be a positive integer greater than 6.', |
|
passmax => 'Warning: maximum password length must be a positive integer (or blank).', |
|
passexp => 'Warning: days before password expiration must be a positive integer (or blank).', |
|
passnum => 'Warning: number of previous passwords to save must be a positive integer (or blank).', |
|
); |
|
&js_escape(\%intalert); |
|
my $defmin = $Apache::lonnet::passwdmin; |
my $intauthjs = <<"ENDSCRIPT"; |
my $intauthjs = <<"ENDSCRIPT"; |
|
|
function warnIntAuth(field) { |
function warnIntAuth(field) { |
if (field.name == 'intauth_check') { |
if (field.name == 'intauth_check') { |
if (field.value == '2') { |
if (field.value == '2') { |
alert('$intauthcheck'); |
alert('$intalert{authcheck}'); |
} |
} |
} |
} |
if (field.name == 'intauth_cost') { |
if (field.name == 'intauth_cost') { |
Line 7152 function warnIntAuth(field) {
|
Line 7453 function warnIntAuth(field) {
|
if (field.value != '') { |
if (field.value != '') { |
var regexdigit=/^\\d+\$/; |
var regexdigit=/^\\d+\$/; |
if (!regexdigit.test(field.value)) { |
if (!regexdigit.test(field.value)) { |
alert('$intauthcost'); |
alert('$intalert{authcost}'); |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
|
function warnIntPass(field) { |
|
field.value.replace(/^\s+/,''); |
|
field.value.replace(/\s+\$/,''); |
|
var regexdigit=/^\\d+\$/; |
|
if (field.name == 'passwords_min') { |
|
if (field.value == '') { |
|
alert('$intalert{passmin}'); |
|
field.value = '$defmin'; |
|
} else { |
|
if (!regexdigit.test(field.value)) { |
|
alert('$intalert{passmin}'); |
|
field.value = '$defmin'; |
|
} |
|
var minval = parseInt(field.value,10); |
|
if (minval < $defmin) { |
|
alert('$intalert{passmin}'); |
|
field.value = '$defmin'; |
|
} |
|
} |
|
} else { |
|
if (field.value == '0') { |
|
field.value = ''; |
|
} |
|
if (field.value != '') { |
|
if (field.name == 'passwords_expire') { |
|
var regexpposnum=/^\\d+(|\\.\\d*)\$/; |
|
if (!regexpposnum.test(field.value)) { |
|
alert('$intalert{passexp}'); |
|
field.value = ''; |
|
} else { |
|
var expval = parseFloat(field.value); |
|
if (expval == 0) { |
|
alert('$intalert{passexp}'); |
|
field.value = ''; |
|
} |
|
} |
|
} else { |
|
if (!regexdigit.test(field.value)) { |
|
if (field.name == 'passwords_max') { |
|
alert('$intalert{passmax}'); |
|
} else { |
|
if (field.name == 'passwords_numsaved') { |
|
alert('$intalert{passnum}'); |
|
} |
|
} |
|
field.value = ''; |
|
} |
} |
} |
} |
} |
} |
} |
Line 7272 ENDSCRIPT
|
Line 7626 ENDSCRIPT
|
sub initialize_categories { |
sub initialize_categories { |
my ($itemcount) = @_; |
my ($itemcount) = @_; |
my ($datatable,$css_class,$chgstr); |
my ($datatable,$css_class,$chgstr); |
my %default_names = ( |
my %default_names = &Apache::lonlocal::texthash ( |
instcode => 'Official courses (with institutional codes)', |
instcode => 'Official courses (with institutional codes)', |
communities => 'Communities', |
communities => 'Communities', |
); |
); |
Line 7305 sub initialize_categories {
|
Line 7659 sub initialize_categories {
|
.'<option value="0">1</option>' |
.'<option value="0">1</option>' |
.'<option value="1">2</option>' |
.'<option value="1">2</option>' |
.'<option value="2" selected="selected">3</option></select> ' |
.'<option value="2" selected="selected">3</option></select> ' |
.&mt('Add category').'</span></td><tda<span class="LC_nobreak">>'.&mt('Name:') |
.&mt('Add category').'</span></td><td><span class="LC_nobreak">'.&mt('Name:') |
.' <input type="text" size="20" name="addcategory_name" value="" /></span>' |
.' <input type="text" size="20" name="addcategory_name" value="" /></span>' |
.'</td></tr>'; |
.'</td></tr>'; |
return $datatable; |
return $datatable; |
Line 7557 sub insttypes_row {
|
Line 7911 sub insttypes_row {
|
statustocreate => 'Institutional affiliation(s) able to create own account (login/SSO)', |
statustocreate => 'Institutional affiliation(s) able to create own account (login/SSO)', |
lockablenames => 'User preference to lock name', |
lockablenames => 'User preference to lock name', |
selfassign => 'Self-reportable affiliations', |
selfassign => 'Self-reportable affiliations', |
|
overrides => "Override domain's helpdesk settings based on requester's affiliation", |
); |
); |
my $showdom; |
my $showdom; |
if ($context eq 'cansearch') { |
if ($context eq 'cansearch') { |
Line 7603 sub insttypes_row {
|
Line 7958 sub insttypes_row {
|
if (grep(/^\Q$types->[$i]\E$/,@{$settings->{$context}})) { |
if (grep(/^\Q$types->[$i]\E$/,@{$settings->{$context}})) { |
$check = ' checked="checked" '; |
$check = ' checked="checked" '; |
} |
} |
|
} elsif (ref($settings->{$context}) eq 'HASH') { |
|
if (ref($settings->{$context}->{$types->[$i]}) eq 'HASH') { |
|
$check = ' checked="checked" '; |
|
} |
} elsif ($context eq 'statustocreate') { |
} elsif ($context eq 'statustocreate') { |
$check = ' checked="checked" '; |
$check = ' checked="checked" '; |
} |
} |
Line 7617 sub insttypes_row {
|
Line 7976 sub insttypes_row {
|
$rem = @{$types}%($numinrow); |
$rem = @{$types}%($numinrow); |
} |
} |
my $colsleft = $numinrow - $rem; |
my $colsleft = $numinrow - $rem; |
if ($rem == 0) { |
if ($context eq 'overrides') { |
$output .= '<tr>'; |
if ($colsleft > 1) { |
} |
$output .= '<td colspan="'.$colsleft.'" class="LC_left_item">'; |
if ($colsleft > 1) { |
} else { |
$output .= '<td colspan="'.$colsleft.'" class="LC_left_item">'; |
$output .= '<td class="LC_left_item">'; |
|
} |
|
$output .= ' '; |
} else { |
} else { |
$output .= '<td class="LC_left_item">'; |
if ($rem == 0) { |
} |
$output .= '<tr>'; |
my $defcheck = ' '; |
} |
if (ref($settings) eq 'HASH') { |
if ($colsleft > 1) { |
if (ref($settings->{$context}) eq 'ARRAY') { |
$output .= '<td colspan="'.$colsleft.'" class="LC_left_item">'; |
if (grep(/^default$/,@{$settings->{$context}})) { |
} else { |
|
$output .= '<td class="LC_left_item">'; |
|
} |
|
my $defcheck = ' '; |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{$context}) eq 'ARRAY') { |
|
if (grep(/^default$/,@{$settings->{$context}})) { |
|
$defcheck = ' checked="checked" '; |
|
} |
|
} elsif ($context eq 'statustocreate') { |
$defcheck = ' checked="checked" '; |
$defcheck = ' checked="checked" '; |
} |
} |
} elsif ($context eq 'statustocreate') { |
|
$defcheck = ' checked="checked" '; |
|
} |
} |
|
$output .= '<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="'.$context.'" '. |
|
'value="default"'.$defcheck.$onclick.' />'. |
|
$othertitle.'</label></span>'; |
} |
} |
$output .= '<span class="LC_nobreak"><label>'. |
$output .= '</td></tr></table></td></tr>'; |
'<input type="checkbox" name="'.$context.'" '. |
|
'value="default"'.$defcheck.$onclick.'/>'. |
|
$othertitle.'</label></span></td>'. |
|
'</tr></table></td></tr>'; |
|
return $output; |
return $output; |
} |
} |
|
|
Line 10232 sub modify_contacts {
|
Line 10600 sub modify_contacts {
|
my @contacts = ('supportemail','adminemail'); |
my @contacts = ('supportemail','adminemail'); |
my @mailings = ('errormail','packagesmail','helpdeskmail','otherdomsmail', |
my @mailings = ('errormail','packagesmail','helpdeskmail','otherdomsmail', |
'lonstatusmail','requestsmail','updatesmail','idconflictsmail','hostipmail'); |
'lonstatusmail','requestsmail','updatesmail','idconflictsmail','hostipmail'); |
my @toggles = ('reporterrors','reportupdates'); |
my @toggles = ('reporterrors','reportupdates','reportstatus'); |
|
my @lonstatus = ('threshold','sysmail','weights','excluded'); |
my ($fields,$fieldtitles,$fieldoptions,$possoptions) = &helpform_fields(); |
my ($fields,$fieldtitles,$fieldoptions,$possoptions) = &helpform_fields(); |
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
@{$newsetting{$type}} = |
@{$newsetting{$type}} = |
Line 10265 sub modify_contacts {
|
Line 10634 sub modify_contacts {
|
$contacts_hash{'contacts'}{$item} = $env{'form.'.$item}; |
$contacts_hash{'contacts'}{$item} = $env{'form.'.$item}; |
} |
} |
} |
} |
|
my ($lonstatus_defs,$lonstatus_names) = &Apache::loncommon::lon_status_items(); |
|
foreach my $item (@lonstatus) { |
|
if ($item eq 'excluded') { |
|
my (%serverhomes,@excluded); |
|
map { $serverhomes{$_} = 1; } values(%Apache::lonnet::serverhomeIDs); |
|
my @possexcluded = &Apache::loncommon::get_env_multiple('form.errorexcluded'); |
|
if (@possexcluded) { |
|
foreach my $id (sort(@possexcluded)) { |
|
if ($serverhomes{$id}) { |
|
push(@excluded,$id); |
|
} |
|
} |
|
} |
|
if (@excluded) { |
|
$contacts_hash{'contacts'}{'lonstatus'}{$item} = \@excluded; |
|
} |
|
} elsif ($item eq 'weights') { |
|
foreach my $type ('E','W','N','U') { |
|
$env{'form.error'.$item.'_'.$type} =~ s/^\s+|\s+$//g; |
|
if ($env{'form.error'.$item.'_'.$type} =~ /^\d+$/) { |
|
unless ($env{'form.error'.$item.'_'.$type} == $lonstatus_defs->{$type}) { |
|
$contacts_hash{'contacts'}{'lonstatus'}{$item}{$type} = |
|
$env{'form.error'.$item.'_'.$type}; |
|
} |
|
} |
|
} |
|
} elsif (($item eq 'threshold') || ($item eq 'sysmail')) { |
|
$env{'form.error'.$item} =~ s/^\s+|\s+$//g; |
|
if ($env{'form.error'.$item} =~ /^\d+$/) { |
|
unless ($env{'form.error'.$item} == $lonstatus_defs->{$item}) { |
|
$contacts_hash{'contacts'}{'lonstatus'}{$item} = $env{'form.error'.$item}; |
|
} |
|
} |
|
} |
|
} |
if ((ref($fields) eq 'ARRAY') && (ref($possoptions) eq 'HASH')) { |
if ((ref($fields) eq 'ARRAY') && (ref($possoptions) eq 'HASH')) { |
foreach my $field (@{$fields}) { |
foreach my $field (@{$fields}) { |
if (ref($possoptions->{$field}) eq 'ARRAY') { |
if (ref($possoptions->{$field}) eq 'ARRAY') { |
my $value = $env{'form.helpform_'.$field}; |
my $value = $env{'form.helpform_'.$field}; |
$value =~ s/^\s+|\s+$//g; |
$value =~ s/^\s+|\s+$//g; |
if (grep(/^\Q$value\E$/,@{$possoptions->{$field}})) { |
if (grep(/^\Q$value\E$/,@{$possoptions->{$field}})) { |
$contacts_hash{contacts}{'helpform'}{$field} = $value; |
$contacts_hash{'contacts'}{'helpform'}{$field} = $value; |
if ($field eq 'screenshot') { |
if ($field eq 'screenshot') { |
$env{'form.helpform_maxsize'} =~ s/^\s+|\s+$//g; |
$env{'form.helpform_maxsize'} =~ s/^\s+|\s+$//g; |
if ($env{'form.helpform_maxsize'} =~ /^\d+\.?\d*$/) { |
if ($env{'form.helpform_maxsize'} =~ /^\d+\.?\d*$/) { |
$contacts_hash{contacts}{'helpform'}{'maxsize'} = $env{'form.helpform_maxsize'}; |
$contacts_hash{'contacts'}{'helpform'}{'maxsize'} = $env{'form.helpform_maxsize'}; |
} |
} |
} |
} |
} |
} |
} |
} |
} |
} |
} |
} |
|
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
|
my (@statuses,%usertypeshash,@overrides); |
|
if ((ref($types) eq 'ARRAY') && (@{$types} > 0)) { |
|
@statuses = @{$types}; |
|
if (ref($usertypes) eq 'HASH') { |
|
%usertypeshash = %{$usertypes}; |
|
} |
|
} |
|
if (@statuses) { |
|
my @possoverrides = &Apache::loncommon::get_env_multiple('form.overrides'); |
|
foreach my $type (@possoverrides) { |
|
if (($type ne '') && (grep(/^\Q$type\E$/,@statuses))) { |
|
push(@overrides,$type); |
|
} |
|
} |
|
if (@overrides) { |
|
foreach my $type (@overrides) { |
|
my @standard = &Apache::loncommon::get_env_multiple('form.override_'.$type); |
|
foreach my $item (@contacts) { |
|
if (grep(/^\Q$item\E$/,@standard)) { |
|
$contacts_hash{'contacts'}{'overrides'}{$type}{$item} = 1; |
|
$newsetting{'override_'.$type}{$item} = 1; |
|
} else { |
|
$contacts_hash{'contacts'}{'overrides'}{$type}{$item} = 0; |
|
$newsetting{'override_'.$type}{$item} = 0; |
|
} |
|
} |
|
$contacts_hash{'contacts'}{'overrides'}{$type}{'others'} = $env{'form.override_'.$type.'_others'}; |
|
$contacts_hash{'contacts'}{'overrides'}{$type}{'bcc'} = $env{'form.override_'.$type.'_bcc'}; |
|
$newsetting{'override_'.$type}{'others'} = $env{'form.override_'.$type.'_others'}; |
|
$newsetting{'override_'.$type}{'bcc'} = $env{'form.override_'.$type.'_bcc'}; |
|
if (($env{'form.override_'.$type.'_includestr'} ne '') && ($env{'form.override_'.$type.'_includeloc'} =~ /^s|b$/)) { |
|
$includestr{$type} = $env{'form.override_'.$type.'_includestr'}; |
|
$includeloc{$type} = $env{'form.override_'.$type.'_includeloc'}; |
|
$contacts_hash{'contacts'}{'overrides'}{$type}{'include'} = $includeloc{$type}.':'.&escape($includestr{$type}); |
|
$newsetting{'override_'.$type}{'include'} = $contacts_hash{'contacts'}{'overrides'}{$type}{'include'}; |
|
} |
|
} |
|
} |
|
} |
if (keys(%currsetting) > 0) { |
if (keys(%currsetting) > 0) { |
foreach my $item (@contacts) { |
foreach my $item (@contacts) { |
if ($to{$item} ne $currsetting{$item}) { |
if ($to{$item} ne $currsetting{$item}) { |
Line 10336 sub modify_contacts {
|
Line 10780 sub modify_contacts {
|
} |
} |
} |
} |
} |
} |
|
if (@statuses) { |
|
if (ref($currsetting{'overrides'}) eq 'HASH') { |
|
foreach my $key (keys(%{$currsetting{'overrides'}})) { |
|
if (ref($currsetting{'overrides'}{$key}) eq 'HASH') { |
|
if (ref($newsetting{'override_'.$key}) eq 'HASH') { |
|
foreach my $item (@contacts,'bcc','others','include') { |
|
if ($currsetting{'overrides'}{$key}{$item} ne $newsetting{'override_'.$key}{$item}) { |
|
push(@{$changes{'overrides'}},$key); |
|
last; |
|
} |
|
} |
|
} else { |
|
push(@{$changes{'overrides'}},$key); |
|
} |
|
} |
|
} |
|
foreach my $key (@overrides) { |
|
unless (exists($currsetting{'overrides'}{$key})) { |
|
push(@{$changes{'overrides'}},$key); |
|
} |
|
} |
|
} else { |
|
foreach my $key (@overrides) { |
|
push(@{$changes{'overrides'}},$key); |
|
} |
|
} |
|
} |
|
if (ref($currsetting{'lonstatus'}) eq 'HASH') { |
|
foreach my $key ('excluded','weights','threshold','sysmail') { |
|
if ($key eq 'excluded') { |
|
if ((ref($contacts_hash{contacts}{lonstatus}) eq 'HASH') && |
|
(ref($contacts_hash{contacts}{lonstatus}{excluded}) eq 'ARRAY')) { |
|
if ((ref($currsetting{'lonstatus'}{$key}) eq 'ARRAY') && |
|
(@{$currsetting{'lonstatus'}{$key}})) { |
|
my @diffs = |
|
&Apache::loncommon::compare_arrays($contacts_hash{contacts}{lonstatus}{excluded}, |
|
$currsetting{'lonstatus'}{$key}); |
|
if (@diffs) { |
|
push(@{$changes{'lonstatus'}},$key); |
|
} |
|
} elsif (@{$contacts_hash{contacts}{lonstatus}{excluded}}) { |
|
push(@{$changes{'lonstatus'}},$key); |
|
} |
|
} elsif ((ref($currsetting{'lonstatus'}{$key}) eq 'ARRAY') && |
|
(@{$currsetting{'lonstatus'}{$key}})) { |
|
push(@{$changes{'lonstatus'}},$key); |
|
} |
|
} elsif ($key eq 'weights') { |
|
if ((ref($contacts_hash{contacts}{lonstatus}) eq 'HASH') && |
|
(ref($contacts_hash{contacts}{lonstatus}{$key}) eq 'HASH')) { |
|
if (ref($currsetting{'lonstatus'}{$key}) eq 'HASH') { |
|
foreach my $type ('E','W','N','U') { |
|
unless ($contacts_hash{contacts}{lonstatus}{$key}{$type} eq |
|
$currsetting{'lonstatus'}{$key}{$type}) { |
|
push(@{$changes{'lonstatus'}},$key); |
|
last; |
|
} |
|
} |
|
} else { |
|
foreach my $type ('E','W','N','U') { |
|
if ($contacts_hash{contacts}{lonstatus}{$key}{$type} ne '') { |
|
push(@{$changes{'lonstatus'}},$key); |
|
last; |
|
} |
|
} |
|
} |
|
} elsif (ref($currsetting{'lonstatus'}{$key}) eq 'HASH') { |
|
foreach my $type ('E','W','N','U') { |
|
if ($currsetting{'lonstatus'}{$key}{$type} ne '') { |
|
push(@{$changes{'lonstatus'}},$key); |
|
last; |
|
} |
|
} |
|
} |
|
} elsif (($key eq 'threshold') || ($key eq 'sysmail')) { |
|
if (ref($contacts_hash{contacts}{lonstatus}) eq 'HASH') { |
|
if ($currsetting{'lonstatus'}{$key} =~ /^\d+$/) { |
|
if ($currsetting{'lonstatus'}{$key} != $contacts_hash{contacts}{lonstatus}{$key}) { |
|
push(@{$changes{'lonstatus'}},$key); |
|
} |
|
} elsif ($contacts_hash{contacts}{lonstatus}{$key} =~ /^\d+$/) { |
|
push(@{$changes{'lonstatus'}},$key); |
|
} |
|
} elsif ($currsetting{'lonstatus'}{$key} =~ /^\d+$/) { |
|
push(@{$changes{'lonstatus'}},$key); |
|
} |
|
} |
|
} |
|
} else { |
|
if (ref($contacts_hash{contacts}{lonstatus}) eq 'HASH') { |
|
foreach my $key ('excluded','weights','threshold','sysmail') { |
|
if (exists($contacts_hash{contacts}{lonstatus}{$key})) { |
|
push(@{$changes{'lonstatus'}},$key); |
|
} |
|
} |
|
} |
|
} |
} else { |
} else { |
my %default; |
my %default; |
$default{'supportemail'} = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
$default{'supportemail'} = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
Line 10381 sub modify_contacts {
|
Line 10922 sub modify_contacts {
|
} |
} |
} |
} |
} |
} |
|
if (ref($contacts_hash{contacts}{lonstatus}) eq 'HASH') { |
|
foreach my $key ('excluded','weights','threshold','sysmail') { |
|
if (exists($contacts_hash{contacts}{lonstatus}{$key})) { |
|
push(@{$changes{'lonstatus'}},$key); |
|
} |
|
} |
|
} |
} |
} |
foreach my $item (@toggles) { |
foreach my $item (@toggles) { |
if (($env{'form.'.$item} == 1) && ($currsetting{$item} == 0)) { |
if (($env{'form.'.$item} == 1) && ($currsetting{$item} == 0)) { |
Line 10451 sub modify_contacts {
|
Line 10999 sub modify_contacts {
|
$resulttext .= '</li>'; |
$resulttext .= '</li>'; |
} |
} |
} |
} |
|
if (ref($changes{'overrides'}) eq 'ARRAY') { |
|
my @deletions; |
|
foreach my $type (@{$changes{'overrides'}}) { |
|
if ($usertypeshash{$type}) { |
|
if (grep(/^\Q$type\E/,@overrides)) { |
|
$resulttext .= '<li>'.&mt("Overrides based on requester's affiliation set for [_1]", |
|
$usertypeshash{$type}).'<ul><li>'; |
|
if (ref($newsetting{'override_'.$type}) eq 'HASH') { |
|
my @text; |
|
foreach my $item (@contacts) { |
|
if ($newsetting{'override_'.$type}{$item}) { |
|
push(@text,$short_titles->{$item}); |
|
} |
|
} |
|
if ($newsetting{'override_'.$type}{'others'} ne '') { |
|
push(@text,$newsetting{'override_'.$type}{'others'}); |
|
} |
|
|
|
if (@text) { |
|
$resulttext .= &mt('Helpdesk e-mail sent to: [_1]', |
|
'<span class="LC_cusr_emph">'.join(', ',@text).'</span>'); |
|
} |
|
if ($newsetting{'override_'.$type}{'bcc'} ne '') { |
|
my $bcctext; |
|
if (@text) { |
|
$bcctext = ' '.&mt('with Bcc to'); |
|
} else { |
|
$bcctext = '(Bcc)'; |
|
} |
|
$resulttext .= $bcctext.': <span class="LC_cusr_emph">'.$newsetting{'override_'.$type}{'bcc'}.'</span>'; |
|
} elsif (!@text) { |
|
$resulttext .= &mt('Helpdesk e-mail sent to no one'); |
|
} |
|
$resulttext .= '</li>'; |
|
if ($newsetting{'override_'.$type}{'include'} ne '') { |
|
my ($loc,$str) = split(/:/,$newsetting{'override_'.$type}{'include'}); |
|
if ($loc eq 'b') { |
|
$resulttext .= '<li>'.&mt('Text automatically added to e-mail body:').' '.&unescape($str).'</li>'; |
|
} elsif ($loc eq 's') { |
|
$resulttext .= '<li>'.&mt('Text automatically added to e-mail subject:').' '.&unescape($str).'</li>'; |
|
} |
|
} |
|
} |
|
$resulttext .= '</li></ul></li>'; |
|
} else { |
|
push(@deletions,$usertypeshash{$type}); |
|
} |
|
} |
|
} |
|
if (@deletions) { |
|
$resulttext .= '<li>'.&mt("Overrides based on requester's affiliation discontinued for: [_1]", |
|
join(', ',@deletions)).'</li>'; |
|
} |
|
} |
my @offon = ('off','on'); |
my @offon = ('off','on'); |
|
my $corelink = &core_link_msu(); |
if ($changes{'reporterrors'}) { |
if ($changes{'reporterrors'}) { |
$resulttext .= '<li>'. |
$resulttext .= '<li>'. |
&mt('E-mail error reports to [_1] set to "'. |
&mt('E-mail error reports to [_1] set to "'. |
$offon[$env{'form.reporterrors'}].'".', |
$offon[$env{'form.reporterrors'}].'".', |
&Apache::loncommon::modal_link('http://loncapa.org/core.html', |
$corelink). |
&mt('LON-CAPA core group - MSU'),600,500)). |
|
'</li>'; |
'</li>'; |
} |
} |
if ($changes{'reportupdates'}) { |
if ($changes{'reportupdates'}) { |
$resulttext .= '<li>'. |
$resulttext .= '<li>'. |
&mt('E-mail record of completed LON-CAPA updates to [_1] set to "'. |
&mt('E-mail record of completed LON-CAPA updates to [_1] set to "'. |
$offon[$env{'form.reportupdates'}].'".', |
$offon[$env{'form.reportupdates'}].'".', |
&Apache::loncommon::modal_link('http://loncapa.org/core.html', |
$corelink). |
&mt('LON-CAPA core group - MSU'),600,500)). |
'</li>'; |
|
} |
|
if ($changes{'reportstatus'}) { |
|
$resulttext .= '<li>'. |
|
&mt('E-mail status if errors above threshold to [_1] set to "'. |
|
$offon[$env{'form.reportstatus'}].'".', |
|
$corelink). |
'</li>'; |
'</li>'; |
} |
} |
|
if (ref($changes{'lonstatus'}) eq 'ARRAY') { |
|
$resulttext .= '<li>'. |
|
&mt('Nightly status check e-mail settings').':<ul>'; |
|
my (%defval,%use_def,%shown); |
|
$defval{'threshold'} = $lonstatus_defs->{'threshold'}; |
|
$defval{'sysmail'} = $lonstatus_defs->{'sysmail'}; |
|
$defval{'weights'} = |
|
join(', ',map { $lonstatus_names->{$_}.'='.$lonstatus_defs->{$_}; } ('E','W','N','U')); |
|
$defval{'excluded'} = &mt('None'); |
|
if (ref($contacts_hash{'contacts'}{'lonstatus'}) eq 'HASH') { |
|
foreach my $item ('threshold','sysmail','weights','excluded') { |
|
if (exists($contacts_hash{'contacts'}{'lonstatus'}{$item})) { |
|
if (($item eq 'threshold') || ($item eq 'sysmail')) { |
|
$shown{$item} = $contacts_hash{'contacts'}{'lonstatus'}{$item}; |
|
} elsif ($item eq 'weights') { |
|
if (ref($contacts_hash{'contacts'}{'lonstatus'}{$item}) eq 'HASH') { |
|
foreach my $type ('E','W','N','U') { |
|
$shown{$item} .= $lonstatus_names->{$type}.'='; |
|
if (exists($contacts_hash{'contacts'}{'lonstatus'}{$item}{$type})) { |
|
$shown{$item} .= $contacts_hash{'contacts'}{'lonstatus'}{$item}{$type}; |
|
} else { |
|
$shown{$item} .= $lonstatus_defs->{$type}; |
|
} |
|
$shown{$item} .= ', '; |
|
} |
|
$shown{$item} =~ s/, $//; |
|
} else { |
|
$shown{$item} = $defval{$item}; |
|
} |
|
} elsif ($item eq 'excluded') { |
|
if (ref($contacts_hash{'contacts'}{'lonstatus'}{$item}) eq 'ARRAY') { |
|
$shown{$item} = join(', ',@{$contacts_hash{'contacts'}{'lonstatus'}{$item}}); |
|
} else { |
|
$shown{$item} = $defval{$item}; |
|
} |
|
} |
|
} else { |
|
$shown{$item} = $defval{$item}; |
|
} |
|
} |
|
} else { |
|
foreach my $item ('threshold','weights','excluded','sysmail') { |
|
$shown{$item} = $defval{$item}; |
|
} |
|
} |
|
foreach my $item ('threshold','weights','excluded','sysmail') { |
|
$resulttext .= '<li>'.&mt($titles->{'error'.$item}.' -- [_1]', |
|
$shown{$item}).'</li>'; |
|
} |
|
$resulttext .= '</ul></li>'; |
|
} |
if ((ref($changes{'helpform'}) eq 'ARRAY') && (ref($fields) eq 'ARRAY')) { |
if ((ref($changes{'helpform'}) eq 'ARRAY') && (ref($fields) eq 'ARRAY')) { |
my (@optional,@required,@unused,$maxsizechg); |
my (@optional,@required,@unused,$maxsizechg); |
foreach my $field (@{$changes{'helpform'}}) { |
foreach my $field (@{$changes{'helpform'}}) { |
Line 10506 sub modify_contacts {
|
Line 11165 sub modify_contacts {
|
&mt('Max size for file uploaded to help form by logged-in user set to [_1] MB.', |
&mt('Max size for file uploaded to help form by logged-in user set to [_1] MB.', |
$contacts_hash{'contacts'}{'helpform'}{'maxsize'}). |
$contacts_hash{'contacts'}{'helpform'}{'maxsize'}). |
'</li>'; |
'</li>'; |
|
|
} |
} |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
Line 10575 sub modify_passwords {
|
Line 11233 sub modify_passwords {
|
'intauth_cost' => 10, |
'intauth_cost' => 10, |
'intauth_check' => 0, |
'intauth_check' => 0, |
'intauth_switch' => 0, |
'intauth_switch' => 0, |
'min' => 7, |
|
); |
); |
|
$staticdefaults{'min'} = $Apache::lonnet::passwdmin; |
foreach my $type (@oktypes) { |
foreach my $type (@oktypes) { |
$staticdefaults{'resetpostlink'}{$type} = ['email','username']; |
$staticdefaults{'resetpostlink'}{$type} = ['email','username']; |
} |
} |
Line 10588 sub modify_passwords {
|
Line 11246 sub modify_passwords {
|
if ($current{'resetlink'} ne $linklife) { |
if ($current{'resetlink'} ne $linklife) { |
$changes{'reset'} = 1; |
$changes{'reset'} = 1; |
} |
} |
} elsif (!exists($domconfig{passwords})) { |
} elsif (!ref($domconfig{passwords}) eq 'HASH') { |
if ($staticdefaults{'resetlink'} ne $linklife) { |
if ($staticdefaults{'resetlink'} ne $linklife) { |
$changes{'reset'} = 1; |
$changes{'reset'} = 1; |
} |
} |
Line 10609 sub modify_passwords {
|
Line 11267 sub modify_passwords {
|
if (@diffs > 0) { |
if (@diffs > 0) { |
$changes{'reset'} = 1; |
$changes{'reset'} = 1; |
} |
} |
} elsif (!exists($domconfig{passwords})) { |
} elsif (!ref($domconfig{passwords}) eq 'HASH') { |
my @diffs = &Apache::loncommon::compare_arrays($staticdefaults{'resetcase'},\@casesens); |
my @diffs = &Apache::loncommon::compare_arrays($staticdefaults{'resetcase'},\@casesens); |
if (@diffs > 0) { |
if (@diffs > 0) { |
$changes{'reset'} = 1; |
$changes{'reset'} = 1; |
Line 10621 sub modify_passwords {
|
Line 11279 sub modify_passwords {
|
if ($current{'resetprelink'} ne $newvalues{'resetprelink'}) { |
if ($current{'resetprelink'} ne $newvalues{'resetprelink'}) { |
$changes{'reset'} = 1; |
$changes{'reset'} = 1; |
} |
} |
} elsif (!exists($domconfig{passwords})) { |
} elsif (!ref($domconfig{passwords}) eq 'HASH') { |
if ($staticdefaults{'resetprelink'} ne $newvalues{'resetprelink'}) { |
if ($staticdefaults{'resetprelink'} ne $newvalues{'resetprelink'}) { |
$changes{'reset'} = 1; |
$changes{'reset'} = 1; |
} |
} |
Line 10648 sub modify_passwords {
|
Line 11306 sub modify_passwords {
|
} else { |
} else { |
$changes{'reset'} = 1; |
$changes{'reset'} = 1; |
} |
} |
} elsif (!exists($domconfig{passwords})) { |
} elsif (!ref($domconfig{passwords}) eq 'HASH') { |
my @diffs = &Apache::loncommon::compare_arrays($staticdefaults{'resetpostlink'}{$type},\@postlink); |
my @diffs = &Apache::loncommon::compare_arrays($staticdefaults{'resetpostlink'}{$type},\@postlink); |
if (@diffs > 0) { |
if (@diffs > 0) { |
$changes{'reset'} = 1; |
$changes{'reset'} = 1; |
Line 10670 sub modify_passwords {
|
Line 11328 sub modify_passwords {
|
if (@diffs > 0) { |
if (@diffs > 0) { |
$changes{'reset'} = 1; |
$changes{'reset'} = 1; |
} |
} |
} elsif (!exists($domconfig{passwords})) { |
} elsif (!ref($domconfig{passwords}) eq 'HASH') { |
my @diffs = &Apache::loncommon::compare_arrays($staticdefaults{'resetemail'},\@resetemail); |
my @diffs = &Apache::loncommon::compare_arrays($staticdefaults{'resetemail'},\@resetemail); |
if (@diffs > 0) { |
if (@diffs > 0) { |
$changes{'reset'} = 1; |
$changes{'reset'} = 1; |
Line 10756 sub modify_passwords {
|
Line 11414 sub modify_passwords {
|
} |
} |
foreach my $rule ('min','max','numsaved') { |
foreach my $rule ('min','max','numsaved') { |
$env{'form.passwords_'.$rule} =~ s/^\s+|\s+$//g; |
$env{'form.passwords_'.$rule} =~ s/^\s+|\s+$//g; |
if ($env{'form.passwords_'.$rule} =~ /^\d+$/) { |
my $ruleok; |
|
if ($rule eq 'min') { |
|
if ($env{'form.passwords_'.$rule} =~ /^\d+$/) { |
|
if ($env{'form.passwords_'.$rule} >= $Apache::lonnet::passwdmin) { |
|
$ruleok = 1; |
|
} |
|
} |
|
} elsif (($env{'form.passwords_'.$rule} =~ /^\d+$/) && |
|
($env{'form.passwords_'.$rule} ne '0')) { |
|
$ruleok = 1; |
|
} |
|
if ($ruleok) { |
$newvalues{$rule} = $env{'form.passwords_'.$rule}; |
$newvalues{$rule} = $env{'form.passwords_'.$rule}; |
if (exists($current{$rule})) { |
if (exists($current{$rule})) { |
if ($newvalues{$rule} ne $current{$rule}) { |
if ($newvalues{$rule} ne $current{$rule}) { |
Line 10766 sub modify_passwords {
|
Line 11435 sub modify_passwords {
|
if ($staticdefaults{$rule} ne $newvalues{$rule}) { |
if ($staticdefaults{$rule} ne $newvalues{$rule}) { |
$changes{'rules'} = 1; |
$changes{'rules'} = 1; |
} |
} |
|
} else { |
|
$changes{'rules'} = 1; |
} |
} |
} elsif (exists($current{$rule})) { |
} elsif (exists($current{$rule})) { |
$changes{'rules'} = 1; |
$changes{'rules'} = 1; |
Line 10814 sub modify_passwords {
|
Line 11485 sub modify_passwords {
|
} |
} |
} |
} |
} |
} |
} elsif (!exists($domconfig{passwords})) { |
} elsif (!(ref($domconfig{passwords}) eq 'HASH')) { |
foreach my $item ('by','for') { |
foreach my $item ('by','for') { |
if (@{$crsownerchg{$item}} > 0) { |
if (@{$crsownerchg{$item}} > 0) { |
$changes{'crsownerchg'} = 1; |
$changes{'crsownerchg'} = 1; |
Line 10844 sub modify_passwords {
|
Line 11515 sub modify_passwords {
|
$resulttext .= '<li>'.&mt('CAPTCHA validation set to use: original CAPTCHA').'</li>'; |
$resulttext .= '<li>'.&mt('CAPTCHA validation set to use: original CAPTCHA').'</li>'; |
} elsif ($confighash{'passwords'}{'captcha'} eq 'recaptcha') { |
} elsif ($confighash{'passwords'}{'captcha'} eq 'recaptcha') { |
$resulttext .= '<li>'.&mt('CAPTCHA validation set to use: reCAPTCHA').' '. |
$resulttext .= '<li>'.&mt('CAPTCHA validation set to use: reCAPTCHA').' '. |
&mt('version: [_1]',$confighash{'passwords'}{'recaptchaversion'}).'<br />'. |
&mt('version: [_1]',$confighash{'passwords'}{'recaptchaversion'}).'<br />'; |
&mt('Public key: [_1]',$confighash{'passwords'}{'recaptchapub'}).'</br>'. |
if (ref($confighash{'passwords'}{'recaptchakeys'}) eq 'HASH') { |
&mt('Private key: [_1]',$confighash{'passwords'}{'recaptchapriv'}).'</li>'; |
$resulttext .= &mt('Public key: [_1]',$confighash{'passwords'}{'recaptchakeys'}{'public'}).'</br>'. |
|
&mt('Private key: [_1]',$confighash{'passwords'}{'recaptchakeys'}{'private'}).'</li>'; |
|
} |
} else { |
} else { |
$resulttext .= '<li>'.&mt('No CAPTCHA validation').'</li>'; |
$resulttext .= '<li>'.&mt('No CAPTCHA validation').'</li>'; |
} |
} |
Line 10916 sub modify_passwords {
|
Line 11589 sub modify_passwords {
|
$resulttext .= '<li>'.&mt('E-mail address(es) in LON-CAPA used for verification will include: [_1]',join(', ',map { $titles{$_}; } @{$staticdefaults{'resetemail'}})).'</li>'; |
$resulttext .= '<li>'.&mt('E-mail address(es) in LON-CAPA used for verification will include: [_1]',join(', ',map { $titles{$_}; } @{$staticdefaults{'resetemail'}})).'</li>'; |
} |
} |
} else { |
} else { |
$resulttext .= '<li>'.&mt('E-mail address(es) in LON-CAPA usedfor verification will include: [_1]',join(', ',map { $titles{$_}; } @{$staticdefaults{'resetemail'}})).'</li>'; |
$resulttext .= '<li>'.&mt('E-mail address(es) in LON-CAPA used for verification will include: [_1]',join(', ',map { $titles{$_}; } @{$staticdefaults{'resetemail'}})).'</li>'; |
} |
} |
if ($confighash{'passwords'}{'resetremove'}) { |
if ($confighash{'passwords'}{'resetremove'}) { |
$resulttext .= '<li>'.&mt('Preamble to "Forgot Password" web form not shown').'</li>'; |
$resulttext .= '<li>'.&mt('Preamble to "Forgot Password" web form not shown').'</li>'; |
Line 10925 sub modify_passwords {
|
Line 11598 sub modify_passwords {
|
} |
} |
if ($confighash{'passwords'}{'resetcustom'}) { |
if ($confighash{'passwords'}{'resetcustom'}) { |
my $customlink = &Apache::loncommon::modal_link($confighash{'passwords'}{'resetcustom'}, |
my $customlink = &Apache::loncommon::modal_link($confighash{'passwords'}{'resetcustom'}, |
$titles{custom},600,500); |
&mt('custom text'),600,500,undef,undef, |
$resulttext .= '<li>'.&mt('Preamble to "Forgot Password" form includes [_1]',$customlink).'</li>'; |
undef,undef,'background-color:#ffffff'); |
|
$resulttext .= '<li>'.&mt('Preamble to "Forgot Password" form includes: [_1]',$customlink).'</li>'; |
} else { |
} else { |
$resulttext .= '<li>'.&mt('No custom text included in preamble to "Forgot Password" form').'</li>'; |
$resulttext .= '<li>'.&mt('No custom text included in preamble to "Forgot Password" form').'</li>'; |
} |
} |
Line 10963 sub modify_passwords {
|
Line 11637 sub modify_passwords {
|
if ($confighash{'passwords'}{$rule} eq '') { |
if ($confighash{'passwords'}{$rule} eq '') { |
if ($rule eq 'min') { |
if ($rule eq 'min') { |
$resulttext .= '<li>'.&mt('[_1] not set.',$titles{$rule}); |
$resulttext .= '<li>'.&mt('[_1] not set.',$titles{$rule}); |
' '.&mt('Default of 7 will be used').'</li>'; |
' '.&mt('Default of [_1] will be used', |
|
$Apache::lonnet::passwdmin).'</li>'; |
} else { |
} else { |
$resulttext .= '<li>'.&mt('[_1] set to none',$titles{$rule}).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to none',$titles{$rule}).'</li>'; |
} |
} |
Line 10971 sub modify_passwords {
|
Line 11646 sub modify_passwords {
|
$resulttext .= '<li>'.&mt('[_1] set to [_2]',$titles{$rule},$confighash{'passwords'}{$rule}).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to [_2]',$titles{$rule},$confighash{'passwords'}{$rule}).'</li>'; |
} |
} |
} |
} |
|
if (ref($confighash{'passwords'}{'chars'}) eq 'ARRAY') { |
|
if (@{$confighash{'passwords'}{'chars'}} > 0) { |
|
my %rulenames = &Apache::lonlocal::texthash( |
|
uc => 'At least one upper case letter', |
|
lc => 'At least one lower case letter', |
|
num => 'At least one number', |
|
spec => 'At least one non-alphanumeric', |
|
); |
|
my $needed = '<ul><li>'. |
|
join('</li><li>',map {$rulenames{$_} } @{$confighash{'passwords'}{'chars'}}). |
|
'</li></ul>'; |
|
$resulttext .= '<li>'.&mt('[_1] set to: [_2]',$titles{'chars'},$needed).'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('[_1] set to none',$titles{'chars'}).'</li>'; |
|
} |
|
} else { |
|
$resulttext .= '<li>'.&mt('[_1] set to none',$titles{'chars'}).'</li>'; |
|
} |
} elsif ($key eq 'crsownerchg') { |
} elsif ($key eq 'crsownerchg') { |
if (ref($confighash{'passwords'}{'crsownerchg'}) eq 'HASH') { |
if (ref($confighash{'passwords'}{'crsownerchg'}) eq 'HASH') { |
if ((@{$confighash{'passwords'}{'crsownerchg'}{'by'}} == 0) || |
if ((@{$confighash{'passwords'}{'crsownerchg'}{'by'}} == 0) || |
Line 12111 sub modify_selfcreation {
|
Line 12804 sub modify_selfcreation {
|
} |
} |
|
|
sub process_captcha { |
sub process_captcha { |
my ($container,$changes,$newsettings,$current) = @_; |
my ($container,$changes,$newsettings,$currsettings) = @_; |
return unless ((ref($changes) eq 'HASH') && (ref($newsettings) eq 'HASH') || (ref($current) eq 'HASH')); |
return unless ((ref($changes) eq 'HASH') && (ref($newsettings) eq 'HASH')); |
$newsettings->{'captcha'} = $env{'form.'.$container.'_captcha'}; |
$newsettings->{'captcha'} = $env{'form.'.$container.'_captcha'}; |
unless ($newsettings->{'captcha'} eq 'recaptcha' || $newsettings->{'captcha'} eq 'notused') { |
unless ($newsettings->{'captcha'} eq 'recaptcha' || $newsettings->{'captcha'} eq 'notused') { |
$newsettings->{'captcha'} = 'original'; |
$newsettings->{'captcha'} = 'original'; |
} |
} |
if ($current->{'captcha'} ne $newsettings->{'captcha'}) { |
my %current; |
|
if (ref($currsettings) eq 'HASH') { |
|
%current = %{$currsettings}; |
|
} |
|
if ($current{'captcha'} ne $newsettings->{'captcha'}) { |
if ($container eq 'cancreate') { |
if ($container eq 'cancreate') { |
if (ref($changes->{'cancreate'}) eq 'ARRAY') { |
if (ref($changes->{'cancreate'}) eq 'ARRAY') { |
push(@{$changes->{'cancreate'}},'captcha'); |
push(@{$changes->{'cancreate'}},'captcha'); |
} elsif (!defined($changes->{'cancreate'})) { |
} elsif (!defined($changes->{'cancreate'})) { |
$changes->{'cancreate'} = ['captcha']; |
$changes->{'cancreate'} = ['captcha']; |
} |
} |
|
} elsif ($container eq 'passwords') { |
|
$changes->{'reset'} = 1; |
} else { |
} else { |
$changes->{'captcha'} = 1; |
$changes->{'captcha'} = 1; |
} |
} |
Line 12145 sub process_captcha {
|
Line 12844 sub process_captcha {
|
} |
} |
$newsettings->{'recaptchaversion'} = $newversion; |
$newsettings->{'recaptchaversion'} = $newversion; |
} |
} |
if (ref($current->{'recaptchakeys'}) eq 'HASH') { |
if (ref($current{'recaptchakeys'}) eq 'HASH') { |
$currpub = $current->{'recaptchakeys'}{'public'}; |
$currpub = $current{'recaptchakeys'}{'public'}; |
$currpriv = $current->{'recaptchakeys'}{'private'}; |
$currpriv = $current{'recaptchakeys'}{'private'}; |
unless ($newsettings->{'captcha'} eq 'recaptcha') { |
unless ($newsettings->{'captcha'} eq 'recaptcha') { |
$newsettings->{'recaptchakeys'} = { |
$newsettings->{'recaptchakeys'} = { |
public => '', |
public => '', |
Line 12155 sub process_captcha {
|
Line 12854 sub process_captcha {
|
} |
} |
} |
} |
} |
} |
if ($current->{'captcha'} eq 'recaptcha') { |
if ($current{'captcha'} eq 'recaptcha') { |
$currversion = $current->{'recaptchaversion'}; |
$currversion = $current{'recaptchaversion'}; |
if ($currversion ne '2') { |
if ($currversion ne '2') { |
$currversion = 1; |
$currversion = 1; |
} |
} |
Line 12168 sub process_captcha {
|
Line 12867 sub process_captcha {
|
} elsif (!defined($changes->{'cancreate'})) { |
} elsif (!defined($changes->{'cancreate'})) { |
$changes->{'cancreate'} = ['recaptchaversion']; |
$changes->{'cancreate'} = ['recaptchaversion']; |
} |
} |
|
} elsif ($container eq 'passwords') { |
|
$changes->{'reset'} = 1; |
} else { |
} else { |
$changes->{'recaptchaversion'} = 1; |
$changes->{'recaptchaversion'} = 1; |
} |
} |
Line 12179 sub process_captcha {
|
Line 12880 sub process_captcha {
|
} elsif (!defined($changes->{'cancreate'})) { |
} elsif (!defined($changes->{'cancreate'})) { |
$changes->{'cancreate'} = ['recaptchakeys']; |
$changes->{'cancreate'} = ['recaptchakeys']; |
} |
} |
|
} elsif ($container eq 'passwords') { |
|
$changes->{'reset'} = 1; |
} else { |
} else { |
$changes->{'recaptchakeys'} = 1; |
$changes->{'recaptchakeys'} = 1; |
} |
} |
Line 14219 sub modify_usersessions {
|
Line 14922 sub modify_usersessions {
|
} |
} |
} |
} |
$defaultshash{'usersessions'}{'offloadnow'} = {}; |
$defaultshash{'usersessions'}{'offloadnow'} = {}; |
|
$defaultshash{'usersessions'}{'offloadoth'} = {}; |
my @offloadnow = &Apache::loncommon::get_env_multiple('form.offloadnow'); |
my @offloadnow = &Apache::loncommon::get_env_multiple('form.offloadnow'); |
my @okoffload; |
my @okoffload; |
if (@offloadnow) { |
if (@offloadnow) { |
Line 14235 sub modify_usersessions {
|
Line 14939 sub modify_usersessions {
|
} |
} |
} |
} |
} |
} |
|
my @offloadoth = &Apache::loncommon::get_env_multiple('form.offloadoth'); |
|
my @okoffloadoth; |
|
if (@offloadoth) { |
|
foreach my $server (@offloadoth) { |
|
if (&Apache::lonnet::hostname($server) ne '') { |
|
unless (grep(/^\Q$server\E$/,@okoffloadoth)) { |
|
push(@okoffloadoth,$server); |
|
} |
|
} |
|
} |
|
if (@okoffloadoth) { |
|
foreach my $lonhost (@okoffloadoth) { |
|
$defaultshash{'usersessions'}{'offloadoth'}{$lonhost} = 1; |
|
} |
|
} |
|
} |
if (ref($domconfig{'usersessions'}) eq 'HASH') { |
if (ref($domconfig{'usersessions'}) eq 'HASH') { |
if (ref($domconfig{'usersessions'}{'spares'}) eq 'HASH') { |
if (ref($domconfig{'usersessions'}{'spares'}) eq 'HASH') { |
if (ref($changes{'spares'}) eq 'HASH') { |
if (ref($changes{'spares'}) eq 'HASH') { |
Line 14245 sub modify_usersessions {
|
Line 14965 sub modify_usersessions {
|
} else { |
} else { |
$savespares = 1; |
$savespares = 1; |
} |
} |
if (ref($domconfig{'usersessions'}{'offloadnow'}) eq 'HASH') { |
foreach my $offload ('offloadnow','offloadoth') { |
foreach my $lonhost (keys(%{$domconfig{'usersessions'}{'offloadnow'}})) { |
if (ref($domconfig{'usersessions'}{$offload}) eq 'HASH') { |
unless ($defaultshash{'usersessions'}{'offloadnow'}{$lonhost}) { |
foreach my $lonhost (keys(%{$domconfig{'usersessions'}{$offload}})) { |
$changes{'offloadnow'} = 1; |
unless ($defaultshash{'usersessions'}{$offload}{$lonhost}) { |
last; |
$changes{$offload} = 1; |
} |
|
} |
|
unless ($changes{'offloadnow'}) { |
|
foreach my $lonhost (keys(%{$defaultshash{'usersessions'}{'offloadnow'}})) { |
|
unless ($domconfig{'usersessions'}{'offloadnow'}{$lonhost}) { |
|
$changes{'offloadnow'} = 1; |
|
last; |
last; |
} |
} |
} |
} |
|
unless ($changes{$offload}) { |
|
foreach my $lonhost (keys(%{$defaultshash{'usersessions'}{$offload}})) { |
|
unless ($domconfig{'usersessions'}{$offload}{$lonhost}) { |
|
$changes{$offload} = 1; |
|
last; |
|
} |
|
} |
|
} |
|
} else { |
|
if (($offload eq 'offloadnow') && (@okoffload)) { |
|
$changes{'offloadnow'} = 1; |
|
} |
|
if (($offload eq 'offloadoth') && (@okoffloadoth)) { |
|
$changes{'offloadoth'} = 1; |
|
} |
} |
} |
} elsif (@okoffload) { |
} |
|
} else { |
|
if (@okoffload) { |
$changes{'offloadnow'} = 1; |
$changes{'offloadnow'} = 1; |
} |
} |
} elsif (@okoffload) { |
if (@okoffloadoth) { |
$changes{'offloadnow'} = 1; |
$changes{'offloadoth'} = 1; |
|
} |
} |
} |
my $nochgmsg = &mt('No changes made to settings for user session hosting/offloading.'); |
my $nochgmsg = &mt('No changes made to settings for user session hosting/offloading.'); |
if ((keys(%changes) > 0) || ($savespares)) { |
if ((keys(%changes) > 0) || ($savespares)) { |
Line 14281 sub modify_usersessions {
|
Line 15013 sub modify_usersessions {
|
if (ref($defaultshash{'usersessions'}{'offloadnow'}) eq 'HASH') { |
if (ref($defaultshash{'usersessions'}{'offloadnow'}) eq 'HASH') { |
$domdefaults{'offloadnow'} = $defaultshash{'usersessions'}{'offloadnow'}; |
$domdefaults{'offloadnow'} = $defaultshash{'usersessions'}{'offloadnow'}; |
} |
} |
|
if (ref($defaultshash{'usersessions'}{'offloadoth'}) eq 'HASH') { |
|
$domdefaults{'offloadoth'} = $defaultshash{'usersessions'}{'offloadoth'}; |
|
} |
} |
} |
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
Line 14354 sub modify_usersessions {
|
Line 15089 sub modify_usersessions {
|
if ($changes{'offloadnow'}) { |
if ($changes{'offloadnow'}) { |
if (ref($defaultshash{'usersessions'}{'offloadnow'}) eq 'HASH') { |
if (ref($defaultshash{'usersessions'}{'offloadnow'}) eq 'HASH') { |
if (keys(%{$defaultshash{'usersessions'}{'offloadnow'}}) > 0) { |
if (keys(%{$defaultshash{'usersessions'}{'offloadnow'}}) > 0) { |
$resulttext .= '<li>'.&mt('Switch active users on next access, for server(s):').'<ul>'; |
$resulttext .= '<li>'.&mt('Switch any active user on next access, for server(s):').'<ul>'; |
foreach my $lonhost (sort(keys(%{$defaultshash{'usersessions'}{'offloadnow'}}))) { |
foreach my $lonhost (sort(keys(%{$defaultshash{'usersessions'}{'offloadnow'}}))) { |
$resulttext .= '<li>'.$lonhost.'</li>'; |
$resulttext .= '<li>'.$lonhost.'</li>'; |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
} else { |
} else { |
$resulttext .= '<li>'.&mt('No servers now set to switch active users on next access.'); |
$resulttext .= '<li>'.&mt('No servers now set to switch any active user on next access.'); |
} |
} |
} else { |
} else { |
$resulttext .= '<li>'.&mt('No servers now set to switch active users on next access.').'</li>'; |
$resulttext .= '<li>'.&mt('No servers now set to switch any active user on next access.').'</li>'; |
|
} |
|
} |
|
if ($changes{'offloadoth'}) { |
|
if (ref($defaultshash{'usersessions'}{'offloadoth'}) eq 'HASH') { |
|
if (keys(%{$defaultshash{'usersessions'}{'offloadoth'}}) > 0) { |
|
$resulttext .= '<li>'.&mt('Switch other institutions on next access, for server(s):').'<ul>'; |
|
foreach my $lonhost (sort(keys(%{$defaultshash{'usersessions'}{'offloadoth'}}))) { |
|
$resulttext .= '<li>'.$lonhost.'</li>'; |
|
} |
|
$resulttext .= '</ul>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('No servers now set to switch other institutions on next access.'); |
|
} |
|
} else { |
|
$resulttext .= '<li>'.&mt('No servers now set to switch other institutions on next access.').'</li>'; |
} |
} |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
Line 14617 sub modify_loadbalancing {
|
Line 15367 sub modify_loadbalancing {
|
$resulttext .= '<li>'.&mt('Load Balancer: [_1] -- cookie use enabled', |
$resulttext .= '<li>'.&mt('Load Balancer: [_1] -- cookie use enabled', |
$balancer).'</li>'; |
$balancer).'</li>'; |
} |
} |
if (keys(%toupdate)) { |
} |
my %thismachine; |
} |
my $updatedhere; |
if (keys(%toupdate)) { |
my $cachetime = 60*60*24; |
my %thismachine; |
map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids(); |
my $updatedhere; |
foreach my $lonhost (keys(%toupdate)) { |
my $cachetime = 60*60*24; |
if ($thismachine{$lonhost}) { |
map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids(); |
unless ($updatedhere) { |
foreach my $lonhost (keys(%toupdate)) { |
&Apache::lonnet::do_cache_new('loadbalancing',$dom, |
if ($thismachine{$lonhost}) { |
$defaultshash{'loadbalancing'}, |
unless ($updatedhere) { |
$cachetime); |
&Apache::lonnet::do_cache_new('loadbalancing',$dom, |
$updatedhere = 1; |
$defaultshash{'loadbalancing'}, |
} |
$cachetime); |
} else { |
$updatedhere = 1; |
my $cachekey = &escape('loadbalancing').':'.&escape($dom); |
|
&Apache::lonnet::remote_devalidate_cache($lonhost,[$cachekey]); |
|
} |
|
} |
} |
|
} else { |
|
my $cachekey = &escape('loadbalancing').':'.&escape($dom); |
|
&Apache::lonnet::remote_devalidate_cache($lonhost,[$cachekey]); |
} |
} |
} |
} |
} |
} |