--- loncom/interface/domainprefs.pm 2012/12/20 13:23:49 1.181
+++ loncom/interface/domainprefs.pm 2013/10/06 21:25:59 1.212
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.181 2012/12/20 13:23:49 raeburn Exp $
+# $Id: domainprefs.pm,v 1.212 2013/10/06 21:25:59 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -45,7 +45,7 @@ described at http://www.lon-capa.org.
=head1 OVERVIEW
Each institution using LON-CAPA will typically have a single domain designated
-for use by individuals affliated with the institution. Accordingly, each domain
+for use by individuals affiliated with the institution. Accordingly, each domain
may define a default set of logos and a color scheme which can be used to "brand"
the LON-CAPA instance. In addition, an institution will typically have a language
and timezone which are used for the majority of courses.
@@ -86,7 +86,7 @@ $dom,$settings,$rowtotal,$action.
$dom is the domain, $settings is a reference to a hash of current settings for
the current context, $rowtotal is a reference to the scalar used to record the
-number of rows displayed on the page, and $action is the context (quotas,
+number of rows displayed on the page, and $action is the context (quotas,
requestcourses or requestauthor).
The print_quotas routine was orginally created to display/store information
@@ -94,7 +94,8 @@ about default quota sizes for portfolio
institutional affiliation in the domain (e.g., Faculty, Staff, Student etc.),
but is now also used to manage availability of user tools:
i.e., blogs, aboutme page, and portfolios, and the course request tool,
-used by course owners to request creation of a course.
+used by course owners to request creation of a course, and to display/store
+default quota sizes for authoring spaces.
Outputs: 1
@@ -254,11 +255,11 @@ sub handler {
col2 => 'Value'}],
},
'quotas' =>
- { text => 'Blogs, personal web pages, webDAV, portfolios',
+ { text => 'Blogs, personal web pages, webDAV/quotas, portfolios',
help => 'Domain_Configuration_Quotas',
header => [{col1 => 'User affiliation',
col2 => 'Available tools',
- col3 => 'Portfolio quota',}],
+ col3 => 'Quotas, Mb; (Authoring requires role)',}],
},
'autoenroll' =>
{ text => 'Auto-enrollment settings',
@@ -386,11 +387,11 @@ sub handler {
col2 => 'Rules'}],
},
'loadbalancing' =>
- {text => 'Dedicated Load Balancer',
+ {text => 'Dedicated Load Balancer(s)',
help => 'Domain_Configuration_Load_Balancing',
header => [{col1 => 'Balancers',
col2 => 'Default destinations',
- col3 => 'User affliation',
+ col3 => 'User affiliation',
col4 => 'Overrides'},
],
},
@@ -407,8 +408,6 @@ sub handler {
};
}
-
-
my @roles = ('student','coordinator','author','admin');
my @actions = &Apache::loncommon::get_env_multiple('form.actions');
&Apache::lonhtmlcommon::add_breadcrumb
@@ -417,9 +416,15 @@ sub handler {
my $confname = $dom.'-domainconfig';
if ($phase eq 'process') {
- &Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,\@roles);
+ my $result = &Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,
+ \%prefs,\%domconfig,$confname,\@roles);
+ if (ref($result) eq 'HASH') {
+ $r->rflush();
+ &devalidate_remote_domconfs($dom,$result);
+ }
} elsif ($phase eq 'display') {
- my $js = &recaptcha_js();
+ my $js = &recaptcha_js().
+ &credits_js();
if ((keys(%servers) > 1) || (keys(%existing) > 0)) {
my ($othertitle,$usertypes,$types) =
&Apache::loncommon::sorted_inst_types($dom);
@@ -438,7 +443,7 @@ sub handler {
unless ($configuserok eq 'ok') {
&Apache::lonconfigsettings::print_header($r,$phase,$context);
$r->print(&mt('The domain configuration user "[_1]" has yet to be created.',
- $confname).
+ $confname).
'
'
);
if ($switchserver) {
@@ -492,28 +497,27 @@ sub handler {
}
}
}
-
&Apache::lonconfigsettings::display_choices($r,$phase,$context,\@prefs_order,\%prefs);
}
return OK;
}
sub process_changes {
- my ($r,$dom,$confname,$action,$roles,$values) = @_;
+ my ($r,$dom,$confname,$action,$roles,$values,$lastactref) = @_;
my %domconfig;
if (ref($values) eq 'HASH') {
%domconfig = %{$values};
}
my $output;
if ($action eq 'login') {
- $output = &modify_login($r,$dom,$confname,%domconfig);
+ $output = &modify_login($r,$dom,$confname,$lastactref,%domconfig);
} elsif ($action eq 'rolecolors') {
$output = &modify_rolecolors($r,$dom,$confname,$roles,
- %domconfig);
+ $lastactref,%domconfig);
} elsif ($action eq 'quotas') {
- $output = &modify_quotas($dom,$action,%domconfig);
+ $output = &modify_quotas($dom,$action,$lastactref,%domconfig);
} elsif ($action eq 'autoenroll') {
- $output = &modify_autoenroll($dom,%domconfig);
+ $output = &modify_autoenroll($dom,$lastactref,%domconfig);
} elsif ($action eq 'autoupdate') {
$output = &modify_autoupdate($dom,%domconfig);
} elsif ($action eq 'autocreate') {
@@ -525,25 +529,25 @@ sub process_changes {
} elsif ($action eq 'usermodification') {
$output = &modify_usermodification($dom,%domconfig);
} elsif ($action eq 'contacts') {
- $output = &modify_contacts($dom,%domconfig);
+ $output = &modify_contacts($dom,$lastactref,%domconfig);
} elsif ($action eq 'defaults') {
- $output = &modify_defaults($dom,$r);
+ $output = &modify_defaults($dom,$lastactref,%domconfig);
} elsif ($action eq 'scantron') {
- $output = &modify_scantron($r,$dom,$confname,%domconfig);
+ $output = &modify_scantron($r,$dom,$confname,$lastactref,%domconfig);
} elsif ($action eq 'coursecategories') {
$output = &modify_coursecategories($dom,%domconfig);
} elsif ($action eq 'serverstatuses') {
$output = &modify_serverstatuses($dom,%domconfig);
} elsif ($action eq 'requestcourses') {
- $output = &modify_quotas($dom,$action,%domconfig);
+ $output = &modify_quotas($dom,$action,$lastactref,%domconfig);
} elsif ($action eq 'requestauthor') {
- $output = &modify_quotas($dom,$action,%domconfig);
+ $output = &modify_quotas($dom,$action,$lastactref,%domconfig);
} elsif ($action eq 'helpsettings') {
$output = &modify_helpsettings($r,$dom,$confname,%domconfig);
} elsif ($action eq 'coursedefaults') {
- $output = &modify_coursedefaults($dom,%domconfig);
+ $output = &modify_coursedefaults($dom,$lastactref,%domconfig);
} elsif ($action eq 'usersessions') {
- $output = &modify_usersessions($dom,%domconfig);
+ $output = &modify_usersessions($dom,$lastactref,%domconfig);
} elsif ($action eq 'loadbalancing') {
$output = &modify_loadbalancing($dom,%domconfig);
}
@@ -554,7 +558,6 @@ sub print_config_box {
my ($r,$dom,$confname,$phase,$action,$item,$settings) = @_;
my $rowtotal = 0;
my $output;
-
if ($action eq 'coursecategories') {
$output = &coursecategories_javascript($settings);
}
@@ -573,7 +576,7 @@ sub print_config_box {
if ($numheaders > 1) {
my $colspan = '';
my $rightcolspan = '';
- if (($action eq 'rolecolors') || ($action eq 'coursecategories') ||
+ if (($action eq 'rolecolors') || ($action eq 'coursecategories') ||
(($action eq 'login') && ($numheaders < 3))) {
$colspan = ' colspan="2"';
}
@@ -792,7 +795,7 @@ sub print_config_box {
} elsif ($action eq 'contacts') {
$output .= &print_contacts($dom,$settings,\$rowtotal);
} elsif ($action eq 'defaults') {
- $output .= &print_defaults($dom,\$rowtotal);
+ $output .= &print_defaults($dom,$settings,\$rowtotal);
} elsif ($action eq 'scantron') {
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'serverstatuses') {
@@ -843,7 +846,7 @@ sub print_login {
'
|