version 1.382, 2021/04/29 17:45:22
|
version 1.384, 2021/08/01 19:28:10
|
Line 223 sub handler {
|
Line 223 sub handler {
|
'ltitools','ssl','trust','lti','privacy','passwords', |
'ltitools','ssl','trust','lti','privacy','passwords', |
'proctoring','wafproxy'],$dom); |
'proctoring','wafproxy'],$dom); |
my %encconfig = |
my %encconfig = |
&Apache::lonnet::get_dom('encconfig',['ltitools','lti','proctoring'],$dom); |
&Apache::lonnet::get_dom('encconfig',['ltitools','lti','proctoring'],$dom,undef,1); |
if (ref($domconfig{'ltitools'}) eq 'HASH') { |
if (ref($domconfig{'ltitools'}) eq 'HASH') { |
if (ref($encconfig{'ltitools'}) eq 'HASH') { |
if (ref($encconfig{'ltitools'}) eq 'HASH') { |
foreach my $id (keys(%{$domconfig{'ltitools'}})) { |
foreach my $id (keys(%{$domconfig{'ltitools'}})) { |
Line 7337 sub print_wafproxy {
|
Line 7337 sub print_wafproxy {
|
foreach my $domain (keys(%otherdoms)) { |
foreach my $domain (keys(%otherdoms)) { |
%{$values{$domain}} = (); |
%{$values{$domain}} = (); |
my %config = &Apache::lonnet::get_dom('configuration',['wafproxy'],$domain); |
my %config = &Apache::lonnet::get_dom('configuration',['wafproxy'],$domain); |
if (ref($config{$domain}) eq 'HASH') { |
if (ref($config{'wafproxy'}) eq 'HASH') { |
if (ref($config{$domain}{'wafproxy'}) eq 'HASH') { |
$aliases{$domain} = $config{'wafproxy'}{'alias'}; |
$aliases{$domain} = $config{$domain}{'wafproxy'}{'alias'}; |
foreach my $item ('remoteip','ipheader','trusted','vpnint','vpnext') { |
foreach my $item ('remoteip','ipheader','trusted','vpnint','vpnext') { |
$values{$domain}{$item} = $config{'wafproxy'}{$item}; |
$values{$domain}{$item} = $config{$domain}{'wafproxy'}{$item}; |
|
} |
|
} |
} |
} |
} |
} |
} |
Line 7354 sub print_wafproxy {
|
Line 7352 sub print_wafproxy {
|
$itemcount ++; |
$itemcount ++; |
my $dom_in_effect; |
my $dom_in_effect; |
my $aliasrows = '<tr>'. |
my $aliasrows = '<tr>'. |
'<td class="LC_left_item">'.&mt('Hostname').': '. |
'<td class="LC_left_item" style="vertical-align: baseline;">'. |
&Apache::lonnet::hostname($server).'</td>'; |
&mt('Hostname').': '. |
|
'<i>'.&Apache::lonnet::hostname($server).'</i></td><td> </td>'; |
if ($othercontrol{$server}) { |
if ($othercontrol{$server}) { |
$dom_in_effect = $othercontrol{$server}; |
$dom_in_effect = $othercontrol{$server}; |
my $current; |
my $current; |
if (ref($aliases{$othercontrol{$server}}) eq 'HASH') { |
if (ref($aliases{$dom_in_effect}) eq 'HASH') { |
$current = $aliases{$othercontrol{$server}{$server}}; |
$current = $aliases{$dom_in_effect}{$server}; |
} |
} |
|
$aliasrows .= '<td class="LC_left_item" style="vertical-align: baseline;">'. |
|
&mt('Alias').': '; |
if ($current) { |
if ($current) { |
$aliasrows .= $current; |
$aliasrows .= $current; |
} else { |
} else { |
$aliasrows .= &mt('None in effect'); |
$aliasrows .= &mt('None'); |
} |
} |
$aliasrows .= '<td class="LC_left_item"><span class="LC_small">('. |
$aliasrows .= ' <span class="LC_small">('. |
&mt('WAF/Reverse Proxy controlled by domain: [_1]', |
&mt('controlled by domain: [_1]', |
'<b>'.$othercontrol{$server}.'</b>').'</span></td>'; |
'<b>'.$dom_in_effect.'</b>').')</span></td>'; |
} else { |
} else { |
$dom_in_effect = $dom; |
$dom_in_effect = $dom; |
my $current; |
my $current; |
Line 7378 sub print_wafproxy {
|
Line 7379 sub print_wafproxy {
|
$current = $aliases{$dom}{$server}; |
$current = $aliases{$dom}{$server}; |
} |
} |
} |
} |
$aliasrows .= '<td class="LC_left_item">'.&mt('WAF/Reverse Proxy Alias').': '. |
$aliasrows .= '<td class="LC_left_item" style="vertical-align: baseline;">'. |
|
&mt('Alias').': '. |
'<input type="text" name="wafproxy_alias_'.$server.'" '. |
'<input type="text" name="wafproxy_alias_'.$server.'" '. |
'value="'.$current.'" size="30" /></td>'; |
'value="'.$current.'" size="30" /></td>'; |
} |
} |
Line 7408 sub print_wafproxy {
|
Line 7410 sub print_wafproxy {
|
'</table></td></tr>'; |
'</table></td></tr>'; |
$itemcount++; |
$itemcount++; |
} |
} |
if (keys(%othercontrol)) { |
if (keys(%otherdoms)) { |
foreach my $key (sort(keys(%othercontrol))) { |
foreach my $key (sort(keys(%otherdoms))) { |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$datatable = '<tr'.$css_class.'>'. |
$datatable .= '<tr'.$css_class.'>'. |
'<td class="LC_left_item">'.&mt('Domain: [_1]','<b>'.$key.'</b>').'</td>'. |
'<td class="LC_left_item">'.&mt('Domain: [_1]','<b>'.$key.'</b>').'</td>'. |
'<td class="LC_left_item"><table>'.$aliasinfo{$key}. |
'<td class="LC_left_item"><table>'.$aliasinfo{$key}. |
'</table></td></tr>'; |
'</table></td></tr>'; |
$itemcount++; |
$itemcount++; |
} |
} |
} |
} |
} else { |
} else { |
|
my %ip_methods = &remoteip_methods(); |
if ($setdom) { |
if ($setdom) { |
$itemcount ++; |
$itemcount ++; |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
Line 7467 sub print_wafproxy {
|
Line 7470 sub print_wafproxy {
|
'<tr>'. |
'<tr>'. |
'<td valign="top">'.$lt{'remoteip'}.': '. |
'<td valign="top">'.$lt{'remoteip'}.': '. |
'<select name="wafproxy_remoteip" id="wafproxy_remoteip" onchange="javascript:updateWAF();">'; |
'<select name="wafproxy_remoteip" id="wafproxy_remoteip" onchange="javascript:updateWAF();">'; |
my %ip_methods = &remoteip_methods(); |
|
foreach my $option ('m','h','n') { |
foreach my $option ('m','h','n') { |
my $sel; |
my $sel; |
if ($option eq $curr_remotip) { |
if ($option eq $curr_remotip) { |
Line 7515 sub print_wafproxy {
|
Line 7517 sub print_wafproxy {
|
$itemcount ++; |
$itemcount ++; |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$datatable .= '<tr'.$css_class.'>'. |
$datatable .= '<tr'.$css_class.'>'. |
'<td class="LC_left_item">'.&mt('Domain: [_1]',$domain).'</td>'. |
'<td class="LC_left_item">'.&mt('Domain: [_1]','<b>'.$domain.'</b>').'</td>'. |
'<td class="LC_left_item"><table>'; |
'<td class="LC_left_item"><table>'; |
foreach my $item ('remoteip','ipheader','trusted','vpnint','vpnext','sslopt') { |
foreach my $item ('remoteip','ipheader','trusted','vpnint','vpnext','sslopt') { |
my $showval = &mt('None'); |
my $showval = &mt('None'); |
Line 7526 sub print_wafproxy {
|
Line 7528 sub print_wafproxy {
|
$showval = $values{$domain}{$item}; |
$showval = $values{$domain}{$item}; |
if ($item eq 'ssl') { |
if ($item eq 'ssl') { |
$showval = $lt{'alltossl'}; |
$showval = $lt{'alltossl'}; |
|
} elsif ($item eq 'remoteip') { |
|
$showval = $ip_methods{$values{$domain}{$item}}; |
} |
} |
} |
} |
$datatable .= '<tr>'. |
$datatable .= '<tr>'. |
Line 13523 sub modify_ltitools {
|
Line 13527 sub modify_ltitools {
|
my %ltienchash = ( |
my %ltienchash = ( |
$action => { %encconfig } |
$action => { %encconfig } |
); |
); |
&Apache::lonnet::put_dom('encconfig',\%ltienchash,$dom); |
&Apache::lonnet::put_dom('encconfig',\%ltienchash,$dom,undef,1); |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
my %ltiall = %confhash; |
my %ltiall = %confhash; |
Line 14097 sub modify_proctoring {
|
Line 14101 sub modify_proctoring {
|
my %proc_enchash = ( |
my %proc_enchash = ( |
$action => { %encconfhash } |
$action => { %encconfhash } |
); |
); |
&Apache::lonnet::put_dom('encconfig',\%proc_enchash,$dom); |
&Apache::lonnet::put_dom('encconfig',\%proc_enchash,$dom,undef,1); |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
my %procall = %confhash; |
my %procall = %confhash; |
Line 14589 sub modify_lti {
|
Line 14593 sub modify_lti {
|
my %ltienchash = ( |
my %ltienchash = ( |
$action => { %encconfig } |
$action => { %encconfig } |
); |
); |
&Apache::lonnet::put_dom('encconfig',\%ltienchash,$dom); |
&Apache::lonnet::put_dom('encconfig',\%ltienchash,$dom,undef,1); |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
my %ltiall = %confhash; |
my %ltiall = %confhash; |