From 6cdad111f03bfb3cb4d46c0e075de7e8f8cbcd50 Mon Sep 17 00:00:00 2001 From: Daichimarukana Date: Thu, 14 Nov 2024 20:12:04 +0900 Subject: [PATCH] uwuzu v1.4.7 Funium --- abi/addabi.php | 21 ++--- actor/index.php | 2 + css/home.css | 2 +- function/function.php | 78 +++++++++++++++++-- function/reuse.php | 4 +- home/index.php | 14 +++- server/uwuzuabout.txt | 21 ----- server/uwuzuinfo.txt | 4 +- server/uwuzurelease.txt | 22 ++++++ settings/index.php | 53 ++++++++++++- settings_admin/plugin_admin.php | 35 ++++++++- .../aiblockwatermark_settings.php | 5 ++ settings_admin/serveradmin.php | 10 ++- ueuse/index.php | 14 +++- update.json | 37 ++++----- user/followers/index.php | 29 +++++++ user/following/index.php | 29 +++++++ user/index.php | 21 +++-- user/outbox/index.php | 2 - uwuzu_database.sql | 5 +- 20 files changed, 318 insertions(+), 90 deletions(-) create mode 100644 settings_admin/plugin_settings/aiblockwatermark_settings.php create mode 100644 user/followers/index.php create mode 100644 user/following/index.php diff --git a/abi/addabi.php b/abi/addabi.php index 6905126..dc9502c 100644 --- a/abi/addabi.php +++ b/abi/addabi.php @@ -3,7 +3,7 @@ $mojisizefile = "../server/textsize.txt"; $banurldomainfile = "../server/banurldomain.txt"; $banurl_info = file_get_contents($banurldomainfile); -$banurl = preg_split("/\r\n|\n|\r/", $banurl_info); +$banurl = array_filter(preg_split("/\r\n|\n|\r/", $banurl_info)); require('../db.php'); @@ -57,16 +57,19 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['abitext'])) && s exit; } // 禁止url確認 - for($i = 0; $i < count($banurl); $i++) { - if (false !== strpos($abitext, 'https://'.$banurl[$i])) { - $err = "contains_prohibited_url"; - $response = array( - 'error_code' => $err, - ); - echo json_encode($response, JSON_UNESCAPED_UNICODE); - exit; + if(!(empty($banurl))){ + for($i = 0; $i < count($banurl); $i++) { + if (false !== strpos($abitext, 'https://'.$banurl[$i])) { + $err = "contains_prohibited_url"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } } } + try { $pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS); diff --git a/actor/index.php b/actor/index.php index 51f41ea..11674f2 100644 --- a/actor/index.php +++ b/actor/index.php @@ -61,6 +61,8 @@ if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){ "preferredUsername" => "".$userData["userid"]."", "name" => "".$userData["username"]."", "summary" => "".nl2br($userData["profile"])."", + "followers" => "https://".$domain."/user/followers/?actor=@".$userid."", + "following" => "https://".$domain."/user/following/?actor=@".$userid."", "inbox" => "https://".$domain."/user/inbox/?actor=@".$userid."", "outbox" => "https://".$domain."/user/outbox/?actor=@".$userid."", "published" => "".date(DATE_ATOM, strtotime($userData["datetime"]))."", diff --git a/css/home.css b/css/home.css index 6f77ab5..db44ea8 100644 --- a/css/home.css +++ b/css/home.css @@ -3745,7 +3745,7 @@ label>input { .rightbox .btmbox{ position: absolute; - bottom: 6px; /*下に固定*/ + bottom: 8px; /*下に固定*/ height: fit-content; max-width: 45dvh; width: 90%; diff --git a/function/function.php b/function/function.php index a51d001..cd3ce8e 100644 --- a/function/function.php +++ b/function/function.php @@ -405,7 +405,7 @@ function YouTube_and_nicovideo_Links($postText) { } $video_id = str_replace('&', '?', $video_id); } elseif (isset($parsedUrl['path'])) { - if (preg_match('/^\/watch\/|^\/embed\/|^\/shorts\/|^\/v\//', $parsedUrl['path'])) { + if (preg_match('/^\/watch\/|^\/embed\/|^\/shorts\/|^\/v\/|\//', $parsedUrl['path'])) { $video_id = str_replace('/', '', htmlentities($parsedUrl['path'], ENT_QUOTES, 'UTF-8', false)); $video_time = 0; $iframe = true; @@ -692,7 +692,11 @@ function send_notification($to,$from,$title,$message,$url,$category){ } } // ユーズするとき全部この関数 -function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw){ +function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw,$aibwm){ + //AIBlockWaterMark-------------------------------------------- + require('../settings_admin/plugin_settings/aiblockwatermark_settings.php'); + //------------------------------------------------------ + $rpUniqid = safetext($rpUniqid); $ruUniqid = safetext($ruUniqid); $userid = safetext($userid); @@ -707,7 +711,8 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$ $banurldomainfile = "../server/banurldomain.txt"; $banurl_info = file_get_contents($banurldomainfile); - $banurl = preg_split("/\r\n|\n|\r/", $banurl_info); + $banurl = array_filter(preg_split("/\r\n|\n|\r/", $banurl_info)); + // データベースに接続 try { @@ -743,13 +748,16 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$ } // 禁止url確認 - for($i = 0; $i < count($banurl); $i++) { - if(!($banurl[$i] == "")){ - if (false !== strpos($ueuse, 'https://'.$banurl[$i])) { - $error_message[] = '投稿が禁止されているURLが含まれています。(INPUT_CONTAINS_PROHIBITED_URL)'; + if(!(empty($banurl))){ + for($i = 0; $i < count($banurl); $i++) { + if(!($banurl[$i] == "")){ + if (false !== strpos($ueuse, 'https://'.$banurl[$i])) { + $error_message[] = '投稿が禁止されているURLが含まれています。(INPUT_CONTAINS_PROHIBITED_URL)'; + } } } } + } $old_datetime = date("Y-m-d H:i:00"); @@ -963,6 +971,22 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$ } } + if($aibwm === true && !empty(AIBWM_CHK && AIBWM_CHK == "true")){ + require('../plugin/AIBlockWaterMark/aiblockwatermark.php'); + if(!($save_photo1 == "none")){ + AIBlockWaterMark($save_photo1, $userid); + } + if(!($save_photo2 == "none")){ + AIBlockWaterMark($save_photo2, $userid); + } + if(!($save_photo3 == "none")){ + AIBlockWaterMark($save_photo3, $userid); + } + if(!($save_photo4 == "none")){ + AIBlockWaterMark($save_photo4, $userid); + } + } + if(empty($error_message)) { // 書き込み日時を取得 $datetime = date("Y-m-d H:i:s"); @@ -1346,4 +1370,44 @@ function uwuzu_password_verify($password, $hash){ } } } + +//ユーザーのOther_Settings読み取り関数 +function val_OtherSettings($dataname, $jsontext){ + $other_settings = json_decode($jsontext, true); + if(!(empty($other_settings[$dataname]))) { + if(is_bool($other_settings[$dataname]) === true){ + if($other_settings[$dataname] == true){ + $ret = true; + }else{ + $ret = false; + } + }elseif(is_int($other_settings[$dataname]) === true){ + $ret = (int)$other_settings[$dataname]; + }elseif(is_string($other_settings[$dataname])){ + $ret = $other_settings[$dataname]; + } + }else{ + $ret = false; + } + return $ret; +} +//ユーザーのOther_Settings追加関数 +function val_AddOtherSettings($dataname, $data, $jsontext){ + $other_settings = json_decode($jsontext, true); + if(isset($dataname) && isset($data) && isset($jsontext)) { + if(is_bool($data) === true){ + $new_data = [$dataname=>$data]; + $ret = json_encode(array_merge($other_settings,$new_data)); + }elseif(is_int($data) === true){ + $new_data = [$dataname=>(int)$data]; + $ret = json_encode(array_merge($other_settings,$new_data)); + }elseif(is_string($data)){ + $new_data = [$dataname=>$data]; + $ret = json_encode(array_merge($other_settings,$new_data)); + } + }else{ + $ret = false; + } + return $ret; +} ?> \ No newline at end of file diff --git a/function/reuse.php b/function/reuse.php index 9b24bee..13973bb 100644 --- a/function/reuse.php +++ b/function/reuse.php @@ -43,12 +43,14 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['reusetext'])) && $video1 = ""; $rpUniqid = ""; + + $AIBWM = false; if(!(empty($result["ueuse"]))){ $ruUniqid = $postUniqid; }else{ $ruUniqid = $result["ruuniqid"]; } - $ueuse_result = send_ueuse($userid,$rpUniqid,$ruUniqid,$reusetext,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw_chk); + $ueuse_result = send_ueuse($userid,$rpUniqid,$ruUniqid,$reusetext,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw_chk,$AIBWM); if($ueuse_result == null){ echo json_encode(['success' => true]); diff --git a/home/index.php b/home/index.php index a3cbc5a..f307857 100644 --- a/home/index.php +++ b/home/index.php @@ -187,7 +187,7 @@ $notificationcount = $notiData['notification_count']; //-----------------URLから取得---------------- if(isset($_GET['text'])) { - $ueuse = safetext($_GET['text']); + $ueuse = safetext(urldecode($_GET['text'])); }elseif(isset($_COOKIE['ueuse'])) { $ueuse = safetext($_COOKIE['ueuse']); } @@ -195,6 +195,16 @@ if(isset($_GET['text'])) { //------------------------------------------- if( !empty($_POST['btn_submit']) ) { + $settingsJsonQuery = $pdo->prepare("SELECT userid, other_settings FROM account WHERE userid = :userid"); + $settingsJsonQuery->bindValue(':userid', $userid); + $settingsJsonQuery->execute(); + $settingsJson = $settingsJsonQuery->fetch(); + if(!(empty($settingsJson["other_settings"]))){ + $isAIBWM = val_OtherSettings("isAIBlockWaterMark", $settingsJson["other_settings"]); + }else{ + $isAIBWM = false; + } + $ueuse = safetext($_POST['ueuse']); if(isset($_POST['nsfw_chk'])){ @@ -211,7 +221,7 @@ if( !empty($_POST['btn_submit']) ) { $rpUniqid = ""; $ruUniqid = ""; - $ueuse_result = send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw_chk); + $ueuse_result = send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw_chk,$isAIBWM); if($ueuse_result == null){ //一時保存していたユーズ内容の削除 diff --git a/server/uwuzuabout.txt b/server/uwuzuabout.txt index 8dce441..1c2de9c 100644 --- a/server/uwuzuabout.txt +++ b/server/uwuzuabout.txt @@ -94,27 +94,6 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -### WebPush -Copyright (c) 2015 Louis Lagrange - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ## 更新情報 編集者 : daichimarukana diff --git a/server/uwuzuinfo.txt b/server/uwuzuinfo.txt index 45ffcce..8bb6ecd 100644 --- a/server/uwuzuinfo.txt +++ b/server/uwuzuinfo.txt @@ -1,4 +1,4 @@ uwuzu -1.4.6 -2024/11/06 +1.4.7 +2024/11/14 daichimarukana,putonfps \ No newline at end of file diff --git a/server/uwuzurelease.txt b/server/uwuzurelease.txt index 03bedcf..d3cedfb 100644 --- a/server/uwuzurelease.txt +++ b/server/uwuzurelease.txt @@ -1,6 +1,28 @@ ## リリースノートだぜぇぇぇぇぇぇい!!!!!!! ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...) +## Version 1.4.7 (Funium) +2024/11/14 +fix: 未使用のライブラリのライセンス情報が表示されてしまう問題を修正しました。 +fix: 一部のYouTubeリンクで埋め込みがされない問題を修正しました。 +fix: ドメインブロック機能の設定が空白の際にすべてのドメインがブロックされてしまう問題を修正しました! +chg: ActivityPubの仕様に少しでも近づけるようちょこっといじりました +chg: 一部UIを変更しました!!! +new: 各ユーザーごとにAI学習を拒否する設定を行えるようにしました! + これはHTML内にnoaiフラグを含むことによりAI学習を拒否する意思表示を行うものです。 + なお、この機能を使用するにはデータベースの更新が必要となります。 + データベースのaccountテーブルにother_settings(longtext)というカラムを追加してください。 + phpMyAdminで追加する場合は、タイプをJSONに選択して追加してください。 +new: AIによる学習(クロール)を拒否する管理者設定を追加しました! + この設定で次のAIクローラーによる学習が拒否されます。 + OpenAI、Google、Anthropic、Common Crawl +new: 利用可能なプラグインを増やしました! + 現在利用可能なプラグインは以下のものです。 + - AIBlockWaterMark + - PHPMailer + AIBlockWaterMarkの利用にもデータベースのaccountテーブルにother_settings(longtext)というカラムを追加する必要があります。 +del: OpenAI社によるGPTBotのクロールを拒否する設定項目を削除しました。 +uwuzu_database.sqlは更新済みです。 ## Version 1.4.6 (Funium) リリース日:2024/11/06 diff --git a/settings/index.php b/settings/index.php index 35bed7e..1778fef 100644 --- a/settings/index.php +++ b/settings/index.php @@ -190,6 +190,7 @@ $mail_settings = safetext($res["mail_settings"]); //phpmailer-------------------------------------------- require('../settings_admin/plugin_settings/phpmailer_settings.php'); //------------------------------------------------------ +require('../settings_admin/plugin_settings/aiblockwatermark_settings.php'); if( !empty($pdo) ) { // データベース接続の設定 @@ -200,6 +201,9 @@ if( !empty($pdo) ) { $role = $userData["role"]; + $isAIBlock = val_OtherSettings("isAIBlock", $userData["other_settings"]); + $isAIBWM = val_OtherSettings("isAIBlockWaterMark", $userData["other_settings"]); + if(!(empty($userData["encryption_ivkey"]))){ $view_mailadds = DecryptionUseEncrKey($userData["mailadds"], GenUserEnckey($userData["datetime"]), $userData["encryption_ivkey"]); }else{ @@ -231,6 +235,22 @@ if( !empty($_POST['btn_submit']) ) { $mailadds = safetext($_POST['mailadds']); + $new_isAIBlock = safetext($_POST['isAIBlock']); + if($new_isAIBlock === "true"){ + $save_isAIBlock = true; + }else{ + $save_isAIBlock = false; + } + $other_settings_json = val_AddOtherSettings("isAIBlock", $save_isAIBlock, $userData["other_settings"]); + + $new_isAIBMW = safetext($_POST['isAIBMW']); + if($new_isAIBMW === "true"){ + $save_isAIBMW = true; + }else{ + $save_isAIBMW = false; + } + $other_settings_json = val_AddOtherSettings("isAIBlockWaterMark", $save_isAIBMW, $other_settings_json); + if( !empty($_POST['mail_important']) ) { $mail_important = safetext($_POST['mail_important']); }else{ @@ -306,7 +326,7 @@ if( !empty($_POST['btn_submit']) ) { try { // SQL作成 - $stmt = $pdo->prepare("UPDATE account SET username = :username, mailadds = :mailadds, profile = :profile, sacinfo = :saveimbot, mail_settings = :mail_settings WHERE userid = :userid;"); + $stmt = $pdo->prepare("UPDATE account SET username = :username, mailadds = :mailadds, profile = :profile, sacinfo = :saveimbot, mail_settings = :mail_settings, other_settings = :other_settings WHERE userid = :userid;"); // 他の値をセット $stmt->bindParam(':username', $username, PDO::PARAM_STR); @@ -314,6 +334,7 @@ if( !empty($_POST['btn_submit']) ) { $stmt->bindParam(':profile', $profile, PDO::PARAM_STR); $stmt->bindParam(':saveimbot', $saveim_bot, PDO::PARAM_STR); $stmt->bindParam(':mail_settings', $savemail_important, PDO::PARAM_STR); + $stmt->bindParam(':other_settings', $other_settings_json, PDO::PARAM_STR); // 条件を指定 // 以下の部分を適切な条件に置き換えてください @@ -845,6 +866,36 @@ $pdo = null; + +

