File: /var/www/doco/keytest/wp-content/themes/ormedia/keyAlertData/push/c_push.php
<?php
if (isset($_REQUEST['checking_api_file'])){
exit();
}
$title = $_REQUEST['title'];
$content = $_REQUEST['content'];
$cat = $_REQUEST['cat'];
$cat = empty($cat)?0:$cat;
if(empty($title)||empty($content)){
$rv->rc = -1;
$rv->msg = "missing params";
}else{
$id = c_alert($title,$content,$cat);
$alert = r_alert($id);
$push_id = get_push_id_by_cat($cat);
$res = send_alert($alert,$push_id);
if($res){
$rv->rc = 1;
$rv->msg ="success";
}else{
$rv->rc = -2;
$rv->msg ="failed to push a message";
}
}
insert_log(0, $token, 0, get_request_string(), "發送推送:rc=" . $rv->rc . ",msg=" . $rv->msg);
echo json_encode($rv);
?>