4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'app/controllers/mdm/server_controller.rb', line 4
def server
if params[:Status] == Command::Status::IDLE
return render nothing: true if device.commands.pending.empty?
return render text: device.commands.pending.first.payload
end
command.update(status: params[:Status])
if command.complete?
payload = Plist::parse_xml(command.payload).with_indifferent_access
if payload[:Command][:RequestType] == 'DeviceInformation'
device.refresh!(params[:QueryResponses])
end
end
render nothing: true
end
|