1
0
mirror of https://github.com/Daichimarukana/uwuzu.git synced 2026-06-05 03:24:41 +00:00

uwuzu v1.4.2 Funium

This commit is contained in:
Daichimarukana
2024-08-19 17:24:19 +09:00
parent da06d2bd38
commit e8b5a3a6dd
20 changed files with 560 additions and 546 deletions
+8 -32
View File
@@ -96,38 +96,14 @@ if(isset($_GET['migration_code'])) {
}
//メール送信はナシ
//------------
$pdo->beginTransaction();
try {
$datetime = date("Y-m-d H:i:s");
$msg = "アカウントの移行が完了したためこのアカウントの不正コピーを防ぐためアカウントを凍結しました!\n引き続きこのアカウントを利用するには管理者に凍結を解除してもらってください!";
$title = "✨アカウントの移行が完了しました!🔄️";
$url = "/rule/serverabout";
$userchk = 'none';
$from_userid = "uwuzu-fromsys";
$stmt = $pdo->prepare("INSERT INTO notification (fromuserid, touserid, msg, url, datetime, userchk, title) VALUES (:fromuserid, :touserid, :msg, :url, :datetime, :userchk, :title)");
$stmt->bindParam(':fromuserid', $from_userid, PDO::PARAM_STR);
$stmt->bindParam(':touserid', $account, PDO::PARAM_STR);
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
$stmt->bindParam(':url', $url, PDO::PARAM_STR);
$stmt->bindParam(':userchk', $userchk, PDO::PARAM_STR);
$stmt->bindParam(':title', $title, PDO::PARAM_STR);
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
// SQLクエリの実行
$res2 = $stmt->execute();
// コミット
$res2 = $pdo->commit();
} catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
$msg = "アカウントの移行が完了したためこのアカウントの不正コピーを防ぐためアカウントを凍結しました!\n引き続きこのアカウントを利用するには管理者に凍結を解除してもらってください!";
$title = "✨アカウントの移行が完了しました!🔄️";
$url = "/rule/serverabout";
$from_userid = "uwuzu-fromsys";
$category = "system";
send_notification($from_userid,$account,$title,$msg,$url,$category);
if ($res) {
$item = array(
+26 -100
View File
@@ -72,7 +72,7 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
session_start();
if( !empty($pdo) ) {
$userQuery = $pdo->prepare("SELECT username, userid, role FROM account WHERE token = :token");
$userQuery = $pdo->prepare("SELECT username, userid, role, loginid FROM account WHERE token = :token");
$userQuery->bindValue(':token', $token);
$userQuery->execute();
$userData = $userQuery->fetch();
@@ -93,111 +93,37 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
echo json_encode($response, JSON_UNESCAPED_UNICODE);
exit;
}else{
$query = $pdo->prepare('SELECT * FROM ueuse WHERE uniqid = :uniqid limit 1');
$query->execute(array(':uniqid' => $ueuseid));
$result = $query->fetch();
if(!(empty($result))){
if($result["account"] === $userData["userid"]){
$Userid = $userData["userid"];
$photo_query = $pdo->prepare("SELECT * FROM ueuse WHERE account = :userid AND uniqid = :uniqid");
$photo_query->bindValue(':userid', $Userid);
$photo_query->bindValue(':uniqid', $ueuseid);
$photo_query->execute();
$photo_and_video = $photo_query->fetch();
if(!($photo_and_video["photo1"] == "none")){
$photoDelete1 = glob("../".$photo_and_video["photo1"]); // 「-ユーザーID.拡張子」というパターンを検索
foreach ($photoDelete1 as $photo1) {
if (is_file($photo1)) {
unlink($photo1);
}
}
}
if(!($photo_and_video["photo2"] == "none")){
$photoDelete2 = glob("../".$photo_and_video["photo2"]); // 「-ユーザーID.拡張子」というパターンを検索
foreach ($photoDelete2 as $photo2) {
if (is_file($photo2)) {
unlink($photo2);
}
}
}
if(!($photo_and_video["photo3"] == "none")){
$photoDelete3 = glob("../".$photo_and_video["photo3"]); // 「-ユーザーID.拡張子」というパターンを検索
foreach ($photoDelete3 as $photo3) {
if (is_file($photo3)) {
unlink($photo3);
}
}
}
if(!($photo_and_video["photo4"] == "none")){
$photoDelete4 = glob("../".$photo_and_video["photo4"]); // 「-ユーザーID.拡張子」というパターンを検索
foreach ($photoDelete4 as $photo4) {
if (is_file($photo4)) {
unlink($photo4);
}
}
}
if(!($photo_and_video["video1"] == "none")){
$videoDelete1 = glob("../".$photo_and_video["video1"]); // 「-ユーザーID.拡張子」というパターンを検索
foreach ($videoDelete1 as $video1) {
if (is_file($video1)) {
unlink($video1);
}
}
}
try {
$deleteQuery = $pdo->prepare("DELETE FROM ueuse WHERE uniqid = :uniqid AND account = :userid");
$deleteQuery->bindValue(':uniqid', $ueuseid, PDO::PARAM_STR);
$deleteQuery->bindValue(':userid', $Userid, PDO::PARAM_STR);
$res = $deleteQuery->execute();
if ($res) {
$response = array(
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueuseid)),
'userid' => decode_yajirushi(htmlspecialchars_decode($userData["userid"])),
'success' => true
);
echo json_encode($response, JSON_UNESCAPED_UNICODE);
exit;
} else {
$response = array(
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueuseid)),
'userid' => decode_yajirushi(htmlspecialchars_decode($Userid)),
'success' => false
);
echo json_encode($response, JSON_UNESCAPED_UNICODE);
exit;
}
} catch(PDOException $e) {
$response = array(
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueuseid)),
'userid' => decode_yajirushi(htmlspecialchars_decode($userData["userid"])),
'success' => false
);
echo json_encode($response, JSON_UNESCAPED_UNICODE);
exit;
}
if (safetext(isset($ueuseid)) && safetext(isset($userData["userid"])) && safetext(isset($userData["loginid"]))){
$postUserid = safetext($userData["userid"]);
$postUniqid = safetext($ueuseid);
$loginid = safetext($userData["loginid"]);
$result = delete_ueuse($postUniqid, $postUserid, $loginid);
if($result[0] === true){
$response = array(
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueuseid)),
'userid' => decode_yajirushi(htmlspecialchars_decode($userData["userid"])),
'success' => true
);
echo json_encode($response, JSON_UNESCAPED_UNICODE);
exit;
}else{
$response = array(
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueuseid)),
'userid' => decode_yajirushi(htmlspecialchars_decode($userData["userid"])),
'success' => false
);
echo json_encode($response, JSON_UNESCAPED_UNICODE);
exit;
}
} else {
$err = "ueuse_not_found";
}else{
$err = "input_not_found";
$response = array(
'error_code' => $err,
);
echo json_encode($response, JSON_UNESCAPED_UNICODE);
exit;
}
}
}
}else{
+9 -35
View File
@@ -118,53 +118,27 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
$updateQuery->bindValue(':follower', $newFollowerList, PDO::PARAM_STR);
$updateQuery->bindValue(':userid', $Follow_userdata['userid'], PDO::PARAM_STR);
$res = $updateQuery->execute();
// 自分のfollowカラムを更新
$updateQuery = $pdo->prepare("UPDATE account SET follow = CONCAT_WS(',', follow, :follow) WHERE userid = :userid");
$updateQuery->bindValue(':follow', $Follow_userdata["userid"], PDO::PARAM_STR);
$myflwlist = explode(',', $userData['follow']);
$myflwlist[] = $userData['userid'];
$newFollowList = implode(',', array_unique($myflwlist));
$updateQuery = $pdo->prepare("UPDATE account SET follow = :follow WHERE userid = :userid");
$updateQuery->bindValue(':follow', $newFollowList, PDO::PARAM_STR);
$updateQuery->bindValue(':userid', $userid, PDO::PARAM_STR);
$res_follow = $updateQuery->execute();
$datetime = date("Y-m-d H:i:s");
$pdo->beginTransaction();
try {
$fromuserid = safetext($userid);
$touserid = safetext($Follow_userdata["userid"]);
$datetime = safetext(date("Y-m-d H:i:s"));
$msg = safetext("".$userid."さんにフォローされました。");
$title = safetext("🎉".$userid."さんにフォローされました!🎉");
$url = safetext("/@" . $userid . "");
$userchk = safetext('none');
// 通知用SQL作成
$stmt = $pdo->prepare("INSERT INTO notification (fromuserid, touserid, msg, url, datetime, userchk, title) VALUES (:fromuserid, :touserid, :msg, :url, :datetime, :userchk, :title)");
$stmt->bindParam(':fromuserid', $fromuserid, PDO::PARAM_STR);
$stmt->bindParam(':touserid', $touserid, PDO::PARAM_STR);
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
$stmt->bindParam(':url', $url, PDO::PARAM_STR);
$stmt->bindParam(':userchk', $userchk, PDO::PARAM_STR);
$stmt->bindParam(':title', $title, PDO::PARAM_STR);
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
} catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
send_notification($follow_userid, $userid, "🎉" . $userid . "さんにフォローされました!🎉", "" . $userid . "さんにフォローされました。", "/@" . $userid . "", "follow");
if ($res && $res_follow) {
//フォロー完了
$response = array(
'userid' => decode_yajirushi(htmlspecialchars_decode($Follow_userdata["userid"])),
'success' => true
);
echo json_encode($response, JSON_UNESCAPED_UNICODE);
} else {