version 1.160.6.15, 2013/02/02 02:54:04
|
version 1.171, 2012/09/25 19:54:21
|
Line 45 described at http://www.lon-capa.org.
|
Line 45 described at http://www.lon-capa.org.
|
=head1 OVERVIEW |
=head1 OVERVIEW |
|
|
Each institution using LON-CAPA will typically have a single domain designated |
Each institution using LON-CAPA will typically have a single domain designated |
for use by individuals affiliated with the institution. Accordingly, each domain |
for use by individuals affliated with the institution. Accordingly, each domain |
may define a default set of logos and a color scheme which can be used to "brand" |
may define a default set of logos and a color scheme which can be used to "brand" |
the LON-CAPA instance. In addition, an institution will typically have a language |
the LON-CAPA instance. In addition, an institution will typically have a language |
and timezone which are used for the majority of courses. |
and timezone which are used for the majority of courses. |
Line 86 $dom,$settings,$rowtotal,$action.
|
Line 86 $dom,$settings,$rowtotal,$action.
|
|
|
$dom is the domain, $settings is a reference to a hash of current settings for |
$dom is the domain, $settings is a reference to a hash of current settings for |
the current context, $rowtotal is a reference to the scalar used to record the |
the current context, $rowtotal is a reference to the scalar used to record the |
number of rows displayed on the page, and $action is the context (quotas, |
number of rows displayed on the page, and $action is the context (quotas, |
requestcourses or requestauthor). |
requestcourses or requestauthor). |
|
|
The print_quotas routine was orginally created to display/store information |
The print_quotas routine was orginally created to display/store information |
Line 210 sub handler {
|
Line 210 sub handler {
|
'quotas','autoenroll','autoupdate','autocreate', |
'quotas','autoenroll','autoupdate','autocreate', |
'directorysrch','usercreation','usermodification', |
'directorysrch','usercreation','usermodification', |
'contacts','defaults','scantron','coursecategories', |
'contacts','defaults','scantron','coursecategories', |
'serverstatuses','requestcourses','usersessions', |
'serverstatuses','requestcourses','helpsettings', |
'loadbalancing','requestauthor'],$dom); |
'coursedefaults','usersessions','loadbalancing', |
|
'requestauthor'],$dom); |
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', |
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', |
'autoupdate','autocreate','directorysrch','contacts', |
'autoupdate','autocreate','directorysrch','contacts', |
'usercreation','usermodification','scantron', |
'usercreation','usermodification','scantron', |
'requestcourses','requestauthor','coursecategories', |
'requestcourses','requestauthor','coursecategories', |
'serverstatuses','usersessions'); |
'serverstatuses','helpsettings', |
|
'coursedefaults','usersessions'); |
my %existing; |
my %existing; |
if (ref($domconfig{'loadbalancing'}) eq 'HASH') { |
if (ref($domconfig{'loadbalancing'}) eq 'HASH') { |
%existing = %{$domconfig{'loadbalancing'}}; |
%existing = %{$domconfig{'loadbalancing'}}; |
Line 353 sub handler {
|
Line 355 sub handler {
|
col3 => 'Specific IPs', |
col3 => 'Specific IPs', |
}], |
}], |
}, |
}, |
|
'helpsettings' => |
|
{text => 'Help page settings', |
|
help => 'Domain_Configuration_Help_Settings', |
|
header => [{col1 => 'Help Settings (logged-in users)', |
|
col2 => 'Value'}], |
|
}, |
|
'coursedefaults' => |
|
{text => 'Course/Community defaults', |
|
help => 'Domain_Configuration_Course_Defaults', |
|
header => [{col1 => 'Defaults which can be overridden in each course by a CC', |
|
col2 => 'Value',}, |
|
{col1 => 'Defaults which can be overridden for each course by a DC', |
|
col2 => 'Value',},], |
|
}, |
|
'privacy' => |
|
{text => 'User Privacy', |
|
help => 'Domain_Configuration_User_Privacy', |
|
header => [{col1 => 'Setting', |
|
col2 => 'Value',}], |
|
}, |
'usersessions' => |
'usersessions' => |
{text => 'User session hosting/offloading', |
{text => 'User session hosting/offloading', |
help => 'Domain_Configuration_User_Sessions', |
help => 'Domain_Configuration_User_Sessions', |
Line 364 sub handler {
|
Line 386 sub handler {
|
col2 => 'Rules'}], |
col2 => 'Rules'}], |
}, |
}, |
'loadbalancing' => |
'loadbalancing' => |
{text => 'Dedicated Load Balancer(s)', |
{text => 'Dedicated Load Balancer', |
help => 'Domain_Configuration_Load_Balancing', |
help => 'Domain_Configuration_Load_Balancing', |
header => [{col1 => 'Balancers', |
header => [{col1 => 'Balancers', |
col2 => 'Default destinations', |
col2 => 'Default destinations', |
col3 => 'User affiliation', |
col3 => 'User affliation', |
col4 => 'Overrides'}, |
col4 => 'Overrides'}, |
], |
], |
}, |
}, |
Line 384 sub handler {
|
Line 406 sub handler {
|
col2 => 'Value'}], |
col2 => 'Value'}], |
}; |
}; |
} |
} |
|
|
my @roles = ('student','coordinator','author','admin'); |
my @roles = ('student','coordinator','author','admin'); |
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'pickactions')", |
({href=>"javascript:changePage(document.$phase,'pickactions')", |
text=>"Settings to display/modify"}); |
text=>"Settings to display/modify"}); |
my $confname = $dom.'-domainconfig'; |
my $confname = $dom.'-domainconfig'; |
|
|
if ($phase eq 'process') { |
if ($phase eq 'process') { |
&Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,\@roles); |
&Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,\@roles); |
} elsif ($phase eq 'display') { |
} elsif ($phase eq 'display') { |
Line 407 sub handler {
|
Line 427 sub handler {
|
} |
} |
&Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,$js); |
&Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,$js); |
} else { |
} else { |
# check if domconfig user exists for the domain. |
|
my $servadm = $r->dir_config('lonAdmEMail'); |
|
my ($configuserok,$author_ok,$switchserver) = |
|
&config_check($dom,$confname,$servadm); |
|
unless ($configuserok eq 'ok') { |
|
&Apache::lonconfigsettings::print_header($r,$phase,$context); |
|
$r->print(&mt('The domain configuration user "[_1]" has yet to be created.', |
|
$confname). |
|
'<br />' |
|
); |
|
if ($switchserver) { |
|
$r->print(&mt('Ordinarily, that domain configuration user is created when the ./UPDATE script is run to install LON-CAPA for the first time.'). |
|
'<br />'. |
|
&mt('However, that does not apply when new domains are added to a multi-domain server, and ./UPDATE has not been run recently.'). |
|
'<br />'. |
|
&mt('The "[_1]" user can be created automatically when a Domain Coordinator visits the web-based "Set domain configuration" screen, in a session hosted on the primary library server.',$confname). |
|
'<br />'. |
|
&mt('To do that now, use the following link: [_1]',$switchserver) |
|
); |
|
} else { |
|
$r->print(&mt('To create that user from the command line run the ./UPDATE script found in the top level directory of the extracted LON-CAPA tarball.'). |
|
'<br />'. |
|
&mt('Once that is done, you will be able to use the web-based "Set domain configuration" to configure the domain') |
|
); |
|
} |
|
$r->print(&Apache::loncommon::end_page()); |
|
return OK; |
|
} |
|
if (keys(%domconfig) == 0) { |
if (keys(%domconfig) == 0) { |
my $primarylibserv = &Apache::lonnet::domain($dom,'primary'); |
my $primarylibserv = &Apache::lonnet::domain($dom,'primary'); |
my @ids=&Apache::lonnet::current_machine_ids(); |
my @ids=&Apache::lonnet::current_machine_ids(); |
Line 513 sub process_changes {
|
Line 505 sub process_changes {
|
$output = &modify_quotas($dom,$action,%domconfig); |
$output = &modify_quotas($dom,$action,%domconfig); |
} elsif ($action eq 'requestauthor') { |
} elsif ($action eq 'requestauthor') { |
$output = &modify_quotas($dom,$action,%domconfig); |
$output = &modify_quotas($dom,$action,%domconfig); |
|
} elsif ($action eq 'helpsettings') { |
|
$output = &modify_helpsettings($r,$dom,$confname,%domconfig); |
|
} elsif ($action eq 'coursedefaults') { |
|
$output = &modify_coursedefaults($dom,%domconfig); |
} elsif ($action eq 'usersessions') { |
} elsif ($action eq 'usersessions') { |
$output = &modify_usersessions($dom,%domconfig); |
$output = &modify_usersessions($dom,%domconfig); |
} elsif ($action eq 'loadbalancing') { |
} elsif ($action eq 'loadbalancing') { |
Line 543 sub print_config_box {
|
Line 539 sub print_config_box {
|
if ($numheaders > 1) { |
if ($numheaders > 1) { |
my $colspan = ''; |
my $colspan = ''; |
my $rightcolspan = ''; |
my $rightcolspan = ''; |
if (($action eq 'rolecolors') || ($action eq 'coursecategories') || |
if (($action eq 'rolecolors') || ($action eq 'coursecategories') || |
(($action eq 'login') && ($numheaders < 3))) { |
(($action eq 'login') && ($numheaders < 3))) { |
$colspan = ' colspan="2"'; |
$colspan = ' colspan="2"'; |
} |
} |
Line 582 sub print_config_box {
|
Line 578 sub print_config_box {
|
$output .= &print_usersessions('top',$dom,$settings,\$rowtotal); |
$output .= &print_usersessions('top',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'rolecolors') { |
} elsif ($action eq 'rolecolors') { |
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); |
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); |
|
} elsif ($action eq 'coursedefaults') { |
|
$output .= &print_coursedefaults('top',$dom,$settings,\$rowtotal); |
} |
} |
$output .= ' |
$output .= ' |
</table> |
</table> |
Line 811 sub print_login {
|
Line 809 sub print_login {
|
'<td><select name="'.$lonhost.'_server">'. |
'<td><select name="'.$lonhost.'_server">'. |
'<option value=""'.$direct.'>'.$choices{'directlogin'}. |
'<option value=""'.$direct.'>'.$choices{'directlogin'}. |
'</option>'; |
'</option>'; |
foreach my $hostid (sort(keys(%servers))) { |
foreach my $hostid (keys(%servers)) { |
next if ($servers{$hostid} eq $servers{$lonhost}); |
next if ($servers{$hostid} eq $servers{$lonhost}); |
my $selected = ''; |
my $selected = ''; |
if (ref($disallowed{$lonhost}) eq 'HASH') { |
if (ref($disallowed{$lonhost}) eq 'HASH') { |
Line 854 sub print_login {
|
Line 852 sub print_login {
|
} elsif ($caller eq 'page') { |
} elsif ($caller eq 'page') { |
my %defaultchecked = ( |
my %defaultchecked = ( |
'coursecatalog' => 'on', |
'coursecatalog' => 'on', |
'helpdesk' => 'on', |
|
'adminmail' => 'off', |
'adminmail' => 'off', |
'newuser' => 'off', |
'newuser' => 'off', |
); |
); |
my @toggles = ('coursecatalog','adminmail','helpdesk','newuser'); |
my @toggles = ('coursecatalog','adminmail','newuser'); |
my (%checkedon,%checkedoff); |
my (%checkedon,%checkedoff); |
foreach my $item (@toggles) { |
foreach my $item (@toggles) { |
if ($defaultchecked{$item} eq 'on') { |
if ($defaultchecked{$item} eq 'on') { |
Line 1074 sub login_choices {
|
Line 1071 sub login_choices {
|
&Apache::lonlocal::texthash ( |
&Apache::lonlocal::texthash ( |
coursecatalog => 'Display Course/Community Catalog link?', |
coursecatalog => 'Display Course/Community Catalog link?', |
adminmail => "Display Administrator's E-mail Address?", |
adminmail => "Display Administrator's E-mail Address?", |
helpdesk => 'Display "Contact Helpdesk" link', |
|
disallowlogin => "Login page requests redirected", |
disallowlogin => "Login page requests redirected", |
hostid => "Server", |
hostid => "Server", |
server => "Redirect to:", |
server => "Redirect to:", |
Line 1195 sub display_color_options {
|
Line 1191 sub display_color_options {
|
} else { |
} else { |
$datatable .= '<td> </td>'; |
$datatable .= '<td> </td>'; |
} |
} |
my $current_color = $designs->{'font'} ? $designs->{'font'} : $defaults->{'font'}; |
my $fontlink = &color_pick($phase,$role,'font',$choices->{'font'},$designs->{'font'}); |
|
|
$datatable .= '<td><span class="LC_nobreak">'. |
$datatable .= '<td><span class="LC_nobreak">'. |
'<input type="text" class="colorchooser" size="10" name="'.$role.'_font"'. |
'<input type="text" size="10" name="'.$role.'_font"'. |
' value="'.$current_color.'" /> '. |
' value="'.$designs->{'font'}.'" /> '.$fontlink. |
' </td></tr>'; |
' <span id="css_'.$role.'_font" style="background-color: '. |
|
$designs->{'font'}.';"> </span>'. |
|
'</span></td></tr>'; |
unless ($role eq 'login') { |
unless ($role eq 'login') { |
$datatable .= '<tr'.$css_class.'>'. |
$datatable .= '<tr'.$css_class.'>'. |
'<td>'.$choices->{'fontmenu'}.'</td>'; |
'<td>'.$choices->{'fontmenu'}.'</td>'; |
Line 1209 sub display_color_options {
|
Line 1206 sub display_color_options {
|
} else { |
} else { |
$datatable .= '<td> </td>'; |
$datatable .= '<td> </td>'; |
} |
} |
$current_color = $designs->{'fontmenu'} ? |
$fontlink = &color_pick($phase,$role,'fontmenu',$choices->{'fontmenu'},$designs->{'fontmenu'}); |
$designs->{'fontmenu'} : $defaults->{'fontmenu'}; |
|
$datatable .= '<td><span class="LC_nobreak">'. |
$datatable .= '<td><span class="LC_nobreak">'. |
'<input class="colorchooser" type="text" size="10" name="' |
'<input type="text" size="10" name="'.$role.'_fontmenu"'. |
.$role.'_fontmenu"'. |
' value="'.$designs->{'fontmenu'}.'" /> '.$fontlink. |
' value="'.$current_color.'" /> '. |
' <span id="css_'.$role.'_fontmenu" style="background-color: '. |
' </td></tr>'; |
$designs->{'fontmenu'}.';"> </span>'. |
|
'</span></td></tr>'; |
} |
} |
my $switchserver = &check_switchserver($dom,$confname); |
my $switchserver = &check_switchserver($dom,$confname); |
foreach my $img (@{$images}) { |
foreach my $img (@{$images}) { |
Line 1342 sub display_color_options {
|
Line 1339 sub display_color_options {
|
} |
} |
$datatable .= '<td class="LC_right_item">'. |
$datatable .= '<td class="LC_right_item">'. |
'<table border="0"><tr>'; |
'<table border="0"><tr>'; |
|
|
foreach my $item (@{$bgs}) { |
foreach my $item (@{$bgs}) { |
$datatable .= '<td align="center">'; |
my $link = &color_pick($phase,$role,$item,$choices->{$item},$designs->{'bgs'}{$item}); |
my $color = $designs->{'bgs'}{$item} ? $designs->{'bgs'}{$item} : $defaults->{'bgs'}{$item}; |
$datatable .= '<td align="center">'.$link; |
if ($designs->{'bgs'}{$item}) { |
if ($designs->{'bgs'}{$item}) { |
$datatable .= ' '; |
$datatable .= ' <span id="css_'.$role.'_'.$item.'" style="background-color: '.$designs->{'bgs'}{$item}.';"> </span>'; |
} |
} |
$datatable .= '<br /><input type="text" class="colorchooser" size="8" name="'.$role.'_'.$item.'" value="'.$color. |
$datatable .= '<br /><input type="text" size="8" name="'.$role.'_'.$item.'" value="'.$designs->{'bgs'}{$item}. |
'" onblur = "javascript:colchg_span('."'css_".$role.'_'.$item."'".',this);" /></td>'; |
'" onblur = "javascript:colchg_span('."'css_".$role.'_'.$item."'".',this);" /></td>'; |
} |
} |
$datatable .= '</tr></table></td></tr>'; |
$datatable .= '</tr></table></td></tr>'; |
Line 1371 sub display_color_options {
|
Line 1367 sub display_color_options {
|
$datatable .= '<td class="LC_right_item">'. |
$datatable .= '<td class="LC_right_item">'. |
'<table border="0"><tr>'; |
'<table border="0"><tr>'; |
foreach my $item (@{$links}) { |
foreach my $item (@{$links}) { |
my $color = $designs->{'link'}{$item} ? $designs->{'link'}{$item} : $defaults->{'links'}{$item}; |
$datatable .= '<td align="center">'."\n". |
$datatable .= '<td align="center">'."\n"; |
&color_pick($phase,$role,$item,$choices->{$item}, |
|
$designs->{'links'}{$item}); |
if ($designs->{'links'}{$item}) { |
if ($designs->{'links'}{$item}) { |
$datatable.=' '; |
$datatable.=' <span id="css_'.$role.'_'.$item.'" style="background-color: '.$designs->{'links'}{$item}.';"> </span>'; |
} |
} |
$datatable .= '<br /><input type="text" size="8" class="colorchooser" name="'.$role.'_'.$item.'" value="'.$color. |
$datatable .= '<br /><input type="text" size="8" name="'.$role.'_'.$item.'" value="'.$designs->{'links'}{$item}. |
'" /></td>'; |
'" /></td>'; |
} |
} |
$$rowtotal += $itemcount; |
$$rowtotal += $itemcount; |
Line 1507 sub print_quotas {
|
Line 1503 sub print_quotas {
|
} elsif ($context eq 'requestauthor') { |
} elsif ($context eq 'requestauthor') { |
@usertools = ('author'); |
@usertools = ('author'); |
@options = ('norequest','approval','automatic'); |
@options = ('norequest','approval','automatic'); |
%titles = &authorrequest_titles(); |
%titles = &authorrequest_titles(); |
} else { |
} else { |
@usertools = ('aboutme','blog','webdav','portfolio'); |
@usertools = ('aboutme','blog','webdav','portfolio'); |
%titles = &tool_titles(); |
%titles = &tool_titles(); |
Line 1718 sub print_quotas {
|
Line 1714 sub print_quotas {
|
} elsif ($context eq 'requestauthor') { |
} elsif ($context eq 'requestauthor') { |
my $curroption; |
my $curroption; |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
$curroption = $settings->{'default'}; |
if (ref($settings->{'requestauthor'}) eq 'HASH') { |
|
$curroption = $settings->{'requestauthor'}; |
|
} |
} |
} |
if (!$curroption) { |
if (!$curroption) { |
$curroption = 'norequest'; |
$curroption = 'norequest'; |
Line 1863 sub print_quotas {
|
Line 1861 sub print_quotas {
|
$checked = ' checked="checked"'; |
$checked = ' checked="checked"'; |
} |
} |
$datatable .= '<span class="LC_nobreak"><label>'. |
$datatable .= '<span class="LC_nobreak"><label>'. |
'<input type="radio" name="authorreq__LC_adv"'. |
'<input type="radio" name="crsreq_'.$item. |
' value="'.$val.'"'.$checked.' />'. |
'__LC_adv" value="'.$val.'"'.$checked.' />'. |
$titles{$option}.'</label></span> '; |
$titles{$option}.'</label></span> '; |
} |
} |
} else { |
} else { |
Line 1967 sub print_requestmail {
|
Line 1965 sub print_requestmail {
|
$datatable .= '<span class="LC_nobreak"><label>'. |
$datatable .= '<span class="LC_nobreak"><label>'. |
'<input type="checkbox" name="reqapprovalnotify" '. |
'<input type="checkbox" name="reqapprovalnotify" '. |
'value="'.$domcoord[$i].'"'.$check.'/>'. |
'value="'.$domcoord[$i].'"'.$check.'/>'. |
$fullname.' ('.$uname.':'.$udom.')</label></span></td>'; |
$fullname.'</label></span></td>'; |
} |
} |
$datatable .= '</tr></table>'; |
$datatable .= '</tr></table>'; |
} else { |
} else { |
Line 2294 sub print_contacts {
|
Line 2292 sub print_contacts {
|
my @contacts = ('adminemail','supportemail'); |
my @contacts = ('adminemail','supportemail'); |
my (%checked,%to,%otheremails,%bccemails); |
my (%checked,%to,%otheremails,%bccemails); |
my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail', |
my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail', |
'requestsmail','updatesmail'); |
'requestsmail'); |
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
$otheremails{$type} = ''; |
$otheremails{$type} = ''; |
} |
} |
Line 2330 sub print_contacts {
|
Line 2328 sub print_contacts {
|
$checked{'helpdeskmail'}{'supportemail'} = ' checked="checked" '; |
$checked{'helpdeskmail'}{'supportemail'} = ' checked="checked" '; |
$checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'requestsmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'requestsmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'updatesmail'}{'adminemail'} = ' checked="checked" '; |
|
} |
} |
my ($titles,$short_titles) = &contact_titles(); |
my ($titles,$short_titles) = &contact_titles(); |
my $rownum = 0; |
my $rownum = 0; |
Line 2761 sub spares_row {
|
Line 2758 sub spares_row {
|
$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 rowspan="2"> |
<td rowspan="2"> |
<span class="LC_nobreak">'. |
<span class="LC_nobreak"><b>'.$server.'</b> when busy, offloads to:</span></td>'."\n"; |
&mt('[_1] when busy, offloads to:' |
|
,'<b>'.$server.'</b>'). |
|
"\n"; |
|
my (%current,%canselect); |
my (%current,%canselect); |
my @choices = |
my @choices = |
&possible_newspares($server,$spareid->{$server},$serverhomes,$altids); |
&possible_newspares($server,$spareid->{$server},$serverhomes,$altids); |
Line 2931 sub print_loadbalancing {
|
Line 2925 sub print_loadbalancing {
|
'<td rowspan="'.$rownum.'" valign="top">'. |
'<td rowspan="'.$rownum.'" valign="top">'. |
'<p>'; |
'<p>'; |
if ($lonhost eq '') { |
if ($lonhost eq '') { |
$datatable .= '<span class="LC_nobreak">'; |
$datatable .= '<span class="LC_nobreak">'; |
if (keys(%currbalancer) > 0) { |
if (keys(%currbalancer) > 0) { |
$datatable .= &mt('Add balancer:'); |
$datatable .= &mt('Add balancer:'); |
} else { |
} else { |
Line 2947 sub print_loadbalancing {
|
Line 2941 sub print_loadbalancing {
|
next if ($currbalancer{$server}); |
next if ($currbalancer{$server}); |
$datatable .= '<option value="'.$server.'">'.$server.'</option>'."\n"; |
$datatable .= '<option value="'.$server.'">'.$server.'</option>'."\n"; |
} |
} |
$datatable .= |
$datatable .= |
'</select>'."\n". |
'</select>'."\n". |
'<input type="hidden" name="loadbalancing_prevlonhost_'.$balnum.'" id="loadbalancing_prevlonhost_'.$balnum.'" value="" /> </span>'."\n"; |
'<input type="hidden" name="loadbalancing_prevlonhost_'.$balnum.'" id="loadbalancing_prevlonhost_'.$balnum.'" value="" /> </span>'."\n"; |
} else { |
} else { |
Line 2986 sub print_loadbalancing {
|
Line 2980 sub print_loadbalancing {
|
if (exists($currbalancer{$spares[$i]})) { |
if (exists($currbalancer{$spares[$i]})) { |
$disabled = ' disabled="disabled"'; |
$disabled = ' disabled="disabled"'; |
} |
} |
$targettable .= |
$targettable .= |
'<td><label><input type="checkbox" name="loadbalancing_target_'.$balnum.'_'.$sparetype.'"'. |
'<td><label><input type="checkbox" name="loadbalancing_target_'.$balnum.'_'.$sparetype.'"'. |
$checked.$disabled.' value="'.$chkboxval.'" id="loadbalancing_target_'.$balnum.'_'.$sparetype.'_'.$i.'" onclick="checkOffloads('."this,'$balnum','$sparetype'".');" /><span id="loadbalancing_targettxt_'.$balnum.'_'.$sparetype.'_'.$i.'"> '.$chkboxval. |
$checked.$disabled.' value="'.$chkboxval.'" id="loadbalancing_target_'.$balnum.'_'.$sparetype.'_'.$i.'" onclick="checkOffloads('."this,'$balnum','$sparetype'".');" /><span id="loadbalancing_targettxt_'.$balnum.'_'.$sparetype.'_'.$i.'"> '.$chkboxval. |
'</span></label></td>'; |
'</span></label></td>'; |
Line 3013 sub print_loadbalancing {
|
Line 3007 sub print_loadbalancing {
|
'<table><tr>'.$targettable.'</tr></table><br />'; |
'<table><tr>'.$targettable.'</tr></table><br />'; |
} |
} |
} |
} |
|
my $cssidx = $balnum%2; |
$datatable .= '</div></td></tr>'. |
$datatable .= '</div></td></tr>'. |
&loadbalancing_rules($dom,$intdom,$currrules{$lonhost}, |
&loadbalancing_rules($dom,$intdom,$currrules{$lonhost}, |
$othertitle,$usertypes,$types,\%servers, |
$othertitle,$usertypes,$types,\%servers, |
Line 3070 sub loadbalancing_rules {
|
Line 3065 sub loadbalancing_rules {
|
$css_class,$balnum,$islast) = @_; |
$css_class,$balnum,$islast) = @_; |
my $output; |
my $output; |
my $num = 0; |
my $num = 0; |
my ($alltypes,$othertypes,$titles) = |
my ($alltypes,$othertypes,$titles) = |
&loadbalancing_titles($dom,$intdom,$usertypes,$types); |
&loadbalancing_titles($dom,$intdom,$usertypes,$types); |
if ((ref($alltypes) eq 'ARRAY') && (ref($titles) eq 'HASH')) { |
if ((ref($alltypes) eq 'ARRAY') && (ref($titles) eq 'HASH')) { |
foreach my $type (@{$alltypes}) { |
foreach my $type (@{$alltypes}) { |
Line 3142 sub loadbalance_rule_row {
|
Line 3137 sub loadbalance_rule_row {
|
if ($islast && $num == 1) { |
if ($islast && $num == 1) { |
$space = '<div display="inline-block"> </div>'; |
$space = '<div display="inline-block"> </div>'; |
} |
} |
my $output = |
my $output = |
'<tr class="'.$css_class.'" id="balanceruletr_'.$balnum.'_'.$num.'"><td valign="top">'.$space. |
'<tr class="'.$css_class.'" id="balanceruletr_'.$balnum.'_'.$num.'"><td valign="top">'.$space. |
'<div id="balanceruletitle_'.$balnum.'_'.$type.'" style="'.$style.'">'.$title.'</div></td>'."\n". |
'<div id="balanceruletitle_'.$balnum.'_'.$type.'" style="'.$style.'">'.$title.'</div></td>'."\n". |
'<td valaign="top">'.$space. |
'<td valaign="top">'.$space. |
Line 3162 sub loadbalance_rule_row {
|
Line 3157 sub loadbalance_rule_row {
|
unless ($checked) { |
unless ($checked) { |
$default = ' selected="selected"'; |
$default = ' selected="selected"'; |
} |
} |
$extra = |
$extra = |
': <select name="loadbalancing_singleserver_'.$balnum.'_'.$type. |
': <select name="loadbalancing_singleserver_'.$balnum.'_'.$type. |
'" id="loadbalancing_singleserver_'.$balnum.'_'.$type. |
'" id="loadbalancing_singleserver_'.$balnum.'_'.$type. |
'" onchange="singleServerToggle('."'$balnum','$type'".')">'."\n". |
'" onchange="singleServerToggle('."'$balnum','$type'".')">'."\n". |
Line 3221 sub contact_titles {
|
Line 3216 sub contact_titles {
|
'helpdeskmail' => 'Helpdesk requests to be e-mailed to', |
'helpdeskmail' => 'Helpdesk requests to be e-mailed to', |
'lonstatusmail' => 'E-mail from nightly status check (warnings/errors)', |
'lonstatusmail' => 'E-mail from nightly status check (warnings/errors)', |
'requestsmail' => 'E-mail from course requests requiring approval', |
'requestsmail' => 'E-mail from course requests requiring approval', |
'updatesmail' => 'E-mail from nightly check of LON-CAPA module integrity/updates', |
|
); |
); |
my %short_titles = &Apache::lonlocal::texthash ( |
my %short_titles = &Apache::lonlocal::texthash ( |
adminemail => 'Admin E-mail address', |
adminemail => 'Admin E-mail address', |
Line 3264 sub authorrequest_titles {
|
Line 3258 sub authorrequest_titles {
|
automatic => 'Automatic approval', |
automatic => 'Automatic approval', |
); |
); |
return %titles; |
return %titles; |
} |
} |
|
|
sub courserequest_conditions { |
sub courserequest_conditions { |
my %conditions = &Apache::lonlocal::texthash ( |
my %conditions = &Apache::lonlocal::texthash ( |
Line 3503 sub captcha_choice {
|
Line 3497 sub captcha_choice {
|
# |
# |
# Note: If reCAPTCHA is to be used for LON-CAPA servers in a domain, a domain coordinator should visit: |
# Note: If reCAPTCHA is to be used for LON-CAPA servers in a domain, a domain coordinator should visit: |
# https://www.google.com/recaptcha and generate a Public and Private key. For domains with multiple |
# https://www.google.com/recaptcha and generate a Public and Private key. For domains with multiple |
# servers a single key pair will be used for all servers, so the internet domain (e.g., yourcollege.edu) |
# servers a single key pair will be used for all servers, so the internet domain (e.g., yourcollege.edu) |
# specified for use with the key should be broad enough to accommodate all servers in the LON-CAPA domain. |
# specified for use with the key should be broad enough to accommodate all servers in the LON-CAPA domain. |
# |
# |
$output .= '</td></tr>'."\n". |
$output .= '</td></tr>'."\n". |
'<tr><td>'."\n". |
'<tr><td>'."\n". |
'<span class="LC_nobreak"><span id="'.$context.'_recaptchapubtxt">'.$pubtext.'</span> '."\n". |
'<span class="LC_nobreak"><span id="'.$context.'_recaptchapubtxt">'.$pubtext.'</span> '."\n". |
Line 4184 sub print_serverstatuses {
|
Line 4178 sub print_serverstatuses {
|
|
|
sub serverstatus_pages { |
sub serverstatus_pages { |
return ('userstatus','lonstatus','loncron','server-status','codeversions', |
return ('userstatus','lonstatus','loncron','server-status','codeversions', |
'checksums','clusterstatus','metadata_keywords','metadata_harvest', |
'clusterstatus','metadata_keywords','metadata_harvest', |
'takeoffline','takeonline','showenv','toggledebug','ping','domconf'); |
'takeoffline','takeonline','showenv','toggledebug','ping','domconf'); |
} |
} |
|
|
Line 4639 sub modify_login {
|
Line 4633 sub modify_login {
|
%curr_loginvia,%loginhash,@currlangs,@newlangs,$addedfile,%title,@offon); |
%curr_loginvia,%loginhash,@currlangs,@newlangs,$addedfile,%title,@offon); |
%title = ( coursecatalog => 'Display course catalog', |
%title = ( coursecatalog => 'Display course catalog', |
adminmail => 'Display administrator E-mail address', |
adminmail => 'Display administrator E-mail address', |
helpdesk => 'Display "Contact Helpdesk" link', |
|
newuser => 'Link for visitors to create a user account', |
newuser => 'Link for visitors to create a user account', |
loginheader => 'Log-in box header'); |
loginheader => 'Log-in box header'); |
@offon = ('off','on'); |
@offon = ('off','on'); |
Line 4652 sub modify_login {
|
Line 4645 sub modify_login {
|
} |
} |
($errors,%colchanges) = &modify_colors($r,$dom,$confname,['login'], |
($errors,%colchanges) = &modify_colors($r,$dom,$confname,['login'], |
\%domconfig,\%loginhash); |
\%domconfig,\%loginhash); |
my @toggles = ('coursecatalog','adminmail','helpdesk','newuser'); |
my @toggles = ('coursecatalog','adminmail','newuser'); |
foreach my $item (@toggles) { |
foreach my $item (@toggles) { |
$loginhash{login}{$item} = $env{'form.'.$item}; |
$loginhash{login}{$item} = $env{'form.'.$item}; |
} |
} |
Line 4814 sub modify_login {
|
Line 4807 sub modify_login {
|
} else { |
} else { |
my $puberror = &mt("Upload of [_1] failed because an error occurred publishing the file in RES space. Error was: [_2].",$newfile{$lang},$result); |
my $puberror = &mt("Upload of [_1] failed because an error occurred publishing the file in RES space. Error was: [_2].",$newfile{$lang},$result); |
$errors .= '<li><span class="LC_error">'.$puberror.'</span></li>'; |
$errors .= '<li><span class="LC_error">'.$puberror.'</span></li>'; |
if ((grep(/^\Q$lang\E$/,@currlangs)) && |
if ((grep(/^\Q$lang\E$/,@currlangs)) && |
(!grep(/^\Q$lang\E$/,@delurls))) { |
(!grep(/^\Q$lang\E$/,@delurls))) { |
|
|
$loginhash{'login'}{'helpurl'}{$lang} = $domconfig{'login'}{'helpurl'}{$lang}; |
$loginhash{'login'}{'helpurl'}{$lang} = $domconfig{'login'}{'helpurl'}{$lang}; |
Line 4840 sub modify_login {
|
Line 4833 sub modify_login {
|
my $putresult = &Apache::lonnet::put_dom('configuration',\%loginhash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%loginhash, |
$dom); |
$dom); |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
my @toggles = ('coursecatalog','adminmail','helpdesk','newuser'); |
my @toggles = ('coursecatalog','adminmail','newuser'); |
my %defaultchecked = ( |
my %defaultchecked = ( |
'coursecatalog' => 'on', |
'coursecatalog' => 'on', |
'helpdesk' => 'on', |
|
'adminmail' => 'off', |
'adminmail' => 'off', |
'newuser' => 'off', |
'newuser' => 'off', |
); |
); |
Line 4931 sub modify_login {
|
Line 4923 sub modify_login {
|
} |
} |
} elsif ($item eq 'captcha') { |
} elsif ($item eq 'captcha') { |
if (ref($loginhash{'login'}) eq 'HASH') { |
if (ref($loginhash{'login'}) eq 'HASH') { |
my $chgtxt; |
my $chgtxt; |
if ($loginhash{'login'}{$item} eq 'notused') { |
if ($loginhash{'login'}{$item} eq 'notused') { |
$chgtxt .= &mt('No CAPTCHA validation in use for helpdesk form.'); |
$chgtxt .= &mt('No CAPTCHA validation in use for helpdesk form.'); |
} else { |
} else { |
Line 5409 sub publishlogo {
|
Line 5401 sub publishlogo {
|
# See if there is anything left |
# See if there is anything left |
unless ($fname) { return ('error: no uploaded file'); } |
unless ($fname) { return ('error: no uploaded file'); } |
$fname="$subdir/$fname"; |
$fname="$subdir/$fname"; |
my $docroot=$r->dir_config('lonDocRoot'); |
my $docroot=$r->dir_config('lonDocRoot'); |
my $filepath="$docroot/priv"; |
my $filepath="$docroot/priv"; |
my $relpath = "$dom/$confname"; |
my $relpath = "$dom/$confname"; |
my ($fnamepath,$file,$fetchthumb); |
my ($fnamepath,$file,$fetchthumb); |
Line 5417 sub publishlogo {
|
Line 5409 sub publishlogo {
|
if ($fname=~m|/|) { |
if ($fname=~m|/|) { |
($fnamepath,$file) = ($fname =~ m|^(.*)/([^/]+)$|); |
($fnamepath,$file) = ($fname =~ m|^(.*)/([^/]+)$|); |
} |
} |
my @parts=split(/\//,"$filepath/$relpath/$fnamepath"); |
my @parts=split(/\//,"$filepath/$relpath/$fnamepath"); |
my $count; |
my $count; |
for ($count=5;$count<=$#parts;$count++) { |
for ($count=5;$count<=$#parts;$count++) { |
$filepath.="/$parts[$count]"; |
$filepath.="/$parts[$count]"; |
Line 5588 sub write_metadata {
|
Line 5580 sub write_metadata {
|
print $logfile "\nWrite metadata file for ".$targetdir.'/'.$file; |
print $logfile "\nWrite metadata file for ".$targetdir.'/'.$file; |
my $mfh; |
my $mfh; |
if (open($mfh,'>'.$targetdir.'/'.$file.'.meta')) { |
if (open($mfh,'>'.$targetdir.'/'.$file.'.meta')) { |
foreach (sort(keys(%metadatafields))) { |
foreach (sort keys %metadatafields) { |
unless ($_=~/\./) { |
unless ($_=~/\./) { |
my $unikey=$_; |
my $unikey=$_; |
$unikey=~/^([A-Za-z]+)/; |
$unikey=~/^([A-Za-z]+)/; |
Line 5672 sub check_switchserver {
|
Line 5664 sub check_switchserver {
|
my @ids=&Apache::lonnet::current_machine_ids(); |
my @ids=&Apache::lonnet::current_machine_ids(); |
foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } } |
foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } } |
if (!$allowed) { |
if (!$allowed) { |
$switchserver='<a href="/adm/switchserver?otherserver='.$home.'&role=dc./'.$dom.'/&destinationurl=/adm/domainprefs">'.&mt('Switch Server').'</a>'; |
$switchserver='<a href="/adm/switchserver?otherserver='.$home.'&role=dc./'.$dom.'/">'.&mt('Switch Server').'</a>'; |
} |
} |
return $switchserver; |
return $switchserver; |
} |
} |
Line 5683 sub modify_quotas {
|
Line 5675 sub modify_quotas {
|
%limithash,$toolregexp,%conditions,$resulttext,%changes); |
%limithash,$toolregexp,%conditions,$resulttext,%changes); |
if ($action eq 'quotas') { |
if ($action eq 'quotas') { |
$context = 'tools'; |
$context = 'tools'; |
} else { |
} else { |
$context = $action; |
$context = $action; |
} |
} |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
Line 5873 sub modify_quotas {
|
Line 5865 sub modify_quotas {
|
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
|
|
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
unless (($context eq 'requestcourses') || |
unless (($context eq 'requestcourses') || |
($context eq 'requestauthor')) { |
($context eq 'requestauthor')) { |
if (ref($changes{'defaultquota'}) eq 'HASH') { |
if (ref($changes{'defaultquota'}) eq 'HASH') { |
$resulttext .= '<li>'.&mt('Portfolio default quotas').'<ul>'; |
$resulttext .= '<li>'.&mt('Portfolio default quotas').'<ul>'; |
Line 5894 sub modify_quotas {
|
Line 5886 sub modify_quotas {
|
my (%haschgs,%inconf); |
my (%haschgs,%inconf); |
if ($context eq 'requestauthor') { |
if ($context eq 'requestauthor') { |
%haschgs = %changes; |
%haschgs = %changes; |
%inconf = %confhash; |
%inconf = %confhash; |
} else { |
} else { |
if (ref($changes{$item}) eq 'HASH') { |
if (ref($changes{$item}) eq 'HASH') { |
%haschgs = %{$changes{$item}}; |
%haschgs = %{$changes{$item}}; |
Line 5908 sub modify_quotas {
|
Line 5900 sub modify_quotas {
|
&Apache::lonnet::usertools_access($env{'user.name'}, |
&Apache::lonnet::usertools_access($env{'user.name'}, |
$env{'user.domain'}, |
$env{'user.domain'}, |
$item,'reload',$context); |
$item,'reload',$context); |
if (($context eq 'requestcourses') || |
if (($context eq 'requestcourses') || |
($context eq 'requestauthor')) { |
($context eq 'requestauthor')) { |
if ($env{'environment.canrequest.'.$item} ne $newacc) { |
if ($env{'environment.canrequest.'.$item} ne $newacc) { |
$newenv{'environment.canrequest.'.$item} = $newacc; |
$newenv{'environment.canrequest.'.$item} = $newacc; |
Line 5942 sub modify_quotas {
|
Line 5934 sub modify_quotas {
|
$cond = $conditions{$inconf{$type}}; |
$cond = $conditions{$inconf{$type}}; |
} |
} |
$resulttext .= '<li>'.&mt('Set to be available to [_1].',$typetitle).' '.$cond.'</li>'; |
$resulttext .= '<li>'.&mt('Set to be available to [_1].',$typetitle).' '.$cond.'</li>'; |
} elsif ($context eq 'requestauthor') { |
|
$resulttext .= '<li>'.&mt('Set to "[_1]" for "[_2]".', |
|
$titles{$inconf{$type}},$typetitle); |
|
|
|
} else { |
} else { |
$resulttext .= '<li>'.&mt('Set to be available to [_1]',$typetitle).'</li>'; |
$resulttext .= '<li>'.&mt('Set to be available to [_1]',$typetitle).'</li>'; |
} |
} |
Line 6319 sub modify_autocreate {
|
Line 6307 sub modify_autocreate {
|
foreach my $item (@types) { |
foreach my $item (@types) { |
if ($changes{$item}) { |
if ($changes{$item}) { |
my $newtxt = $offon[$newvals{$item}]; |
my $newtxt = $offon[$newvals{$item}]; |
$resulttext .= '<li>'. |
$resulttext .= '<li>'.&mt("$title{$item} set to [_1]$newtxt [_2]",'<b>','</b>').'</li>'; |
&mt("$title{$item} set to [_1]$newtxt [_2]", |
|
'<b>','</b>'). |
|
'</li>'; |
|
} |
} |
} |
} |
if ($changes{'xmldc'}) { |
if ($changes{'xmldc'}) { |
my ($dcname,$dcdom) = split(':',$newvals{'xmldc'}); |
my ($dcname,$dcdom) = split(':',$newvals{'xmldc'}); |
my $newtxt = &Apache::loncommon::plainname($dcname,$dcdom); |
my $newtxt = &Apache::loncommon::plainname($dcname,$dcdom); |
$resulttext .= '<li>'.&mt("$title{'xmldc'} set to [_1]",'<b>'.$newtxt.'</b>').'</li>'; |
$resulttext .= '<li>'.&mt("$title{'xmldc'} set to [_1]$newtxt [_2]",'<b>','</b>').'</li>'; |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
} else { |
} else { |
Line 6474 sub modify_directorysrch {
|
Line 6459 sub modify_directorysrch {
|
} else { |
} else { |
$chgtext =~ s/\; $//; |
$chgtext =~ s/\; $//; |
} |
} |
$resulttext .= |
$resulttext .= '<li>'.&mt("Users from domain '<span class=\"LC_cusr_emph\">[_1]</span>' permitted to search the institutional directory set to: [_2]",$dom,$chgtext).'</li>'; |
'<li>'. |
|
&mt("Users from domain '[_1]' permitted to search the institutional directory set to: [_2]", |
|
'<span class="LC_cusr_emph">'.$dom.'</span>',$chgtext). |
|
'</li>'; |
|
} |
} |
} |
} |
} |
} |
Line 6506 sub modify_directorysrch {
|
Line 6487 sub modify_directorysrch {
|
} |
} |
} |
} |
$chgtext =~ s/\; $//; |
$chgtext =~ s/\; $//; |
$resulttext .= '<li>'.&mt($title{'searchtypes'}.' set to: "[_1]"',$chgtext).'</li>'; |
$resulttext .= '<li>'.&mt("$title{'searchtypes'} set to: \"[_1]\"",$chgtext).'</li>'; |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
} else { |
} else { |
Line 6530 sub modify_contacts {
|
Line 6511 sub modify_contacts {
|
my (%others,%to,%bcc); |
my (%others,%to,%bcc); |
my @contacts = ('supportemail','adminemail'); |
my @contacts = ('supportemail','adminemail'); |
my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail', |
my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail', |
'requestsmail','updatesmail'); |
'requestsmail'); |
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
@{$newsetting{$type}} = |
@{$newsetting{$type}} = |
&Apache::loncommon::get_env_multiple('form.'.$type); |
&Apache::loncommon::get_env_multiple('form.'.$type); |
Line 6586 sub modify_contacts {
|
Line 6567 sub modify_contacts {
|
$default{'helpdeskmail'} = 'supportemail'; |
$default{'helpdeskmail'} = 'supportemail'; |
$default{'lonstatusmail'} = 'adminemail'; |
$default{'lonstatusmail'} = 'adminemail'; |
$default{'requestsmail'} = 'adminemail'; |
$default{'requestsmail'} = 'adminemail'; |
$default{'updatesmail'} = 'adminemail'; |
|
foreach my $item (@contacts) { |
foreach my $item (@contacts) { |
if ($to{$item} ne $default{$item}) { |
if ($to{$item} ne $default{$item}) { |
$changes{$item} = 1; |
$changes{$item} = 1; |
Line 6941 sub modify_usercreation {
|
Line 6921 sub modify_usercreation {
|
if ($captchas{$cancreate{$type}}) { |
if ($captchas{$cancreate{$type}}) { |
$chgtext .= &mt("Validation for self-creation screen set to $captchas{$cancreate{$type}}."); |
$chgtext .= &mt("Validation for self-creation screen set to $captchas{$cancreate{$type}}."); |
} else { |
} else { |
$chgtext .= &mt('Validation for self-creation screen set to unknown type.'); |
$chgtext .= &mt('Validation for self-creation screen set to unknown type.'); |
} |
} |
} |
} |
} elsif ($type eq 'recaptchakeys') { |
} elsif ($type eq 'recaptchakeys') { |
Line 7069 sub process_captcha {
|
Line 7049 sub process_captcha {
|
$newsettings->{'captcha'} = 'original'; |
$newsettings->{'captcha'} = 'original'; |
} |
} |
if ($current->{'captcha'} ne $newsettings->{'captcha'}) { |
if ($current->{'captcha'} ne $newsettings->{'captcha'}) { |
if ($container eq 'cancreate') { |
if ($container eq 'cancreate') { |
if (ref($changes->{'cancreate'}) eq 'ARRAY') { |
if (ref($changes->{'cancreate'}) eq 'ARRAY') { |
push(@{$changes->{'cancreate'}},'captcha'); |
push(@{$changes->{'cancreate'}},'captcha'); |
} elsif (!defined($changes->{'cancreate'})) { |
} elsif (!defined($changes->{'cancreate'})) { |
Line 7093 sub process_captcha {
|
Line 7073 sub process_captcha {
|
if (ref($current->{'recaptchakeys'}) eq 'HASH') { |
if (ref($current->{'recaptchakeys'}) eq 'HASH') { |
$currpub = $current->{'recaptchakeys'}{'public'}; |
$currpub = $current->{'recaptchakeys'}{'public'}; |
$currpriv = $current->{'recaptchakeys'}{'private'}; |
$currpriv = $current->{'recaptchakeys'}{'private'}; |
unless ($newsettings->{'captcha'} eq 'recaptcha') { |
$newsettings->{'recaptchakeys'} = { |
$newsettings->{'recaptchakeys'} = { |
public => '', |
public => '', |
private => '', |
private => '', |
} |
} |
|
} |
|
} |
} |
if (($newpub ne $currpub) || ($newpriv ne $currpriv)) { |
if (($newpub ne $currpub) || ($newpriv ne $currpriv)) { |
if ($container eq 'cancreate') { |
if ($container eq 'cancreate') { |
Line 7108 sub process_captcha {
|
Line 7086 sub process_captcha {
|
$changes->{'cancreate'} = ['recaptchakeys']; |
$changes->{'cancreate'} = ['recaptchakeys']; |
} |
} |
} else { |
} else { |
$changes->{'recaptchakeys'} = 1; |
$changes->{'recaptchakeys'} = 1; |
} |
} |
} |
} |
return; |
return; |
Line 7792 sub modify_helpsettings {
|
Line 7770 sub modify_helpsettings {
|
} elsif ($domconfig{'helpsettings'}{$item} ne $env{'form.'.$item}) { |
} elsif ($domconfig{'helpsettings'}{$item} ne $env{'form.'.$item}) { |
$changes{$item} = 1; |
$changes{$item} = 1; |
} |
} |
} |
} |
if (($env{'form.'.$item} eq '0') || ($env{'form.'.$item} eq '1')) { |
if (($env{'form.'.$item} eq '0') || ($env{'form.'.$item} eq '1')) { |
$helphash{'helpsettings'}{$item} = $env{'form.'.$item}; |
$helphash{'helpsettings'}{$item} = $env{'form.'.$item}; |
} |
} |
} |
} |
Line 8200 sub modify_loadbalancing {
|
Line 8178 sub modify_loadbalancing {
|
if ($balancer eq '') { |
if ($balancer eq '') { |
next; |
next; |
} |
} |
if (!exists($servers{$balancer})) { |
if (!exists($servers{$balancer})) { |
if (exists($currbalancer{$balancer})) { |
if (exists($currbalancer{$balancer})) { |
push(@{$changes{'delete'}},$balancer); |
push(@{$changes{'delete'}},$balancer); |
} |
} |
Line 8251 sub modify_loadbalancing {
|
Line 8229 sub modify_loadbalancing {
|
} |
} |
} else { |
} else { |
if (ref($defaultshash{'loadbalancing'}{$balancer}) eq 'HASH') { |
if (ref($defaultshash{'loadbalancing'}{$balancer}) eq 'HASH') { |
foreach my $sparetype (@sparestypes) { |
foreach my $sparetype (@sparestypes) { |
if (ref($defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype}) eq 'ARRAY') { |
if (ref($defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype}) eq 'ARRAY') { |
if (@{$defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype}} > 0) { |
if (@{$defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype}} > 0) { |
$changes{'curr'}{$balancer}{'targets'} = 1; |
$changes{'curr'}{$balancer}{'targets'} = 1; |
} |
} |
} |
} |
} |
} |
} |
} |
} |
} |
my $ishomedom; |
my $ishomedom; |
if (&Apache::lonnet::host_domain($balancer) eq $dom) { |
if (&Apache::lonnet::host_domain($balancer) eq $dom) { |
Line 8267 sub modify_loadbalancing {
|
Line 8245 sub modify_loadbalancing {
|
if (ref($alltypes) eq 'ARRAY') { |
if (ref($alltypes) eq 'ARRAY') { |
foreach my $type (@{$alltypes}) { |
foreach my $type (@{$alltypes}) { |
my $rule; |
my $rule; |
unless ((($type eq '_LC_external') || ($type eq '_LC_internetdom')) && |
unless ((($type eq '_LC_external') || ($type eq '_LC_internetdom')) && |
(!$ishomedom)) { |
(!$ishomedom)) { |
$rule = $env{'form.loadbalancing_rules_'.$i.'_'.$type}; |
$rule = $env{'form.loadbalancing_rules_'.$i.'_'.$type}; |
} |
} |
Line 8292 sub modify_loadbalancing {
|
Line 8270 sub modify_loadbalancing {
|
} |
} |
my $putresult = &Apache::lonnet::put_dom('configuration', |
my $putresult = &Apache::lonnet::put_dom('configuration', |
\%defaultshash,$dom); |
\%defaultshash,$dom); |
|
|
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
if (ref($changes{'delete'}) eq 'ARRAY') { |
if (ref($changes{'delete'}) eq 'ARRAY') { |
Line 8302 sub modify_loadbalancing {
|
Line 8280 sub modify_loadbalancing {
|
} |
} |
} |
} |
if (ref($changes{'add'}) eq 'ARRAY') { |
if (ref($changes{'add'}) eq 'ARRAY') { |
foreach my $balancer (sort(@{$changes{'add'}})) { |
foreach my $balancer (sort(@{$changes{'add'}})) { |
$resulttext .= '<li>'.&mt('Load Balancing enabled for: [_1]',$balancer); |
$resulttext .= '<li>'.&mt('Load Balancing enabled for: [_1]',$balancer); |
} |
} |
} |
} |
Line 8348 sub modify_loadbalancing {
|
Line 8326 sub modify_loadbalancing {
|
} else { |
} else { |
$balancetext = &mt('offload to [_1]',$defaultshash{'loadbalancing'}{$balancer}{'rules'}{$type}); |
$balancetext = &mt('offload to [_1]',$defaultshash{'loadbalancing'}{$balancer}{'rules'}{$type}); |
} |
} |
$resulttext .= '<li>'.&mt('Load Balancer: [_1] -- balancing for [_2] set to - "[_3]"',$balancer,$titles->{$type},$balancetext).'</li>'; |
$resulttext .= '<li>'.&mt('Load Balancer: [_1] -- balancing for [_2] set to - "[_3]"',$balancer,$titles->{$type},$balancetext).'</li>'; |
} |
} |
} |
} |
} |
} |
Line 8408 sub recurse_cat_deletes {
|
Line 8386 sub recurse_cat_deletes {
|
delete($coursecategories->{$subitem}); |
delete($coursecategories->{$subitem}); |
$deletions->{$subitem} = 1; |
$deletions->{$subitem} = 1; |
&recurse_cat_deletes($subitem,$coursecategories,$deletions); |
&recurse_cat_deletes($subitem,$coursecategories,$deletions); |
} |
} |
} |
} |
} |
} |
return; |
return; |
Line 8474 sub active_dc_picker {
|
Line 8452 sub active_dc_picker {
|
'<input type="radio" name="autocreate_xmldc"'. |
'<input type="radio" name="autocreate_xmldc"'. |
' value="'.$dcs[$i].'"'.$check.'/>'. |
' value="'.$dcs[$i].'"'.$check.'/>'. |
&Apache::loncommon::plainname($dcname,$dcdom). |
&Apache::loncommon::plainname($dcname,$dcdom). |
' ('.$dcname.':'.$dcdom.')'. |
|
'</label></span></td>'; |
'</label></span></td>'; |
} |
} |
$datatable .= '</tr></table>'; |
$datatable .= '</tr></table>'; |
Line 8554 sub lonbalance_targets_js {
|
Line 8531 sub lonbalance_targets_js {
|
} |
} |
&get_loadbalancers_config($servers,\%existing,\%currbalancer, |
&get_loadbalancers_config($servers,\%existing,\%currbalancer, |
\%currtargets,\%currrules); |
\%currtargets,\%currrules); |
my $balancers = join("','",sort(keys(%currbalancer))); |
my $balancers = join("','",sort(keys(%currbalancer))); |
return <<"END"; |
return <<"END"; |
|
|
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 8637 function showSpares(balancer,ishomedom,b
|
Line 8614 function showSpares(balancer,ishomedom,b
|
var item = document.getElementById('loadbalancing_singleserver_'+balnum+'_'+insttypes[k]); |
var item = document.getElementById('loadbalancing_singleserver_'+balnum+'_'+insttypes[k]); |
item.options.length = 0; |
item.options.length = 0; |
item.options[0] = new Option("","",true,true); |
item.options[0] = new Option("","",true,true); |
var idx = 0; |
var idx = 0; |
for (var m=0; m<alltargets.length; m++) { |
for (var m=0; m<alltargets.length; m++) { |
if ((currBalancers.indexOf(alltargets[m]) == -1) && (alltargets[m] != balancer)) { |
if ((currBalancers.indexOf(alltargets[m]) == -1) && (alltargets[m] != balancer)) { |
idx ++; |
idx ++; |
item.options[idx] = new Option(alltargets[m],alltargets[m],false,false); |
item.options[idx] = new Option(alltargets[m],alltargets[m],false,false); |
|
|
} |
} |
} |
} |
} |
} |
Line 8715 function singleServerToggle(balnum,type)
|
Line 8692 function singleServerToggle(balnum,type)
|
|
|
function balanceruleChange(formname,balnum,type) { |
function balanceruleChange(formname,balnum,type) { |
if (type == '_LC_external') { |
if (type == '_LC_external') { |
return; |
return; |
} |
} |
var typesRules = getIndicesByName(formname,'loadbalancing_rules_'+balnum+'_'+type); |
var typesRules = getIndicesByName(formname,'loadbalancing_rules_'+balnum+'_'+type); |
for (var i=0; i<typesRules.length; i++) { |
for (var i=0; i<typesRules.length; i++) { |