--- loncom/interface/domainprefs.pm 2012/08/27 00:53:22 1.168 +++ loncom/interface/domainprefs.pm 2012/08/27 06:28:05 1.169 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.168 2012/08/27 00:53:22 raeburn Exp $ +# $Id: domainprefs.pm,v 1.169 2012/08/27 06:28:05 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1054,7 +1054,9 @@ sub print_login { $datatable .= ''; } $datatable .= ''; + $itemcount ++; } + $datatable .= &captcha_choice('login',$settings,$itemcount); } return $datatable; } @@ -3299,9 +3301,10 @@ sub print_usercreation { $dom,$numinrow,$othertitle, 'statustocreate'); $$rowtotal ++; + $rownum ++; } } - $datatable .= &captcha_choice('cancreate',$createsettings); + $datatable .= &captcha_choice('cancreate',$createsettings,$rownum); } else { my @contexts = ('author','course','domain'); my @authtypes = ('int','krb4','krb5','loc'); @@ -3354,14 +3357,14 @@ sub print_usercreation { } sub captcha_choice { - my ($context,$settings) = @_; + my ($context,$settings,$itemcount) = @_; my ($keyentry,$currpub,$currpriv,%checked,$rowname,$pubtext,$privtext); my %lt = &captcha_phrases(); $keyentry = 'hidden'; if ($context eq 'cancreate') { $rowname = &mt('CAPTCHA validation (e-mail as username)'); - } elsif ($context eq 'help') { - $rowname = &mt('CAPTCHA validation'); + } elsif ($context eq 'login') { + $rowname = &mt('"Contact helpdesk" CAPTCHA validation'); } if (ref($settings) eq 'HASH') { if ($settings->{'captcha'}) { @@ -3381,8 +3384,9 @@ sub captcha_choice { } else { $checked{'original'} = ' checked="checked"'; } - my $output = '
'."\n";
foreach my $option ('original','recaptcha','notused') {
$output .= '';
}
}
+ &process_captcha('login',\%changes,$loginhash{'login'},$domconfig{'login'});
my $defaulthelpfile = '/adm/loginproblems.html';
my $defaulttext = &mt('Default in use');
@@ -4819,6 +4823,42 @@ sub modify_login {
}
}
}
+ } elsif ($item eq 'captcha') {
+ if (ref($loginhash{'login'}) eq 'HASH') {
+ my $chgtxt;
+ if ($loginhash{'login'}{$item} eq 'notused') {
+ $chgtxt .= &mt('No CAPTCHA validation in use for helpdesk form.');
+ } else {
+ my %captchas = &captcha_phrases();
+ if ($captchas{$loginhash{'login'}{$item}}) {
+ $chgtxt .= &mt("Validation for helpdesk form set to $captchas{$loginhash{'login'}{$item}}.");
+ } else {
+ $chgtxt .= &mt('Validation for helpdesk form set to unknown type.');
+ }
+ }
+ $resulttext .= '
|