Sha256: f1e6b9b62b0e021986f56f0765d35b1c55fe8a192bb01f320ad880e0c80d677a

Contents?: true

Size: 884 Bytes

Versions: 34

Compression:

Stored size: 884 Bytes

Contents

class Admin::ReadersController < Admin::ResourceController
  helper :reader
  paginate_models
  before_filter :redirect_to_user, :only => :edit

  only_allow_access_to :new, :create, :edit, :update, :remove, :destroy, :settings,
    :when => :admin,
    :denied_url => { :controller => 'pages', :action => 'index' },
    :denied_message => 'You must be an administrator to add or modify readers'
    
  def create
    model.update_attributes!(params[:reader])
    model.clear_password = params[:reader][:password] if params[:reader] && params[:reader][:password]      # condition is so that radiant tests pass
    model.send_invitation_message
    flash[:notice] = t('reader_extension.reader_saved')
    response_for :create
  end

private

  def redirect_to_user
    if model.is_user?
      redirect_to edit_admin_user_url(model.user)
      return false
    end
    true
  end
  
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
radiant-reader-extension-3.0.35 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.33 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.32 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.31 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.30 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.29 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.28 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.27 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.26 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.25 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.24 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.23 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.20 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.19 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.18 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.17 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.16 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.15 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.14 app/controllers/admin/readers_controller.rb
radiant-reader-extension-3.0.13 app/controllers/admin/readers_controller.rb