I'm pretty new to OTRS in terms of configuration/administration. I have a task to add reCAPTCHA to customer registration process. I tried to follow instructions from OTRS 5.0.X reCaptcha thread here (viewtopic.php?f=60&t=33699) but that not helped me.
So, what i've done:
1) Installed Captcha::reCAPTCHA module using cpan;
2) Copied Kernel/System/Web/InterfaceCustomer.pm to Custom directory (including subdirectory creation as Custom/Kernel...);
Same for Kernel/Output/HTML/Layout.pm and Kernel/Output/HTML/Templates/Standart/CustomerLogin.tt;
3) Implemented changes to Layout.pm as suggested:
Code: Select all
use Captcha::reCAPTCHA;
in use section and
Code: Select all
#begin recaptcha
my $rc = Captcha::reCAPTCHA->new;
my $rccustom = "<script type= \"text/javascript\">\n
var RecaptchaOptions = {\n
lang : 'ru',
};\n
</script>\n";
$Param{reCAPTCHA} = $rccustom . $rc->get_html("my_pub_key"); #public key
#end recaptcha
Added
Code: Select all
<!--begin recaptcha -->
<div class="NewLine">
[% Data.reCAPTCHA %]
</div>
<!-- end recaptcha -->
And
Code: Select all
use Captcha::reCAPTCHA;
Code: Select all
#check reCAPTCHA
my $rc = Captcha::reCAPTCHA->new;
my $challenge = $ParamObject->GetParam(Param => 'recaptcha_challenge_field') || '';
my $response = $ParamObject->GetParam(Param => 'recaptcha_response_field') || '';
my $result = $rc->check_answer("my_sec_key", $ENV{'REMOTE_ADDR'}, # private key
$challenge, $response
);
if ( !$result->{is_valid} ) {
my $Output = $LayoutObject->CustomerHeader(
Area => 'Core',
Title => 'Error'
);
$Output .= $LayoutObject->CustomerWarning(
Message => 'reCAPTCHA entry failed.',
Comment => 'Please press Back and try again.'
);
$Output .= $LayoutObject->CustomerFooter();
$LayoutObject->Print( Output => \$Output );
exit 0;
}
#end recaptcha
All changes made to Custom/Kernel... file copies.
4) After all manipulations all i get is 500 Internal error message on all otrs pages. What should i do to configure reCAPTCHA to OTRS 6 properly? (Can't find any instructions. Maybe smth in reCAPTCHA module changed or OTRS itself?)