<commit_before>class ApplicationController < ActionController::Base
  include Authentication
  helper :all # include all helpers, all the time

  protect_from_forgery
  filter_parameter_logging :password, :password_confirmation
  
  before_filter :login_required
  
  protected
  
  def admin_required
    unless admin?
      redirect_to root_url
    end
  end
  
  def admin?
    logged_in? && current_user.admin?
  end

  def redirect_back_or_default(default)
    redirect_to(session[:return_to] || default)
    session[:return_to] = nil
  end
end
<commit_msg>Add logic to handle multiple domains without actually making the change -- the rest is going to need to be a branch as it will definitely break a bunch of stuff<commit_after>class ApplicationController < ActionController::Base
  include Authentication
  helper :all # include all helpers, all the time

  protect_from_forgery
  filter_parameter_logging :password, :password_confirmation
  
  #before_filter :scope_by_domain
  before_filter :login_required
  
  protected
  
  def admin_required
    unless admin?
      redirect_to root_url
    end
  end
  
  def admin?
    logged_in? && current_user.admin?
  end

  def redirect_back_or_default(default)
    redirect_to(session[:return_to] || default)
    session[:return_to] = nil
  end
  
  #def scope_by_domain
  #  @current_domain = Domain.find_by_domain_name!(request.subdomains.join('.'))
  #end
end

{'fraction_non_alphanumeric': 0.06060606060606061, 'fraction_numerical': 0.0, 'mean_word_length': 4.071428571428571, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6413166', 'n_tokens_mistral': 428, 'n_tokens_neox': 423, 'n_words': 118}