AIによる学習を拒否する

+
あなたのプロフィールにAIが訪れた際に、ユーズや画像などのコンテンツを学習しないように要求します。
+ これはHTML内にnoaiフラグを含むことで実装されているため、必ずしもすべてのAIがこれに従うとは限りません。
+ なお、この機能はまだ確実な動作が保証されないためベータ版です。
+
+ + + + + + + +
+ + +

AI学習防止透かしを自動挿入する

+
画像を添付してユーズした際に自動的に画像の右下に「AI学習禁止」と書かれた透かしを挿入する機能です。
+ この機能はまだ確実な動作が確認されていないためベータ版です。
+ また、gif、tiffやsvgなどの一部画像形式では挿入されません。
+
+ + + + + + + +
+ diff --git a/settings_admin/plugin_admin.php b/settings_admin/plugin_admin.php index 209f5d9..5b51023 100644 --- a/settings_admin/plugin_admin.php +++ b/settings_admin/plugin_admin.php @@ -37,6 +37,10 @@ require('plugin_settings/phpmailer_settings.php'); require('plugin_settings/phpmailer_sender.php'); //------------------------------------------------------ +//AIBlockWaterMark-------------------------------------------- +require('plugin_settings/aiblockwatermark_settings.php'); +//------------------------------------------------------ + session_name('uwuzu_s_id'); session_set_cookie_params([ 'lifetime' => 0, @@ -229,6 +233,22 @@ if( !empty($_POST['btn_submit']) ) { fputs($file, $data); fclose($file); + //---------------------------------------------------------------------- + + $N_AIBWM_ONOFF = safetext($_POST['aibwmchk_onoff']); + + $New_AIBWM_Settings = " + + "; + + //設定上書き + $file = fopen('plugin_settings/aiblockwatermark_settings.php', 'w'); + $data = $New_AIBWM_Settings; + fputs($file, $data); + fclose($file); + $url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; header("Location:".$url.""); exit; @@ -355,8 +375,21 @@ require('../logout/logout.php'); > - + +
+ +

