--- loncom/interface/domainprefs.pm 2015/03/30 20:47:13 1.160.6.60
+++ loncom/interface/domainprefs.pm 2014/05/09 15:02:31 1.242
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.160.6.60 2015/03/30 20:47:13 raeburn Exp $
+# $Id: domainprefs.pm,v 1.242 2014/05/09 15:02:31 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -213,15 +213,15 @@ sub handler {
'quotas','autoenroll','autoupdate','autocreate',
'directorysrch','usercreation','usermodification',
'contacts','defaults','scantron','coursecategories',
- 'serverstatuses','requestcourses','coursedefaults',
- 'usersessions','loadbalancing','requestauthor',
- 'selfenrollment','inststatus'],$dom);
+ 'serverstatuses','requestcourses','helpsettings',
+ 'coursedefaults','usersessions','loadbalancing',
+ 'requestauthor','selfenrollment','inststatus'],$dom);
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll',
'autoupdate','autocreate','directorysrch','contacts',
'usercreation','selfcreation','usermodification','scantron',
'requestcourses','requestauthor','coursecategories',
- 'serverstatuses','coursedefaults','selfenrollment',
- 'usersessions');
+ 'serverstatuses','helpsettings',
+ 'coursedefaults','selfenrollment','usersessions');
my %existing;
if (ref($domconfig{'loadbalancing'}) eq 'HASH') {
%existing = %{$domconfig{'loadbalancing'}};
@@ -250,8 +250,6 @@ sub handler {
header => [{col1 => 'Log-in Page Items',
col2 => '',},
{col1 => 'Log-in Help',
- col2 => 'Value'},
- {col1 => 'Custom HTML in document head',
col2 => 'Value'}],
print => \&print_login,
modify => \&modify_login,
@@ -411,6 +409,14 @@ sub handler {
print => \&print_serverstatuses,
modify => \&modify_serverstatuses,
},
+ 'helpsettings' =>
+ {text => 'Help page settings',
+ help => 'Domain_Configuration_Help_Settings',
+ header => [{col1 => 'Help Settings (logged-in users)',
+ col2 => 'Value'}],
+ print => \&print_helpsettings,
+ modify => \&modify_helpsettings,
+ },
'coursedefaults' =>
{text => 'Course/Community defaults',
help => 'Domain_Configuration_Course_Defaults',
@@ -433,6 +439,14 @@ sub handler {
print => \&print_selfenrollment,
modify => \&modify_selfenrollment,
},
+ 'privacy' =>
+ {text => 'User Privacy',
+ help => 'Domain_Configuration_User_Privacy',
+ header => [{col1 => 'Setting',
+ col2 => 'Value',}],
+ print => \&print_privacy,
+ modify => \&modify_privacy,
+ },
'usersessions' =>
{text => 'User session hosting/offloading',
help => 'Domain_Configuration_User_Sessions',
@@ -465,8 +479,6 @@ sub handler {
{col1 => 'Log-in Page Items',
col2 => ''},
{col1 => 'Log-in Help',
- col2 => 'Value'},
- {col1 => 'Custom HTML in document head',
col2 => 'Value'}],
print => \&print_login,
modify => \&modify_login,
@@ -619,6 +631,8 @@ sub process_changes {
$output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig);
} elsif ($action eq 'requestauthor') {
$output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig);
+ } elsif ($action eq 'helpsettings') {
+ $output = &modify_helpsettings($r,$dom,$confname,%domconfig);
} elsif ($action eq 'coursedefaults') {
$output = &modify_coursedefaults($dom,$lastactref,%domconfig);
} elsif ($action eq 'selfenrollment') {
@@ -656,7 +670,7 @@ sub print_config_box {
my $colspan = '';
my $rightcolspan = '';
if (($action eq 'rolecolors') || ($action eq 'defaults') ||
- (($action eq 'login') && ($numheaders < 4))) {
+ (($action eq 'login') && ($numheaders < 3))) {
$colspan = ' colspan="2"';
}
if ($action eq 'usersessions') {
@@ -678,7 +692,7 @@ sub print_config_box {
} elsif ($action eq 'coursecategories') {
$output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal);
} elsif ($action eq 'login') {
- if ($numheaders == 4) {
+ if ($numheaders == 3) {
$colspan = ' colspan="2"';
$output .= &print_login('service',$dom,$confname,$phase,$settings,\$rowtotal);
} else {
@@ -731,7 +745,7 @@ sub print_config_box {
($action eq 'defaults')) {
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
} elsif ($action eq 'login') {
- if ($numheaders == 4) {
+ if ($numheaders == 3) {
$output .= &print_login('page',$dom,$confname,$phase,$settings,\$rowtotal).'
@@ -747,31 +761,9 @@ sub print_config_box {
} else {
$output .= &print_login('help',$dom,$confname,$phase,$settings,\$rowtotal);
}
- $output .= '
-
-
-
-
-
-
- ';
- if ($numheaders == 4) {
- $output .= '
- '.&mt($item->{'header'}->[3]->{'col1'}).' |
- '.&mt($item->{'header'}->[3]->{'col2'}).' |
- ';
- } else {
- $output .= '
- '.&mt($item->{'header'}->[2]->{'col1'}).' |
- '.&mt($item->{'header'}->[2]->{'col2'}).' |
- ';
- }
- $rowtotal ++;
- $output .= &print_login('headtag',$dom,$confname,$phase,$settings,\$rowtotal);
} elsif ($action eq 'requestcourses') {
- $output .= &print_requestmail($dom,$action,$settings,\$rowtotal);
- $rowtotal ++;
- $output .= &print_studentcode($settings,\$rowtotal).'
+ $output .= &print_requestmail($dom,$action,$settings,\$rowtotal).
+ &print_studentcode($settings,\$rowtotal).'
|
@@ -806,7 +798,6 @@ sub print_config_box {
&print_validation_rows('requestcourses',$dom,$settings,\$rowtotal);
} elsif ($action eq 'requestauthor') {
$output .= &print_requestmail($dom,$action,$settings,\$rowtotal);
- $rowtotal ++;
} elsif ($action eq 'rolecolors') {
$output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).'
@@ -1188,57 +1179,6 @@ sub print_login {
$itemcount ++;
}
$datatable .= &captcha_choice('login',$settings,$itemcount);
- } elsif ($caller eq 'headtag') {
- my %domservers = &Apache::lonnet::get_servers($dom);
- my $choice = $choices{'headtag'};
- $css_class = ' class="LC_odd_row"';
- $datatable .= ''.$choice.' | '.
- ' |
';
}
return $datatable;
}
@@ -1272,9 +1212,6 @@ sub login_choices {
link => "Link",
alink => "Active link",
vlink => "Visited link",
- headtag => "Custom markup",
- action => "Action",
- current => "Current",
);
return %choices;
}
@@ -2137,6 +2074,7 @@ sub print_requestmail {
$datatable .= &mt('There are no active Domain Coordinators');
}
$datatable .='';
+ $$rowtotal += $rows;
return $datatable;
}
@@ -2145,11 +2083,9 @@ sub print_studentcode {
my $rownum = 0;
my ($output,%current);
my @crstypes = ('official','unofficial','community','textbook');
- if (ref($settings) eq 'HASH') {
- if (ref($settings->{'uniquecode'}) eq 'HASH') {
- foreach my $type (@crstypes) {
- $current{$type} = $settings->{'uniquecode'}{$type};
- }
+ if (ref($settings->{'uniquecode'}) eq 'HASH') {
+ foreach my $type (@crstypes) {
+ $current{$type} = $settings->{'uniquecode'}{$type};
}
}
$output .= ''.
@@ -2199,12 +2135,11 @@ sub print_textbookcourses {
my $key = $ordered{$items[$i]};
my %coursehash=&Apache::lonnet::coursedescription($key);
my $coursetitle = $coursehash{'description'};
- my ($subject,$title,$author,$publisher,$image,$imgsrc,$cdom,$cnum);
+ my ($subject,$title,$author,$image,$imgsrc,$cdom,$cnum);
if (ref($bookshash->{$key}) eq 'HASH') {
$subject = $bookshash->{$key}->{'subject'};
$title = $bookshash->{$key}->{'title'};
if ($type eq 'textbooks') {
- $publisher = $bookshash->{$key}->{'publisher'};
$author = $bookshash->{$key}->{'author'};
$image = $bookshash->{$key}->{'image'};
if ($image ne '') {
@@ -2234,8 +2169,6 @@ sub print_textbookcourses {
''.&mt('Title:').' ';
if ($type eq 'textbooks') {
$datatable .= (' 'x2).
- ''.&mt('Publisher:').' '.
- (' 'x2).
''.&mt('Author(s):').' '.
(' 'x2).
''.&mt('Thumbnail:');
@@ -2279,9 +2212,7 @@ sub print_textbookcourses {
''.&mt('Title:').' '."\n".
(' 'x2);
if ($type eq 'textbooks') {
- $datatable .= ''.&mt('Publisher:').' '."\n".
- (' 'x2).
- ''.&mt('Author(s):').' '."\n".
+ $datatable .= ''.&mt('Author(s):').' '."\n".
(' 'x2).
''.&mt('Image:').' ';
if ($switchserver) {
@@ -2583,15 +2514,13 @@ sub print_autocreate {
$createoff{'req'}.' value="0" />'.&mt('No').'';
my ($numdc,$dctable,$rows) = &active_dc_picker($dom,$numinrow,'radio',
'autocreate_xmldc',%currhash);
- $datatable .= '
';
if ($numdc > 1) {
- $datatable .= &mt('Course creation processed as: (choose Dom. Coord.)').
- ' | ';
+ $datatable .= ' |
'.
+ &mt('Course creation processed as: (choose Dom. Coord.)').
+ ' | '.$dctable.' |
';
} else {
- $datatable .= &mt('Course creation processed as:').
- '';
+ $datatable .= $dctable.' | ';
}
- $datatable .= $dctable.'';
$$rowtotal += $rows;
return $datatable;
}
@@ -2826,7 +2755,7 @@ sub print_helpsettings {
sub radiobutton_prefs {
my ($settings,$toggles,$defaultchecked,$choices,$itemcount,$onclick,
- $additional,$align) = @_;
+ $additional) = @_;
return unless ((ref($toggles) eq 'ARRAY') && (ref($defaultchecked) eq 'HASH') &&
(ref($choices) eq 'HASH'));
@@ -2860,14 +2789,8 @@ sub radiobutton_prefs {
$datatable .=
''.
''.$choices->{$item}.
- ' | ';
- if ($align eq 'left') {
- $datatable .= '';
- } else {
- $datatable .= ' | ';
- }
- $datatable .=
- ''.
+ ' | '.
+ ''.
' |
';
if ($numdc > 1) {
- $datatable .= &mt('Course creation processed as: (choose Dom. Coord.)');
+ $datatable .= ' |
'.
+ &mt('Course creation processed as: (choose Dom. Coord.)').
+ ' | '.$dctable.' |
';
} else {
- $datatable .= &mt('Course creation processed as: ');
+ $datatable .= $dctable.'';
}
- $datatable .= ''.$dctable.' | ';
$itemcount ++;
}
if (ref($rowtotal)) {
@@ -3778,10 +3648,9 @@ sub print_loadbalancing {
$disabled = ' disabled="disabled"';
}
$targettable .=
- ' | ';
+ '';
my $rem = $i%($numinrow);
if ($rem == 0) {
if (($i > 0) && ($i < $numspares-1)) {
@@ -3871,7 +3740,7 @@ sub loadbalancing_rules {
if (ref($currrules) eq 'HASH') {
$current = $currrules->{$type};
}
- if (($type eq '_LC_external') || ($type eq '_LC_internetdom')) {
+ if (($type eq '_LC_external') || ($type eq '_LC_internetdom') || ($type eq '_LC_ipchange')) {
if ($dom ne &Apache::lonnet::host_domain($lonhost)) {
$current = '';
}
@@ -3923,7 +3792,7 @@ sub loadbalance_rule_row {
my @rulenames;
my %ruletitles = &offloadtype_text();
if (($type eq '_LC_ipchangesso') || ($type eq '_LC_ipchange')) {
- @rulenames = ('balancer','offloadedto','specific');
+ @rulenames = ('balancer','offloadedto');
} else {
@rulenames = ('default','homeserver');
if ($type eq '_LC_external') {
@@ -3934,7 +3803,7 @@ sub loadbalance_rule_row {
push(@rulenames,'none');
}
my $style = $targets_div_style;
- if (($type eq '_LC_external') || ($type eq '_LC_internetdom')) {
+ if (($type eq '_LC_external') || ($type eq '_LC_internetdom') || ($type eq '_LC_ipchange')) {
$style = $homedom_div_style;
}
my $space;
@@ -3985,13 +3854,8 @@ sub loadbalance_rule_row {
' ';
- if (($rulenames[$i] eq 'specific') && ($type =~ /^_LC_ipchange/)) {
- $output .= $ruletitles{'particular'};
- } else {
- $output .= $ruletitles{$rulenames[$i]};
- }
- $output .= ''.$extra.'
'."\n";
+ ')"'.$checked.' /> '.$ruletitles{$rulenames[$i]}.
+ ''.$extra.'
'."\n";
}
$output .= ''."\n";
return $output;
@@ -4006,7 +3870,6 @@ sub offloadtype_text {
'none' => 'No offload',
'balancer' => 'Session hosted on Load Balancer, after re-authentication',
'offloadedto' => 'Session hosted on offload server, after re-authentication',
- 'particular' => 'Session hosted (after re-auth) on server:',
);
return %ruletitles;
}
@@ -4289,10 +4152,8 @@ sub print_selfcreation {
$datatable .= '';
}
my $currval;
- if (ref($createsettings) eq 'HASH') {
- if (ref($createsettings->{'shibenv'}) eq 'HASH') {
- $currval = $createsettings->{'shibenv'}{$fields[$i]};
- }
+ if (ref($createsettings->{'shibenv'}) eq 'HASH') {
+ $currval = $createsettings->{'shibenv'}{$fields[$i]};
}
$datatable .= ''.
''.
@@ -5296,14 +5157,14 @@ sub serverstatus_pages {
sub defaults_javascript {
my ($settings) = @_;
- return unless (ref($settings) eq 'HASH');
+ my ($output,$jstext);
if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) {
my $maxnum = scalar(@{$settings->{'inststatusorder'}});
if ($maxnum eq '') {
$maxnum = 0;
}
$maxnum ++;
- my $jstext = ' var inststatuses = Array('."'".join("','",@{$settings->{'inststatusorder'}})."'".');';
+ $jstext = ' var inststatuses = Array('."'".join("','",@{$settings->{'inststatusorder'}})."'".');';
return <<"ENDSCRIPT";
|