Bearer認証に変更
This commit is contained in:
parent
dcd92e5be1
commit
d5e6bd45ef
|
|
@ -33,24 +33,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -59,6 +44,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
session_start();
|
||||
|
||||
|
|
|
|||
|
|
@ -33,24 +33,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -59,6 +44,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
session_start();
|
||||
|
||||
|
|
|
|||
|
|
@ -24,24 +24,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -50,6 +35,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
session_start();
|
||||
|
||||
|
|
|
|||
|
|
@ -25,24 +25,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -51,6 +36,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!(empty($_GET['limit']))){
|
||||
$limit = (int)$_GET['limit'];
|
||||
|
|
|
|||
|
|
@ -23,24 +23,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if (isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if (!(empty($_GET['token']))) {
|
||||
$token = safetext($_GET['token']);
|
||||
} else {
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if (isset($post_json["token"])) {
|
||||
$token = safetext($post_json["token"]);
|
||||
} else {
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if ($token == "") {
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -49,6 +34,15 @@ if (isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!(empty($_GET['limit']))) {
|
||||
$limit = (int)$_GET['limit'];
|
||||
|
|
|
|||
|
|
@ -23,24 +23,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if (isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if (!(empty($_GET['token']))) {
|
||||
$token = safetext($_GET['token']);
|
||||
} else {
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if (isset($post_json["token"])) {
|
||||
$token = safetext($post_json["token"]);
|
||||
} else {
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if ($token == "") {
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -49,6 +34,15 @@ if (isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!empty($pdo)) {
|
||||
$AuthData = APIAuth($pdo, $token, "write:me");
|
||||
|
|
|
|||
|
|
@ -25,24 +25,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -51,6 +36,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!(empty($_GET['limit']))){
|
||||
$limit = (int)$_GET['limit'];
|
||||
|
|
|
|||
|
|
@ -32,24 +32,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -58,6 +43,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
session_start();
|
||||
|
||||
|
|
|
|||
|
|
@ -24,24 +24,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -50,6 +35,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!(empty($_GET['uniqid']))){
|
||||
$ueuseid = $_GET['uniqid'];
|
||||
|
|
|
|||
|
|
@ -24,24 +24,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -50,6 +35,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!(empty($_GET['uniqid']))){
|
||||
$ueuseid = $_GET['uniqid'];
|
||||
|
|
|
|||
|
|
@ -25,24 +25,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -51,6 +36,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!(empty($_GET['limit']))){
|
||||
$limit = (int)$_GET['limit'];
|
||||
|
|
|
|||
|
|
@ -25,24 +25,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -51,6 +36,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!(empty($_GET['limit']))){
|
||||
$limit = (int)$_GET['limit'];
|
||||
|
|
|
|||
|
|
@ -25,24 +25,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -51,6 +36,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!(empty($_GET['uniqid']))){
|
||||
$ueuseid = $_GET['uniqid'];
|
||||
|
|
|
|||
|
|
@ -25,24 +25,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -51,6 +36,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!(empty($_GET['keyword']))){
|
||||
$keyword = $_GET['keyword'];
|
||||
|
|
|
|||
|
|
@ -33,24 +33,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -59,6 +44,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
session_start();
|
||||
|
||||
|
|
|
|||
|
|
@ -25,25 +25,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -52,6 +36,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!(empty($_GET['userid']))){
|
||||
$userid = $_GET['userid'];
|
||||
|
|
|
|||
|
|
@ -33,24 +33,9 @@ try {
|
|||
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
//トークン取得
|
||||
if(!(empty($_GET['token']))){
|
||||
$token = safetext($_GET['token']);
|
||||
}else{
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
$token = safetext($post_json["token"]);
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($token == ""){
|
||||
// トークン取得
|
||||
$token = getAPIToken();
|
||||
if($token == "_ERR:INPUT_NOT_FOUND"){
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
|
|
@ -59,6 +44,15 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
if($token == "_ERR:FORMAT_FIFFERENT"){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
session_start();
|
||||
|
||||
|
|
|
|||
|
|
@ -3688,4 +3688,37 @@ function getDatasUeuse(PDO $pdo, array $messages): array {
|
|||
return $messages;
|
||||
}
|
||||
|
||||
function getAPIToken() {
|
||||
// 従来の方法(body/URLパラメータ)
|
||||
$Get_Post_Json = file_get_contents("php://input");
|
||||
if(isset($_GET["token"]) || !empty($Get_Post_Json)) {
|
||||
if(empty($_GET["token"])){
|
||||
$post_json = json_decode($Get_Post_Json, true);
|
||||
if(isset($post_json["token"])){
|
||||
return safetext($post_json["token"]);
|
||||
}else{
|
||||
return "_ERR:INPUT_NOT_FOUND";
|
||||
}
|
||||
}else{
|
||||
return safetext($_GET["token"]);
|
||||
}
|
||||
}elseif(empty($_GET["token"])){
|
||||
return "_ERR:INPUT_NOT_FOUND";
|
||||
}elseif(empty($_SERVER["HTTP_AUTHORIZATION"])){
|
||||
return "_ERR:INPUT_NOT_FOUND";
|
||||
}else{
|
||||
$token = strstr($_SERVER["HTTP_AUTHORIZATION"],"Bearer ");
|
||||
if($token == false){
|
||||
return "_ERR:FORMAT_FIFFERENT";
|
||||
}else{
|
||||
$token = str_replace(" ","",$token);
|
||||
if ($token == "") {
|
||||
return "_ERR:FORMAT_FIFFERENT";
|
||||
} else {
|
||||
return $token;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue