Sha256: 9623029321d62a2e1c1cea081c6655ae134307693d3093a41b18cf72d70c74ce
Contents?: true
Size: 790 Bytes
Versions: 3
Compression:
Stored size: 790 Bytes
Contents
module FlyAdmin module Imbs class ConnectionApi def self.check_user(user) return true if Rails.env == 'development' valid = true begin api_url = SiteConfig['wap_click_addr'] + "/api/check" request = RestClient.get(api_url, :params => {:uuid => user.customer_key, :hash => Digest::MD5.hexdigest(user.customer_key + SiteConfig['wc_service_salt']) }) hash = JSON.parse(request).with_indifferent_access VALIDATION_LOG.info "status for user #{user.id}: #{hash.inspect}" valid = false unless hash[:status].eql? true rescue Exception => e VALIDATION_LOG.error "error check status for user #{user.id}: #{e.message}" end valid end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
fly_admin-0.0.8 | lib/fly_admin/imbs/connection_api.rb |
fly_admin-0.0.7 | lib/fly_admin/imbs/connection_api.rb |
fly_admin-0.0.6 | lib/fly_admin/imbs/connection_api.rb |