File: /var/www/html/wp-content/themes/ormedia/page-api-alert-logout.php
<?php
/* Template Name: api-alert-logout */
require_once('key_alert_functions.php');
$rv = new stdClass();
$uid = $_REQUEST['uid'];
$push_id = $_REQUEST['push_id'];
if ($uid > 0 && !empty($push_id)) {
$old_push_id = r_push_id($uid);
if ($old_push_id == $push_id) {
$res = u_push_id($uid, "");
if ($res !== false) {
$rv->rc = 1;
$rv->msg = "success";
} else {
$rv->rc = -3;
$rv->msg = "update failed";
}
} else {
$rv->rc = -2;
$rv->msg = "push id does not match";
}
} else {
$rv->rc = -1;
$rv->msg = "missing params";
}
insert_log($_REQUEST['uid'], "", 0, get_request_string(), "登出:rc=" . $rv->rc . ",msg=" . $rv->msg);
echo json_encode($rv);