Class: FlyAdmin::Imbs::MainController

Inherits:
ApplicationController
  • 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



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

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



14
15
16
17
18
19
20
# File 'app/controllers/fly_admin/imbs/main_controller.rb', line 14

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



10
11
12
# File 'app/controllers/fly_admin/imbs/main_controller.rb', line 10

def test_request_headers
  @env = request.env
end

#you_blockedObject



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

def you_blocked
  flash[:error] = t('service_not_supported')
  redirect_to paysite_root_url
end