<commit_before>require PADRINO_ROOT + "/app/models/email"
require PADRINO_ROOT + "/app/helpers/validations"

PRgovCAPWebApp::App.controllers :cap do

  include PRgov::Validations

  ############################
  #         Filters          #
  ############################

  # Our before filter makes sure we
  # perform certain checks before the action is
  # evaluated. We can exclude specific actions from
  # the check.
  before :except => [:index, :disclaimer, :form, :form2, :confirm] do
    validate_terms()
    # Terms accepted. Check Captcha flag.
    # Captcha flag missing? Check captcha input.
    # Captcha accepted. Check email.
    # Email accepted. Check validated email database.
    # Email not validated? Send email.
    # Email validated? Show form.
  end

  before :email_sent do
    validation_complete?
  end

  # For all resources that are accessible once the email
  # has been confirmed, we check for email validation:
  before :form do
    email_confirmed?
  end


  ############################
  #         Resources        #
  ############################

  # RESOURCE AVAILABLE:
  # !!!!!!!!!!!!!!!!
  # TODO: Code this!
  # An unused resource. We can use this to provide
  # information prior to the disclaimer. This should
  # not be mapped to '/'.
  #
  get :index, :map => '/info' do
    render 'info', :layout => :prgov
  end

  # This resource provides the terms and conditions
  # and initiates the session for the user.
  # Only: disclaimer should be mapped to '/'
  # because it has all the proper error handling at this<commit_msg>Incorporating security for form2.<commit_after>require PADRINO_ROOT + "/app/models/email"
require PADRINO_ROOT + "/app/helpers/validations"

PRgovCAPWebApp::App.controllers :cap do

  include PRgov::Validations

  ############################
  #         Filters          #
  ############################

  # Our before filter makes sure we
  # perform certain checks before the action is
  # evaluated. We can exclude specific actions from
  # the check.
  before :except => [:index, :disclaimer, :form, :form2, :confirm] do
    validate_terms()
    # Terms accepted. Check Captcha flag.
    # Captcha flag missing? Check captcha input.
    # Captcha accepted. Check email.
    # Email accepted. Check validated email database.
    # Email not validated? Send email.
    # Email validated? Show form.
  end

  before :email_sent do
    validation_complete?
  end

  # For all resources that are accessible once the email
  # has been confirmed, we check for email validation:
  before [:form, :form2] do
    email_confirmed?
  end


  ############################
  #         Resources        #
  ############################

  # RESOURCE AVAILABLE:
  # !!!!!!!!!!!!!!!!
  # TODO: Code this!
  # An unused resource. We can use this to provide
  # information prior to the disclaimer. This should
  # not be mapped to '/'.
  #
  get :index, :map => '/info' do
    render 'info', :layout => :prgov
  end

  # This resource provides the terms and conditions
  # and initiates the session for the user.
  # Only: disclaimer should be mapped to '/'
  # because it has all the proper error handling at this
{'fraction_non_alphanumeric': 0.1533375314861461, 'fraction_numerical': 0.0012594458438287153, 'mean_word_length': 3.191292875989446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2720812', 'n_tokens_mistral': 906, 'n_tokens_neox': 862, 'n_words': 337}