--- loncom/interface/domainprefs.pm 2023/09/04 17:40:47 1.160.6.118.2.15
+++ loncom/interface/domainprefs.pm 2023/11/03 01:12:15 1.430
@@ -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.15 2023/09/04 17:40:47 raeburn Exp $
+# $Id: domainprefs.pm,v 1.430 2023/11/03 01:12:15 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -95,8 +95,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
@@ -104,7 +103,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 lti).
+(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).
@@ -171,6 +170,7 @@ 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;
@@ -221,10 +221,11 @@ sub handler {
'serverstatuses','requestcourses','helpsettings',
'coursedefaults','usersessions','loadbalancing',
'requestauthor','selfenrollment','inststatus',
- 'passwords','ltitools','toolsec','lti','ltisec',
- 'wafproxy','ipaccess'],$dom);
+ 'ltitools','toolsec','ssl','trust','lti','ltisec',
+ 'privacy','passwords','proctoring','wafproxy',
+ 'ipaccess','authordefaults'],$dom);
my %encconfig =
- &Apache::lonnet::get_dom('encconfig',['ltitools','lti','linkprot'],$dom,undef,1);
+ &Apache::lonnet::get_dom('encconfig',['ltitools','lti','proctoring','linkprot'],$dom,undef,1);
my ($checked_is_home,$is_home);
if (ref($domconfig{'ltitools'}) eq 'HASH') {
if (ref($encconfig{'ltitools'}) eq 'HASH') {
@@ -287,12 +288,25 @@ sub handler {
}
}
}
+ 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','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',
+ 'authordefaults','ltitools','proctoring','selfenrollment',
+ 'usersessions','ssl','trust','lti');
my %existing;
if (ref($domconfig{'loadbalancing'}) eq 'HASH') {
%existing = %{$domconfig{'loadbalancing'}};
@@ -368,11 +382,11 @@ sub handler {
modify => \&modify_passwords,
},
'quotas' =>
- { text => 'Blogs, personal pages/timezones, webDAV/quotas, portfolio',
+ { text => 'Blogs, personal pages/timezones, portfolio/quotas',
help => 'Domain_Configuration_Quotas',
header => [{col1 => 'User affiliation',
col2 => 'Available tools',
- col3 => 'Quotas, MB; (Authoring requires role)',}],
+ col3 => 'Portfilo quota (MB)',}],
print => \&print_quotas,
modify => \&modify_quotas,
},
@@ -553,6 +567,20 @@ sub handler {
print => \&print_selfenrollment,
modify => \&modify_selfenrollment,
},
+ 'privacy' =>
+ {text => 'Role assignments and user privacy',
+ 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',
@@ -588,6 +616,52 @@ 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',
+ 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 Link Protection and LTI Consumers',
help => 'Domain_Configuration_LTI_Provider',
@@ -610,6 +684,16 @@ sub handler {
print => \&print_ipaccess,
modify => \&modify_ipaccess,
},
+ 'authordefaults' =>
+ {text => 'Authoring Space defaults',
+ help => 'Domain_Configuration_Author_Defaults',
+ header => [{col1 => 'Defaults which can be overridden by Author',
+ col2 => 'Settings',},
+ {col1 => 'Defaults which can be overridden by a Dom. Coord.',
+ col2 => 'Settings',},],
+ print => \&print_authordefaults,
+ modify => \&modify_authordefaults,
+ },
);
if (keys(%servers) > 1) {
$prefs{'login'} = { text => 'Log-in page options',
@@ -799,14 +883,24 @@ 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,$lastactref,%domconfig);
} elsif ($action eq 'passwords') {
$output = &modify_passwords($r,$dom,$confname,$lastactref,%domconfig);
} elsif ($action eq 'wafproxy') {
$output = &modify_wafproxy($dom,$action,$lastactref,%domconfig);
} elsif ($action eq 'ipaccess') {
$output = &modify_ipaccess($dom,$lastactref,%domconfig);
+ } elsif ($action eq 'authordefaults') {
+ $output = &modify_authordefaults($dom,$lastactref,%domconfig);
}
return $output;
}
@@ -842,6 +936,8 @@ sub print_config_box {
} elsif ($action eq 'lti') {
$output .= &passwords_javascript('ltisecrets')."\n".
<i_javascript($dom,$settings);
+ } elsif ($action eq 'proctoring') {
+ $output .= &proctoring_javascript($settings);
} elsif ($action eq 'wafproxy') {
$output .= &wafproxy_javascript($dom);
} elsif ($action eq 'autoupdate') {
@@ -852,6 +948,8 @@ sub print_config_box {
$output .= &saml_javascript();
} elsif ($action eq 'ipaccess') {
$output .= &ipaccess_javascript($settings);
+ } elsif ($action eq 'authordefaults') {
+ $output .= &authordefaults_javascript();
}
$output .=
'
+
+
+
+ '.&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).'
@@ -1079,8 +1233,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') {
@@ -1095,9 +1249,9 @@ sub print_config_box {
- '.
+ | '.
&mt($item->{'header'}->[2]->{'col1'}).' |
- '.
+ | '.
&mt($item->{'header'}->[2]->{'col2'}).' |
'.
&print_rolecolors($phase,'author',$dom,$confname,$settings,\$rowtotal).'
@@ -1125,30 +1279,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') {
@@ -1157,7 +1311,7 @@ sub print_config_box {
$output .= ' | ';
}
if ($item->{'header'}->[0]->{'col4'}) {
- $output .= ''.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col4'});
}
$output .= '';
@@ -1165,8 +1319,8 @@ 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 'proctoring') || ($action eq 'ipaccess')) {
$output .= $item->{'print'}->($dom,$settings,\$rowtotal);
}
}
@@ -1191,7 +1345,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'}.' | '.
@@ -1472,7 +1626,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";
@@ -2121,7 +2275,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 .= ' ';
@@ -2149,7 +2303,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.=' ';
}
@@ -2210,7 +2364,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 .= '
| ';
@@ -2243,7 +2397,7 @@ sub image_changes {
$role.'_del_'.$img.'" value="1" />'.&mt('Delete?').
' '.&mt('Replace:').' ';
} else {
- $output .= ''.$logincolors.&mt('Upload:').' ';
+ $output .= ' | '.$logincolors.&mt('Upload:').' ';
}
}
return $output;
@@ -2257,12 +2411,12 @@ sub print_quotas {
} else {
$context = $action;
}
- my ($datatable,$defaultquota,$authorquota,@usertools,@options,%validations);
+ my ($datatable,$defaultquota,@usertools,@options,%validations);
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
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();
@@ -2271,12 +2425,12 @@ sub print_quotas {
@options = ('norequest','approval','automatic');
%titles = &authorrequest_titles();
} else {
- @usertools = ('aboutme','blog','webdav','portfolio','timezone');
+ @usertools = ('aboutme','blog','portfolio','portaccess','timezone');
%titles = &tool_titles();
}
if (ref($types) eq 'ARRAY') {
foreach my $type (@{$types}) {
- my ($currdefquota,$currauthorquota);
+ my $currdefquota;
unless (($context eq 'requestcourses') ||
($context eq 'requestauthor')) {
if (ref($settings) eq 'HASH') {
@@ -2285,9 +2439,6 @@ sub print_quotas {
} else {
$currdefquota = $settings->{$type};
}
- if (ref($settings->{authorquota}) eq 'HASH') {
- $currauthorquota = $settings->{authorquota}->{$type};
- }
}
}
if (defined($usertypes->{$type})) {
@@ -2405,13 +2556,9 @@ sub print_quotas {
($context eq 'requestauthor')) {
$datatable .=
' | '.
- ''.&mt('Portfolio').': '.
+ ''.
''.(' ' x 2).
- ''.&mt('Authoring').': '.
- ' | ';
}
$datatable .= ' ';
@@ -2420,16 +2567,12 @@ sub print_quotas {
}
unless (($context eq 'requestcourses') || ($context eq 'requestauthor')) {
$defaultquota = '20';
- $authorquota = '500';
if (ref($settings) eq 'HASH') {
if (ref($settings->{'defaultquota'}) eq 'HASH') {
$defaultquota = $settings->{'defaultquota'}->{'default'};
} elsif (defined($settings->{'default'})) {
$defaultquota = $settings->{'default'};
}
- if (ref($settings->{'authorquota'}) eq 'HASH') {
- $authorquota = $settings->{'authorquota'}->{'default'};
- }
}
}
$typecount ++;
@@ -2541,12 +2684,9 @@ sub print_quotas {
$datatable .= '';
unless (($context eq 'requestcourses') || ($context eq 'requestauthor')) {
$datatable .= ''.
- ''.&mt('Portfolio').': '.
+ ''.
''.(' ' x2).
- ''.&mt('Authoring').': '.
- ' | ';
+ $defaultquota.'" size="5" />';
}
$datatable .= '';
$typecount ++;
@@ -2729,7 +2869,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) {
@@ -3220,6 +3360,102 @@ function toggleWAF() {
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 ($dom,$settings) = @_;
my $togglejs = <i_toggle_js($dom);
@@ -3706,6 +3942,39 @@ $jstext
ENDSCRIPT
}
+sub authordefaults_javascript {
+ my %alert = &Apache::lonlocal::texthash (
+ reqd => 'Warning: at least one editor needs to be available.',
+ rest => 'Unchecking this editor disallowed while others unchecked.',
+ );
+ &js_escape(\%alert);
+ return <<"ENDSCRIPT";
+
+
+ENDSCRIPT
+}
+
sub print_autoenroll {
my ($dom,$settings,$rowtotal) = @_;
my $autorun = &Apache::lonnet::auto_run(undef,$dom),
@@ -4720,7 +4989,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.' '.
' |
|
|
|
---|
|
|
---|
| | | |