--- loncom/interface/domainprefs.pm 2013/12/19 08:25:48 1.160.6.28
+++ loncom/interface/domainprefs.pm 2013/01/09 18:14:04 1.183
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.160.6.28 2013/12/19 08:25:48 raeburn Exp $
+# $Id: domainprefs.pm,v 1.183 2013/01/09 18:14:04 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -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,8 +94,7 @@ 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, and to display/store
-default quota sizes for authoring spaces.
+used by course owners to request creation of a course.
Outputs: 1
@@ -211,13 +210,15 @@ sub handler {
'quotas','autoenroll','autoupdate','autocreate',
'directorysrch','usercreation','usermodification',
'contacts','defaults','scantron','coursecategories',
- 'serverstatuses','requestcourses','coursedefaults',
- 'usersessions','loadbalancing','requestauthor'],$dom);
+ 'serverstatuses','requestcourses','helpsettings',
+ 'coursedefaults','usersessions','loadbalancing',
+ 'requestauthor'],$dom);
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll',
'autoupdate','autocreate','directorysrch','contacts',
'usercreation','usermodification','scantron',
'requestcourses','requestauthor','coursecategories',
- 'serverstatuses','coursedefaults','usersessions');
+ 'serverstatuses','helpsettings',
+ 'coursedefaults','usersessions');
my %existing;
if (ref($domconfig{'loadbalancing'}) eq 'HASH') {
%existing = %{$domconfig{'loadbalancing'}};
@@ -253,11 +254,11 @@ sub handler {
col2 => 'Value'}],
},
'quotas' =>
- { text => 'Blogs, personal web pages, webDAV/quotas, portfolios',
+ { text => 'Blogs, personal web pages, webDAV, portfolios',
help => 'Domain_Configuration_Quotas',
header => [{col1 => 'User affiliation',
col2 => 'Available tools',
- col3 => 'Quotas, MB; (Authoring requires role)',}],
+ col3 => 'Portfolio quota',}],
},
'autoenroll' =>
{ text => 'Auto-enrollment settings',
@@ -354,12 +355,26 @@ sub handler {
col3 => 'Specific IPs',
}],
},
- 'coursedefaults' =>
+ 'helpsettings' =>
+ {text => 'Help page settings',
+ help => 'Domain_Configuration_Help_Settings',
+ header => [{col1 => 'Help Settings (logged-in users)',
+ col2 => 'Value'}],
+ },
+ 'coursedefaults' =>
{text => 'Course/Community defaults',
help => 'Domain_Configuration_Course_Defaults',
- header => [{col1 => 'Defaults which can be overridden for each course by a DC',
+ header => [{col1 => 'Defaults which can be overridden in each course by a CC',
+ col2 => 'Value',},
+ {col1 => 'Defaults which can be overridden for each course by a DC',
col2 => 'Value',},],
},
+ 'privacy' =>
+ {text => 'User Privacy',
+ help => 'Domain_Configuration_User_Privacy',
+ header => [{col1 => 'Setting',
+ col2 => 'Value',}],
+ },
'usersessions' =>
{text => 'User session hosting/offloading',
help => 'Domain_Configuration_User_Sessions',
@@ -371,7 +386,7 @@ sub handler {
col2 => 'Rules'}],
},
'loadbalancing' =>
- {text => 'Dedicated Load Balancer(s)',
+ {text => 'Dedicated Load Balancer',
help => 'Domain_Configuration_Load_Balancing',
header => [{col1 => 'Balancers',
col2 => 'Default destinations',
@@ -392,6 +407,8 @@ sub handler {
};
}
+
+
my @roles = ('student','coordinator','author','admin');
my @actions = &Apache::loncommon::get_env_multiple('form.actions');
&Apache::lonhtmlcommon::add_breadcrumb
@@ -400,15 +417,9 @@ sub handler {
my $confname = $dom.'-domainconfig';
if ($phase eq 'process') {
- 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);
- }
+ &Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,\@roles);
} elsif ($phase eq 'display') {
- my $js = &recaptcha_js().
- &credits_js();
+ my $js = &recaptcha_js();
if ((keys(%servers) > 1) || (keys(%existing) > 0)) {
my ($othertitle,$usertypes,$types) =
&Apache::loncommon::sorted_inst_types($dom);
@@ -427,7 +438,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) {
@@ -481,27 +492,28 @@ sub handler {
}
}
}
+
&Apache::lonconfigsettings::display_choices($r,$phase,$context,\@prefs_order,\%prefs);
}
return OK;
}
sub process_changes {
- my ($r,$dom,$confname,$action,$roles,$values,$lastactref) = @_;
+ my ($r,$dom,$confname,$action,$roles,$values) = @_;
my %domconfig;
if (ref($values) eq 'HASH') {
%domconfig = %{$values};
}
my $output;
if ($action eq 'login') {
- $output = &modify_login($r,$dom,$confname,$lastactref,%domconfig);
+ $output = &modify_login($r,$dom,$confname,%domconfig);
} elsif ($action eq 'rolecolors') {
$output = &modify_rolecolors($r,$dom,$confname,$roles,
- $lastactref,%domconfig);
+ %domconfig);
} elsif ($action eq 'quotas') {
- $output = &modify_quotas($dom,$action,$lastactref,%domconfig);
+ $output = &modify_quotas($dom,$action,%domconfig);
} elsif ($action eq 'autoenroll') {
- $output = &modify_autoenroll($dom,$lastactref,%domconfig);
+ $output = &modify_autoenroll($dom,%domconfig);
} elsif ($action eq 'autoupdate') {
$output = &modify_autoupdate($dom,%domconfig);
} elsif ($action eq 'autocreate') {
@@ -513,23 +525,25 @@ sub process_changes {
} elsif ($action eq 'usermodification') {
$output = &modify_usermodification($dom,%domconfig);
} elsif ($action eq 'contacts') {
- $output = &modify_contacts($dom,$lastactref,%domconfig);
+ $output = &modify_contacts($dom,%domconfig);
} elsif ($action eq 'defaults') {
- $output = &modify_defaults($dom,$lastactref,%domconfig);
+ $output = &modify_defaults($dom,$r);
} elsif ($action eq 'scantron') {
- $output = &modify_scantron($r,$dom,$confname,$lastactref,%domconfig);
+ $output = &modify_scantron($r,$dom,$confname,%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,$lastactref,%domconfig);
+ $output = &modify_quotas($dom,$action,%domconfig);
} elsif ($action eq 'requestauthor') {
- $output = &modify_quotas($dom,$action,$lastactref,%domconfig);
+ $output = &modify_quotas($dom,$action,%domconfig);
+ } elsif ($action eq 'helpsettings') {
+ $output = &modify_helpsettings($r,$dom,$confname,%domconfig);
} elsif ($action eq 'coursedefaults') {
- $output = &modify_coursedefaults($dom,$lastactref,%domconfig);
+ $output = &modify_coursedefaults($dom,%domconfig);
} elsif ($action eq 'usersessions') {
- $output = &modify_usersessions($dom,$lastactref,%domconfig);
+ $output = &modify_usersessions($dom,%domconfig);
} elsif ($action eq 'loadbalancing') {
$output = &modify_loadbalancing($dom,%domconfig);
}
@@ -540,6 +554,7 @@ 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);
}
@@ -558,7 +573,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"';
}
@@ -597,6 +612,8 @@ sub print_config_box {
$output .= &print_usersessions('top',$dom,$settings,\$rowtotal);
} elsif ($action eq 'rolecolors') {
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal);
+ } elsif ($action eq 'coursedefaults') {
+ $output .= &print_coursedefaults('top',$dom,$settings,\$rowtotal);
}
$output .= '
@@ -686,6 +703,8 @@ sub print_config_box {
'.&mt($item->{'header'}->[2]->{'col2'}).' | '.
&print_usersessions('bottom',$dom,$settings,\$rowtotal);
$rowtotal ++;
+ } elsif ($action eq 'coursedefaults') {
+ $output .= &print_coursedefaults('bottom',$dom,$settings,\$rowtotal);
} elsif ($action eq 'rolecolors') {
$output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).'
@@ -773,7 +792,7 @@ sub print_config_box {
} elsif ($action eq 'contacts') {
$output .= &print_contacts($dom,$settings,\$rowtotal);
} elsif ($action eq 'defaults') {
- $output .= &print_defaults($dom,$settings,\$rowtotal);
+ $output .= &print_defaults($dom,\$rowtotal);
} elsif ($action eq 'scantron') {
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'serverstatuses') {
@@ -782,8 +801,6 @@ sub print_config_box {
$output .= &print_helpsettings($dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'loadbalancing') {
$output .= &print_loadbalancing($dom,$settings,\$rowtotal);
- } elsif ($action eq 'coursedefaults') {
- $output .= &print_coursedefaults('bottom',$dom,$settings,\$rowtotal);
}
}
$output .= '
@@ -826,7 +843,7 @@ sub print_login {
' |