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

Implemented Captcha Interface

Discussion in 'Closed Suggestions' started by ragtek, Oct 14, 2010.

  1. ragtek

    ragtek Guest

    Vladislav Rastrusny likes this.
  2. ragtek

    ragtek Guest

    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;
     
    Vladislav Rastrusny, dvsDave and g0rn like this.
  3. ragtek

    ragtek Guest

    *up*

    At least the second part is easy to intergrate:p
     
  4. ragtek

    ragtek Guest

    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;
            }
     
  5. Mike

    Mike XenForo Developer Staff Member

    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.
     
    ragtek likes this.

Share This Page