--- loncom/interface/domainprefs.pm 2009/09/14 15:59:10 1.76.4.2
+++ loncom/interface/domainprefs.pm 2008/12/26 16:34:01 1.82
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.76.4.2 2009/09/14 15:59:10 raeburn Exp $
+# $Id: domainprefs.pm,v 1.82 2008/12/26 16:34:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -107,7 +107,7 @@ sub handler {
'quotas' =>
{ text => 'User blogs, home pages and portfolios',
help => 'Domain_Configuration_Quotas',
- header => [{col1 => 'User type',
+ header => [{col1 => 'User affiliation',
col2 => 'Available tools',
col3 => 'Portfolio quota',}],
},
@@ -175,7 +175,7 @@ sub handler {
}],
},
'serverstatuses' =>
- {text => 'Access to Server Status Pages',
+ {text => 'Access to server status pages',
help => 'Domain_Configuration_Server_Status',
header => [{col1 => 'Status Page',
col2 => 'Other named users',
@@ -817,9 +817,9 @@ sub login_choices {
bgs => "Background colors",
links => "Link colors",
font => "Font color",
- pgbg => "Page",
- mainbg => "Main panel",
- sidebg => "Side panel",
+ pgbg => "Header",
+ mainbg => "Page",
+ sidebg => "Login box",
link => "Link",
alink => "Active link",
vlink => "Visited link",
@@ -1330,7 +1330,7 @@ sub print_quotas {
' ';
}
$datatable .= '('.&mt('overrides affiliation').
- ')';
+ ')';
$$rowtotal += $typecount;
return $datatable;
}
@@ -1571,7 +1571,7 @@ sub print_contacts {
my $datatable;
my @contacts = ('adminemail','supportemail');
my (%checked,%to,%otheremails);
- my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail');
+ my @mailings = ('errormail','packagesmail','helpdeskmail');
foreach my $type (@mailings) {
$otheremails{$type} = '';
}
@@ -1591,8 +1591,6 @@ sub print_contacts {
}
$otheremails{$type} = $settings->{$type}{'others'};
}
- } elsif ($type eq 'lonstatusmail') {
- $checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" ';
}
}
} else {
@@ -1600,8 +1598,7 @@ sub print_contacts {
$to{'adminemail'} = $Apache::lonnet::perlvar{'lonAdmEMail'};
$checked{'errormail'}{'adminemail'} = ' checked="checked" ';
$checked{'packagesmail'}{'adminemail'} = ' checked="checked" ';
- $checked{'helpdeskmail'}{'supportemail'} = ' checked="checked" ';
- $checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" ';
+ $checked{'helpdeskmail'}{'supportemail'} = ' checked="checked" ';
}
my ($titles,$short_titles) = &contact_titles();
my $rownum = 0;
@@ -1645,8 +1642,7 @@ sub contact_titles {
'adminemail' => 'Default Server Admin E-mail address',
'errormail' => 'Error reports to be e-mailed to',
'packagesmail' => 'Package update alerts to be e-mailed to',
- 'helpdeskmail' => 'Helpdesk requests to be e-mailed to',
- 'lonstatusmail' => 'E-mail from nightly status check (warnings/errors)',
+ 'helpdeskmail' => 'Helpdesk requests to be e-mailed to'
);
my %short_titles = &Apache::lonlocal::texthash (
adminemail => 'Admin E-mail address',
@@ -3619,12 +3615,12 @@ sub modify_quotas {
my %newenv;
foreach my $item (@usertools) {
if (ref($changes{$item}) eq 'HASH') {
- my $newacc =
+ my $newacc =
&Apache::lonnet::usertools_access($env{'user.name'},
$env{'user.domain'},
$item,'reload');
- if ($env{'environment.availabletools.'.$item} ne $newacc) {
- $newenv{'environment.availabletools.'.$item} = $newacc;
+ if ($env{'environment.availabletools.'.$item} ne $newacc) {
+ $newenv{'environment.availabletools.'.$item} = $newacc;
}
$resulttext .= '
'.$titles{$item}.'';
foreach my $type (@{$types},'default','_LC_adv') {
@@ -4033,7 +4029,7 @@ sub modify_contacts {
}
my (%others,%to);
my @contacts = ('supportemail','adminemail');
- my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail');
+ my @mailings = ('errormail','packagesmail','helpdeskmail');
foreach my $type (@mailings) {
@{$newsetting{$type}} =
&Apache::loncommon::get_env_multiple('form.'.$type);
@@ -4078,7 +4074,6 @@ sub modify_contacts {
$default{'errormail'} = 'adminemail';
$default{'packagesmail'} = 'adminemail';
$default{'helpdeskmail'} = 'supportemail';
- $default{'lonstatusmail'} = 'adminemail';
foreach my $item (@contacts) {
if ($to{$item} ne $default{$item}) {
$changes{$item} = 1;
@@ -4588,10 +4583,8 @@ sub modify_defaults {
if ($newvalues{$item} ne '') {
if ($newvalues{$item} =~ /^(\w+)/) {
my $langcode = $1;
- if ($langcode ne 'gci' && $langcode ne 'x_chef') {
- if (code2language($langcode) eq '') {
- push(@errors,$item);
- }
+ if (code2language($langcode) eq '') {
+ push(@errors,$item);
}
} else {
push(@errors,$item);
@@ -4768,10 +4761,8 @@ sub modify_coursecategories {
} else {
$changes{'togglecats'} = 1;
$changes{'categorize'} = 1;
- $domconfig{'coursecategories'} = {
- togglecats => $env{'form.togglecats'},
- categorize => $env{'form.categorize'},
- };
+ $domconfig{'coursecategories'}{'togglecats'} = $env{'form.togglecats'};
+ $domconfig{'coursecategories'}{'categorize'} = $env{'form.categorize'};
}
if (ref($cathash) eq 'HASH') {
if (($domconfig{'coursecategories'}{'cats'}{'instcode::0'} ne '') && ($env{'form.instcode'} == 0)) {
@@ -4986,37 +4977,46 @@ sub modify_serverstatuses {
my %serverstatushash = (
serverstatuses => \%newserverstatus,
);
+ my $putresult = &Apache::lonnet::put_dom('configuration',\%serverstatushash,
+ $dom);
my %changes;
foreach my $type (@pages) {
- foreach my $setting ('namedusers','machines') {
- my (@current,@new);
- if (ref($currserverstatus{$type}) eq 'HASH') {
- if ($currserverstatus{$type}{$setting} ne '') {
- @current = split(/,/,$currserverstatus{$type}{$setting});
+ if (ref($currserverstatus{$type}) eq 'HASH') {
+ my @currnamed = split(/,/,$currserverstatus{$type}{'namedusers'});
+ my @newusers = split(/,/,$newserverstatus{$type}{'namedusers'});
+ foreach my $item (@currnamed) {
+ if (!grep(/^\Q$item\E$/,@newusers)) {
+ $changes{$type}{'namedusers'} = 1;
+ last;
}
}
- if ($newserverstatus{$type}{$setting} ne '') {
- @new = split(/,/,$newserverstatus{$type}{$setting});
- }
- if (@current > 0) {
- if (@new > 0) {
- foreach my $item (@current) {
- if (!grep(/^\Q$item\E$/,@new)) {
- $changes{$type}{$setting} = 1;
+ foreach my $item (@newusers) {
+ if (!grep(/^\Q$item\E$/,@currnamed)) {
+ $changes{$type}{'namedusers'} = 1;
+ last;
+ }
+ }
+ my @currmachines = split(/,/,$currserverstatus{$type}{'machines'});
+ my @newmachines = split(/,/,$newserverstatus{$type}{'machines'});
+ if (@currmachines > 0) {
+ if (@newmachines > 0) {
+ foreach my $item (@currmachines) {
+ if (!grep(/^\Q$item\E$/,@newmachines)) {
+ $changes{$type}{'machines'} = 1;
last;
}
}
- foreach my $item (@new) {
- if (!grep(/^\Q$item\E$/,@current)) {
- $changes{$type}{$setting} = 1;
+ foreach my $item (@newmachines) {
+ if (!grep(/^\Q$item\E$/,@currmachines)) {
+ $changes{$type}{'machines'} = 1;
last;
}
}
} else {
- $changes{$type}{$setting} = 1;
+ $changes{$type}{'machines'} = 1;
}
- } elsif (@new > 0) {
- $changes{$type}{$setting} = 1;
+ } elsif (@newmachines > 0) {
+ $changes{$type}{'machines'} = 1;
}
}
}
@@ -5027,16 +5027,15 @@ sub modify_serverstatuses {
if ($putresult eq 'ok') {
$resulttext .= &mt('Changes made:').'';
foreach my $type (@pages) {
- if (ref($changes{$type}) eq 'HASH') {
+ if (defined($changes{$type})) {
$resulttext .= '- '.$titles->{$type}.'
';
- if ($changes{$type}{'namedusers'}) {
+ if (defined($changes{$type}{'namedusers'})) {
if ($newserverstatus{$type}{'namedusers'} eq '') {
$resulttext .= '- '.&mt("Access terminated for all specific (named) users").'
'."\n";
} else {
$resulttext .= '- '.&mt("Access available for the following specified users: ").$newserverstatus{$type}{'namedusers'}.'
'."\n";
}
- }
- if ($changes{$type}{'machines'}) {
+ } elsif (defined($changes{$type}{'machines'})) {
if ($newserverstatus{$type}{'machines'} eq '') {
$resulttext .= '- '.&mt("Access terminated for all specific IP addresses").'
'."\n";
} else {