Sha256: b8bcddf7098023ca4aeff349e68fa53e3b848b117eadf3ccd4daf61a56198317

Contents?: true

Size: 836 Bytes

Versions: 1

Compression:

Stored size: 836 Bytes

Contents

# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  # Pick a unique cookie name to distinguish our session data from others'
  session :session_key => '_al-admin_session_id'

  init_gettext "al-admin"

  include ExceptionNotifiable

  include AuthenticatedSystem
  before_filter :login_from_cookie

  private
  def default_url_options(options)
    default_options = {}
    lang = params["lang"]
    default_options["lang"] = lang if lang
    default_options.merge(options)
  end

  def current_ldap_user
    logged_in? ? current_user.ldap_user : nil
  end

  def schema
    @schema ||= current_ldap_user.schema
  end

  def authorized?
    current_ldap_user.connected?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activeldap-0.9.0 examples/al-admin/app/controllers/application.rb