ElkArte Community

Extending Elk => Addons => Addons ideas and questions => Topic started by: Ant59 on February 20, 2015, 11:04:24 am

Title: How to add a verification control
Post by: Ant59 on February 20, 2015, 11:04:24 am
I've created an addon for reCaptcha, but I'm having trouble figuring out how to add the controls to the admin "Anti-Spam" section. All the other controls are added here: https://github.com/elkarte/Elkarte/blob/development/sources/admin/ManageSecurity.controller.php#L504 However, this doesn't account for addon classes. What would be the best way to go about this?
Title: Re: How to add a verification control
Post by: emanuele on February 20, 2015, 06:16:49 pm
I wrote this addon I wrote a while ago to demonstrate how to add new verifications:
https://github.com/emanuele45/Honey-Captcha

It's more or less a two steps process [1]: you have to attach a function to integrate_control_verification in order to let Elk know about your new verification method:
https://github.com/emanuele45/Honey-Captcha/blob/master/HoneyCaptcha.class.php#L3
and there you either require the file with the class, or add the class to the same file the way I did in my demo addon.

Does what I wrote make sense? :-[
and yes, now that I re-read it it's somehow redundant, it should be simplified, probably I didn't have a clear idea of where I wanted to go... /me adds to the todo list
Title: Re: How to add a verification control
Post by: Ant59 on February 23, 2015, 04:38:44 am
Of course, include the class in the integration function. I'm having a slow week haha -_-

Thanks for the example plugin, that makes it much easier to understand :)
Title: Re: How to add a verification control
Post by: emanuele on February 23, 2015, 07:22:05 am
Glad it helped! :D