Sha256: c8c924480db4faa1164da0dd87623fa72a92eb39411bb7fe1e86812513aeff56

Contents?: true

Size: 777 Bytes

Versions: 12

Compression:

Stored size: 777 Bytes

Contents

class DevController < ActionController::Base

  hobo_controller

  before_filter :developer_modes_only

  def set_current_user
    model = params[:model] || Hobo::Model::User.default_user_model
    self.current_user = if params[:login]
                          model.where(model.login_attribute => params[:login]).first
                        else
                          model.find(params[:id])
                        end
    redirect_to(request.env["HTTP_REFERER"] ? :back : home_page)
  end

  private

  def developer_modes_only
    # Belt and braces. In addition to this check, the routes only get
    # defined when developer_features is true
    render :text => "Permission Denied", :status => 403 unless Rails.application.config.hobo.developer_features
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hobo-1.3.0.pre29 app/controllers/dev_controller.rb
hobo-1.3.0.pre28 app/controllers/dev_controller.rb
hobo-1.3.0.pre27 app/controllers/dev_controller.rb
hobo-1.3.0.pre26 app/controllers/dev_controller.rb
hobo-1.3.0.pre25 app/controllers/dev_controller.rb
hobo-1.3.0.pre24 app/controllers/dev_controller.rb
hobo-1.3.0.pre23 app/controllers/dev_controller.rb
hobo-1.3.0.pre22 app/controllers/dev_controller.rb
hobo-1.3.0.pre21 app/controllers/dev_controller.rb
hobo-1.3.0.pre20 app/controllers/dev_controller.rb
hobo-1.3.0.pre19 app/controllers/dev_controller.rb
hobo-1.3.0.pre18 app/controllers/dev_controller.rb