';
+ if ($same_institution) {
+ my %domservers = &Apache::lonnet::get_servers($dom);
+ $datatable .= &LONCAPA::SSL::print_certstatus(\%domservers,'web','domprefs');
+ } else {
+ $datatable .= &mt("You need to be logged into one of your own domain's servers to display information about the status of LON-CAPA SSL certificates.");
+ }
+ $datatable .= '
';
$itemcount ++;
} else {
my %titles = &ssl_titles();
@@ -4585,6 +4690,9 @@ sub print_loadbalancing {
my ($numspares,@spares) = &count_servers($lonhost,%servers);
my @sparestypes = ('primary','default');
my %typetitles = &sparestype_titles();
+ my %hostherechecked = (
+ no => ' checked="checked"',
+ );
foreach my $sparetype (@sparestypes) {
my $targettable;
for (my $i=0; $i<$numspares; $i++) {
@@ -4630,6 +4738,23 @@ sub print_loadbalancing {
$datatable .= ''.$typetitles{$sparetype}.' '.
'
'.$targettable.'
';
}
+ $hostherechecked{$sparetype} = '';
+ if (ref($currtargets{$lonhost}) eq 'HASH') {
+ if (ref($currtargets{$lonhost}{$sparetype}) eq 'ARRAY') {
+ if (grep(/^\Q$lonhost\E$/,@{$currtargets{$lonhost}{$sparetype}})) {
+ $hostherechecked{$sparetype} = ' checked="checked"';
+ $hostherechecked{'no'} = '';
+ }
+ }
+ }
+ }
+ $datatable .= &mt('Hosting on balancer itself').' '.
+ ' ';
+ foreach my $sparetype (@sparestypes) {
+ $datatable .= ' ';
}
$datatable .= ''.
&loadbalancing_rules($dom,$intdom,$currrules{$lonhost},
@@ -11690,30 +11815,78 @@ sub modify_helpsettings {
my %defaultchecked = ('submitbugs' => 'on');
my @offon = ('off','on');
my @toggles = ('submitbugs');
+ my %current = ('submitbugs' => '');
if (ref($domconfig{'helpsettings'}) eq 'HASH') {
- foreach my $item (@toggles) {
- if ($defaultchecked{$item} eq 'on') {
- if ($domconfig{'helpsettings'}{$item} eq '') {
- if ($env{'form.'.$item} eq '0') {
- $changes{$item} = 1;
- }
- } elsif ($domconfig{'helpsettings'}{$item} ne $env{'form.'.$item}) {
+ %current = %{$domconfig{'helpsettings'}};
+ }
+ foreach my $item (@toggles) {
+ if ($defaultchecked{$item} eq 'on') {
+ if ($current{$item} eq '') {
+ if ($env{'form.'.$item} eq '0') {
$changes{$item} = 1;
}
- } elsif ($defaultchecked{$item} eq 'off') {
- if ($domconfig{'helpsettings'}{$item} eq '') {
- if ($env{'form.'.$item} eq '1') {
- $changes{$item} = 1;
- }
- } elsif ($domconfig{'helpsettings'}{$item} ne $env{'form.'.$item}) {
+ } elsif ($current{$item} ne $env{'form.'.$item}) {
+ $changes{$item} = 1;
+ }
+ } elsif ($defaultchecked{$item} eq 'off') {
+ if ($current{$item} eq '') {
+ if ($env{'form.'.$item} eq '1') {
$changes{$item} = 1;
}
+ } elsif ($current{$item} ne $env{'form.'.$item}) {
+ $changes{$item} = 1;
}
- if (($env{'form.'.$item} eq '0') || ($env{'form.'.$item} eq '1')) {
- $helphash{'helpsettings'}{$item} = $env{'form.'.$item};
+ }
+ if (($env{'form.'.$item} eq '0') || ($env{'form.'.$item} eq '1')) {
+ $helphash{'helpsettings'}{$item} = $env{'form.'.$item};
+ }
+ }
+
+ my @modify = &Apache::loncommon::get_env_multiple('form.modifycusthelp');
+ my $confname = $dom.'-domainconfig';
+ my %existing=&Apache::lonnet::dump('roles',$dom,$confname,'rolesdef_');
+ if (@modify) {
+ foreach my $num (@modify) {
+ my $rolename = $env{'form.custhelprole'.$num};
+ if ($rolename ne '') {
+ if (exists($existing{'rolesdef_'.$rolename})) {
+ my $prefix = 'custhelp'.$num;
+ my %newprivs = &Apache::lonuserutils::custom_role_update($rolename,$prefix);
+ my %currprivs;
+ ($currprivs{'s'},$currprivs{'d'},$currprivs{'c'}) =
+ split(/\_/,$existing{'rolesdef_'.$rolename});
+ foreach my $level ('c','d','s') {
+ if ($newprivs{$level} ne $currprivs{$level}) {
+ $changes{'customrole'}{$rolename} = 1;
+ my $result = &Apache::lonnet::definerole($rolename,$newprivs{'s'},$newprivs{'d'},
+ $newprivs{'c'},$confname,$dom);
+ last;
+ }
+ }
+ }
+ }
+ }
+ }
+ if ($env{'form.newcusthelp'} ne '') {
+ my $prefix = 'custhelp'.$env{'form.newcusthelp'};
+ my $rolename = $env{'form.newcusthelpname'};
+ $rolename=~s/[^A-Za-z0-9]//gs;
+ if ($rolename ne '') {
+ unless(exists($existing{'rolesdef_'.$rolename})) {
+ my %newprivs = &Apache::lonuserutils::custom_role_update($rolename,$prefix);
+ my $result = &Apache::lonnet::definerole($rolename,$newprivs{'s'},$newprivs{'d'},
+ $newprivs{'c'},$confname,$dom);
+ if ($result eq 'ok') {
+ $changes{'newcustomrole'} = $rolename;
+ } else {
+ $errors .= '
'.
+ &mt('An error occurred storing the new custom role: [_1]',
+ $result).'
';
+ }
}
}
}
+
my $putresult;
if (keys(%changes) > 0) {
$putresult = &Apache::lonnet::put_dom('configuration',\%helphash,$dom);
@@ -11724,6 +11897,16 @@ sub modify_helpsettings {
$resulttext .= '
'.&mt('Display link to: [_1] set to "'.$offon[$env{'form.'.$item}].'".',
&Apache::loncommon::modal_link('http://bugs.loncapa.org',
&mt('LON-CAPA bug tracker'),600,500)).'