version 1.405, 2022/02/14 02:48:46
|
version 1.406, 2022/02/15 04:28:01
|
Line 249 sub handler {
|
Line 249 sub handler {
|
} |
} |
} |
} |
if (ref($domconfig{'ltisec'}) eq 'HASH') { |
if (ref($domconfig{'ltisec'}) eq 'HASH') { |
if (ref($domconfig{'ltisec'}{'prot'}) eq 'HASH') { |
if (ref($domconfig{'ltisec'}{'linkprot'}) eq 'HASH') { |
if (ref($encconfig{'linkprot'}) eq 'HASH') { |
if (ref($encconfig{'linkprot'}) eq 'HASH') { |
foreach my $id (keys(%{$domconfig{'ltisec'}{'prot'}})) { |
foreach my $id (keys(%{$domconfig{'ltisec'}{'linkprot'}})) { |
if ((ref($domconfig{'ltisec'}{'prot'}{$id}) eq 'HASH') && |
unless ($id =~ /^\d+$/) { |
|
delete($domconfig{'ltisec'}{'linkprot'}{$id}); |
|
} |
|
if ((ref($domconfig{'ltisec'}{'linkprot'}{$id}) eq 'HASH') && |
(ref($encconfig{'linkprot'}{$id}) eq 'HASH')) { |
(ref($encconfig{'linkprot'}{$id}) eq 'HASH')) { |
foreach my $item ('key','secret') { |
foreach my $item ('key','secret') { |
$domconfig{'ltisec'}{'prot'}{$id}{$item} = $encconfig{'linkprot'}{$id}{$item}; |
$domconfig{'ltisec'}{'linkprot'}{$id}{$item} = $encconfig{'linkprot'}{$id}{$item}; |
} |
} |
} |
} |
} |
} |
Line 637 sub handler {
|
Line 640 sub handler {
|
col2 => 'Settings'}, |
col2 => 'Settings'}, |
{col1 => 'Rules for shared secrets', |
{col1 => 'Rules for shared secrets', |
col2 => 'Settings'}, |
col2 => 'Settings'}, |
{col1 => 'Link Protectors (domain)', |
{col1 => 'Link Protectors', |
col2 => 'Settings'}, |
col2 => 'Settings'}, |
{col1 => 'Consumers', |
{col1 => 'Consumers', |
col2 => 'Settings'},], |
col2 => 'Settings'},], |
Line 3429 sub lti_javascript {
|
Line 3432 sub lti_javascript {
|
push(@jsarray,$ordered{$item}); |
push(@jsarray,$ordered{$item}); |
} |
} |
my $jstext = ' var lti = Array('."'".join("','",@jsarray)."'".');'."\n"; |
my $jstext = ' var lti = Array('."'".join("','",@jsarray)."'".');'."\n"; |
|
my $linkprot_js = &Apache::courseprefs::linkprot_javascript(); |
return <<"ENDSCRIPT"; |
return <<"ENDSCRIPT"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
Line 3473 $jstext
|
Line 3477 $jstext
|
} |
} |
return; |
return; |
} |
} |
|
|
|
$linkprot_js |
|
|
// ]]> |
// ]]> |
</script> |
</script> |
|
|
Line 6490 sub print_lti {
|
Line 6497 sub print_lti {
|
if (exists($settings->{'linkprot'})) { |
if (exists($settings->{'linkprot'})) { |
if (ref($settings->{'linkprot'}) eq 'HASH') { |
if (ref($settings->{'linkprot'}) eq 'HASH') { |
%linkprot = %{$settings->{'linkprot'}}; |
%linkprot = %{$settings->{'linkprot'}}; |
|
if ($linkprot{'lock'}) { |
|
delete($linkprot{'lock'}); |
|
} |
} |
} |
} |
} |
} else { |
} else { |
Line 6595 sub print_lti {
|
Line 6605 sub print_lti {
|
$$rowtotal += $itemcount; |
$$rowtotal += $itemcount; |
} elsif ($position eq 'middle') { |
} elsif ($position eq 'middle') { |
$datatable = &password_rules('secrets',\$itemcount,\%rules); |
$datatable = &password_rules('secrets',\$itemcount,\%rules); |
|
$$rowtotal += $itemcount; |
} elsif ($position eq 'lower') { |
} elsif ($position eq 'lower') { |
$datatable .= '<tr><td>Not set yet</td><td>To be done</td></tr>'; |
$datatable .= &Apache::courseprefs::print_linkprotection($dom,'',$settings,$rowtotal,'','','domain'); |
} else { |
} else { |
my $maxnum = 0; |
my $maxnum = 0; |
my %ordered; |
my %ordered; |
Line 15828 sub modify_lti {
|
Line 15839 sub modify_lti {
|
|
|
my %menutitles = <imenu_titles(); |
my %menutitles = <imenu_titles(); |
|
|
my (%currltisec,%secchanges,%newltisec,%keyset,%newkeyset); |
my (%currltisec,%secchanges,%newltisec,%newltienc,%keyset,%newkeyset); |
$newltisec{'private'}{'keys'} = []; |
$newltisec{'private'}{'keys'} = []; |
$newltisec{'encrypt'} = {}; |
$newltisec{'encrypt'} = {}; |
$newltisec{'rules'} = {}; |
$newltisec{'rules'} = {}; |
|
$newltisec{'linkprot'} = {}; |
if (ref($domconfig{'ltisec'}) eq 'HASH') { |
if (ref($domconfig{'ltisec'}) eq 'HASH') { |
%currltisec = %{$domconfig{'ltisec'}}; |
%currltisec = %{$domconfig{'ltisec'}}; |
|
if (ref($currltisec{'linkprot'}) eq 'HASH') { |
|
foreach my $id (keys(%{$currltisec{'linkprot'}})) { |
|
unless ($id =~ /^\d+$/) { |
|
delete($currltisec{'linkprot'}{$id}); |
|
} |
|
} |
|
} |
if (ref($currltisec{'private'}) eq 'HASH') { |
if (ref($currltisec{'private'}) eq 'HASH') { |
if (ref($currltisec{'private'}{'keys'}) eq 'ARRAY') { |
if (ref($currltisec{'private'}{'keys'}) eq 'ARRAY') { |
$newltisec{'private'}{'keys'} = $currltisec{'private'}{'keys'}; |
$newltisec{'private'}{'keys'} = $currltisec{'private'}{'keys'}; |
Line 15895 sub modify_lti {
|
Line 15914 sub modify_lti {
|
} |
} |
} |
} |
|
|
|
my (%linkprotchg,$linkprotoutput,$is_home); |
|
my $proterror = &Apache::courseprefs::process_linkprot($dom,'',$currltisec{'linkprot'}, |
|
\%linkprotchg,'domain'); |
|
my $home = &Apache::lonnet::domain($dom,'primary'); |
|
unless (($home eq 'no_host') || ($home eq '')) { |
|
my @ids=&Apache::lonnet::current_machine_ids(); |
|
foreach my $id (@ids) { if ($id eq $home) { $is_home=1; } } |
|
} |
|
|
|
if (keys(%linkprotchg)) { |
|
$secchanges{'linkprot'} = 1; |
|
my %oldlinkprot; |
|
if (ref($currltisec{'linkprot'}) eq 'HASH') { |
|
%oldlinkprot = %{$currltisec{'linkprot'}}; |
|
} |
|
foreach my $id (keys(%linkprotchg)) { |
|
if (ref($linkprotchg{$id}) eq 'HASH') { |
|
foreach my $inner (keys(%{$linkprotchg{$id}})) { |
|
if (($inner eq 'secret') || ($inner eq 'key')) { |
|
if ($is_home) { |
|
$newltienc{$id}{$inner} = $linkprotchg{$id}{$inner}; |
|
} |
|
} |
|
} |
|
} else { |
|
$newltisec{'linkprot'}{$id} = $linkprotchg{$id}; |
|
} |
|
} |
|
$linkprotoutput = &Apache::courseprefs::store_linkprot($dom,'','domain',\%linkprotchg,\%oldlinkprot); |
|
if (keys(%linkprotchg)) { |
|
%{$newltisec{'linkprot'}} = %linkprotchg; |
|
} |
|
} |
|
if (ref($currltisec{'linkprot'}) eq 'HASH') { |
|
foreach my $id (%{$currltisec{'linkprot'}}) { |
|
next if ($id !~ /^\d+$/); |
|
unless (exists($linkprotchg{$id})) { |
|
if (ref($currltisec{'linkprot'}{$id}) eq 'HASH') { |
|
foreach my $inner (keys(%{$currltisec{'linkprot'}{$id}})) { |
|
if (($inner eq 'secret') || ($inner eq 'key')) { |
|
if ($is_home) { |
|
$newltienc{$id}{$inner} = $currltisec{'linkprot'}{$id}{$inner}; |
|
} |
|
} else { |
|
$newltisec{'linkprot'}{$id}{$inner} = $currltisec{'linkprot'}{$id}{$inner}; |
|
} |
|
} |
|
} else { |
|
$newltisec{'linkprot'}{$id} = $currltisec{'linkprot'}{$id}; |
|
} |
|
} |
|
} |
|
} |
|
if ($proterror) { |
|
$errors .= '<li>'.$proterror.'</li>'; |
|
} |
my (@items,%deletions,%itemids); |
my (@items,%deletions,%itemids); |
if ($env{'form.lti_add'}) { |
if ($env{'form.lti_add'}) { |
my $consumer = $env{'form.lti_consumer_add'}; |
my $consumer = $env{'form.lti_consumer_add'}; |
Line 16200 sub modify_lti {
|
Line 16275 sub modify_lti {
|
my %ltihash = ( |
my %ltihash = ( |
$action => { %confhash } |
$action => { %confhash } |
); |
); |
|
my %ltienchash = ( |
|
$action => { %encconfig } |
|
); |
if (keys(%secchanges)) { |
if (keys(%secchanges)) { |
$ltihash{'ltisec'} = \%newltisec; |
$ltihash{'ltisec'} = \%newltisec; |
|
if ($secchanges{'linkprot'}) { |
|
if ($is_home) { |
|
$ltienchash{'linkprot'} = \%newltienc; |
|
} |
|
} |
} |
} |
my $putresult = &Apache::lonnet::put_dom('configuration',\%ltihash,$dom); |
my $putresult = &Apache::lonnet::put_dom('configuration',\%ltihash,$dom); |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
Line 16219 sub modify_lti {
|
Line 16302 sub modify_lti {
|
} |
} |
} |
} |
} |
} |
my %ltienchash = ( |
|
$action => { %encconfig } |
|
); |
|
&Apache::lonnet::put_dom('encconfig',\%ltienchash,$dom,undef,1); |
&Apache::lonnet::put_dom('encconfig',\%ltienchash,$dom,undef,1); |
if ((keys(%changes) == 0) && (keys(%secchanges) == 0)) { |
if ((keys(%changes) == 0) && (keys(%secchanges) == 0)) { |
return &mt('No changes made.'); |
return &mt('No changes made.'); |
Line 16298 sub modify_lti {
|
Line 16378 sub modify_lti {
|
} |
} |
} |
} |
} |
} |
|
} elsif ($item eq 'linkprot') { |
|
$resulttext .= $linkprotoutput; |
} |
} |
} |
} |
} |
} |