PDO::ERRMODE_EXCEPTION, PDO::MYSQL_ATTR_MULTI_STATEMENTS => false ); $pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); } catch(PDOException $e) { // 接続エラーのときエラー内容を取得する $error_message[] = $e->getMessage(); } if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) { $passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid"); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->execute(); $res = $passQuery->fetch(); if(empty($res["userid"])){ header("Location: ../login.php"); exit; }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){ // セッションに値をセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $loginid = htmlentities($res["loginid"]); $role = htmlentities($res["role"]); $sacinfo = htmlentities($res["sacinfo"]); $myblocklist = htmlentities($res["blocklist"]); $myfollowlist = htmlentities($res["follow"]); $_SESSION['admin_login'] = true; $_SESSION['userid'] = $userid; $_SESSION['username'] = $username; $_SESSION['loginid'] = $res["loginid"]; setcookie('userid', $userid, [ 'expires' => time() + 60 * 60 * 24 * 14, 'path' => '/', 'samesite' => 'lax', 'secure' => true, 'httponly' => true, ]); setcookie('username', $username,[ 'expires' => time() + 60 * 60 * 24 * 14, 'path' => '/', 'samesite' => 'lax', 'secure' => true, 'httponly' => true, ]); setcookie('loginid', $res["loginid"],[ 'expires' => time() + 60 * 60 * 24 * 14, 'path' => '/', 'samesite' => 'lax', 'secure' => true, 'httponly' => true, ]); setcookie('admin_login', true,[ 'expires' => time() + 60 * 60 * 24 * 14, 'path' => '/', 'samesite' => 'lax', 'secure' => true, 'httponly' => true, ]); }else{ header("Location: ../login.php"); exit; } } elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) { $passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid"); $passQuery->bindValue(':userid', htmlentities($_COOKIE['userid'])); $passQuery->execute(); $res = $passQuery->fetch(); if(empty($res["userid"])){ header("Location: ../login.php"); exit; }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){ // セッションに値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット $loginid = htmlentities($res["loginid"]); $role = htmlentities($res["role"]); $sacinfo = htmlentities($res["sacinfo"]); $myblocklist = htmlentities($res["blocklist"]); $myfollowlist = htmlentities($res["follow"]); $_SESSION['admin_login'] = true; $_SESSION['userid'] = $userid; $_SESSION['username'] = $username; $_SESSION['loginid'] = $res["loginid"]; setcookie('userid', $userid,[ 'expires' => time() + 60 * 60 * 24 * 14, 'path' => '/', 'samesite' => 'lax', 'secure' => true, 'httponly' => true, ]); setcookie('username', $username,[ 'expires' => time() + 60 * 60 * 24 * 14, 'path' => '/', 'samesite' => 'lax', 'secure' => true, 'httponly' => true, ]); setcookie('loginid', $res["loginid"],[ 'expires' => time() + 60 * 60 * 24 * 14, 'path' => '/', 'samesite' => 'lax', 'secure' => true, 'httponly' => true, ]); setcookie('admin_login', true,[ 'expires' => time() + 60 * 60 * 24 * 14, 'path' => '/', 'samesite' => 'lax', 'secure' => true, 'httponly' => true, ]); }else{ header("Location: ../login.php"); exit; } } else { // ログインが許可されていない場合、ログインページにリダイレクト header("Location: ../login.php"); exit; } if(empty($userid)){ header("Location: ../login.php"); exit; } if(empty($username)){ header("Location: ../login.php"); exit; } if(!($res["admin"] === "yes")){ header("Location: ../login.php"); exit; } $notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'"); $notiQuery->bindValue(':userid', $userid); $notiQuery->execute(); $notiData = $notiQuery->fetch(PDO::FETCH_ASSOC); $notificationcount = $notiData['notification_count']; if( !empty($pdo) ) { // データベース接続の設定 $dbh = new PDO('mysql:charset=UTF8;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, )); $userQuery = $dbh->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid"); $userQuery->bindValue(':userid', $userid); $userQuery->execute(); $userData = $userQuery->fetch(); $role = $userData["role"]; $dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); $rerole = $dbh->prepare("SELECT username, userid, password, mailadds, profile, iconname, headname, role, datetime FROM account WHERE userid = :userid"); $rerole->bindValue(':userid', $userid); // SQL実行 $rerole->execute(); $userdata = $rerole->fetch(); // ここでデータベースから取得した値を $role に代入する } if (!empty($pdo)) { $sql = "SELECT code,used,datetime FROM invitation ORDER BY datetime DESC"; $invcode = $pdo->query($sql); while ($row = $invcode->fetch(PDO::FETCH_ASSOC)) { $codes[] = $row; } } if( !empty($_POST['btn_submit']) ) { $servericon = htmlentities($_POST['servericon'], ENT_QUOTES, 'UTF-8', false); $serverhead = htmlentities($_POST['serverhead'], ENT_QUOTES, 'UTF-8', false); $serverlogo_onoff = htmlentities($_POST['serverlogo_onoff'], ENT_QUOTES, 'UTF-8', false); $serverlogo_light = htmlentities($_POST['serverlogo_light'], ENT_QUOTES, 'UTF-8', false); $serverlogo_dark = htmlentities($_POST['serverlogo_dark'], ENT_QUOTES, 'UTF-8', false); if(!($serverlogo_onoff === "true")){ $serverlogo_light = ""; $serverlogo_dark = ""; } $servername = htmlentities($_POST['servername'], ENT_QUOTES, 'UTF-8', false); $serverinfo = htmlentities($_POST['serverinfo'], ENT_QUOTES, 'UTF-8', false); $serveradminname = htmlentities($_POST['serveradminname'], ENT_QUOTES, 'UTF-8', false); $servermailadds = htmlentities($_POST['servermailadds'], ENT_QUOTES, 'UTF-8', false); $onlyuser = htmlentities($_POST['onlyuser'], ENT_QUOTES, 'UTF-8', false); if($onlyuser === "true"){ $saveonlyuser = "true"; }else{ $saveonlyuser = "false"; } $activitypub = htmlentities($_POST['activitypub'], ENT_QUOTES, 'UTF-8', false); if($activitypub === "true"){ $saveactivitypub = "true"; }else{ $saveactivitypub = "false"; } $migration = htmlentities($_POST['migration'], ENT_QUOTES, 'UTF-8', false); if($migration === "true"){ $savemigration = "true"; }else{ $savemigration = "false"; } $postrobots = htmlentities($_POST['robots'], ENT_QUOTES, 'UTF-8', false); if($postrobots === "true"){ //GPTBotによるクロールを拒否 $file = fopen($robots, 'w'); $data = "User-agent: GPTBot\nDisallow: /"; fputs($file, $data); fclose($file); }else{ //GPTBotによるクロールを許可 $file = fopen($robots, 'w'); $data = ""; fputs($file, $data); fclose($file); } $serverterms = htmlentities($_POST['serverterms'], ENT_QUOTES, 'UTF-8', false); $serverprv = htmlentities($_POST['serverprv'], ENT_QUOTES, 'UTF-8', false); $server_new_settings = ' ;サーバーの基本情報 [serverinfo] ;サーバー名 server_name = "'.$servername.'" ;サーバーアイコンのアドレス server_icon = "'.$servericon.'" ;サーバーヘッダーのアドレス server_head = "'.$serverhead.'" ;サーバーロゴのアドレス server_logo_home = "'.$serverlogo_light.'" server_logo_login = "'.$serverlogo_dark.'" ;管理者関係 server_admin = "'.$serveradminname.'" server_admin_mailadds = "'.$servermailadds.'" ;招待のオンオフ server_invitation = "'.$saveonlyuser.'" server_activitypub = "'.$saveactivitypub.'" ;アカウントの移行登録を許可するか server_account_migration = "'.$savemigration.'" '; //サーバー設定上書き $file = fopen($serversettings_file, 'w'); $data = $server_new_settings; fputs($file, $data); fclose($file); //鯖紹介 $file = fopen($serverinfofile, 'w'); $data = $serverinfo; fputs($file, $data); fclose($file); //利用規約 $file = fopen($servertermsfile, 'w'); $data = $serverterms; fputs($file, $data); fclose($file); //プライバシーポリシー $file = fopen($serverprvfile, 'w'); $data = $serverprv; fputs($file, $data); fclose($file); $url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; header("Location:".$url.""); exit; } require('../logout/logout.php'); ?> サーバー設定 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?>

サーバー設定

">
">
">

サーバーアイコン

サーバー登録画面などに表示されます。
自動的に角が丸くなります。
URLより設定してください。(設定しなくても大丈夫です。)
">

サーバーヘッダー

サーバー登録画面などに表示されます。
自動的に角が丸くなります。
URLより設定してください。(設定しなくても大丈夫です。)
">

サーバーロゴ機能のオンオフ

サーバー名

サーバー名です。
">

サーバー紹介メッセージ

サーバーの紹介メッセージです。

サーバー管理者の名前

サーバー管理者名です。
">

サーバーへのお問い合わせ用メールアドレス

ユーザーからのお問い合わせメアドです。
">

招待制にするかどうか

アカウントの移行登録を許可するか

他のuwuzuサーバーからのアカウント移行を許可するかです。
このサーバーが招待制の場合移行登録にも招待コードが必要となります。

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

ActivityPubサーバーとして認識されるようにするか

ActivityPubの仮実装をオンにするかです。inboxに入ってきた内容には今現在これといったレスポンスを返しません。
また、publicKeyも返却しません。
現状ActivityPubサーバーと連合を組むことは出来ません。(リモートユーザーの確認程度なら出来ます。)
オフの状態だと410 Goneを返します。

利用規約

プライバシーポリシー