• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Implemented Captcha Interface

R

ragtek

Guest
#1
R

ragtek

Guest
#2
Second problem:

PHP:
    public static function createDefault($alwaysCreate = false)
    {
        if (!$alwaysCreate && !XenForo_Visitor::getInstance()->showCaptcha())
        {
            return false;
        }

        $captchaType = XenForo_Application::get('options')->captcha;

        if (!$captchaType)
        {
            return false;
        }

        $class = "XenForo_Captcha_" . $captchaType;

        return new $class();
It would be cool, if the class could be a complete variable

Problem:
My class is located in Ragtek/Captcha/Foo because i don't want to add ANY OWN file in the xenforo directory to be sure, that i don't have any upgrade problems in the feature and because of my add-on packager

Maybe it would be possible, to rewrite it with the event listener, but if the classname would be variable, we wouldn't have to create the listener and use only XenForo_Application::get('options')->captcha;
 
R

ragtek

Guest
#4
It would be great if you would add at least a way to use manual to the option added captaches which are not located inside xenforo directory(because you said that we shouldn't do this:p)

Just like with the controllerhelper
PHP:
        if (strpos($class, '_') === false)
        {
            $class = 'XenForo_Captcha_' . $class;
        }
 

Mike

XenForo developer
Staff member
#5
BTW, did this last night. :)

There's a new event you can listen to to add chioces to the CAPTCHA option and the factory can take a full class name.