version 1.274, 2016/07/24 14:34:59
|
version 1.275, 2016/07/25 19:50:30
|
Line 169 use Apache::loncoursequeueadmin();
|
Line 169 use Apache::loncoursequeueadmin();
|
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA::Enrollment; |
use LONCAPA::Enrollment; |
use LONCAPA::lonauthcgi(); |
use LONCAPA::lonauthcgi(); |
|
use LONCAPA::SSL; |
use File::Copy; |
use File::Copy; |
use Locale::Language; |
use Locale::Language; |
use DateTime::TimeZone; |
use DateTime::TimeZone; |
Line 217 sub handler {
|
Line 218 sub handler {
|
'serverstatuses','requestcourses','helpsettings', |
'serverstatuses','requestcourses','helpsettings', |
'coursedefaults','usersessions','loadbalancing', |
'coursedefaults','usersessions','loadbalancing', |
'requestauthor','selfenrollment','inststatus', |
'requestauthor','selfenrollment','inststatus', |
'ltitools'],$dom); |
'ltitools','ssl'],$dom); |
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', |
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', |
'autoupdate','autocreate','directorysrch','contacts', |
'autoupdate','autocreate','directorysrch','contacts', |
'usercreation','selfcreation','usermodification','scantron', |
'usercreation','selfcreation','usermodification','scantron', |
'requestcourses','requestauthor','coursecategories', |
'requestcourses','requestauthor','coursecategories', |
'serverstatuses','helpsettings','coursedefaults', |
'serverstatuses','helpsettings','coursedefaults', |
'ltitools','selfenrollment','usersessions'); |
'ltitools','selfenrollment','usersessions','ssl'); |
my %existing; |
my %existing; |
if (ref($domconfig{'loadbalancing'}) eq 'HASH') { |
if (ref($domconfig{'loadbalancing'}) eq 'HASH') { |
%existing = %{$domconfig{'loadbalancing'}}; |
%existing = %{$domconfig{'loadbalancing'}}; |
Line 482 sub handler {
|
Line 483 sub handler {
|
print => \&print_ltitools, |
print => \&print_ltitools, |
modify => \&modify_ltitools, |
modify => \&modify_ltitools, |
}, |
}, |
|
'ssl' => |
|
{text => 'LON-CAPA Network (SSL)', |
|
help => 'Domain_Configuration_Network_SSL', |
|
header => [{col1 => 'Server', |
|
col2 => 'Certificate Status'}, |
|
{col1 => 'Connections to other servers', |
|
col2 => 'Rules'}, |
|
{col1 => "Replicating domain's published content", |
|
col2 => 'Rules'}], |
|
print => \&print_ssl, |
|
modify => \&modify_ssl, |
|
}, |
); |
); |
if (keys(%servers) > 1) { |
if (keys(%servers) > 1) { |
$prefs{'login'} = { text => 'Log-in page options', |
$prefs{'login'} = { text => 'Log-in page options', |
Line 658 sub process_changes {
|
Line 670 sub process_changes {
|
$output = &modify_loadbalancing($dom,%domconfig); |
$output = &modify_loadbalancing($dom,%domconfig); |
} elsif ($action eq 'ltitools') { |
} elsif ($action eq 'ltitools') { |
$output = &modify_ltitools($r,$dom,$action,$lastactref,%domconfig); |
$output = &modify_ltitools($r,$dom,$action,$lastactref,%domconfig); |
|
} elsif ($action eq 'ssl') { |
|
$output = &modify_ssl($dom,$lastactref,%domconfig); |
} |
} |
return $output; |
return $output; |
} |
} |
Line 704 sub print_config_box {
|
Line 718 sub print_config_box {
|
$rowtotal ++; |
$rowtotal ++; |
if (($action eq 'autoupdate') || ($action eq 'usercreation') || ($action eq 'selfcreation') || |
if (($action eq 'autoupdate') || ($action eq 'usercreation') || ($action eq 'selfcreation') || |
($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 'selfenrollment') || ($action eq 'usersessions') || ($action eq 'ssl')) { |
$output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'coursecategories') { |
} elsif ($action eq 'coursecategories') { |
$output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal); |
$output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal); |
Line 734 sub print_config_box {
|
Line 748 sub print_config_box {
|
$rowtotal ++; |
$rowtotal ++; |
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 'ssl')) { |
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 3795 sub print_validation_rows {
|
Line 3810 sub print_validation_rows {
|
sub print_usersessions { |
sub print_usersessions { |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($css_class,$datatable,%checked,%choices); |
my ($css_class,$datatable,%checked,%choices); |
my (%by_ip,%by_location,@intdoms); |
my (%by_ip,%by_location,@intdoms,@instdoms); |
&build_location_hashes(\@intdoms,\%by_ip,\%by_location); |
&build_location_hashes(\@intdoms,\%by_ip,\%by_location,\@instdoms); |
|
|
my @alldoms = &Apache::lonnet::all_domains(); |
my @alldoms = &Apache::lonnet::all_domains(); |
my %serverhomes = %Apache::lonnet::serverhomeIDs; |
my %serverhomes = %Apache::lonnet::serverhomeIDs; |
Line 3934 sub print_usersessions {
|
Line 3949 sub print_usersessions {
|
return $datatable; |
return $datatable; |
} |
} |
|
|
|
sub print_ssl { |
|
my ($position,$dom,$settings,$rowtotal) = @_; |
|
my ($css_class,$datatable); |
|
my $lonhost = ''; |
|
my $itemcount = 1; |
|
if ($position eq 'top') { |
|
my %domservers = &Apache::lonnet::get_servers($dom); |
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
|
$datatable .= '<tr'.$css_class.'><td colspan="2">'. |
|
&LONCAPA::SSL::print_certstatus(\%domservers,'web','domprefs'). |
|
'</td></tr>'; |
|
$itemcount ++; |
|
} else { |
|
my %titles = &ssl_titles(); |
|
my (%by_ip,%by_location,@intdoms,@instdoms); |
|
&build_location_hashes(\@intdoms,\%by_ip,\%by_location,\@instdoms); |
|
my @alldoms = &Apache::lonnet::all_domains(); |
|
my %serverhomes = %Apache::lonnet::serverhomeIDs; |
|
my @domservers = &Apache::lonnet::get_servers($dom); |
|
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
|
my %altids = &id_for_thisdom(%servers); |
|
if ($position eq 'middle') { |
|
foreach my $type ('dom','intdom','other') { |
|
my %checked; |
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
|
$datatable .= '<tr'.$css_class.'><td>'.$titles{$type}.'</td>'. |
|
'<td class="LC_right_item">'; |
|
my $skip; |
|
if ($type eq 'dom') { |
|
unless (keys(%servers) > 1) { |
|
$datatable .= &mt('Nothing to set here, as there are no other servers/VMs'); |
|
$skip = 1; |
|
} |
|
} |
|
if ($type eq 'intdom') { |
|
unless (@instdoms > 1) { |
|
$datatable .= &mt('Nothing to set here, as there are no other domains for this institution'); |
|
$skip = 1; |
|
} |
|
} elsif ($type eq 'other') { |
|
if (keys(%by_location) == 0) { |
|
$datatable .= &mt('Nothing to set here, as there are no other institutions'); |
|
$skip = 1; |
|
} |
|
} |
|
unless ($skip) { |
|
$checked{'yes'} = ' checked="checked"'; |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{'connect'}) eq 'HASH') { |
|
if ($settings->{'connect'}->{$type} =~ /^(no|req)$/) { |
|
$checked{$1} = $checked{'yes'}; |
|
delete($checked{'yes'}); |
|
} |
|
} |
|
} |
|
foreach my $option ('no','yes','req') { |
|
$datatable .= '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="connect_'.$type.'" '. |
|
'value="'.$option.'"'.$checked{$option}.' />'.$titles{$option}. |
|
'</label></span>'.(' 'x2); |
|
} |
|
} |
|
$datatable .= '</td></tr>'; |
|
$itemcount ++; |
|
} |
|
} else { |
|
my $numinrow = 5; |
|
my $prefix = 'replication'; |
|
my @types = ('certreq','nocertreq'); |
|
my (%current,%checkedon,%checkedoff); |
|
my @locations = sort(keys(%by_location)); |
|
foreach my $type (@types) { |
|
$checkedon{$type} = ''; |
|
$checkedoff{$type} = ' checked="checked"'; |
|
} |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{$prefix}) eq 'HASH') { |
|
foreach my $key (keys(%{$settings->{$prefix}})) { |
|
$current{$key} = $settings->{$prefix}{$key}; |
|
if (ref($current{$key}) eq 'ARRAY') { |
|
$checkedon{$key} = ' checked="checked"'; |
|
$checkedoff{$key} = ''; |
|
} |
|
} |
|
} |
|
} |
|
if (@locations > 0) { |
|
foreach my $type (@types) { |
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
|
$datatable .= '<tr'.$css_class.'> |
|
<td><span class="LC_nobreak LC_right_item">'.$titles{$type}.'</span><br /> |
|
<span class="LC_nobreak"> |
|
<label><input type="radio" name="'.$prefix.'_'.$type.'_inuse" '.$checkedoff{$type}.' value="0" />'.&mt('Not in use').'</label> |
|
<label><input type="radio" name="'.$prefix.'_'.$type.'_inuse" '.$checkedon{$type}.' value="1" />'.&mt('In use').'</label></span></td><td> |
|
<div><input type="button" value="'.&mt('check all').'" '. |
|
'onclick="javascript:checkAll(document.display.'.$prefix.'_'.$type.')"'. |
|
' />'.(' 'x2)."\n". |
|
'<input type="button" value="'.&mt('uncheck all').'" '. |
|
'onclick="javascript:uncheckAll(document.display.'.$prefix.'_'.$type.')" />'. |
|
"\n". |
|
'</div><div><table>'; |
|
my $rem; |
|
for (my $i=0; $i<@locations; $i++) { |
|
my ($showloc,$value,$checkedtype); |
|
if (ref($by_location{$locations[$i]}) eq 'ARRAY') { |
|
my $ip = $by_location{$locations[$i]}->[0]; |
|
if (ref($by_ip{$ip}) eq 'ARRAY') { |
|
$value = join(':',@{$by_ip{$ip}}); |
|
$showloc = join(', ',@{$by_ip{$ip}}); |
|
if (ref($current{$type}) eq 'ARRAY') { |
|
foreach my $loc (@{$by_ip{$ip}}) { |
|
if (grep(/^\Q$loc\E$/,@{$current{$type}})) { |
|
$checkedtype = ' checked="checked"'; |
|
last; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
$rem = $i%($numinrow); |
|
if ($rem == 0) { |
|
if ($i > 0) { |
|
$datatable .= '</tr>'; |
|
} |
|
$datatable .= '<tr>'; |
|
} |
|
$datatable .= '<td class="LC_left_item">'. |
|
'<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="'.$prefix.'_'.$type. |
|
'" value="'.$value.'"'.$checkedtype.' />'.$showloc. |
|
'</label></span></td>'; |
|
} |
|
$rem = @locations%($numinrow); |
|
my $colsleft = $numinrow - $rem; |
|
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>'; |
|
$itemcount ++; |
|
} |
|
} else { |
|
$datatable .= '<tr'.$css_class.'><td>'.&mt('Nothing to set here, as there are no other institutions').'</td></tr>'; |
|
$itemcount ++; |
|
} |
|
} |
|
} |
|
$$rowtotal += $itemcount; |
|
return $datatable; |
|
} |
|
|
|
sub ssl_titles { |
|
return &Apache::lonlocal::texthash ( |
|
dom => 'LON-CAPA servers/VMs from same domain', |
|
intdom => 'LON-CAPA servers/VMs from same "internet" domain', |
|
other => 'External LON-CAPA servers/VMs', |
|
connect => 'Connections to other servers', |
|
replication => 'Replicating content to other institutions', |
|
certreq => 'Client certificate required, but specific domains exempt', |
|
nocertreq => 'No client certificate required, except for specific domains', |
|
no => 'SSL not used', |
|
yes => 'SSL Optional (used if available)', |
|
req => 'SSL Required', |
|
); |
|
} |
|
|
sub build_location_hashes { |
sub build_location_hashes { |
my ($intdoms,$by_ip,$by_location) = @_; |
my ($intdoms,$by_ip,$by_location,$instdoms) = @_; |
return unless((ref($intdoms) eq 'ARRAY') && (ref($by_ip) eq 'HASH') && |
return unless((ref($intdoms) eq 'ARRAY') && (ref($by_ip) eq 'HASH') && |
(ref($by_location) eq 'HASH')); |
(ref($by_location) eq 'HASH') && (ref($instdoms) eq 'ARRAY')); |
my %iphost = &Apache::lonnet::get_iphost(); |
my %iphost = &Apache::lonnet::get_iphost(); |
my $primary_id = &Apache::lonnet::domain($env{'request.role.domain'},'primary'); |
my $primary_id = &Apache::lonnet::domain($env{'request.role.domain'},'primary'); |
my $primary_ip = &Apache::lonnet::get_host_ip($primary_id); |
my $primary_ip = &Apache::lonnet::get_host_ip($primary_id); |
Line 3954 sub build_location_hashes {
|
Line 4137 sub build_location_hashes {
|
foreach my $id (@{$iphost{$ip}}) { |
foreach my $id (@{$iphost{$ip}}) { |
my $location = &Apache::lonnet::internet_dom($id); |
my $location = &Apache::lonnet::internet_dom($id); |
if ($location) { |
if ($location) { |
next if (grep(/^\Q$location\E$/,@{$intdoms})); |
if (grep(/^\Q$location\E$/,@{$intdoms})) { |
|
my $dom = &Apache::lonnet::host_domain($id); |
|
unless (grep(/^\Q$dom\E/,@{$instdoms})) { |
|
push(@{$instdoms},$dom); |
|
} |
|
next; |
|
} |
if (ref($by_ip->{$ip}) eq 'ARRAY') { |
if (ref($by_ip->{$ip}) eq 'ARRAY') { |
unless(grep(/^\Q$location\E$/,@{$by_ip->{$ip}})) { |
unless(grep(/^\Q$location\E$/,@{$by_ip->{$ip}})) { |
push(@{$by_ip->{$ip}},$location); |
push(@{$by_ip->{$ip}},$location); |
Line 5872 sub print_serverstatuses {
|
Line 6061 sub print_serverstatuses {
|
|
|
sub serverstatus_pages { |
sub serverstatus_pages { |
return ('userstatus','lonstatus','loncron','server-status','codeversions', |
return ('userstatus','lonstatus','loncron','server-status','codeversions', |
'checksums','clusterstatus','metadata_keywords','metadata_harvest', |
'checksums','clusterstatus','certstatus','metadata_keywords', |
'takeoffline','takeonline','showenv','toggledebug','ping','domconf', |
'metadata_harvest','takeoffline','takeonline','showenv','toggledebug', |
'uniquecodes','diskusage','coursecatalog'); |
'ping','domconf','uniquecodes','diskusage','coursecatalog'); |
} |
} |
|
|
sub defaults_javascript { |
sub defaults_javascript { |
Line 12040 sub modify_usersessions {
|
Line 12229 sub modify_usersessions {
|
); |
); |
my @prefixes = ('remote','hosted','spares'); |
my @prefixes = ('remote','hosted','spares'); |
my @lcversions = &Apache::lonnet::all_loncaparevs(); |
my @lcversions = &Apache::lonnet::all_loncaparevs(); |
my (%by_ip,%by_location,@intdoms); |
my (%by_ip,%by_location,@intdoms,@instdoms); |
&build_location_hashes(\@intdoms,\%by_ip,\%by_location); |
&build_location_hashes(\@intdoms,\%by_ip,\%by_location,\@instdoms); |
my @locations = sort(keys(%by_location)); |
my @locations = sort(keys(%by_location)); |
my (%defaultshash,%changes); |
my (%defaultshash,%changes); |
foreach my $prefix (@prefixes) { |
foreach my $prefix (@prefixes) { |
Line 12345 sub modify_usersessions {
|
Line 12534 sub modify_usersessions {
|
} else { |
} else { |
$resulttext = $nochgmsg; |
$resulttext = $nochgmsg; |
} |
} |
|
} else { |
|
$resulttext = '<span class="LC_error">'. |
|
&mt('An error occurred: [_1]',$putresult).'</span>'; |
|
} |
|
} else { |
|
$resulttext = $nochgmsg; |
|
} |
|
return $resulttext; |
|
} |
|
|
|
sub modify_ssl { |
|
my ($dom,$lastactref,%domconfig) = @_; |
|
my (%by_ip,%by_location,@intdoms,@instdoms); |
|
&build_location_hashes(\@intdoms,\%by_ip,\%by_location,\@instdoms); |
|
my @locations = sort(keys(%by_location)); |
|
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
|
my (%defaultshash,%changes); |
|
my $action = 'ssl'; |
|
my @prefixes = ('connect','replication'); |
|
foreach my $prefix (@prefixes) { |
|
$defaultshash{$action}{$prefix} = {}; |
|
} |
|
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
|
my $resulttext; |
|
my %iphost = &Apache::lonnet::get_iphost(); |
|
my @reptypes = ('certreq','nocertreq'); |
|
my @connecttypes = ('dom','intdom','other'); |
|
my %types = ( |
|
connect => \@connecttypes, |
|
replication => \@reptypes, |
|
); |
|
my $action = 'ssl'; |
|
foreach my $prefix (sort(keys(%types))) { |
|
foreach my $type (@{$types{$prefix}}) { |
|
if ($prefix eq 'connect') { |
|
my $value = 'yes'; |
|
if ($env{'form.'.$prefix.'_'.$type} =~ /^(no|req)$/) { |
|
$value = $env{'form.'.$prefix.'_'.$type}; |
|
} |
|
if (ref($domconfig{$action}{$prefix}) eq 'HASH') { |
|
if ($domconfig{$action}{$prefix}{$type} ne '') { |
|
if ($value ne $domconfig{$action}{$prefix}{$type}) { |
|
$changes{$prefix}{$type} = 1; |
|
} |
|
$defaultshash{$action}{$prefix}{$type} = $value; |
|
} else { |
|
$defaultshash{$action}{$prefix}{$type} = $value; |
|
$changes{$prefix}{$type} = 1; |
|
} |
|
} else { |
|
$defaultshash{$action}{$prefix}{$type} = $value; |
|
$changes{$prefix}{$type} = 1; |
|
} |
|
if (($type eq 'dom') && (keys(%servers) == 1)) { |
|
delete($changes{$prefix}{$type}); |
|
} elsif (($type eq 'intdom') && (@instdoms == 1)) { |
|
delete($changes{$prefix}{$type}); |
|
} elsif (($type eq 'other') && (keys(%by_location) == 0)) { |
|
delete($changes{$prefix}{$type}); |
|
} |
|
} elsif ($prefix eq 'replication') { |
|
if (@locations > 0) { |
|
my $inuse = $env{'form.'.$prefix.'_'.$type.'_inuse'}; |
|
my @vals = &Apache::loncommon::get_env_multiple('form.'.$prefix.'_'.$type); |
|
my @okvals; |
|
foreach my $val (@vals) { |
|
if ($val =~ /:/) { |
|
my @items = split(/:/,$val); |
|
foreach my $item (@items) { |
|
if (ref($by_location{$item}) eq 'ARRAY') { |
|
push(@okvals,$item); |
|
} |
|
} |
|
} else { |
|
if (ref($by_location{$val}) eq 'ARRAY') { |
|
push(@okvals,$val); |
|
} |
|
} |
|
} |
|
@okvals = sort(@okvals); |
|
if (ref($domconfig{$action}) eq 'HASH') { |
|
if (ref($domconfig{$action}{$prefix}) eq 'HASH') { |
|
if (ref($domconfig{$action}{$prefix}{$type}) eq 'ARRAY') { |
|
if ($inuse == 0) { |
|
$changes{$prefix}{$type} = 1; |
|
} else { |
|
$defaultshash{$action}{$prefix}{$type} = \@okvals; |
|
my @changed = &Apache::loncommon::compare_arrays($domconfig{$action}{$prefix}{$type},$defaultshash{$action}{$prefix}{$type}); |
|
if (@changed > 0) { |
|
$changes{$prefix}{$type} = 1; |
|
} |
|
} |
|
} else { |
|
if ($inuse == 1) { |
|
$defaultshash{$action}{$prefix}{$type} = \@okvals; |
|
$changes{$prefix}{$type} = 1; |
|
} |
|
} |
|
} else { |
|
if ($inuse == 1) { |
|
$defaultshash{$action}{$prefix}{$type} = \@okvals; |
|
$changes{$prefix}{$type} = 1; |
|
} |
|
} |
|
} else { |
|
if ($inuse == 1) { |
|
$defaultshash{$action}{$prefix}{$type} = \@okvals; |
|
$changes{$prefix}{$type} = 1; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
my $nochgmsg = &mt('No changes made to LON-CAPA SSL settings'); |
|
if (keys(%changes) > 0) { |
|
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
|
$dom); |
|
if ($putresult eq 'ok') { |
|
if (ref($defaultshash{$action}) eq 'HASH') { |
|
if (ref($defaultshash{$action}{'replication'}) eq 'HASH') { |
|
$domdefaults{'replication'} = $defaultshash{$action}{'replication'}; |
|
} |
|
if (ref($defaultshash{$action}{'connect'}) eq 'HASH') { |
|
$domdefaults{'connect'} = $domconfig{$action}{'connect'}; |
|
} |
|
} |
|
my $cachetime = 24*60*60; |
|
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
|
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domdefaults'} = 1; |
|
} |
|
if (keys(%changes) > 0) { |
|
my %titles = &ssl_titles(); |
|
$resulttext = &mt('Changes made:').'<ul>'; |
|
foreach my $prefix (@prefixes) { |
|
if (ref($changes{$prefix}) eq 'HASH') { |
|
$resulttext .= '<li>'.$titles{$prefix}.'<ul>'; |
|
foreach my $type (@{$types{$prefix}}) { |
|
if (defined($changes{$prefix}{$type})) { |
|
my $newvalue; |
|
if (ref($defaultshash{$action}) eq 'HASH') { |
|
if (ref($defaultshash{$action}{$prefix})) { |
|
if ($prefix eq 'connect') { |
|
$newvalue = $titles{$defaultshash{$action}{$prefix}{$type}}; |
|
} elsif (ref($defaultshash{$action}{$prefix}{$type}) eq 'ARRAY') { |
|
if (@{$defaultshash{$action}{$prefix}{$type}} > 0) { |
|
$newvalue = join(', ',@{$defaultshash{$action}{$prefix}{$type}}); |
|
} |
|
} |
|
} |
|
if ($newvalue eq '') { |
|
$resulttext .= '<li>'.&mt('[_1] set to: none',$titles{$type}).'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('[_1] set to: [_2].',$titles{$type},$newvalue).'</li>'; |
|
} |
|
} |
|
} |
|
} |
|
$resulttext .= '</ul>'; |
|
} |
|
} |
|
} else { |
|
$resulttext = $nochgmsg; |
|
} |
} else { |
} else { |
$resulttext = '<span class="LC_error">'. |
$resulttext = '<span class="LC_error">'. |
&mt('An error occurred: [_1]',$putresult).'</span>'; |
&mt('An error occurred: [_1]',$putresult).'</span>'; |