Captcha::enabled PHP Method

enabled() public static method

Should we expect captcha submissions?
public static enabled ( ) : boolean
return boolean
    public static function enabled()
    {
        if (!isset(static::$enabled)) {
            $enabled = !c('Garden.Registration.SkipCaptcha', false);
            $handlersAvailable = false;
            Gdn::pluginManager()->fireAs('captcha')->fireEvent('IsEnabled', ['Enabled' => &$handlersAvailable]);
            static::$enabled = $enabled && $handlersAvailable;
        }
        return static::$enabled;
    }

Usage Example

Beispiel #1
0
 /**
  * Wrapper for captcha rendering.
  *
  * Allows conditional ignoring of captcha rendering if skipped in the config.
  *
  * @param Gdn_Controller $controller
  * @return null;
  */
 public static function render($controller)
 {
     if (!Captcha::enabled()) {
         return null;
     }
     // Hook to allow rendering of captcha form
     $controller->fireAs('captcha')->fireEvent('render');
     return null;
 }
All Usage Examples Of Captcha::enabled