--- loncom/interface/domainprefs.pm 2016/09/18 19:22:48 1.160.6.71
+++ loncom/interface/domainprefs.pm 2015/05/21 22:59:16 1.264
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.160.6.71 2016/09/18 19:22:48 raeburn Exp $
+# $Id: domainprefs.pm,v 1.264 2015/05/21 22:59:16 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'}};
@@ -411,6 +411,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 +441,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',
@@ -619,6 +635,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') {
@@ -2398,7 +2416,7 @@ ENDSCRIPT
sub print_autoenroll {
my ($dom,$settings,$rowtotal) = @_;
my $autorun = &Apache::lonnet::auto_run(undef,$dom),
- my ($defdom,$runon,$runoff,$coownerson,$coownersoff,$failsafe);
+ my ($defdom,$runon,$runoff,$coownerson,$coownersoff);
if (ref($settings) eq 'HASH') {
if (exists($settings->{'run'})) {
if ($settings->{'run'} eq '0') {
@@ -2432,9 +2450,6 @@ sub print_autoenroll {
if (exists($settings->{'sender_domain'})) {
$defdom = $settings->{'sender_domain'};
}
- if (exists($settings->{'autofailsafe'})) {
- $failsafe = $settings->{'autofailsafe'};
- }
} else {
if ($autorun) {
$runon = ' checked="checked" ';
@@ -2470,12 +2485,8 @@ sub print_autoenroll {
$coownerson.' value="1" />'.&mt('Yes').' '.
' '.&mt('No').' '.
- '
'.
- ''.&mt('Failsafe for no drops when institutional data missing').' '.
- ''.
- ' ';
- $$rowtotal += 4;
+ '';
+ $$rowtotal += 3;
return $datatable;
}
@@ -2873,7 +2884,7 @@ sub radiobutton_prefs {
} else {
$datatable .= '';
}
- $datatable .=
+ $datatable .=
''.
' '.&mt('Yes').
@@ -2892,28 +2903,28 @@ sub print_coursedefaults {
my ($css_class,$datatable,%checkedon,%checkedoff,%defaultchecked,@toggles);
my $itemcount = 1;
my %choices = &Apache::lonlocal::texthash (
+ canuse_pdfforms => 'Course/Community users can create/upload PDF forms',
uploadquota => 'Default quota for files uploaded directly to course/community using Course Editor (MB)',
anonsurvey_threshold => 'Responder count needed before showing submissions for anonymous surveys',
coursecredits => 'Credits can be specified for courses',
uselcmath => 'Math preview uses LON-CAPA previewer (javascript) in place of DragMath (Java)',
usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)',
postsubmit => 'Disable submit button/keypress following student submission',
- canclone => "People who may clone a course (besides course's owner and coordinators)",
- mysqltables => 'Lifetime (s) of "Temporary" MySQL tables (student performance data) on homeserver',
+ canclone => "People who may clone a course (besides course's owner and coordinators)",
);
my %staticdefaults = (
anonsurvey_threshold => 10,
uploadquota => 500,
postsubmit => 60,
- mysqltables => 172800,
);
if ($position eq 'top') {
%defaultchecked = (
+ 'canuse_pdfforms' => 'off',
'uselcmath' => 'on',
'usejsme' => 'on',
- 'canclone' => 'none',
+ 'canclone' => 'none',
);
- @toggles = ('uselcmath','usejsme');
+ @toggles = ('canuse_pdfforms','uselcmath','usejsme');
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked,
\%choices,$itemcount);
$css_class = $itemcount%2?' class="LC_odd_row"':'';
@@ -2950,7 +2961,7 @@ sub print_coursedefaults {
$currcanclone = $settings->{'canclone'};
}
}
- }
+ }
foreach my $option (@cloneoptions) {
my ($checked,$additional);
if ($currcanclone eq $option) {
@@ -2989,7 +3000,7 @@ sub print_coursedefaults {
$itemcount ++;
} else {
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
- my ($currdefresponder,%defcredits,%curruploadquota,%deftimeout,%currmysql);
+ my ($currdefresponder,%defcredits,%curruploadquota,%deftimeout);
my $currusecredits = 0;
my $postsubmitclient = 1;
my @types = ('official','unofficial','community','textbook');
@@ -3019,7 +3030,7 @@ sub print_coursedefaults {
foreach my $type (@types) {
if (ref($settings->{'postsubmit'}->{'timeout'}) eq 'HASH') {
if ($settings->{'postsubmit'}->{'timeout'}->{$type} =~ /^\d+$/) {
- $deftimeout{$type} = $settings->{'postsubmit'}->{'timeout'}->{$type};
+ $deftimeout{$type} = $settings->{'postsubmit'}->{'timeout'}->{$type};
} else {
$deftimeout{$type} = $staticdefaults{'postsubmit'};
}
@@ -3033,15 +3044,6 @@ sub print_coursedefaults {
$deftimeout{$type} = $staticdefaults{'postsubmit'};
}
}
- if (ref($settings->{'mysqltables'}) eq 'HASH') {
- foreach my $type (keys(%{$settings->{'mysqltables'}})) {
- $currmysql{$type} = $settings->{'mysqltables'}{$type};
- }
- } else {
- foreach my $type (@types) {
- $currmysql{$type} = $staticdefaults{'mysqltables'};
- }
- }
} else {
foreach my $type (@types) {
$deftimeout{$type} = $staticdefaults{'postsubmit'};
@@ -3119,27 +3121,13 @@ sub print_coursedefaults {
$additional .= ''."\n";
%defaultchecked = ('postsubmit' => 'on');
@toggles = ('postsubmit');
- $current = {
- 'postsubmit' => $postsubmitclient,
- };
+ my $current = {
+ 'postsubmit' => $postsubmitclient,
+ };
($table,$itemcount) =
&radiobutton_prefs($current,\@toggles,\%defaultchecked,
\%choices,$itemcount,$onclick,$additional,'left');
$datatable .= $table;
- $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
- $datatable .= ''.
- $choices{'mysqltables'}.
- ' '.
- ''.
- ' '."\n";
- $itemcount ++;
-
}
$$rowtotal += $itemcount;
return $datatable;
@@ -3672,7 +3660,7 @@ sub spares_row {
'.
&mt('[_1] when busy, offloads to:'
,''.$server.' ').' '.
- ''."\n".
+ ''."\n".
' '.
' '.&mt('Switch active users on next access').' '.
"\n";
@@ -4567,8 +4555,7 @@ sub email_as_username {
sub captcha_choice {
my ($context,$settings,$itemcount) = @_;
- my ($keyentry,$currpub,$currpriv,%checked,$rowname,$pubtext,$privtext,
- $vertext,$currver);
+ my ($keyentry,$currpub,$currpriv,%checked,$rowname,$pubtext,$privtext);
my %lt = &captcha_phrases();
$keyentry = 'hidden';
if ($context eq 'cancreate') {
@@ -4586,11 +4573,6 @@ sub captcha_choice {
$pubtext = $lt{'pub'};
$privtext = $lt{'priv'};
$keyentry = 'text';
- $vertext = $lt{'ver'};
- $currver = $settings->{'recaptchaversion'};
- if ($currver ne '2') {
- $currver = 1;
- }
}
if (ref($settings->{'recaptchakeys'}) eq 'HASH') {
$currpub = $settings->{'recaptchakeys'}{'public'};
@@ -4624,11 +4606,7 @@ sub captcha_choice {
$currpub.'" size="40" /> '."\n".
''.$privtext.' '."\n".
' '.
- ''.$vertext.' '."\n".
- ' '.
- ' '."\n".
+ $currpriv.'" size="40" />'."\n".
'';
return $output;
}
@@ -5423,7 +5401,7 @@ sub serverstatus_pages {
sub defaults_javascript {
my ($settings) = @_;
- return unless (ref($settings) eq 'HASH');
+ return unless (ref($settings) eq 'HASH');
if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) {
my $maxnum = scalar(@{$settings->{'inststatusorder'}});
if ($maxnum eq '') {
@@ -5508,10 +5486,7 @@ sub coursecategories_javascript {
}
my $instcode_reserved = &mt('The name: [_1] is a reserved category.','"instcode"');
my $communities_reserved = &mt('The name: [_1] is a reserved category.','"communities"');
- my $choose_again = "\n".&mt('Please use a different name for the new top level category.');
- &js_escape(\$instcode_reserved);
- &js_escape(\$communities_reserved);
- &js_escape(\$choose_again);
+ my $choose_again = '\\n'.&mt('Please use a different name for the new top level category.');
$output = <<"ENDSCRIPT";