'.&mt('ReCAPTCHA for helpdesk form set to version [_1]',$loginhash{'login'}{'recaptchaversion'}).
- '
';
- }
- }
} else {
$resulttext .= '
'.&mt("$title{$item} set to $offon[$env{'form.'.$item}]").'
';
}
@@ -7198,6 +6410,7 @@ sub modify_login {
return $resulttext;
}
+
sub check_exempt_addresses {
my ($iplist) = @_;
$iplist =~ s/^\s+//;
@@ -8107,7 +7320,7 @@ sub modify_quotas {
my $newpos = $env{'form.'.$itemid};
$newpos =~ s/\D+//g;
foreach my $item ('subject','title','publisher','author') {
- next if ((($item eq 'author') || ($item eq 'publisher')) &&
+ next if ((($item eq 'author') || ($item eq 'publisher')) &&
($type eq 'templates'));
$confhash{$type}{$key}{$item} = $env{'form.'.$type.'_'.$item.'_'.$i};
if ($domconfig{$action}{$type}{$key}{$item} ne $confhash{$type}{$key}{$item}) {
@@ -8204,14 +7417,10 @@ sub modify_quotas {
if (@{$confhash{'validation'}{$item}} > 0) {
@{$confhash{'validation'}{$item}} = sort(@{$confhash{'validation'}{$item}});
}
- if (ref($domconfig{'requestcourses'}) eq 'HASH') {
- if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') {
- if (ref($domconfig{'requestcourses'}{'validation'}{$item}) eq 'ARRAY') {
- @changed = &Apache::loncommon::compare_arrays($confhash{'validation'}{$item},
- $domconfig{'requestcourses'}{'validation'}{$item});
- } else {
- @changed = @{$confhash{'validation'}{$item}};
- }
+ if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') {
+ if (ref($domconfig{'requestcourses'}{'validation'}{$item}) eq 'ARRAY') {
+ @changed = &Apache::loncommon::compare_arrays($confhash{'validation'}{$item},
+ $domconfig{'requestcourses'}{'validation'}{$item});
} else {
@changed = @{$confhash{'validation'}{$item}};
}
@@ -8232,15 +7441,9 @@ sub modify_quotas {
$env{'form.requestcourses_validation_'.$item} =~ s/[\n\r\f]+/\s/gs;
}
}
- if (ref($domconfig{'requestcourses'}) eq 'HASH') {
- if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') {
- if ($domconfig{'requestcourses'}{'validation'}{$item} ne $confhash{'validation'}{$item}) {
- $changes{'validation'}{$item} = $confhash{'validation'}{$item};
- }
- } else {
- if ($confhash{'validation'}{$item} ne '') {
- $changes{'validation'}{$item} = $confhash{'validation'}{$item};
- }
+ if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') {
+ if ($domconfig{'requestcourses'}{'validation'}{$item} ne $confhash{'validation'}{$item}) {
+ $changes{'validation'}{$item} = $confhash{'validation'}{$item};
}
} else {
if ($confhash{'validation'}{$item} ne '') {
@@ -8252,24 +7455,20 @@ sub modify_quotas {
}
if ($env{'form.validationdc'}) {
my $newval = $env{'form.validationdc'};
- my %domcoords = &Apache::lonnet::get_active_domroles($dom,['dc']);
+ my %domcoords = &get_active_dcs($dom);
if (exists($domcoords{$newval})) {
$confhash{'validation'}{'dc'} = $newval;
}
}
if (ref($confhash{'validation'}) eq 'HASH') {
- if (ref($domconfig{'requestcourses'}) eq 'HASH') {
- if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') {
- if ($domconfig{'requestcourses'}{'validation'}{'dc'}) {
- unless ($confhash{'validation'}{'dc'} eq $domconfig{'requestcourses'}{'validation'}{'dc'}) {
- if ($confhash{'validation'}{'dc'} eq '') {
- $changes{'validation'}{'dc'} = &mt('None');
- } else {
- $changes{'validation'}{'dc'} = $confhash{'validation'}{'dc'};
- }
+ if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') {
+ if ($domconfig{'requestcourses'}{'validation'}{'dc'}) {
+ unless ($confhash{'validation'}{'dc'} eq $domconfig{'requestcourses'}{'validation'}{'dc'}) {
+ if ($confhash{'validation'}{'dc'} eq '') {
+ $changes{'validation'}{'dc'} = &mt('None');
+ } else {
+ $changes{'validation'}{'dc'} = $confhash{'validation'}{'dc'};
}
- } elsif ($confhash{'validation'}{'dc'} ne '') {
- $changes{'validation'}{'dc'} = $confhash{'validation'}{'dc'};
}
} elsif ($confhash{'validation'}{'dc'} ne '') {
$changes{'validation'}{'dc'} = $confhash{'validation'}{'dc'};
@@ -8277,13 +7476,9 @@ sub modify_quotas {
} elsif ($confhash{'validation'}{'dc'} ne '') {
$changes{'validation'}{'dc'} = $confhash{'validation'}{'dc'};
}
- } else {
- if (ref($domconfig{'requestcourses'}) eq 'HASH') {
- if (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') {
- if ($domconfig{'requestcourses'}{'validation'}{'dc'}) {
- $changes{'validation'}{'dc'} = &mt('None');
- }
- }
+ } elsif (ref($domconfig{'requestcourses'}{'validation'}) eq 'HASH') {
+ if ($domconfig{'requestcourses'}{'validation'}{'dc'}) {
+ $changes{'validation'}{'dc'} = &mt('None');
}
}
}
@@ -8691,8 +7886,7 @@ sub modify_autoenroll {
my $autorun = &Apache::lonnet::auto_run(undef,$dom),
my %title = ( run => 'Auto-enrollment active',
sender => 'Sender for notification messages',
- coowners => 'Automatic assignment of co-ownership to instructors of record (institutional data)',
- failsafe => 'Failsafe for no drops if institutional data missing for a section');
+ coowners => 'Automatic assignment of co-ownership to instructors of record (institutional data)');
my @offon = ('off','on');
my $sender_uname = $env{'form.sender_uname'};
my $sender_domain = $env{'form.sender_domain'};
@@ -8702,17 +7896,11 @@ sub modify_autoenroll {
$sender_domain = '';
}
my $coowners = $env{'form.autoassign_coowners'};
- my $failsafe = $env{'form.autoenroll_failsafe'};
- $failsafe =~ s{^\s+|\s+$}{}g;
- if ($failsafe =~ /\D/) {
- undef($failsafe);
- }
my %autoenrollhash = (
autoenroll => { 'run' => $env{'form.autoenroll_run'},
'sender_uname' => $sender_uname,
'sender_domain' => $sender_domain,
'co-owners' => $coowners,
- 'autofailsafe' => $failsafe,
}
);
my $putresult = &Apache::lonnet::put_dom('configuration',\%autoenrollhash,
@@ -8739,10 +7927,7 @@ sub modify_autoenroll {
}
} elsif ($coowners) {
$changes{'coowners'} = 1;
- }
- if ($currautoenroll{'autofailsafe'} ne $failsafe) {
- $changes{'autofailsafe'} = 1;
- }
+ }
if (keys(%changes) > 0) {
$resulttext = &mt('Changes made:').'
';
if ($changes{'run'}) {
@@ -8762,17 +7947,6 @@ sub modify_autoenroll {
$lastactref->{'domainconfig'} = 1;
}
}
- if ($changes{'autofailsafe'}) {
- if ($failsafe ne '') {
- $resulttext .= '
'.&mt('Failsafe for no drops if institutional data missing for a section set to: [_1]',$failsafe).'
';
- } else {
- $resulttext .= '
'.&mt('Failsafe for no drops if institutional data missing for a section: deleted');
- }
- &Apache::lonnet::get_domain_defaults($dom,1);
- if (ref($lastactref) eq 'HASH') {
- $lastactref->{'domdefaults'} = 1;
- }
- }
$resulttext .= '
';
} else {
$resulttext = &mt('No changes made to auto-enrollment settings');
@@ -8988,7 +8162,7 @@ sub modify_autocreate {
$newvals{$item} = 0 if ($newvals{$item} eq '');
}
$newvals{'xmldc'} = $env{'form.autocreate_xmldc'};
- my %domcoords = &Apache::lonnet::get_active_domroles($dom,['dc']);
+ my %domcoords = &get_active_dcs($dom);
unless (exists($domcoords{$newvals{'xmldc'}})) {
$newvals{'xmldc'} = '';
}
@@ -9045,7 +8219,7 @@ sub modify_autocreate {
}
sub modify_directorysrch {
- my ($dom,$lastactref,%domconfig) = @_;
+ my ($dom,%domconfig) = @_;
my ($resulttext,%changes);
my %currdirsrch;
if (ref($domconfig{'directorysrch'}) eq 'HASH') {
@@ -9053,10 +8227,8 @@ sub modify_directorysrch {
$currdirsrch{$key} = $domconfig{'directorysrch'}{$key};
}
}
- my %title = ( available => 'Institutional directory search available',
- localonly => 'Other domains can search institution',
- lcavailable => 'LON-CAPA directory search available',
- lclocalonly => 'Other domains can search LON-CAPA domain',
+ my %title = ( available => 'Directory search available',
+ localonly => 'Other domains can search',
searchby => 'Search types',
searchtypes => 'Search latitude');
my @offon = ('off','on');
@@ -9130,9 +8302,7 @@ sub modify_directorysrch {
my %dirsrch_hash = (
directorysrch => { available => $env{'form.dirsrch_available'},
cansearch => \@cansearch,
- localonly => $env{'form.dirsrch_instlocalonly'},
- lclocalonly => $env{'form.dirsrch_domlocalonly'},
- lcavailable => $env{'form.dirsrch_domavailable'},
+ localonly => $env{'form.dirsrch_localonly'},
searchby => \@searchby,
searchtypes => \@searchtypes,
}
@@ -9149,47 +8319,24 @@ sub modify_directorysrch {
$changes{'available'} = 1;
}
}
- if (exists($currdirsrch{'lcavailable'})) {
- if ($currdirsrch{'lcavailable'} ne $env{'form.dirsrch_domavailable'}) {
- $changes{'lcavailable'} = 1;
- }
- } else {
- if ($env{'form.dirsrch_lcavailable'} eq '1') {
- $changes{'lcavailable'} = 1;
- }
- }
if (exists($currdirsrch{'localonly'})) {
- if ($currdirsrch{'localonly'} ne $env{'form.dirsrch_instlocalonly'}) {
- $changes{'localonly'} = 1;
- }
+ if ($currdirsrch{'localonly'} ne $env{'form.dirsrch_localonly'}) {
+ $changes{'localonly'} = 1;
+ }
} else {
- if ($env{'form.dirsrch_instlocalonly'} eq '1') {
+ if ($env{'form.dirsrch_localonly'} eq '1') {
$changes{'localonly'} = 1;
}
}
- if (exists($currdirsrch{'lclocalonly'})) {
- if ($currdirsrch{'lclocalonly'} ne $env{'form.dirsrch_domlocalonly'}) {
- $changes{'lclocalonly'} = 1;
- }
- } else {
- if ($env{'form.dirsrch_domlocalonly'} eq '1') {
- $changes{'lclocalonly'} = 1;
- }
- }
if (keys(%changes) > 0) {
$resulttext = &mt('Changes made:').'
';
if ($changes{'available'}) {
$resulttext .= '
'.&mt("$title{'available'} set to: $offon[$env{'form.dirsrch_available'}]").'
';
}
- if ($changes{'lcavailable'}) {
- $resulttext .= '
'.&mt("$title{'lcavailable'} set to: $offon[$env{'form.dirsrch_domavailable'}]").'
';
- }
if ($changes{'localonly'}) {
- $resulttext .= '
'.&mt("$title{'localonly'} set to: $otherdoms[$env{'form.dirsrch_instlocalonly'}]").'
';
foreach my $item (sort(keys(%changes))) {
if ($item eq 'submitbugs') {
$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)).'
';
- } elsif ($item eq 'customrole') {
- if (ref($changes{'customrole'}) eq 'HASH') {
- my @keyorder = ('order','desc','access','status','exc','inc');
- my %keytext = &Apache::lonlocal::texthash(
- order => 'Order',
- desc => 'Role description',
- access => 'Role usage',
- status => 'Allowed institutional types',
- exc => 'Allowed personnel',
- inc => 'Disallowed personnel',
- );
- foreach my $role (sort(keys(%{$changes{'customrole'}}))) {
- if (ref($changes{'customrole'}{$role}) eq 'HASH') {
- if ($role eq $newrole) {
- $resulttext .= '
'.&mt('New custom role added: [_1]',
- $role).'
';
- } else {
- $resulttext .= '
'.&mt('Existing custom role modified: [_1]',
- $role).'
';
- }
- foreach my $key (@keyorder) {
- if ($changes{'customrole'}{$role}{$key}) {
- $resulttext .= '
'.&mt("[_1] set to: [_2]",
- $keytext{$key},$newsettings{$role}{$key}).
- '
'.&mt('Submit button(s) remain enabled on page after student makes submission.');
} else {
$resulttext .= '
'.&mt('Submit button(s) disabled on page after student makes submission').'; ';
- if (ref($defaultshash{'coursedefaults'}{'postsubmit'}) eq 'HASH') {
+ if (ref($defaultshash{'coursedefaults'}{'postsubmit'}) eq 'HASH') {
$resulttext .= &mt('durations:').'