Updated indentation and moved some code

This commit is contained in:
James Campbell 2015-06-03 21:32:57 +10:00
parent d191f34601
commit 676812b87e

View File

@ -55,7 +55,6 @@ foreach( $opts as $api ) {
} }
break; break;
} }
$curl = curl_init();
switch( $obj['state'] ) { switch( $obj['state'] ) {
case 0: case 0:
$title_text = "OK"; $title_text = "OK";
@ -79,6 +78,7 @@ foreach( $opts as $api ) {
} }
} }
$data['message'] = $message_text; $data['message'] = $message_text;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.pushover.net/1/messages.json'); curl_setopt($curl, CURLOPT_URL, 'https://api.pushover.net/1/messages.json');
curl_setopt($curl, CURLOPT_SAFE_UPLOAD, true); curl_setopt($curl, CURLOPT_SAFE_UPLOAD, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data); curl_setopt($curl, CURLOPT_POSTFIELDS, $data);