--- loncom/interface/domainprefs.pm 2008/12/25 02:22:08 1.76.2.4
+++ loncom/interface/domainprefs.pm 2009/01/27 15:59:30 1.85
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.76.2.4 2008/12/25 02:22:08 raeburn Exp $
+# $Id: domainprefs.pm,v 1.85 2009/01/27 15:59:30 schafran 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",
@@ -1329,7 +1329,8 @@ sub print_quotas {
'" value="_LC_adv" '.$checked.'/>'.$titles{$item}.
' ';
}
- $datatable .= '('.&mt('overrides affiliation').')';
+ $datatable .= '('.&mt('overrides affiliation').
+ ')';
$$rowtotal += $typecount;
return $datatable;
}
@@ -1893,7 +1894,7 @@ sub usercreation_types {
any => 'Any',
official => 'Institutional only ',
unofficial => 'Non-institutional only',
- email => 'Email address',
+ email => 'E-mail address',
login => 'Institutional Login',
sso => 'SSO',
none => 'None',
@@ -3614,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') {
@@ -4976,40 +4977,38 @@ sub modify_serverstatuses {
my %serverstatushash = (
serverstatuses => \%newserverstatus,
);
- my $putresult = &Apache::lonnet::put_dom('configuration',\%serverstatushash,
- $dom);
my %changes;
foreach my $type (@pages) {
- 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;
- }
- }
- foreach my $item (@newusers) {
- if (!grep(/^\Q$item\E$/,@currnamed)) {
- $changes{$type}{'namedusers'} = 1;
- last;
+ foreach my $setting ('namedusers','machines') {
+ my (@current,@new);
+ if (ref($currserverstatus{$type}) eq 'HASH') {
+ if ($currserverstatus{$type}{$setting} ne '') {
+ @current = split(/,/,$currserverstatus{$type}{$setting});
}
}
- my @currmachines = split(/,/,$currserverstatus{$type}{'machines'});
- my @newmachines = split(/,/,$newserverstatus{$type}{'machines'});
- foreach my $item (@currmachines) {
- if (!grep(/^\Q$item\E$/,@newmachines)) {
- $changes{$type}{'machines'} = 1;
- last;
- }
- }
- foreach my $item (@newmachines) {
- if (!grep(/^\Q$item\E$/,@currmachines)) {
- $changes{$type}{'machines'} = 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;
+ last;
+ }
+ }
+ foreach my $item (@new) {
+ if (!grep(/^\Q$item\E$/,@current)) {
+ $changes{$type}{$setting} = 1;
+ last;
+ }
+ }
+ } else {
+ $changes{$type}{$setting} = 1;
}
+ } elsif (@new > 0) {
+ $changes{$type}{$setting} = 1;
}
-
}
}
if (keys(%changes) > 0) {
@@ -5019,15 +5018,16 @@ sub modify_serverstatuses {
if ($putresult eq 'ok') {
$resulttext .= &mt('Changes made:').'';
foreach my $type (@pages) {
- if (defined($changes{$type})) {
+ if (ref($changes{$type}) eq 'HASH') {
$resulttext .= '- '.$titles->{$type}.'
';
- if (defined($changes{$type}{'namedusers'})) {
+ if ($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";
}
- } elsif (defined($changes{$type}{'machines'})) {
+ }
+ if ($changes{$type}{'machines'}) {
if ($newserverstatus{$type}{'machines'} eq '') {
$resulttext .= '- '.&mt("Access terminated for all specific IP addresses").'
'."\n";
} else {