Changeset 1344
- Timestamp:
- 03/07/08 15:30:25 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
hive/trunk/data_webapp/app/controllers/hc_database_controller.rb
r1342 r1344 1 1 require 'base64' 2 require 'yaml' 2 3 require 'rbyaml' 3 4 … … 44 45 obj_hash = obj_str 45 46 else 46 obj_hash = RbYAML.load(obj_str)47 obj_hash = YAML.load(obj_str) 47 48 end 48 49 count = 0 … … 63 64 # Removes all references from the queue. 64 65 def insert_history_urls(obj_str) 65 obj_hash = RbYAML.load(obj_str)66 obj_hash = YAML.load(obj_str) 66 67 cid = obj_hash.delete("client_id") 67 68 hid = Client.find(cid).host_id … … 104 105 # Insert fingerprints from a suspicious VM 105 106 def insert_fingerprint(obj_str) 106 obj_hash = RbYAML.load(obj_str)107 obj_hash = YAML.load(obj_str) 107 108 108 109 # Remove compromise time from fingerprint and use to update related client object … … 113 114 114 115 def insert_client(obj_str) 115 obj_hash = RbYAML.load(obj_str)116 obj_hash = YAML.load(obj_str) 116 117 insert(Client,obj_hash) 117 118 end 118 119 119 120 def set_client_compromised(id_str) 120 cid = RbYAML.load(id_str)121 cid = YAML.load(id_str) 121 122 Client.update(cid,{:status => "compromised"}) 122 123 end 123 124 124 125 def set_client_suspended(id_str) 125 cid = RbYAML.load(id_str)126 cid = YAML.load(id_str) 126 127 Client.update(cid,{:status => "suspended"}) 127 128 end 128 129 129 130 def set_client_running(id_str) 130 cid = RbYAML.load(id_str)131 cid = YAML.load(id_str) 131 132 Client.update(cid,{:status => "running"}) 132 133 end 133 134 134 135 def set_client_deleted(id_str) 135 cid = RbYAML.load(id_str)136 cid = YAML.load(id_str) 136 137 Client.update(cid,{:status => "deleted"}) 137 138 end 138 139 139 140 def set_client_bug(id_str) 140 cid = RbYAML.load(id_str)141 cid = YAML.load(id_str) 141 142 Client.update(cid,{:status => "bug"}) 142 143 end 143 144 144 145 def set_client_unknown(id_str) 145 cid = RbYAML.load(id_str)146 cid = YAML.load(id_str) 146 147 Client.update(cid,{:status => "unknown"}) 147 148 end … … 149 150 # Input YAML encoded hash table of format {"client_id" => <int>, "compromise" => <timestamp>} 150 151 def set_client_suspicious(compromise_str) 151 compromise_hash = RbYAML.load(compromise_str)152 compromise_hash = YAML.load(compromise_str) 152 153 cid = compromise_hash.delete("client_id") 153 154 time = compromise_hash.delete("compromise")
