--- loncom/interface/domainprefs.pm 2022/02/21 05:31:41 1.160.6.118.2.5
+++ loncom/interface/domainprefs.pm 2022/01/16 19:04:04 1.160.6.119
@@ -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.5 2022/02/21 05:31:41 raeburn Exp $
+# $Id: domainprefs.pm,v 1.160.6.119 2022/01/16 19:04:04 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -218,43 +218,13 @@ sub handler {
'serverstatuses','requestcourses','helpsettings',
'coursedefaults','usersessions','loadbalancing',
'requestauthor','selfenrollment','inststatus',
- 'passwords','ltitools','ltisec','wafproxy','ipaccess'],$dom);
- if (ref($domconfig{'ltitools'}) eq 'HASH') {
- my %encconfig =
- &Apache::lonnet::get_dom('encconfig',['ltitools','linkprot'],$dom,undef,1);
- if (ref($encconfig{'ltitools'}) eq 'HASH') {
- foreach my $id (keys(%{$domconfig{'ltitools'}})) {
- if (ref($domconfig{'ltitools'}{$id}) eq 'HASH') {
- foreach my $item ('key','secret') {
- $domconfig{'ltitools'}{$id}{$item} = $encconfig{'ltitools'}{$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};
- }
- }
- }
- }
- }
- }
+ 'passwords','wafproxy','ipaccess'],$dom);
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');
+ 'selfenrollment','usersessions');
my %existing;
if (ref($domconfig{'loadbalancing'}) eq 'HASH') {
%existing = %{$domconfig{'loadbalancing'}};
@@ -536,26 +506,6 @@ sub handler {
print => \&print_loadbalancing,
modify => \&modify_loadbalancing,
},
- 'ltitools' =>
- {text => 'External Tools (LTI)',
- help => 'Domain_Configuration_LTI_Tools',
- header => [{col1 => 'Setting',
- col2 => 'Value',}],
- print => \&print_ltitools,
- modify => \&modify_ltitools,
- },
- 'lti' =>
- {text => 'LTI Link Protection and LTI Consumers',
- help => 'Domain_Configuration_LTI_Provider',
- header => [{col1 => 'Encryption of shared secrets',
- col2 => 'Settings'},
- {col1 => 'Rules for shared secrets',
- col2 => 'Settings'},
- {col1 => 'Link Protectors',
- col2 => 'Settings'},],
- print => \&print_lti,
- modify => \&modify_lti,
- },
'ipaccess' =>
{text => 'IP-based access control',
help => 'Domain_Configuration_IP_Access',
@@ -571,7 +521,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',
@@ -751,12 +701,8 @@ sub process_changes {
$output = &modify_usersessions($dom,$lastactref,%domconfig);
} elsif ($action eq 'loadbalancing') {
$output = &modify_loadbalancing($dom,%domconfig);
- } elsif ($action eq 'lti') {
- $output = &modify_lti($r,$dom,$action,$lastactref,%domconfig);
} elsif ($action eq 'passwords') {
$output = &modify_passwords($r,$dom,$confname,$lastactref,%domconfig);
- } elsif ($action eq 'ltitools') {
- $output = &modify_ltitools($r,$dom,$action,$lastactref,%domconfig);
} elsif ($action eq 'wafproxy') {
$output = &modify_wafproxy($dom,$action,$lastactref,%domconfig);
} elsif ($action eq 'ipaccess') {
@@ -774,7 +720,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=();
@@ -791,11 +737,6 @@ 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 .= &passwords_javascript('secrets')."\n".
- <i_javascript($dom,$settings);
} elsif ($action eq 'wafproxy') {
$output .= &wafproxy_javascript($dom);
} elsif ($action eq 'autoupdate') {
@@ -846,7 +787,7 @@ sub print_config_box {
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 'helpsettings') || ($action eq 'contacts') || ($action eq 'wafproxy')) {
$output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal);
} elsif ($action eq 'passwords') {
$output .= $item->{'print'}->('top',$dom,$confname,$settings,\$rowtotal);
@@ -881,7 +822,7 @@ 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 'contacts') || ($action eq 'passwords') || ($action eq 'lti')) {
+ ($action eq 'contacts') || ($action eq 'passwords')) {
if ($action eq 'coursecategories') {
$output .= &print_coursecategories('middle',$dom,$item,$settings,\$rowtotal);
$colspan = ' colspan="2"';
@@ -1117,7 +1058,7 @@ 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 'ipaccess')) {
+ ($action eq 'ipaccess')) {
$output .= $item->{'print'}->($dom,$settings,\$rowtotal);
}
}
@@ -1936,7 +1877,7 @@ sub display_color_options {
$logincolors =
&login_text_colors($img,$role,$logintext,$phase,$choices,
$designs,$defaults);
- } else {
+ } else
if ($img ne 'domlogo') {
$datatable.= &logo_display_options($img,$defaults,$designs);
}
@@ -2915,108 +2856,6 @@ $jstext{'templates'};
ENDSCRIPT
}
-sub ltitools_javascript {
- my ($settings) = @_;
- my $togglejs = <itools_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 ltitools = Array('."'".join("','",@jsarray)."'".');'."\n";
- return <<"ENDSCRIPT";
-
-
-$togglejs
-
-ENDSCRIPT
-}
-
-sub ltitools_toggle_js {
- return <<"ENDSCRIPT";
-
-
-ENDSCRIPT
-}
-
sub wafproxy_javascript {
my ($dom) = @_;
return <<"ENDSCRIPT";
@@ -3132,137 +2971,6 @@ function toggleWAF() {
ENDSCRIPT
}
-sub lti_javascript {
- my ($dom,$settings) = @_;
- my $togglejs = <i_toggle_js($dom);
- my $linkprot_js = &Apache::courseprefs::linkprot_javascript();
- return <<"ENDSCRIPT";
-
-
-$togglejs
-
-ENDSCRIPT
-}
-
-sub lti_toggle_js {
- my ($dom) = @_;
- my %servers = &Apache::lonnet::get_servers($dom,'library');
- my $primary = &Apache::lonnet::domain($dom,'primary');
- my $course_servers = "'".join("','",keys(%servers))."'";
-function toggleLTIEncKey(form) {
- var shownhosts = new Array();
- var hiddenhosts = new Array();
- var forcourse = new Array($course_servers);
- var fromdomain = '$primary';
- var crsradio = form.elements['ltisec_crslinkprot'];
- if (crsradio.length) {
- for (var i=0; i 0) {
- for (var j=0; j 0) {
- for (var j=0; j 0) {
- for (var i=0; i 0) {
- for (var i=0; i 0) {
- var setvis;
- for (var i=0; i
-
-
-ENDSCRIPT
-}
-
sub autoupdate_javascript {
return <<"ENDSCRIPT";