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;
}
/** * 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; }