Hi, I’m trying to put the recaptcha that appears on the registration page on the login page. I have seen many topics like this that have helped me identify some key files to do what I want, but I have not succeeded.
I am using OJS 3.1.2. I’ve already been looking at the files RegistrationForm.inc.php, LoginHandler.inc.php, userLogin.tpl …
From RegistrationForm.inc.php I copied the following code
if ($ this-> captchaEnabled) {
$ publicKey = Config :: getVar (‘captcha’, ‘recaptcha_public_key’);
$ reCaptchaHtml = ’
';
$ templateMgr-> assign (array (
‘reCaptchaHtml’ => $ reCaptchaHtml,
‘captchaEnabled’ => true,
));
}
and I copied it into the index() method of LoginHandler to assign it to the userLogin template
and from userRegister.tpl I copied the code showing the recaptcha and pasted it into userLogin.tpl
{if $ reCaptchaHtml}
{$ reCaptchaHtml}
{/ if}
but it does not show me anything, when I inspect the page I see that the html code of the recaptcha is on the page but it is not displayed. What am I missing?
Thanks @Vitaliy, but right now it is impossible for me to migrate from OJS 3.1.2 to 3.3.0 maybe later. Could you guide me how to make the change in my OJS version? Do you think that maybe seeing how they do it in OJS 3.3.0 I can achieve it in my current version?