We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Add captcha to forgot password form [Solved] | Forum

Topic location: Forum home » Support » General Questions
Arie
Arie Apr 1 '15
Is it possible to add a captcha to the forgot password form?
if so, what files do i need to change in order to achieve this?
Or is there a plugin for this????

kind regards
The Forum post is edited by Taissa Apr 3 '15
Taissa Team
Taissa Apr 2 '15
Arie, I'm not sure if there some actual existing plugins with such functionality, but you can try searching one in our Store.

Or it's possible to add a captcha to the forgot password form manually and this is considered as a custom code modification. I can't give you detailed step by step instructions. I can only point where the changes need to be done.
You can see how the captcha works in the Contact us plugin. The captcha code is in the /ow_plugins/contactus/contollers/contact.php and the /ow_plugins/contactus/views/controllers/contact_index.html files.
So to display the captcha at the Forgot password page you need to modify ow_system_plugins/base/controllers/users.php file and/ow_system_plugins/base/views/controllers/user_forgot_password.html file.

However you need to remember that all your customizations will be overwritten while next update of the software, so you need to remember them and apply again, or implement the changes via custom plugin.

If you are not familiar with the plugin development or code modification, it would be better for you to find a developer who can help you with it. Please visit our Oxwall Market (http://www.oxwall.org/market/specialists )
The Forum post is edited by Taissa Apr 8 '15
Arie
Arie Apr 2 '15
Thanks Taissa for your reply. I always keep document tracking of my updates and modifications on files.


Arie
Arie Apr 3 '15
To all,

I added the captcha to the forgot password form and it works like a charm.
This should be added in core as default!!!

thanks Taissa for heading me in the right direction :-)

Attachments:
  forgot-password-captcha.jpg (21Kb)
Taissa Team
Taissa Apr 3 '15
Great! I'm going to mark this thread as Solved.
Jordi
Jordi Apr 4 '15
Arie, 


can u show me how you did that?



thanks

Arie
Arie Apr 8 '15
Jordi, here is the code that you need to change.

'--- step 1.
Find file:ow_system_plugins/base/bol/user_service.php
Find function: getResetForm

above return $form; place the following code.

/** added by Arie begin captcha field **/
$fieldCaptcha = new CaptchaField('captcha');
$fieldCaptcha->setLabel($language->text('contactus', 'form_label_captcha'));
$form->addElement($fieldCaptcha);
/** added by Arie end captcha field **/

Save and close file.

'--- Step 2.
Find file:ow_system_plugins/base/views/controllers/user_forgot_password.html
Find:  {input name='email' class='ow_smallmargin'}{error name='email'}
and add below the following code.
 {input name='captcha'}{error name='captcha'}

Save and close file.

'--- Step 3.
Clear website cache and browser cache and there you have it...
CAPTCHA

Note: Backup files before you make any changes. I am not responsible for any site errors or DB errors. This modification code is done under site version. 1.7.2. Don't know if it works for older versions.
Jordi
Jordi Apr 8 '15
Thanks Arie,


i gonna try it! are you dutch?

Taissa Team
Taissa Apr 9 '15
Guys, I'm gonna delete the posts which are not related to the topic. It would be better for you to use PM for such kind of discussions.
Arie
Arie Apr 9 '15
Thanx Taissa... i agree :-)