AIBlockWaterMarkプラグイン

+
AI学習対策に、ユーザー単位で画像に透かしを自動挿入できるプラグインです。pluginフォルダに解凍済みのAIBlockWaterMarkのファイル一式が入っていることが必須要件になります。
plugin/AIBlockWaterMark/README.MDなど一式
+

AIBlockWaterMarkのオンオフ

+
+ + + + + + +
diff --git a/settings_admin/plugin_settings/aiblockwatermark_settings.php b/settings_admin/plugin_settings/aiblockwatermark_settings.php new file mode 100644 index 0000000..daae8b1 --- /dev/null +++ b/settings_admin/plugin_settings/aiblockwatermark_settings.php @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/settings_admin/serveradmin.php b/settings_admin/serveradmin.php index 8f7fb81..2cf2b9f 100644 --- a/settings_admin/serveradmin.php +++ b/settings_admin/serveradmin.php @@ -284,7 +284,7 @@ if( !empty($_POST['btn_submit']) ) { if($postrobots === "true"){ //GPTBotによるクロールを拒否 $file = fopen($robots, 'w'); - $data = "User-agent: GPTBot\nDisallow: /"; + $data = "User-agent: GPTBot\nDisallow: /\n\nUser-agent: ChatGPT-User\nDisallow: /\n\nUser-agent: Google-Extended\nDisallow: /\n\nUser-agent: ClaudeBot\nDisallow: /\n\nUser-agent: CCBot\nDisallow: /"; fputs($file, $data); fclose($file); }else{ @@ -348,7 +348,7 @@ if( !empty($_POST['btn_submit']) ) { $url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; header("Location:".$url.""); - exit; + exit; } require('../logout/logout.php'); ?> @@ -496,9 +496,11 @@ require('../logout/logout.php');
-

OpenAIによるクロールを拒否するかどうか
※robots.txtによりOpenAIからのクロールを拒否するものであり、他のAI企業によるクロールを完全拒否するものではございません。

+

AI学習を拒否するかどうか

+
robots.txtを使用し、OpenAI、Google、Anthropic、Common Crawlのクローラーを拒否します。
+ 必ずしもすべてのAI学習用クローラーをブロックできるわけではありません。
- + diff --git a/ueuse/index.php b/ueuse/index.php index 343fa5f..e6a7b83 100644 --- a/ueuse/index.php +++ b/ueuse/index.php @@ -213,7 +213,7 @@ if (!(empty($pdo))) { //-----------------URLから取得---------------- if(isset($_GET['text'])) { - $ueuse = safetext($_GET['text']); + $ueuse = safetext(urldecode($_GET['text'])); }elseif(isset($_COOKIE['ueuse'])) { $ueuse = safetext($_COOKIE['ueuse']); } @@ -221,6 +221,16 @@ if(isset($_GET['text'])) { //------------------------------------------- if( !empty($_POST['btn_submit']) ) { + $settingsJsonQuery = $pdo->prepare("SELECT userid, other_settings FROM account WHERE userid = :userid"); + $settingsJsonQuery->bindValue(':userid', $userid); + $settingsJsonQuery->execute(); + $settingsJson = $settingsJsonQuery->fetch(); + if(!(empty($settingsJson["other_settings"]))){ + $isAIBWM = val_OtherSettings("isAIBlockWaterMark", $settingsJson["other_settings"]); + }else{ + $isAIBWM = false; + } + $ueuse = safetext($_POST['ueuse']); if(isset($_POST['nsfw_chk'])){ @@ -237,7 +247,7 @@ if( !empty($_POST['btn_submit']) ) { $rpUniqid = $ueuseid; $ruUniqid = ""; - $ueuse_result = send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw_chk); + $ueuse_result = send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw_chk,$isAIBWM); if($ueuse_result == null){ //一時保存していたユーズ内容の削除 diff --git a/update.json b/update.json index ebadd6d..f8e9a74 100644 --- a/update.json +++ b/update.json @@ -1,35 +1,26 @@ { "software": "uwuzu", - "version": "1.4.6", - "release_date": "2024-11-06", - "release_notes": "このアップデートではパスワードが完全に入力されていなくても認証されてしまう問題を含め、他数件の問題が修正されています!!!\n早急なアップデートを強く推奨します!!!!!", - "notices": "アップデートの前に、データのバックアップを行うことをおすすめします!", + "version": "1.4.7", + "release_date": "2024-11-14", + "release_notes": "このアップデートではAI学習対策を中心に様々な新機能の追加がされています!\nまた、いくつかのバグ修正が含まれています!\nアップデートを推奨します!!", + "notices": "アップデートの前に、データベースの構造の更新をお忘れなく!\n合わせてデータのバックアップを行うことをおすすめします!", "files": { "overwrite": [ - "/admin/addadmin.php", + "/abi/addabi.php", + "/actor/index.php", "/css/home.css", "/function/function.php", + "/function/reuse.php", "/home/index.php", - "/js/console_notice.js", - "/migration/index.php", - "/nextpage/bookmark.php", - "/nextpage/ftlpage.php", - "/nextpage/nextpage.php", - "/nextpage/notification.php", - "/nextpage/ueusepage.php", - "/nextpage/userlikepage.php", - "/nextpage/usermediapage.php", - "/nextpage/userpage.php", - "/others/index.php", - "/passrecovery/startrecovery.php", - "/settings/addauthcode.php", "/settings/index.php", - "/settings_admin/userinfo.php", + "/settings_admin/plugin_settings/aiblockwatermark_settings.php", + "/settings_admin/plugin_admin.php", + "/settings_admin/serveradmin.php", + "/ueuse/index.php", + "/user/followers/index.php", + "/user/following/index.php", "/user/outbox/index.php", - "/addauthcode.php", - "/authlogin.php", - "/login.php", - "/new.php", + "/user/index.php", "/server/uwuzuabout.txt", "/server/uwuzuinfo.txt", "/server/uwuzurelease.txt" diff --git a/user/followers/index.php b/user/followers/index.php new file mode 100644 index 0000000..738ae08 --- /dev/null +++ b/user/followers/index.php @@ -0,0 +1,29 @@ + "https://www.w3.org/ns/activitystreams", + "id" => "https://".$domain."/user/followers/?actor=".$userid, + "type" => "OrderedCollection", + "totalItems" => 0, + "orderedItems" => [], + ); + + echo json_encode($item, JSON_UNESCAPED_UNICODE); +}else{ + header("HTTP/1.1 410 Gone"); +} +?> \ No newline at end of file diff --git a/user/following/index.php b/user/following/index.php new file mode 100644 index 0000000..1f224e3 --- /dev/null +++ b/user/following/index.php @@ -0,0 +1,29 @@ + "https://www.w3.org/ns/activitystreams", + "id" => "https://".$domain."/user/following/?actor=".$userid, + "type" => "OrderedCollection", + "totalItems" => 0, + "orderedItems" => [], + ); + + echo json_encode($item, JSON_UNESCAPED_UNICODE); +}else{ + header("HTTP/1.1 410 Gone"); +} +?> \ No newline at end of file diff --git a/user/index.php b/user/index.php index 024cfd3..6dd93a6 100644 --- a/user/index.php +++ b/user/index.php @@ -184,19 +184,11 @@ function customStripTags($html, $allowedTags) $allowedTags = array('h1', 'h2', 'h3', 'center', 'font'); if (!empty($pdo)) { - - // データベース接続の設定 - $dbh = new PDO('mysql:charset=utf8mb4;dbname=' . DB_NAME . ';host=' . DB_HOST, DB_USER, DB_PASS, array( - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, - PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, - )); - $uwuzuid2 = safetext(str_replace('@', '', $_GET['uwuzuid'])); $uwuzuid = safetext(str_replace('@' . $domain, '', $uwuzuid2)); - $userQuery = $dbh->prepare("SELECT username, userid, profile, role, follower, blocklist FROM account WHERE userid = :userid"); + $userQuery = $pdo->prepare("SELECT username, userid, profile, role, follower, blocklist FROM account WHERE userid = :userid"); $userQuery->bindValue(':userid', $uwuzuid); $userQuery->execute(); $userData = $userQuery->fetch(); @@ -207,7 +199,7 @@ if (!empty($pdo)) { $roles = explode(',', $userData["role"]); // カンマで区切られたロールを配列に分割 - $rerole = $dbh->prepare("SELECT follow, follower,blocklist, username, userid, password, mailadds, profile, iconname, headname, role, datetime FROM account WHERE userid = :userid"); + $rerole = $pdo->prepare("SELECT follow, follower,blocklist, username, userid, password, mailadds, profile, iconname, headname, role, datetime, other_settings FROM account WHERE userid = :userid"); $rerole->bindValue(':userid', $uwuzuid); // SQL実行 @@ -218,12 +210,13 @@ if (!empty($pdo)) { $roleDataArray = array(); foreach ($roles as $roleId) { - $rerole = $dbh->prepare("SELECT rolename, roleauth, rolecolor, roleeffect FROM role WHERE roleidname = :role"); + $rerole = $pdo->prepare("SELECT rolename, roleauth, rolecolor, roleeffect FROM role WHERE roleidname = :role"); $rerole->bindValue(':role', $roleId); $rerole->execute(); $roleDataArray[$roleId] = $rerole->fetch(); } + $isAIBlock = val_OtherSettings("isAIBlock", $userdata["other_settings"]); //-------フォロー数--------- $follow = $userdata['follow']; // コンマで区切られたユーザーIDを含む変数 @@ -250,7 +243,7 @@ if (!empty($pdo)) { $profileText = safetext($userData['profile']); - $allueuse = $dbh->prepare("SELECT account FROM ueuse WHERE account = :userid"); + $allueuse = $pdo->prepare("SELECT account FROM ueuse WHERE account = :userid"); $allueuse->bindValue(':userid', $uwuzuid); $allueuse->execute(); $ueuse_cnt = $allueuse->rowCount(); @@ -508,6 +501,10 @@ $pdo = null; + + + + diff --git a/user/outbox/index.php b/user/outbox/index.php index 3a31652..5af10c3 100644 --- a/user/outbox/index.php +++ b/user/outbox/index.php @@ -57,7 +57,6 @@ if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){ foreach ($messages as $value) { $activity = array( "type" => "Create", - "@context" => "https://www.w3.org/ns/activitystreams", "id" => "https://" . $domain . "/ueuse/activity/?ueuse=" . $value["uniqid"], "url" => "https://" . $domain . "/ueuse/activity/?ueuse=" . $value["uniqid"], "published" => date(DATE_ATOM, strtotime($value["datetime"])), @@ -86,7 +85,6 @@ if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){ "type" => "OrderedCollection", "@context" => "https://www.w3.org/ns/activitystreams", "id" => "https://" . $domain . "/user/outbox/?actor=@" . $userid . "&page=true", - "partOf" => "https://" . $domain . "/user/outbox/?actor=@" . $userid, "summary" => "outbox of " . $userid, "totalItems" => count($messages), "orderedItems" => $orderedItems, diff --git a/uwuzu_database.sql b/uwuzu_database.sql index e43727f..aeb19de 100644 --- a/uwuzu_database.sql +++ b/uwuzu_database.sql @@ -3,7 +3,7 @@ -- https://www.phpmyadmin.net/ -- -- ホスト: 127.0.0.1 --- 生成日時: 2024-08-19 10:03:35 +-- 生成日時: 2024-11-14 11:59:48 -- サーバのバージョン: 10.4.32-MariaDB -- PHP のバージョン: 8.2.12 @@ -50,7 +50,8 @@ CREATE TABLE `account` ( `sacinfo` varchar(256) NOT NULL, `notification_settings` varchar(256) NOT NULL, `mail_settings` mediumtext NOT NULL, - `encryption_ivkey` varchar(256) NOT NULL + `encryption_ivkey` varchar(256) NOT NULL, + `other_settings` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`other_settings`)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- --------------------------------------------------------