Implemented Captcha Interface

  • Thread starter Thread starter ragtek
  • Start date Start date
R

ragtek

Guest
Upvote 1
This suggestion has been implemented. Votes are no longer accepted.
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;
 
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;
        }
 
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.
 
Top Bottom