mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-04 19:14:41 +00:00
uwuzu v1.6.0 Hapuego
This commit is contained in:
+20
-26
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
$domain = $_SERVER['HTTP_HOST'];
|
||||
require('../../db.php');
|
||||
require(__DIR__ . '/../../db.php');
|
||||
//関数呼び出し
|
||||
//- Base64_mime
|
||||
require('../../function/function.php');
|
||||
require(__DIR__ . '/../../function/function.php');
|
||||
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||
|
||||
$mojisizefile = "../../server/textsize.txt";
|
||||
$mojisizefile = __DIR__ . "/../../server/textsize.txt";
|
||||
|
||||
$banurldomainfile = "../../server/banurldomain.txt";
|
||||
$banurldomainfile = __DIR__ . "/../../server/banurldomain.txt";
|
||||
$banurl_info = file_get_contents($banurldomainfile);
|
||||
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
|
||||
|
||||
@@ -44,6 +44,7 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
@@ -53,6 +54,7 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
@@ -61,28 +63,9 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
session_start();
|
||||
|
||||
if( !empty($pdo) ) {
|
||||
$userQuery = $pdo->prepare("SELECT username, userid, role, follow, follower FROM account WHERE token = :token");
|
||||
$userQuery->bindValue(':token', $token);
|
||||
$userQuery->execute();
|
||||
$userData = $userQuery->fetch();
|
||||
|
||||
if(empty($userData["userid"])){
|
||||
$err = "token_invalid";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}elseif($userData["role"] === "ice"){
|
||||
$err = "this_account_has_been_frozen";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}else{
|
||||
//本文取得
|
||||
$AuthData = APIAuth($pdo, $token, "write:favorite");
|
||||
if($AuthData[0] === true){
|
||||
$userData = $AuthData[2];
|
||||
if(!(empty($_GET['uniqid']))){
|
||||
$fav_uniqid = safetext($_GET['uniqid']);
|
||||
}elseif(!(empty($post_json["uniqid"]))){
|
||||
@@ -101,6 +84,7 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
@@ -108,16 +92,26 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
}else{
|
||||
$err = $AuthData[1];
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
'success' => false
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
Reference in New Issue
Block a user