Module: CamaleonCms::SessionCaptchaRuntimeConcern
- Extended by:
- ActiveSupport::Concern
- Includes:
- CaptchaHelper
- Included in:
- SessionRuntimeConcern
- Defined in:
- app/controllers/concerns/camaleon_cms/session_captcha_runtime_concern.rb
Overview
Wires the captcha helper into the runtime controller stack. Tag building, verification and the under-attack session counters live only in CamaleonCms::CaptchaHelper (shared with views); challenge/image generation lives in CamaleonCms::CaptchaImageGeneration, which both the helper and the controller-stack RuntimeCaptchaImageConcern include (parity-guarded), so the controller and view contexts cannot drift apart.
CaptchaHelper is ivar-free (it only touches session/params/current_site and
ActionController::Base.helpers), so it is safe to mix into the controller.
Including it here restores cama_captcha_tag/cama_captcha_build on the
controller runtime stack so shortcodes/forms rendered in controller context
(e.g. the contact-form plugin) can call them.
Constant Summary
Constants included from CaptchaHelper
CaptchaHelper::CAMA_ATTACK_WINDOW
Constants included from CaptchaImageGeneration
CaptchaImageGeneration::CAPTCHA_DEFAULT_LENGTH, CaptchaImageGeneration::CAPTCHA_MAX_LENGTH, CaptchaImageGeneration::CAPTCHA_MIN_LENGTH
Method Summary
Methods included from CaptchaHelper
#cama_captcha_attack_ip_count, #cama_captcha_attack_ip_key, #cama_captcha_increment_attack, #cama_captcha_reset_attack, #cama_captcha_tag, #cama_captcha_tags_if_under_attack, #cama_captcha_total_attacks, #cama_captcha_under_attack?, #cama_captcha_verified?, #captcha_verify_if_under_attack