version 1.414, 2022/09/18 22:33:45
|
version 1.420, 2023/03/08 15:06:45
|
Line 167 use Apache::lonmsg();
|
Line 167 use Apache::lonmsg();
|
use Apache::lonconfigsettings; |
use Apache::lonconfigsettings; |
use Apache::lonuserutils(); |
use Apache::lonuserutils(); |
use Apache::loncoursequeueadmin(); |
use Apache::loncoursequeueadmin(); |
|
use Apache::courseprefs(); |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA::Enrollment; |
use LONCAPA::Enrollment; |
use LONCAPA::lonauthcgi(); |
use LONCAPA::lonauthcgi(); |
Line 3431 ENDSCRIPT
|
Line 3432 ENDSCRIPT
|
sub lti_javascript { |
sub lti_javascript { |
my ($dom,$settings) = @_; |
my ($dom,$settings) = @_; |
my $togglejs = <i_toggle_js($dom); |
my $togglejs = <i_toggle_js($dom); |
|
my $linkprot_js = &Apache::courseprefs::linkprot_javascript(); |
unless (ref($settings) eq 'HASH') { |
unless (ref($settings) eq 'HASH') { |
return $togglejs; |
return $togglejs.' |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
|
|
'.$linkprot_js.' |
|
|
|
// ]]> |
|
</script> |
|
'; |
} |
} |
my (%ordered,$total,%jstext); |
my (%ordered,$total,%jstext); |
$total = scalar(keys(%{$settings})); |
$total = scalar(keys(%{$settings})); |
Line 3450 sub lti_javascript {
|
Line 3460 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 6583 sub print_lti {
|
Line 6592 sub print_lti {
|
'<label><input type="radio" value="1" name="ltisec_changeprivkey_'.$hostid.'" onclick="javascript:togglePrivKey(this.form,'."'$hostid'".');" />'.&mt('Yes'). |
'<label><input type="radio" value="1" name="ltisec_changeprivkey_'.$hostid.'" onclick="javascript:togglePrivKey(this.form,'."'$hostid'".');" />'.&mt('Yes'). |
'</label> </span><div id="ltisec_divchgprivkey_'.$hostid.'" style="display:none" />'. |
'</label> </span><div id="ltisec_divchgprivkey_'.$hostid.'" style="display:none" />'. |
'<span class="LC_nobreak">'.&mt('New Key').':'. |
'<span class="LC_nobreak">'.&mt('New Key').':'. |
'<input type="password" size="20" name="ltisec_privkey_'.$hostid.'" value="" autocomplete="off" />'. |
'<input type="password" size="20" name="ltisec_privkey_'.$hostid.'" value="" autocomplete="new-password" />'. |
'<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.ltisec_privkey_'.$hostid.'.type='."'text'".' } else { this.form.ltisec_privkey_'.$hostid.'.type='."'password'".' }" />'.&mt('Visible input').'</label>'. |
'<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.ltisec_privkey_'.$hostid.'.type='."'text'".' } else { this.form.ltisec_privkey_'.$hostid.'.type='."'password'".' }" />'.&mt('Visible input').'</label>'. |
'</span></div>'; |
'</span></div>'; |
} else { |
} else { |
$extra .= '<span class="LC_nobreak">'.&mt('Encryption Key').':'. |
$extra .= '<span class="LC_nobreak">'.&mt('Encryption Key').':'. |
'<input type="password" size="20" name="ltisec_privkey_'.$hostid.'" value="" autocomplete="off" />'. |
'<input type="password" size="20" name="ltisec_privkey_'.$hostid.'" value="" autocomplete="new-password" />'. |
'<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.ltisec_privkey_'.$hostid.'.type='."'text'".' } else { this.form.ltisec_privkey_'.$hostid.'.type='."'password'".' }" />'.&mt('Visible input').'</label>'; |
'<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.ltisec_privkey_'.$hostid.'.type='."'text'".' } else { this.form.ltisec_privkey_'.$hostid.'.type='."'password'".' }" />'.&mt('Visible input').'</label>'; |
} |
} |
$extra .= '</fieldset>'; |
$extra .= '</fieldset>'; |
Line 7714 sub print_privacy {
|
Line 7723 sub print_privacy {
|
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($datatable,$css_class,$numinrow,@items,%names,$othertitle,$usertypes,$types); |
my ($datatable,$css_class,$numinrow,@items,%names,$othertitle,$usertypes,$types); |
my $itemcount = 0; |
my $itemcount = 0; |
unless ($position eq 'top') { |
if ($position eq 'top') { |
|
$numinrow = 2; |
|
} else { |
@items = ('domain','author','course','community'); |
@items = ('domain','author','course','community'); |
%names = &Apache::lonlocal::texthash ( |
%names = &Apache::lonlocal::texthash ( |
domain => 'Assigned domain role(s)', |
domain => 'Assigned domain role(s)', |
author => 'Assigned co-author role(s)', |
author => 'Assigned co-author role(s)', |
course => 'Assigned course role(s)', |
course => 'Assigned course role(s)', |
community => 'Assigned community role', |
community => 'Assigned community role(s)', |
); |
); |
$numinrow = 4; |
$numinrow = 4; |
($othertitle,$usertypes,$types) = |
($othertitle,$usertypes,$types) = |
Line 7739 sub print_privacy {
|
Line 7750 sub print_privacy {
|
auto => 'Unrestricted', |
auto => 'Unrestricted', |
instdom => 'Other domain shares institution/provider', |
instdom => 'Other domain shares institution/provider', |
extdom => 'Other domain has different institution/provider', |
extdom => 'Other domain has different institution/provider', |
|
notify => 'Notify when role needs authorization', |
); |
); |
my %names = &Apache::lonlocal::texthash ( |
my %names = &Apache::lonlocal::texthash ( |
domain => 'Domain role', |
domain => 'Domain role', |
Line 7790 sub print_privacy {
|
Line 7802 sub print_privacy {
|
$datatable .= '</td></tr>'; |
$datatable .= '</td></tr>'; |
$itemcount ++; |
$itemcount ++; |
} |
} |
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
|
$datatable .= '<tr'.$css_class.'><td>'.$titles{'notify'}.'</td>'. |
|
'<td class="LC_left_item">'; |
|
if ((@instdoms > 1) || (keys(%by_location) > 0)) { |
|
my %curr; |
|
if (ref($settings) eq 'HASH') { |
|
if ($settings->{'notify'} ne '') { |
|
map {$curr{$_}=1;} split(/,/,$settings->{'notify'}); |
|
} |
|
} |
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
|
my ($numdc,$table,$rows) = &active_dc_picker($dom,$numinrow,'checkbox', |
|
'privacy_notify',%curr); |
|
if ($numdc > 0) { |
|
$datatable .= $table; |
|
} else { |
|
$datatable .= &mt('There are no active Domain Coordinators'); |
|
} |
|
} else { |
|
$datatable .= &mt('Nothing to set here, as there are no other domains'); |
|
} |
|
$datatable .='</td></tr>'; |
} elsif ($position eq 'middle') { |
} elsif ($position eq 'middle') { |
if ((@instdoms > 1) || (keys(%by_location) > 0)) { |
if ((@instdoms > 1) || (keys(%by_location) > 0)) { |
if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) { |
if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) { |
Line 17950 sub modify_privacy {
|
Line 17984 sub modify_privacy {
|
domain => 'Assigned domain role(s)', |
domain => 'Assigned domain role(s)', |
author => 'Assigned co-author role(s)', |
author => 'Assigned co-author role(s)', |
course => 'Assigned course role(s)', |
course => 'Assigned course role(s)', |
community => 'Assigned community role', |
community => 'Assigned community role(s)', |
); |
); |
my %roles = &Apache::lonlocal::texthash ( |
my %roles = &Apache::lonlocal::texthash ( |
domain => 'Domain role', |
domain => 'Domain role', |
Line 17969 sub modify_privacy {
|
Line 18003 sub modify_privacy {
|
user => 'User authorizes', |
user => 'User authorizes', |
domain => 'Domain Coordinator authorizes', |
domain => 'Domain Coordinator authorizes', |
auto => 'Unrestricted', |
auto => 'Unrestricted', |
|
notify => 'Notify when role needs authorization', |
); |
); |
my %fieldnames = &Apache::lonlocal::texthash ( |
my %fieldnames = &Apache::lonlocal::texthash ( |
id => 'Student/Employee ID', |
id => 'Student/Employee ID', |
Line 17994 sub modify_privacy {
|
Line 18029 sub modify_privacy {
|
); |
); |
foreach my $item (@items) { |
foreach my $item (@items) { |
if (@instdoms > 1) { |
if (@instdoms > 1) { |
if ($env{'form.privacy_approval_instdom'.$item} =~ /^(none|user|domain|auto)$/) { |
if ($env{'form.privacy_approval_instdom_'.$item} =~ /^(none|user|domain|auto)$/) { |
$privacyhash{'approval'}{'instdom'}{$item} = $env{'form.privacy_approval_instdom_'.$item}; |
$privacyhash{'approval'}{'instdom'}{$item} = $env{'form.privacy_approval_instdom_'.$item}; |
} |
} |
if (ref($current{'approval'}) eq 'HASH') { |
if (ref($current{'approval'}) eq 'HASH') { |
Line 18086 sub modify_privacy {
|
Line 18121 sub modify_privacy {
|
} |
} |
} |
} |
} |
} |
|
my %domcoords = &Apache::lonnet::get_active_domroles($dom,['dc']); |
|
my %notify; |
|
foreach my $possdc (&Apache::loncommon::get_env_multiple('form.privacy_notify')) { |
|
if (exists($domcoords{$possdc})) { |
|
$notify{$possdc} = 1; |
|
} |
|
} |
|
my $notify = join(',',sort(keys(%notify))); |
|
if ($current{'notify'} ne $notify) { |
|
$changes{'notify'} = 1; |
|
} |
|
$privacyhash{'notify'} = $notify; |
} |
} |
my %confighash = ( |
my %confighash = ( |
privacy => \%privacyhash, |
privacy => \%privacyhash, |
Line 18094 sub modify_privacy {
|
Line 18141 sub modify_privacy {
|
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
$resulttext = &mt('Changes made: ').'<ul>'; |
$resulttext = &mt('Changes made: ').'<ul>'; |
foreach my $key ('approval','othdom','priv','unpriv') { |
foreach my $key ('approval','notify','othdom','priv','unpriv') { |
if ($changes{$key}) { |
if ($changes{$key}) { |
$resulttext .= '<li>'.$titles{$key}.':<ul>'; |
$resulttext .= '<li>'.$titles{$key}.':<ul>'; |
if ($key eq 'approval') { |
if ($key eq 'approval') { |
Line 18112 sub modify_privacy {
|
Line 18159 sub modify_privacy {
|
} |
} |
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
|
} elsif ($key eq 'notify') { |
|
if ($privacyhash{$key}) { |
|
foreach my $dc (split(/,/,$privacyhash{$key})) { |
|
my ($dcname,$dcdom) = split(/:/,$dc); |
|
$resulttext .= '<li>'.&Apache::loncommon::plainname($dcname,$dcdom).'</li>'; |
|
} |
|
} else { |
|
$resulttext .= '<li>'.&mt('No DCs to notify').'</li>'; |
|
} |
} elsif ($key eq 'othdom') { |
} elsif ($key eq 'othdom') { |
my @statuses; |
my @statuses; |
if (ref($types) eq 'ARRAY') { |
if (ref($types) eq 'ARRAY') { |
Line 18152 sub modify_privacy {
|
Line 18208 sub modify_privacy {
|
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
} |
} |
|
$resulttext .= '</ul>'; |
} else { |
} else { |
$resulttext = &mt('No changes made to user information settings'); |
$resulttext = &mt('No changes made to user information settings'); |
} |
} |
Line 22230 sub modify_wafproxy {
|
Line 22287 sub modify_wafproxy {
|
} |
} |
} |
} |
} |
} |
|
$output .= '</ul>'; |
} else { |
} else { |
$output = '<span class="LC_error">'. |
$output = '<span class="LC_error">'. |
&mt('An error occurred: [_1]',$putresult).'</span>'; |
&mt('An error occurred: [_1]',$putresult).'</span>'; |