diff --git a/app/models/card.rb b/app/models/card.rb index db48fda..1416ac3 100644 --- a/app/models/card.rb +++ b/app/models/card.rb @@ -12,7 +12,7 @@ class Card < ActiveRecord::Base # connect to door access system source = open("#{door_access_url}?e=#{door_access_password}").read - results = source.scan(/authok/) + results = source.scan(/ok/) if(results.size > 0) then #only continue if we've got an OK login cardid = self.id.to_s.rjust(3, '0') #TODO: provide ability for @@ -47,7 +47,7 @@ class Card < ActiveRecord::Base door_access_password = APP_CONFIG['door_access_password'] source = open("#{door_access_url}?e=#{door_access_password}").read - results = source.scan(/authok/) + results = source.scan(/ok/) if(results.size > 0) then @cards.each do |u| #only continue if we've got an OK login diff --git a/app/models/door_log.rb b/app/models/door_log.rb index 267a893..20727c5 100644 --- a/app/models/door_log.rb +++ b/app/models/door_log.rb @@ -9,7 +9,7 @@ class DoorLog < ActiveRecord::Base # connect to door access system source = open("#{door_access_url}?e=#{door_access_password}").read - results = source.scan(/authok/) + results = source.scan(/ok/) if(results.size > 0) then @end_results = Array.new