--- loncom/interface/domainprefs.pm 2024/02/25 06:15:54 1.160.6.118.2.19
+++ loncom/interface/domainprefs.pm 2021/12/28 02:04:35 1.399
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.160.6.118.2.19 2024/02/25 06:15:54 raeburn Exp $
+# $Id: domainprefs.pm,v 1.399 2021/12/28 02:04:35 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -104,8 +104,8 @@ $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 lti).
-In each case the radio buttons allow the selection of one of four values:
+(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).
which have the following effects:
@@ -167,17 +167,16 @@ use Apache::lonmsg();
use Apache::lonconfigsettings;
use Apache::lonuserutils();
use Apache::loncoursequeueadmin();
-use Apache::courseprefs();
use LONCAPA qw(:DEFAULT :match);
use LONCAPA::Enrollment;
use LONCAPA::lonauthcgi();
+use LONCAPA::SSL;
use File::Copy;
use Locale::Language;
use DateTime::TimeZone;
use DateTime::Locale;
use Time::HiRes qw( sleep );
use Net::CIDR;
-use Crypt::CBC;
my $registered_cleanup;
my $modified_urls;
@@ -221,27 +220,17 @@ sub handler {
'serverstatuses','requestcourses','helpsettings',
'coursedefaults','usersessions','loadbalancing',
'requestauthor','selfenrollment','inststatus',
- 'passwords','ltitools','toolsec','lti','ltisec',
- 'wafproxy','ipaccess'],$dom);
+ 'ltitools','ssl','trust','lti','privacy','passwords',
+ 'proctoring','wafproxy','ipaccess'],$dom);
my %encconfig =
- &Apache::lonnet::get_dom('encconfig',['ltitools','lti','linkprot'],$dom,undef,1);
- my ($checked_is_home,$is_home);
+ &Apache::lonnet::get_dom('encconfig',['ltitools','lti','proctoring'],$dom,undef,1);
if (ref($domconfig{'ltitools'}) eq 'HASH') {
if (ref($encconfig{'ltitools'}) eq 'HASH') {
- my $home = &Apache::lonnet::domain($dom,'primary');
- unless (($home eq 'no_host') || ($home eq '')) {
- my @ids=&Apache::lonnet::current_machine_ids();
- if (grep(/^\Q$home\E$/,@ids)) {
- $is_home = 1;
- }
- }
- $checked_is_home = 1;
foreach my $id (keys(%{$domconfig{'ltitools'}})) {
if ((ref($domconfig{'ltitools'}{$id}) eq 'HASH') &&
(ref($encconfig{'ltitools'}{$id}) eq 'HASH')) {
- $domconfig{'ltitools'}{$id}{'key'} = $encconfig{'ltitools'}{$id}{'key'};
- if (($is_home) && ($phase eq 'process')) {
- $domconfig{'ltitools'}{$id}{'secret'} = $encconfig{'ltitools'}{$id}{'secret'};
+ foreach my $item ('key','secret') {
+ $domconfig{'ltitools'}{$id}{$item} = $encconfig{'ltitools'}{$id}{$item};
}
}
}
@@ -249,39 +238,23 @@ sub handler {
}
if (ref($domconfig{'lti'}) eq 'HASH') {
if (ref($encconfig{'lti'}) eq 'HASH') {
- unless ($checked_is_home) {
- my $home = &Apache::lonnet::domain($dom,'primary');
- unless (($home eq 'no_host') || ($home eq '')) {
- my @ids=&Apache::lonnet::current_machine_ids();
- if (grep(/^\Q$home\E$/,@ids)) {
- $is_home = 1;
- }
- }
- $checked_is_home = 1;
- }
foreach my $id (keys(%{$domconfig{'lti'}})) {
if ((ref($domconfig{'lti'}{$id}) eq 'HASH') &&
(ref($encconfig{'lti'}{$id}) eq 'HASH')) {
- $domconfig{'lti'}{$id}{'key'} = $encconfig{'lti'}{$id}{'key'};
- if (($is_home) && ($phase eq 'process')) {
- $domconfig{'lti'}{$id}{'secret'} = $encconfig{'lti'}{$id}{'secret'};
+ foreach my $item ('key','secret') {
+ $domconfig{'lti'}{$id}{$item} = $encconfig{'lti'}{$id}{$item};
}
}
}
}
}
- if (ref($domconfig{'ltisec'}) eq 'HASH') {
- if (ref($domconfig{'ltisec'}{'linkprot'}) eq 'HASH') {
- if (ref($encconfig{'linkprot'}) eq 'HASH') {
- foreach my $id (keys(%{$domconfig{'ltisec'}{'linkprot'}})) {
- unless ($id =~ /^\d+$/) {
- delete($domconfig{'ltisec'}{'linkprot'}{$id});
- }
- if ((ref($domconfig{'ltisec'}{'linkprot'}{$id}) eq 'HASH') &&
- (ref($encconfig{'linkprot'}{$id}) eq 'HASH')) {
- foreach my $item ('key','secret') {
- $domconfig{'ltisec'}{'linkprot'}{$id}{$item} = $encconfig{'linkprot'}{$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};
}
}
}
@@ -289,10 +262,11 @@ sub handler {
}
my @prefs_order = ('rolecolors','login','ipaccess','defaults','wafproxy','passwords',
'quotas','autoenroll','autoupdate','autocreate','directorysrch',
- 'contacts','usercreation','selfcreation','usermodification',
- 'scantron','requestcourses','requestauthor','coursecategories',
- 'serverstatuses','helpsettings','coursedefaults',
- 'ltitools','selfenrollment','usersessions','lti');
+ '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'}};
@@ -336,9 +310,7 @@ sub handler {
header => [{col1 => 'Setting',
col2 => 'Value'},
{col1 => 'Institutional user types',
- col2 => 'Name displayed'},
- {col1 => 'Mapping for missing usernames via standard log-in',
- col2 => 'Rules in use'}],
+ col2 => 'Name displayed'}],
print => \&print_defaults,
modify => \&modify_defaults,
},
@@ -368,7 +340,7 @@ sub handler {
modify => \&modify_passwords,
},
'quotas' =>
- { text => 'Blogs, personal pages/timezones, webDAV/quotas, portfolio',
+ { text => 'Blogs, personal web pages, webDAV/quotas, portfolios',
help => 'Domain_Configuration_Quotas',
header => [{col1 => 'User affiliation',
col2 => 'Available tools',
@@ -553,6 +525,20 @@ sub handler {
print => \&print_selfenrollment,
modify => \&modify_selfenrollment,
},
+ 'privacy' =>
+ {text => 'Availability of User Information',
+ help => 'Domain_Configuration_User_Privacy',
+ 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,
+ },
'usersessions' =>
{text => 'User session hosting/offloading',
help => 'Domain_Configuration_User_Sessions',
@@ -576,35 +562,69 @@ sub handler {
print => \&print_loadbalancing,
modify => \&modify_loadbalancing,
},
- 'ltitools' =>
+ 'ltitools' =>
{text => 'External Tools (LTI)',
help => 'Domain_Configuration_LTI_Tools',
- header => [{col1 => 'Encryption of shared secrets',
- col2 => 'Settings'},
- {col1 => 'Rules for shared secrets',
- col2 => 'Settings'},
- {col1 => 'Providers',
- col2 => 'Settings',}],
+ header => [{col1 => 'Setting',
+ col2 => 'Value',}],
print => \&print_ltitools,
modify => \&modify_ltitools,
},
- 'lti' =>
- {text => 'LTI Link Protection and LTI Consumers',
+ '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',
+ header => [{col1 => 'Server',
+ col2 => 'Certificate Status'},
+ {col1 => 'Connections to other servers',
+ col2 => 'Rules'},
+ {col1 => 'Connections from other servers',
+ col2 => 'Rules'},
+ {col1 => "Replicating domain's published content",
+ col2 => 'Rules'}],
+ print => \&print_ssl,
+ modify => \&modify_ssl,
+ },
+ 'trust' =>
+ {text => 'Trust Settings',
+ help => 'Domain_Configuration_Trust',
+ header => [{col1 => "Access to this domain's content by others",
+ col2 => 'Rules'},
+ {col1 => "Access to other domain's content by this domain",
+ col2 => 'Rules'},
+ {col1 => "Enrollment in this domain's courses by others",
+ col2 => 'Rules',},
+ {col1 => "Co-author roles in this domain for others",
+ col2 => 'Rules',},
+ {col1 => "Co-author roles for this domain's users elsewhere",
+ col2 => 'Rules',},
+ {col1 => "Domain roles in this domain assignable to others",
+ col2 => 'Rules'},
+ {col1 => "Course catalog for this domain displayed elsewhere",
+ col2 => 'Rules'},
+ {col1 => "Requests for creation of courses in this domain by others",
+ col2 => 'Rules'},
+ {col1 => "Users in other domains can send messages to this domain",
+ col2 => 'Rules'},],
+ print => \&print_trust,
+ modify => \&modify_trust,
+ },
+ 'lti' =>
+ {text => 'LTI Provider',
help => 'Domain_Configuration_LTI_Provider',
- header => [{col1 => 'Encryption of shared secrets',
- col2 => 'Settings'},
- {col1 => 'Rules for shared secrets',
- col2 => 'Settings'},
- {col1 => 'Link Protectors in Courses',
- col2 => 'Values'},
- {col1 => 'Link Protectors',
- col2 => 'Settings'},
- {col1 => 'Consumers',
- col2 => 'Settings'},],
+ header => [{col1 => 'Setting',
+ col2 => 'Value',}],
print => \&print_lti,
modify => \&modify_lti,
},
- 'ipaccess' =>
+ 'ipaccess' =>
{text => 'IP-based access control',
help => 'Domain_Configuration_IP_Access',
header => [{col1 => 'Setting',
@@ -619,7 +639,7 @@ sub handler {
header => [{col1 => 'Log-in Service',
col2 => 'Server Setting',},
{col1 => 'Log-in Page Items',
- col2 => 'Settings'},
+ col2 => ''},
{col1 => 'Log-in Help',
col2 => 'Value'},
{col1 => 'Custom HTML in document head',
@@ -801,8 +821,16 @@ 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') {
@@ -822,7 +850,7 @@ sub print_config_box {
} elsif ($action eq 'defaults') {
$output = &defaults_javascript($settings);
} elsif ($action eq 'passwords') {
- $output = &passwords_javascript($action);
+ $output = &passwords_javascript();
} elsif ($action eq 'helpsettings') {
my (%privs,%levelscurrent);
my %full=();
@@ -837,13 +865,14 @@ sub print_config_box {
&Apache::lonuserutils::custom_role_privs(\%privs,\%full,\%levels,\%levelscurrent);
my @templateroles = &Apache::lonuserutils::custom_template_roles($context,$crstype);
$output =
- &Apache::lonuserutils::custom_roledefs_js($context,$crstype,$formname,\%full,
+ &Apache::lonuserutils::custom_roledefs_js($context,$crstype,$formname,\%full,
\@templateroles);
} elsif ($action eq 'ltitools') {
- $output .= &Apache::lonconfigsettings::ltitools_javascript($settings);
+ $output .= <itools_javascript($settings);
} elsif ($action eq 'lti') {
- $output .= &passwords_javascript('ltisecrets')."\n".
- <i_javascript($dom,$settings);
+ $output .= <i_javascript($settings);
+ } elsif ($action eq 'proctoring') {
+ $output .= &proctoring_javascript($settings);
} elsif ($action eq 'wafproxy') {
$output .= &wafproxy_javascript($dom);
} elsif ($action eq 'autoupdate') {
@@ -893,9 +922,9 @@ sub print_config_box {
$rowtotal ++;
if (($action eq 'autoupdate') || ($action eq 'usercreation') || ($action eq 'selfcreation') ||
($action eq 'usermodification') || ($action eq 'defaults') || ($action eq 'coursedefaults') ||
- ($action eq 'selfenrollment') || ($action eq 'usersessions') || ($action eq 'directorysrch') ||
- ($action eq 'helpsettings') || ($action eq 'contacts') || ($action eq 'wafproxy') ||
- ($action eq 'lti') || ($action eq 'ltitools')) {
+ ($action eq 'selfenrollment') || ($action eq 'usersessions') || ($action eq 'ssl') ||
+ ($action eq 'directorysrch') || ($action eq 'trust') || ($action eq 'helpsettings') ||
+ ($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);
@@ -929,36 +958,49 @@ sub print_config_box {
$rowtotal ++;
if (($action eq 'autoupdate') || ($action eq 'usercreation') ||
($action eq 'selfcreation') || ($action eq 'selfenrollment') ||
- ($action eq 'usersessions') || ($action eq 'coursecategories') ||
- ($action eq 'contacts') || ($action eq 'passwords') ||
- ($action eq 'defaults') || ($action eq 'lti') ||
- ($action eq 'ltitools')) {
+ ($action eq 'usersessions') || ($action eq 'coursecategories') ||
+ ($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);
- } elsif ($action eq 'lti') {
- $output .= $item->{'print'}->('upper',$dom,$settings,\$rowtotal).'
-
-
-
-
+
+
+
+ '.&mt($item->{'header'}->[3]->{'col1'}).' |
+ '.&mt($item->{'header'}->[3]->{'col2'}).' | '.
+ $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
} elsif ($action eq 'login') {
if ($numheaders == 5) {
$output .= &print_login('page',$dom,$confname,$phase,$settings,\$rowtotal).'
@@ -1099,8 +1163,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') {
@@ -1115,9 +1179,9 @@ sub print_config_box {
- '.
+ | '.
&mt($item->{'header'}->[2]->{'col1'}).' |
- '.
+ | '.
&mt($item->{'header'}->[2]->{'col2'}).' |
'.
&print_rolecolors($phase,'author',$dom,$confname,$settings,\$rowtotal).'
@@ -1145,30 +1209,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') {
@@ -1177,7 +1241,7 @@ sub print_config_box {
$output .= ' | ';
}
if ($item->{'header'}->[0]->{'col4'}) {
- $output .= ''.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col4'});
}
$output .= '';
@@ -1185,8 +1249,9 @@ sub print_config_box {
if ($action eq 'quotas') {
$output .= &print_quotas($dom,$settings,\$rowtotal,$action);
} elsif (($action eq 'autoenroll') || ($action eq 'autocreate') ||
- ($action eq 'serverstatuses') || ($action eq 'loadbalancing') ||
- ($action eq 'ipaccess')) {
+ ($action eq 'serverstatuses') || ($action eq 'loadbalancing') ||
+ ($action eq 'ltitools') || ($action eq 'lti') ||
+ ($action eq 'proctoring') || ($action eq 'ipaccess')) {
$output .= $item->{'print'}->($dom,$settings,\$rowtotal);
}
}
@@ -1211,7 +1276,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'}.' | '.
@@ -1292,7 +1357,6 @@ sub print_login {
}
}
my @images = ('img','logo','domlogo','login');
- my @alttext = ('img','logo','domlogo');
my @logintext = ('textcol','bgcol');
my @bgs = ('pgbg','mainbg','sidebg');
my @links = ('link','alink','vlink');
@@ -1334,13 +1398,6 @@ sub print_login {
$designs{'showlogo'}{$item} = $settings->{'showlogo'}{$item};
}
}
- foreach my $item (@alttext) {
- if (ref($settings->{'alttext'}) eq 'HASH') {
- if ($settings->{'alttext'}->{$item} ne '') {
- $designs{'alttext'}{$item} = $settings->{'alttext'}{$item};
- }
- }
- }
foreach my $item (@logintext) {
if ($settings->{$item} ne '') {
$designs{'logintext'}{$item} = $settings->{$item};
@@ -1492,7 +1549,7 @@ sub print_login {
my $choice = $choices{'headtag'};
$css_class = ' class="LC_odd_row"';
$datatable .= '
---|
'.$choice.' | '.
- ''.$choices{'hostid'}.' | '.
+ ''.$choices{'hostid'}.' | '.
''.$choices{'current'}.' | '.
''.$choices{'action'}.' | '.
''.$choices{'exempt'}.' | '."\n";
@@ -1536,13 +1593,13 @@ sub print_login {
''.$choices{'hostid'}.' | '.
''.$choices{'samllanding'}.' | '.
''.$choices{'samloptions'}.' | '."\n";
- my (%saml,%samltext,%samlimg,%samlalt,%samlurl,%samltitle,%samlwindow,%samlnotsso,%styleon,%styleoff);
+ my (%saml,%samltext,%samlimg,%samlalt,%samlurl,%samltitle,%samlnotsso,%styleon,%styleoff);
foreach my $lonhost (keys(%domservers)) {
$samlurl{$lonhost} = '/adm/sso';
$styleon{$lonhost} = 'display:none';
$styleoff{$lonhost} = '';
}
- if ((ref($settings) eq 'HASH') && (ref($settings->{'saml'}) eq 'HASH')) {
+ if (ref($settings->{'saml'}) eq 'HASH') {
foreach my $lonhost (keys(%{$settings->{'saml'}})) {
if (ref($settings->{'saml'}{$lonhost}) eq 'HASH') {
$saml{$lonhost} = 1;
@@ -1551,7 +1608,6 @@ sub print_login {
$samlalt{$lonhost} = $settings->{'saml'}{$lonhost}{'alt'};
$samlurl{$lonhost} = $settings->{'saml'}{$lonhost}{'url'};
$samltitle{$lonhost} = $settings->{'saml'}{$lonhost}{'title'};
- $samlwindow{$lonhost} = $settings->{'saml'}{$lonhost}{'window'};
$samlnotsso{$lonhost} = $settings->{'saml'}{$lonhost}{'notsso'};
$styleon{$lonhost} = '';
$styleoff{$lonhost} = 'display:none';
@@ -1569,12 +1625,6 @@ sub print_login {
$samlon = $samloff;
$samloff = ' ';
}
- my $samlwinon = '';
- my $samlwinoff = ' checked="checked"';
- if ($samlwindow{$lonhost}) {
- $samlwinon = $samlwinoff;
- $samlwinoff = '';
- }
my $css_class = $itemcount%2?' class="LC_odd_row"':'';
$datatable .= ''.$domservers{$lonhost}.' | '.
' | '.
''.
- ''.&mt('SSO').' | '.
+ ' '.
- ''.
' | ';
@@ -1663,7 +1707,6 @@ sub login_choices {
current => "Current",
samllanding => "Dual login?",
samloptions => "Options",
- alttext => "Alt text",
);
return %choices;
}
@@ -2009,7 +2052,7 @@ sub display_color_options {
$css_class = $itemcount%2?' class="LC_odd_row"':'';
$datatable .= ''.
''.$choices->{$img};
- my ($imgfile,$img_import,$login_hdr_pick,$logincolors,$alttext);
+ my ($imgfile,$img_import,$login_hdr_pick,$logincolors);
if ($role eq 'login') {
if ($img eq 'login') {
$login_hdr_pick =
@@ -2017,13 +2060,8 @@ sub display_color_options {
$logincolors =
&login_text_colors($img,$role,$logintext,$phase,$choices,
$designs,$defaults);
- } else {
- if ($img ne 'domlogo') {
- $datatable.= &logo_display_options($img,$defaults,$designs);
- }
- if (ref($designs->{'alttext'}) eq 'HASH') {
- $alttext = $designs->{'alttext'}{$img};
- }
+ } elsif ($img ne 'domlogo') {
+ $datatable.= &logo_display_options($img,$defaults,$designs);
}
}
$datatable .= ' | ';
@@ -2115,11 +2153,6 @@ sub display_color_options {
$datatable .=' ';
}
}
- if (($role eq 'login') && ($img ne 'login')) {
- $datatable .= (' ' x2).' ';
- }
$datatable .= ' ';
}
$itemcount ++;
@@ -2141,7 +2174,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 .= ' ';
@@ -2169,7 +2202,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.=' ';
}
@@ -2230,7 +2263,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 .= '
| ';
@@ -2263,7 +2296,7 @@ sub image_changes {
$role.'_del_'.$img.'" value="1" />'.&mt('Delete?').
' '.&mt('Replace:').' ';
} else {
- $output .= ''.$logincolors.&mt('Upload:').' ';
+ $output .= ' | '.$logincolors.&mt('Upload:').' ';
}
}
return $output;
@@ -2282,7 +2315,7 @@ sub print_quotas {
my $typecount = 0;
my ($css_class,%titles);
if ($context eq 'requestcourses') {
- @usertools = ('official','unofficial','community','textbook','lti');
+ @usertools = ('official','unofficial','community','textbook','placement','lti');
@options =('norequest','approval','validate','autolimit');
%validations = &Apache::lonnet::auto_courserequest_checks($dom);
%titles = &courserequest_titles();
@@ -2291,7 +2324,7 @@ sub print_quotas {
@options = ('norequest','approval','automatic');
%titles = &authorrequest_titles();
} else {
- @usertools = ('aboutme','blog','webdav','portfolio','timezone');
+ @usertools = ('aboutme','blog','webdav','portfolio');
%titles = &tool_titles();
}
if (ref($types) eq 'ARRAY') {
@@ -2395,12 +2428,9 @@ sub print_quotas {
}
} else {
my $checked = 'checked="checked" ';
- if ($item eq 'timezone') {
- $checked = '';
- }
if (ref($settings) eq 'HASH') {
if (ref($settings->{$item}) eq 'HASH') {
- if (!$settings->{$item}->{$type}) {
+ if ($settings->{$item}->{$type} == 0) {
$checked = '';
} elsif ($settings->{$item}->{$type} == 1) {
$checked = 'checked="checked" ';
@@ -2749,7 +2779,7 @@ sub print_studentcode {
my ($settings,$rowtotal) = @_;
my $rownum = 0;
my ($output,%current);
- my @crstypes = ('official','unofficial','community','textbook','lti');
+ my @crstypes = ('official','unofficial','community','textbook','placement','lti');
if (ref($settings) eq 'HASH') {
if (ref($settings->{'uniquecode'}) eq 'HASH') {
foreach my $type (@crstypes) {
@@ -3240,20 +3270,107 @@ function toggleWAF() {
ENDSCRIPT
}
-sub lti_javascript {
- my ($dom,$settings) = @_;
- my $togglejs = <i_toggle_js($dom);
- my $linkprot_js = &Apache::courseprefs::linkprot_javascript();
- unless (ref($settings) eq 'HASH') {
- return $togglejs.'
+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 = scalar(keys(%{$settings}));
@@ -3315,9 +3432,6 @@ $jstext
}
return;
}
-
-$linkprot_js
-
// ]]>
@@ -3327,16 +3441,12 @@ ENDSCRIPT
}
sub lti_toggle_js {
- my ($dom) = @_;
my %lcauthparmtext = &Apache::lonlocal::texthash (
localauth => 'Local auth argument',
krb => 'Kerberos domain',
);
my $crsincalert = &mt('"User\'s identity sent" needs to be set to "Yes" first,[_1] before setting "Course\'s identity sent" to "Yes"',"\n");
&js_escape(\$crsincalert);
- my %servers = &Apache::lonnet::get_servers($dom,'library');
- my $primary = &Apache::lonnet::domain($dom,'primary');
- my $course_servers = "'".join("','",keys(%servers))."'";
return <<"ENDSCRIPT";
@@ -3620,16 +3729,16 @@ sub saml_javascript {
return <<"ENDSCRIPT";
@@ -4740,7 +4851,7 @@ sub print_helpsettings {
my @templateroles = &Apache::lonuserutils::custom_template_roles($context,$crstype);
$css_class = $itemcount%2?' class="LC_odd_row"':'';
my $chgstr = ' onchange="javascript:reorderHelpRoles(this.form,'."'helproles_".$num."_pos'".');"';
- $datatable .= ' | '.$role.' '.
+ $datatable .= ' | '.$role.' '.
' |
|
|
|
|
---|
|
|
---|
| | | |