--- loncom/interface/domainprefs.pm 2017/05/09 03:04:26 1.297
+++ loncom/interface/domainprefs.pm 2021/01/30 21:47:44 1.377
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.297 2017/05/09 03:04:26 raeburn Exp $
+# $Id: domainprefs.pm,v 1.377 2021/01/30 21:47:44 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -104,7 +104,7 @@ $datatable - HTML containing form eleme
In the case of course requests, radio buttons are displayed for each institutional
affiliate type (and also default, and _LC_adv) for each of the course types
-(official, unofficial, community, textbook, and placement).
+(official, unofficial, community, textbook, placement, and lti).
In each case the radio buttons allow the selection of one of four values:
0, approval, validate, autolimit=N (where N is blank, or a positive integer).
@@ -176,6 +176,7 @@ use Locale::Language;
use DateTime::TimeZone;
use DateTime::Locale;
use Time::HiRes qw( sleep );
+use Net::CIDR;
my $registered_cleanup;
my $modified_urls;
@@ -219,13 +220,15 @@ sub handler {
'serverstatuses','requestcourses','helpsettings',
'coursedefaults','usersessions','loadbalancing',
'requestauthor','selfenrollment','inststatus',
- 'ltitools','ssl','trust'],$dom);
+ 'ltitools','ssl','trust','lti','privacy','passwords',
+ 'proctoring','wafproxy'],$dom);
+ my %encconfig =
+ &Apache::lonnet::get_dom('encconfig',['ltitools','lti','proctoring'],$dom);
if (ref($domconfig{'ltitools'}) eq 'HASH') {
- my %encconfig =
- &Apache::lonnet::get_dom('encconfig',['ltitools'],$dom);
if (ref($encconfig{'ltitools'}) eq 'HASH') {
foreach my $id (keys(%{$domconfig{'ltitools'}})) {
- if (ref($domconfig{'ltitools'}{$id}) eq 'HASH') {
+ if ((ref($domconfig{'ltitools'}{$id}) eq 'HASH') &&
+ (ref($encconfig{'ltitools'}{$id}) eq 'HASH')) {
foreach my $item ('key','secret') {
$domconfig{'ltitools'}{$id}{$item} = $encconfig{'ltitools'}{$id}{$item};
}
@@ -233,12 +236,37 @@ sub handler {
}
}
}
- my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll',
- 'autoupdate','autocreate','directorysrch','contacts',
- 'usercreation','selfcreation','usermodification','scantron',
- 'requestcourses','requestauthor','coursecategories',
- 'serverstatuses','helpsettings','coursedefaults',
- 'ltitools','selfenrollment','usersessions','ssl','trust');
+ if (ref($domconfig{'lti'}) eq 'HASH') {
+ if (ref($encconfig{'lti'}) eq 'HASH') {
+ foreach my $id (keys(%{$domconfig{'lti'}})) {
+ if ((ref($domconfig{'lti'}{$id}) eq 'HASH') &&
+ (ref($encconfig{'lti'}{$id}) eq 'HASH')) {
+ foreach my $item ('key','secret') {
+ $domconfig{'lti'}{$id}{$item} = $encconfig{'lti'}{$id}{$item};
+ }
+ }
+ }
+ }
+ }
+ if (ref($domconfig{'proctoring'}) eq 'HASH') {
+ if (ref($encconfig{'proctoring'}) eq 'HASH') {
+ foreach my $provider (keys(%{$domconfig{'proctoring'}})) {
+ if ((ref($domconfig{'proctoring'}{$provider}) eq 'HASH') &&
+ (ref($encconfig{'proctoring'}{$provider}) eq 'HASH')) {
+ foreach my $item ('key','secret') {
+ $domconfig{'proctoring'}{$provider}{$item} = $encconfig{'proctoring'}{$provider}{$item};
+ }
+ }
+ }
+ }
+ }
+ my @prefs_order = ('rolecolors','login','defaults','wafproxy','passwords','quotas',
+ 'autoenroll','autoupdate','autocreate','directorysrch',
+ 'contacts','privacy','usercreation','selfcreation',
+ 'usermodification','scantron','requestcourses','requestauthor',
+ 'coursecategories','serverstatuses','helpsettings','coursedefaults',
+ 'ltitools','proctoring','selfenrollment','usersessions','ssl',
+ 'trust','lti');
my %existing;
if (ref($domconfig{'loadbalancing'}) eq 'HASH') {
%existing = %{$domconfig{'loadbalancing'}};
@@ -278,13 +306,36 @@ sub handler {
help => 'Domain_Configuration_LangTZAuth',
header => [{col1 => 'Setting',
col2 => 'Value'},
- {col1 => 'Internal Authentication',
- col2 => 'Value'},
{col1 => 'Institutional user types',
- col2 => 'Assignable to e-mail usernames'}],
+ col2 => 'Name displayed'}],
print => \&print_defaults,
modify => \&modify_defaults,
},
+ 'wafproxy' =>
+ { text => 'Web Application Firewall/Reverse Proxy',
+ help => 'Domain_Configuration_WAF_Proxy',
+ header => [{col1 => 'Domain server',
+ col2 => 'Alias for WAF/Reverse Proxy',
+ },
+ {col1 => 'Setting',
+ col2 => 'Value',}],
+ print => \&print_wafproxy,
+ modify => \&modify_wafproxy,
+ },
+ 'passwords' =>
+ { text => 'Passwords (Internal authentication)',
+ help => 'Domain_Configuration_Passwords',
+ header => [{col1 => 'Resetting Forgotten Password',
+ col2 => 'Settings'},
+ {col1 => 'Encryption of Stored Passwords (Internal Auth)',
+ col2 => 'Settings'},
+ {col1 => 'Rules for LON-CAPA Passwords',
+ col2 => 'Settings'},
+ {col1 => 'Course Owner Changing Student Passwords',
+ col2 => 'Settings'}],
+ print => \&print_passwords,
+ modify => \&modify_passwords,
+ },
'quotas' =>
{ text => 'Blogs, personal web pages, webDAV/quotas, portfolios',
help => 'Domain_Configuration_Quotas',
@@ -339,6 +390,8 @@ sub handler {
col2 => 'Value',},
{col1 => 'Recipient(s) for notifications',
col2 => 'Value',},
+ {col1 => 'Nightly status check e-mail',
+ col2 => 'Settings',},
{col1 => 'Ask helpdesk form settings',
col2 => 'Value',},],
print => \&print_contacts,
@@ -363,7 +416,7 @@ sub handler {
col2 => 'Enabled?'},
{col1 => 'Institutional user type (login/SSO self-creation)',
col2 => 'Information user can enter'},
- {col1 => 'Self-creation with e-mail as username',
+ {col1 => 'Self-creation with e-mail verification',
col2 => 'Settings'}],
print => \&print_selfcreation,
modify => \&modify_selfcreation,
@@ -379,11 +432,12 @@ sub handler {
modify => \&modify_usermodification,
},
'scantron' =>
- { text => 'Bubblesheet format file',
+ { text => 'Bubblesheet format',
help => 'Domain_Configuration_Scantron_Format',
- header => [ {col1 => 'Item',
- col2 => '',
- }],
+ header => [ {col1 => 'Bubblesheet format file',
+ col2 => ''},
+ {col1 => 'Bubblesheet data upload formats',
+ col2 => 'Settings'}],
print => \&print_scantron,
modify => \&modify_scantron,
},
@@ -469,10 +523,16 @@ sub handler {
modify => \&modify_selfenrollment,
},
'privacy' =>
- {text => 'User Privacy',
+ {text => 'Availability of User Information',
help => 'Domain_Configuration_User_Privacy',
- header => [{col1 => 'Setting',
- col2 => 'Value',}],
+ header => [{col1 => 'Role assigned in different domain',
+ col2 => 'Approval options'},
+ {col1 => 'Role assigned in different domain to user of type',
+ col2 => 'User information available in that domain'},
+ {col1 => "Role assigned in user's domain",
+ col2 => 'Information viewable by privileged user'},
+ {col1 => "Role assigned in user's domain",
+ col2 => 'Information viewable by unprivileged user'}],
print => \&print_privacy,
modify => \&modify_privacy,
},
@@ -507,6 +567,14 @@ sub handler {
print => \&print_ltitools,
modify => \&modify_ltitools,
},
+ 'proctoring' =>
+ {text => 'Remote Proctoring Integration',
+ help => 'Domain_Configuration_Proctoring',
+ header => [{col1 => 'Name',
+ col2 => 'Configuration'}],
+ print => \&print_proctoring,
+ modify => \&modify_proctoring,
+ },
'ssl' =>
{text => 'LON-CAPA Network (SSL)',
help => 'Domain_Configuration_Network_SSL',
@@ -545,6 +613,14 @@ sub handler {
print => \&print_trust,
modify => \&modify_trust,
},
+ 'lti' =>
+ {text => 'LTI Provider',
+ help => 'Domain_Configuration_LTI_Provider',
+ header => [{col1 => 'Setting',
+ col2 => 'Value',}],
+ print => \&print_lti,
+ modify => \&modify_lti,
+ },
);
if (keys(%servers) > 1) {
$prefs{'login'} = { text => 'Log-in page options',
@@ -598,9 +674,15 @@ $javascript_validations
$coursebrowserjs
END
}
+ if (grep(/^selfcreation$/,@actions)) {
+ $js .= &selfcreate_javascript();
+ }
if (grep(/^contacts$/,@actions)) {
$js .= &contacts_javascript();
}
+ if (grep(/^scantron$/,@actions)) {
+ $js .= &scantron_javascript();
+ }
&Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,$js);
} else {
# check if domconfig user exists for the domain.
@@ -694,7 +776,7 @@ sub process_changes {
} elsif ($action eq 'usercreation') {
$output = &modify_usercreation($dom,%domconfig);
} elsif ($action eq 'selfcreation') {
- $output = &modify_selfcreation($dom,%domconfig);
+ $output = &modify_selfcreation($dom,$lastactref,%domconfig);
} elsif ($action eq 'usermodification') {
$output = &modify_usermodification($dom,%domconfig);
} elsif ($action eq 'contacts') {
@@ -723,10 +805,20 @@ sub process_changes {
$output = &modify_loadbalancing($dom,%domconfig);
} elsif ($action eq 'ltitools') {
$output = &modify_ltitools($r,$dom,$action,$lastactref,%domconfig);
+ } elsif ($action eq 'proctoring') {
+ $output = &modify_proctoring($r,$dom,$action,$lastactref,%domconfig);
} elsif ($action eq 'ssl') {
$output = &modify_ssl($dom,$lastactref,%domconfig);
} elsif ($action eq 'trust') {
$output = &modify_trust($dom,$lastactref,%domconfig);
+ } elsif ($action eq 'lti') {
+ $output = &modify_lti($r,$dom,$action,$lastactref,%domconfig);
+ } elsif ($action eq 'privacy') {
+ $output = &modify_privacy($dom,%domconfig);
+ } elsif ($action eq 'passwords') {
+ $output = &modify_passwords($r,$dom,$confname,$lastactref,%domconfig);
+ } elsif ($action eq 'wafproxy') {
+ $output = &modify_wafproxy($dom,$action,$lastactref,%domconfig);
}
return $output;
}
@@ -739,6 +831,8 @@ sub print_config_box {
$output = &coursecategories_javascript($settings);
} elsif ($action eq 'defaults') {
$output = &defaults_javascript($settings);
+ } elsif ($action eq 'passwords') {
+ $output = &passwords_javascript();
} elsif ($action eq 'helpsettings') {
my (%privs,%levelscurrent);
my %full=();
@@ -755,11 +849,17 @@ sub print_config_box {
$output =
&Apache::lonuserutils::custom_roledefs_js($context,$crstype,$formname,\%full,
\@templateroles);
+ } elsif ($action eq 'ltitools') {
+ $output .= <itools_javascript($settings);
+ } elsif ($action eq 'lti') {
+ $output .= <i_javascript($settings);
+ } elsif ($action eq 'proctoring') {
+ $output .= &proctoring_javascript($settings);
}
$output .=
'
- '.
+ | '.
&mt($item->{text}).' '.
&Apache::loncommon::help_open_topic($item->{'help'}).' | '."\n".
'
';
@@ -771,6 +871,7 @@ sub print_config_box {
if ($numheaders > 1) {
my $colspan = '';
my $rightcolspan = '';
+ my $leftnobr = '';
if (($action eq 'rolecolors') || ($action eq 'defaults') ||
($action eq 'directorysrch') ||
(($action eq 'login') && ($numheaders < 4))) {
@@ -779,12 +880,15 @@ sub print_config_box {
if ($action eq 'usersessions') {
$rightcolspan = ' colspan="3"';
}
+ if ($action eq 'passwords') {
+ $leftnobr = ' LC_nobreak';
+ }
$output .= '
- '.&mt($item->{'header'}->[0]->{'col1'}).' |
+ '.&mt($item->{'header'}->[0]->{'col1'}).' |
'.&mt($item->{'header'}->[0]->{'col2'}).' |
';
$rowtotal ++;
@@ -792,10 +896,14 @@ sub print_config_box {
($action eq 'usermodification') || ($action eq 'defaults') || ($action eq 'coursedefaults') ||
($action eq 'selfenrollment') || ($action eq 'usersessions') || ($action eq 'ssl') ||
($action eq 'directorysrch') || ($action eq 'trust') || ($action eq 'helpsettings') ||
- ($action eq 'contacts')) {
+ ($action eq 'contacts') || ($action eq 'privacy') || ($action eq 'wafproxy')) {
$output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal);
+ } elsif ($action eq 'passwords') {
+ $output .= $item->{'print'}->('top',$dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'coursecategories') {
$output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal);
+ } elsif ($action eq 'scantron') {
+ $output .= $item->{'print'}->($r,'top',$dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'login') {
if ($numheaders == 4) {
$colspan = ' colspan="2"';
@@ -823,12 +931,15 @@ sub print_config_box {
if (($action eq 'autoupdate') || ($action eq 'usercreation') ||
($action eq 'selfcreation') || ($action eq 'selfenrollment') ||
($action eq 'usersessions') || ($action eq 'coursecategories') ||
- ($action eq 'trust') || ($action eq 'contacts') || ($action eq 'defaults')) {
+ ($action eq 'trust') || ($action eq 'contacts') ||
+ ($action eq 'privacy') || ($action eq 'passwords')) {
if ($action eq 'coursecategories') {
$output .= &print_coursecategories('middle',$dom,$item,$settings,\$rowtotal);
$colspan = ' colspan="2"';
} elsif ($action eq 'trust') {
$output .= $item->{'print'}->('shared',$dom,$settings,\$rowtotal);
+ } elsif ($action eq 'passwords') {
+ $output .= $item->{'print'}->('middle',$dom,$confname,$settings,\$rowtotal);
} else {
$output .= $item->{'print'}->('middle',$dom,$settings,\$rowtotal);
}
@@ -874,6 +985,33 @@ sub print_config_box {
'."\n";
if ($action eq 'coursecategories') {
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal);
+ } elsif (($action eq 'contacts') || ($action eq 'privacy') || ($action eq 'passwords')) {
+ if ($action eq 'passwords') {
+ $output .= $item->{'print'}->('lower',$dom,$confname,$settings,\$rowtotal);
+ } else {
+ $output .= $item->{'print'}->('lower',$dom,$settings,\$rowtotal);
+ }
+ $output .= '
+
+
+ |
+
+
+
+
+
+ '.&mt($item->{'header'}->[3]->{'col1'}).' |
+ '.&mt($item->{'header'}->[3]->{'col2'}).' | '."\n";
+ if ($action eq 'passwords') {
+ $output .= $item->{'print'}->('bottom',$dom,$confname,$settings,\$rowtotal);
+ } else {
+ $output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
+ }
+ $output .= '
+
+ |
+
+ ';
} else {
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
}
@@ -881,8 +1019,10 @@ sub print_config_box {
$rowtotal ++;
} elsif (($action eq 'usermodification') || ($action eq 'coursedefaults') ||
($action eq 'defaults') || ($action eq 'directorysrch') ||
- ($action eq 'helpsettings')) {
+ ($action eq 'helpsettings') || ($action eq 'wafproxy')) {
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
+ } elsif ($action eq 'scantron') {
+ $output .= $item->{'print'}->($r,'bottom',$dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'ssl') {
$output .= $item->{'print'}->('connto',$dom,$settings,\$rowtotal).'
@@ -975,8 +1115,8 @@ sub print_config_box {
- '.&mt($item->{'header'}->[4]->{'col1'}).' |
- '.&mt($item->{'header'}->[4]->{'col2'}).' |
+ '.&mt($item->{'header'}->[4]->{'col1'}).' |
+ '.&mt($item->{'header'}->[4]->{'col2'}).' |
'.
&print_validation_rows('requestcourses',$dom,$settings,\$rowtotal);
} elsif ($action eq 'requestauthor') {
@@ -991,9 +1131,9 @@ sub print_config_box {
- '.
+ | '.
&mt($item->{'header'}->[2]->{'col1'}).' |
- '.
+ | '.
&mt($item->{'header'}->[2]->{'col2'}).' |
'.
&print_rolecolors($phase,'author',$dom,$confname,$settings,\$rowtotal).'
@@ -1021,30 +1161,30 @@ sub print_config_box {
'.&mt($item->{'header'}->[0]->{'col1'}).' | ';
} elsif ($action eq 'serverstatuses') {
$output .= '
- '.&mt($item->{'header'}->[0]->{'col1'}).
+ | '.&mt($item->{'header'}->[0]->{'col1'}).
' ('.&mt('Automatic access for Dom. Coords.').') | ';
} else {
$output .= '
- '.&mt($item->{'header'}->[0]->{'col1'}).' | ';
+ '.&mt($item->{'header'}->[0]->{'col1'}).' | ';
}
if (defined($item->{'header'}->[0]->{'col3'})) {
- $output .= ''.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col2'});
if ($action eq 'serverstatuses') {
$output .= ' ('.&mt('user1:domain1,user2:domain2 etc.').')';
}
} else {
- $output .= ' | '.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col2'});
}
$output .= ' | ';
if ($item->{'header'}->[0]->{'col3'}) {
if (defined($item->{'header'}->[0]->{'col4'})) {
- $output .= ''.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col3'});
} else {
- $output .= ' | '.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col3'});
}
if ($action eq 'serverstatuses') {
@@ -1053,7 +1193,7 @@ sub print_config_box {
$output .= ' | ';
}
if ($item->{'header'}->[0]->{'col4'}) {
- $output .= ''.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col4'});
}
$output .= '';
@@ -1062,10 +1202,9 @@ sub print_config_box {
$output .= &print_quotas($dom,$settings,\$rowtotal,$action);
} elsif (($action eq 'autoenroll') || ($action eq 'autocreate') ||
($action eq 'serverstatuses') || ($action eq 'loadbalancing') ||
- ($action eq 'ltitools')) {
+ ($action eq 'ltitools') || ($action eq 'lti') ||
+ ($action eq 'proctoring')) {
$output .= $item->{'print'}->($dom,$settings,\$rowtotal);
- } elsif ($action eq 'scantron') {
- $output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal);
}
}
$output .= '
@@ -1086,7 +1225,7 @@ sub print_login {
my $choice = $choices{'disallowlogin'};
$css_class = ' class="LC_odd_row"';
$datatable .= ' | '.$choice.' | '.
- ''.$choices{'hostid'}.' | '.
+ ''.$choices{'hostid'}.' | '.
''.$choices{'server'}.' | '.
''.$choices{'serverpath'}.' | '.
''.$choices{'custompath'}.' | '.
@@ -1367,7 +1506,7 @@ sub print_login {
my $choice = $choices{'headtag'};
$css_class = ' class="LC_odd_row"';
$datatable .= '
---|
'.$choice.' | '.
- ''.$choices{'hostid'}.' | '.
+ ' | ';
}
@@ -1570,7 +1709,7 @@ sub display_color_options {
my $datatable = ''.
''.$choices->{'font'}.' | ';
if (!$is_custom->{'font'}) {
- $datatable .= ''.&mt('Default in use:').' '.$defaults->{'font'}.' | ';
+ $datatable .= ''.&mt('Default in use:').' '.$defaults->{'font'}.' | ';
} else {
$datatable .= ' | ';
}
@@ -1579,12 +1718,12 @@ sub display_color_options {
$datatable .= ''.
' '.
- ' | ';
+ ' ';
unless ($role eq 'login') {
$datatable .= ''.
''.$choices->{'fontmenu'}.' | ';
if (!$is_custom->{'fontmenu'}) {
- $datatable .= ''.&mt('Default in use:').' '.$defaults->{'fontmenu'}.' | ';
+ $datatable .= ''.&mt('Default in use:').' '.$defaults->{'fontmenu'}.' | ';
} else {
$datatable .= ' | ';
}
@@ -1594,7 +1733,7 @@ sub display_color_options {
' '.
- ' ';
+ ' ';
}
my $switchserver = &check_switchserver($dom,$confname);
foreach my $img (@{$images}) {
@@ -1653,7 +1792,8 @@ sub display_color_options {
if ($fullwidth ne '' && $fullheight ne '') {
if ($fullwidth > $width && $fullheight > $height) {
my $size = $width.'x'.$height;
- system("convert -sample $size $input $output");
+ my @args = ('convert','-sample',$size,$input,$output);
+ system({$args[0]} @args);
$showfile = "/$imgdir/tn-".$filename;
}
}
@@ -1711,7 +1851,7 @@ sub display_color_options {
my $bgs_def;
foreach my $item (@{$bgs}) {
if (!$is_custom->{$item}) {
- $bgs_def .= ''.$choices->{$item}.' '.$defaults->{'bgs'}{$item}.' | ';
+ $bgs_def .= ''.$choices->{$item}.' '.$defaults->{'bgs'}{$item}.' | ';
}
}
if ($bgs_def) {
@@ -1723,7 +1863,7 @@ sub display_color_options {
'';
foreach my $item (@{$bgs}) {
- $datatable .= ''.$choices->{$item};
+ $datatable .= ' | '.$choices->{$item};
my $color = $designs->{'bgs'}{$item} ? $designs->{'bgs'}{$item} : $defaults->{'bgs'}{$item};
if ($designs->{'bgs'}{$item}) {
$datatable .= ' ';
@@ -1739,7 +1879,7 @@ sub display_color_options {
my $links_def;
foreach my $item (@{$links}) {
if (!$is_custom->{$item}) {
- $links_def .= ' | '.$choices->{$item}.' '.$defaults->{'links'}{$item}.' | ';
+ $links_def .= ''.$choices->{$item}.' '.$defaults->{'links'}{$item}.' | ';
}
}
if ($links_def) {
@@ -1751,7 +1891,7 @@ sub display_color_options {
'';
foreach my $item (@{$links}) {
my $color = $designs->{'links'}{$item} ? $designs->{'links'}{$item} : $defaults->{'links'}{$item};
- $datatable .= ''.$choices->{$item}."\n";
+ $datatable .= ' | '.$choices->{$item}."\n";
if ($designs->{'links'}{$item}) {
$datatable.=' ';
}
@@ -1812,7 +1952,7 @@ sub login_text_colors {
my ($img,$role,$logintext,$phase,$choices,$designs,$defaults) = @_;
my $color_menu = '';
foreach my $item (@{$logintext}) {
- $color_menu .= ''.$choices->{$item};
+ $color_menu .= ' | '.$choices->{$item};
my $color = $designs->{'logintext'}{$item} ? $designs->{'logintext'}{$item} : $defaults->{'logintext'}{$item};
$color_menu .= '
| ';
@@ -1825,17 +1965,15 @@ sub image_changes {
my ($is_custom,$alt_text,$img_import,$showfile,$fullsize,$role,$img,$imgfile,$logincolors) = @_;
my $output;
if ($img eq 'login') {
- # suppress image for Log-in header
+ $output = ''.$logincolors; # suppress image for Log-in header
} elsif (!$is_custom) {
if ($img ne 'domlogo') {
- $output .= &mt('Default image:').' ';
+ $output = &mt('Default image:').' ';
} else {
- $output .= &mt('Default in use:').' ';
+ $output = &mt('Default in use:').' ';
}
}
- if ($img eq 'login') { # suppress image for Log-in header
- $output .= ' | '.$logincolors;
- } else {
+ if ($img ne 'login') {
if ($img_import) {
$output .= '';
}
@@ -1847,7 +1985,7 @@ sub image_changes {
$role.'_del_'.$img.'" value="1" />'.&mt('Delete?').
' '.&mt('Replace:').' ';
} else {
- $output .= ' | '.$logincolors.&mt('Upload:').' ';
+ $output .= ' | '.$logincolors.&mt('Upload:').' ';
}
}
return $output;
@@ -1866,7 +2004,7 @@ sub print_quotas {
my $typecount = 0;
my ($css_class,%titles);
if ($context eq 'requestcourses') {
- @usertools = ('official','unofficial','community','textbook','placement');
+ @usertools = ('official','unofficial','community','textbook','placement','lti');
@options =('norequest','approval','validate','autolimit');
%validations = &Apache::lonnet::auto_courserequest_checks($dom);
%titles = &courserequest_titles();
@@ -2279,7 +2417,7 @@ sub print_quotas {
}
sub print_requestmail {
- my ($dom,$action,$settings,$rowtotal) = @_;
+ my ($dom,$action,$settings,$rowtotal,$customcss,$rowstyle) = @_;
my ($now,$datatable,%currapp);
$now = time;
if (ref($settings) eq 'HASH') {
@@ -2291,7 +2429,19 @@ sub print_requestmail {
}
my $numinrow = 2;
my $css_class;
- $css_class = ($$rowtotal%2? ' class="LC_odd_row"':'');
+ if ($$rowtotal%2) {
+ $css_class = 'LC_odd_row';
+ }
+ if ($customcss) {
+ $css_class .= " $customcss";
+ }
+ $css_class =~ s/^\s+//;
+ if ($css_class) {
+ $css_class = ' class="'.$css_class.'"';
+ }
+ if ($rowstyle) {
+ $css_class .= ' style="'.$rowstyle.'"';
+ }
my $text;
if ($action eq 'requestcourses') {
$text = &mt('Receive notification of course requests requiring approval');
@@ -2318,7 +2468,7 @@ sub print_studentcode {
my ($settings,$rowtotal) = @_;
my $rownum = 0;
my ($output,%current);
- my @crstypes = ('official','unofficial','community','textbook','placement');
+ my @crstypes = ('official','unofficial','community','textbook','placement','lti');
if (ref($settings) eq 'HASH') {
if (ref($settings->{'uniquecode'}) eq 'HASH') {
foreach my $type (@crstypes) {
@@ -2445,7 +2595,7 @@ sub print_textbookcourses {
$datatable .= '';
}
$datatable .= ' '."\n".
- ''.&mt('Add').' | '."\n".
+ ''.&mt('Add').''."\n".
''.
''.&mt('Subject:').' '."\n".
(' 'x2).
@@ -2462,13 +2612,13 @@ sub print_textbookcourses {
} else {
$datatable .= '';
}
+ $datatable .= ''."\n";
}
- $datatable .= ''."\n".
- ''.&mt('LON-CAPA course:').' '.
+ $datatable .= ''.&mt('LON-CAPA course:').' '.
&Apache::loncommon::select_dom_form($env{'request.role.domain'},$type.'_addbook_cdom').
''.
&Apache::loncommon::selectcourse_link
- ('display',$type.'_addbook_cnum',$type.'_addbook_cdom',undef,undef,undef,'Course');
+ ('display',$type.'_addbook_cnum',$type.'_addbook_cdom',undef,undef,undef,'Course').
' | '."\n".
' '."\n";
$itemcount ++;
@@ -2570,7 +2720,10 @@ ENDSCRIPT
sub ltitools_javascript {
my ($settings) = @_;
- return unless(ref($settings) eq 'HASH');
+ my $togglejs = <itools_toggle_js();
+ unless (ref($settings) eq 'HASH') {
+ return $togglejs;
+ }
my (%ordered,$total,%jstext);
$total = 0;
foreach my $item (keys(%{$settings})) {
@@ -2588,7 +2741,7 @@ sub ltitools_javascript {
return <<"ENDSCRIPT";
+$togglejs
+
+ENDSCRIPT
+}
+
+sub ltitools_toggle_js {
+ return <<"ENDSCRIPT";
+
+
+ENDSCRIPT
+}
+
+sub proctoring_javascript {
+ my ($settings) = @_;
+ my (%ordered,$total,%jstext);
+ $total = 0;
+ if (ref($settings) eq 'HASH') {
+ foreach my $item (keys(%{$settings})) {
+ if (ref($settings->{$item}) eq 'HASH') {
+ my $num = $settings->{$item}{'order'};
+ $ordered{$num} = $item;
+ }
+ }
+ $total = scalar(keys(%{$settings}));
+ } else {
+ %ordered = (
+ 0 => 'proctorio',
+ 1 => 'examity',
+ );
+ $total = 2;
+ }
+ my @jsarray = ();
+ foreach my $item (sort {$a <=> $b } (keys(%ordered))) {
+ push(@jsarray,$ordered{$item});
+ }
+ my $jstext = ' var proctors = Array('."'".join("','",@jsarray)."'".');'."\n";
+ return <<"ENDSCRIPT";
+
+
+ENDSCRIPT
+}
+
+
+sub lti_javascript {
+ my ($settings) = @_;
+ my $togglejs = <i_toggle_js();
+ unless (ref($settings) eq 'HASH') {
+ return $togglejs;
+ }
+ my (%ordered,$total,%jstext);
+ $total = 0;
+ foreach my $item (keys(%{$settings})) {
+ if (ref($settings->{$item}) eq 'HASH') {
+ my $num = $settings->{$item}{'order'};
+ $ordered{$num} = $item;
+ }
+ }
+ $total = scalar(keys(%{$settings}));
+ my @jsarray = ();
+ foreach my $item (sort {$a <=> $b } (keys(%ordered))) {
+ push(@jsarray,$ordered{$item});
+ }
+ my $jstext = ' var lti = Array('."'".join("','",@jsarray)."'".');'."\n";
+ return <<"ENDSCRIPT";
+
+
+$togglejs
+
+ENDSCRIPT
+}
+
+sub lti_toggle_js {
+ my %lcauthparmtext = &Apache::lonlocal::texthash (
+ localauth => 'Local auth argument',
+ krb => 'Kerberos domain',
+ );
+ return <<"ENDSCRIPT";
+
+
ENDSCRIPT
}
@@ -2715,7 +3273,7 @@ sub print_autoenroll {
''.&mt('Failsafe for no drops when institutional data missing').' | '.
''.
' | ';
+ ' value="'.$failsafe.'" size="4" />';
$$rowtotal += 4;
return $datatable;
}
@@ -2764,7 +3322,7 @@ sub print_autoupdate {
my $locknamesettings;
$datatable .= &insttypes_row($settings,$types,$usertypes,
$dom,$numinrow,$othertitle,
- 'lockablenames');
+ 'lockablenames',$rowtotal);
$$rowtotal ++;
} else {
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
@@ -2907,7 +3465,8 @@ sub print_directorysrch {
if (ref($usertypes) eq 'HASH') {
if (keys(%{$usertypes}) > 0) {
$datatable .= &insttypes_row($settings,$types,$usertypes,$dom,
- $numinrow,$othertitle,'cansearch');
+ $numinrow,$othertitle,'cansearch',
+ $rowtotal);
$cansrchrow = 1;
}
}
@@ -2996,7 +3555,7 @@ sub print_contacts {
my $datatable;
my @contacts = ('adminemail','supportemail');
my (%checked,%to,%otheremails,%bccemails,%includestr,%includeloc,%currfield,
- $maxsize,$fields,$fieldtitles,$fieldoptions,$possoptions,@mailings);
+ $maxsize,$fields,$fieldtitles,$fieldoptions,$possoptions,@mailings,%lonstatus);
if ($position eq 'top') {
if (ref($settings) eq 'HASH') {
foreach my $item (@contacts) {
@@ -3007,10 +3566,16 @@ sub print_contacts {
}
} elsif ($position eq 'middle') {
@mailings = ('errormail','packagesmail','lonstatusmail','requestsmail',
- 'updatesmail','idconflictsmail');
+ 'updatesmail','idconflictsmail','hostipmail');
foreach my $type (@mailings) {
$otheremails{$type} = '';
}
+ } elsif ($position eq 'lower') {
+ if (ref($settings) eq 'HASH') {
+ if (ref($settings->{'lonstatus'}) eq 'HASH') {
+ %lonstatus = %{$settings->{'lonstatus'}};
+ }
+ }
} else {
@mailings = ('helpdeskmail','otherdomsmail');
foreach my $type (@mailings) {
@@ -3023,7 +3588,7 @@ sub print_contacts {
($fields,$fieldtitles,$fieldoptions,$possoptions) = &helpform_fields();
}
if (ref($settings) eq 'HASH') {
- unless ($position eq 'top') {
+ unless (($position eq 'top') || ($position eq 'lower')) {
foreach my $type (@mailings) {
if (exists($settings->{$type})) {
if (ref($settings->{$type}) eq 'HASH') {
@@ -3084,6 +3649,7 @@ sub print_contacts {
$checked{'requestsmail'}{'adminemail'} = ' checked="checked" ';
$checked{'updatesmail'}{'adminemail'} = ' checked="checked" ';
$checked{'idconflictsmail'}{'adminemail'} = ' checked="checked" ';
+ $checked{'hostipmail'}{'adminemail'} = ' checked="checked" ';
} elsif ($position eq 'bottom') {
$checked{'helpdeskmail'}{'supportemail'} = ' checked="checked" ';
$checked{'otherdomsmail'}{'supportemail'} = ' checked="checked" ';
@@ -3108,7 +3674,54 @@ sub print_contacts {
$to{$item}.'" />';
$rownum ++;
}
- } else {
+ } elsif ($position eq 'bottom') {
+ $css_class = $rownum%2?' class="LC_odd_row"':'';
+ $datatable .= ''.
+ ''.&mt('Extra helpdesk form fields:').' '.
+ &mt('(e-mail, subject, and description always shown)').
+ ' | ';
+ if ((ref($fields) eq 'ARRAY') && (ref($fieldtitles) eq 'HASH') &&
+ (ref($fieldoptions) eq 'HASH') && (ref($possoptions) eq 'HASH')) {
+ $datatable .= '';
+ }
+ $datatable .= ' | '."\n";
+ $rownum ++;
+ }
+ unless (($position eq 'top') || ($position eq 'lower')) {
foreach my $type (@mailings) {
$css_class = $rownum%2?' class="LC_odd_row"':'';
$datatable .= ''.
@@ -3142,7 +3755,7 @@ sub print_contacts {
'value="'.$bccemails{$type}.'" />'.
'
|
|
|
---|
| | |