Class: FlyAdmin::Imbs::MainController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/fly_admin/imbs/main_controller.rb

Instance Method Summary collapse

Instance Method Details

#authorize_customer(customer_key, password, login) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'app/controllers/fly_admin/imbs/main_controller.rb', line 19

def authorize_customer(customer_key, password, )
  user = User.()
  if user.nil?
    user = User.new(
      :login => ,
      :password => password,
      :customer_key => customer_key
      )
    user.save
  end

   user unless user_signed_in?
  flash[:notice] = [ t('your_login') + " #{login}" ]
  flash[:notice] << "#{t('your_password')} #{password}"

  cookies[:active_user] = { value: 1, expires: 1.day.from_now }

  redirect_to item_link
end

#enterObject



11
12
13
14
15
16
17
# File 'app/controllers/fly_admin/imbs/main_controller.rb', line 11

def enter
  if params[:operation_status] == 'deviceblock'
    redirect_to "#{root_url}&operation_status=deviceblock" and return
  end
  redirect_to paysite_root_url and return unless check_hash!
  authorize_customer params[:key], params[:pass], params[:login]
end

#test_request_headersObject



7
8
9
# File 'app/controllers/fly_admin/imbs/main_controller.rb', line 7

def test_request_headers
  @env = request.env
end

#you_blockedObject



4
5
# File 'app/controllers/fly_admin/imbs/main_controller.rb', line 4

def you_blocked
end