Class: FlyAdmin::Imbs::MainController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- FlyAdmin::Imbs::MainController
- Defined in:
- app/controllers/fly_admin/imbs/main_controller.rb
Instance Method Summary collapse
- #authorize_customer(customer_key, password, login) ⇒ Object
- #enter ⇒ Object
- #test_request_headers ⇒ Object
- #you_blocked ⇒ Object
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 (customer_key, password, login) user = User.find_by_login(login) if user.nil? user = User.new( :login => login, :password => password, :customer_key => customer_key ) user.save end sign_in user unless user_signed_in? flash[:notice] = [ t('your_login') + " #{login}" ] flash[:notice] << "#{t('your_password')} #{password}" [:active_user] = { value: 1, expires: 1.day.from_now } redirect_to item_link end |
#enter ⇒ Object
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! params[:key], params[:pass], params[:login] end |
#test_request_headers ⇒ Object
10 11 12 |
# File 'app/controllers/fly_admin/imbs/main_controller.rb', line 10 def test_request_headers @env = request.env end |
#you_blocked ⇒ Object
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 |