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

uwuzu version 1.2.28

This commit is contained in:
daichimarukana
2023-12-20 22:36:44 +09:00
parent 6367282bb5
commit 51d7d84b63
89 changed files with 2770 additions and 1998 deletions
+5 -2
View File
@@ -1,6 +1,9 @@
<?php <?php
$activitypub_file = "../../server/activitypub.txt"; $serversettings_file = "../server/serversettings.ini";
if(file_get_contents($activitypub_file) === "true"){ $serversettings = parse_ini_file($serversettings_file, true);
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/xml; charset=UTF-8"); header("Content-Type: application/xml; charset=UTF-8");
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
+3 -2
View File
@@ -1,6 +1,7 @@
<?php <?php
$activitypub_file = "../../server/activitypub.txt"; $serversettings_file = "../server/serversettings.ini";
if(file_get_contents($activitypub_file) === "true"){ $serversettings = parse_ini_file($serversettings_file, true);
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/json; charset=utf-8"); header("Content-Type: application/json; charset=utf-8");
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
+3 -2
View File
@@ -1,6 +1,7 @@
<?php <?php
$activitypub_file = "../../server/activitypub.txt"; $serversettings_file = "../server/serversettings.ini";
if(file_get_contents($activitypub_file) === "true"){ $serversettings = parse_ini_file($serversettings_file, true);
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/json; charset=utf-8"); header("Content-Type: application/json; charset=utf-8");
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
+2 -9
View File
@@ -42,9 +42,7 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
### emoji ### emoji
- sysid(INT)(AUTO_INCREMENT) アカウントが追加されるとカウントされるシステム用ID - sysid(INT)(AUTO_INCREMENT) アカウントが追加されるとカウントされるシステム用ID
- emojifile(varchar(512)) 絵文字ファイル保存用 - emojifile(varchar(512)) 絵文字ファイルパス保存用
- emojitype(varchar(256)) 絵文字拡張子保存用
- emojicontent(mediumblob) 絵文字画像保存用
- emojiname(varchar(512)) 「:emoji:」のような絵文字名保存用 - emojiname(varchar(512)) 「:emoji:」のような絵文字名保存用
- emojiinfo(text) 絵文字についての説明保存用 - emojiinfo(text) 絵文字についての説明保存用
- emojidate(datetime) 絵文字登録日時保存用 - emojidate(datetime) 絵文字登録日時保存用
@@ -122,19 +120,14 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
- 404imagepath.txt : 404ページに表示する画像パス保存用 - 404imagepath.txt : 404ページに表示する画像パス保存用
- 503imagepath.txt : 503ページに表示する画像パス保存用 - 503imagepath.txt : 503ページに表示する画像パス保存用
- activitypub.txt : ActivityPub機能のオンオフ(trueまたはfalse)
- admininfo.txt : 管理者名(てすとまる/@sampledayo)
- banurldomain.txt : 投稿禁止URLドメイン - banurldomain.txt : 投稿禁止URLドメイン
- banuserid.txt : 登録禁止ユーザーid - banuserid.txt : 登録禁止ユーザーid
- contact.txt : 管理者への連絡用メアド(sample@test.com)
- info.txt : サーバー登録時に表示されるメッセージ(好きな内容) - info.txt : サーバー登録時に表示されるメッセージ(好きな内容)
- privacypolicy.txt : プライバシーポリシー(サーバーのプライバシーポリシーを記載) - privacypolicy.txt : プライバシーポリシー(サーバーのプライバシーポリシーを記載)
- servaricon.txt : サーバーアイコンのURL
- servarlogo.txt : サーバーロゴのURL
- servername.txt : サーバー名(てすとさば)
- serverstop.txt : サーバー停止ページで表示するメッセージ - serverstop.txt : サーバー停止ページで表示するメッセージ
- terms.txt : 利用規約(サーバーの利用規約を記載) - terms.txt : 利用規約(サーバーの利用規約を記載)
- textsize.txt : 最大文字数 - textsize.txt : 最大文字数
- serversettings.ini : サーバー情報保存ファイル
- uwuzuabout.txt : このファイル(uwuzuを改造した場合は書き換え) - uwuzuabout.txt : このファイル(uwuzuを改造した場合は書き換え)
- uwuzuinfo.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え) - uwuzuinfo.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え)
- uwuzurelease.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え) - uwuzurelease.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え)
+3 -2
View File
@@ -1,6 +1,7 @@
<?php <?php
$activitypub_file = "../server/activitypub.txt"; $serversettings_file = "../server/serversettings.ini";
if(file_get_contents($activitypub_file) === "true"){ $serversettings = parse_ini_file($serversettings_file, true);
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/json; charset=utf-8"); header("Content-Type: application/json; charset=utf-8");
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
+9 -18
View File
@@ -16,20 +16,11 @@ function random($length = 32)
require('db.php'); require('db.php');
$servernamefile = "server/servername.txt"; $serversettings_file = "server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverlogofile = "server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
$onlyuserfile = "server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
// 変数の初期化 // 変数の初期化
@@ -193,12 +184,12 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="js/unsupported.js"></script> <script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>アカウント登録 - <?php echo file_get_contents($servernamefile);?></title> <title>アカウント登録 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -207,9 +198,9 @@ $pdo = null;
<div class="leftbox"> <div class="leftbox">
<?php if(!empty($serverlogo_link[1])){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
@@ -233,7 +224,7 @@ $pdo = null;
<?php <?php
$title = file_get_contents($servernamefile); $title = htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');
$name = $userid; $name = $userid;
+10 -10
View File
@@ -11,14 +11,14 @@ function createUniqId(){
require('../db.php'); require('../db.php');
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$onlyuserfile = "../server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
// 変数の初期化 // 変数の初期化
$current_date = null; $current_date = null;
$message_array = array(); $message_array = array();
@@ -84,7 +84,7 @@ if( !empty($_POST['btn_submit']) ) {
$profile = $_POST['profile']; $profile = $_POST['profile'];
if($onlyuser === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){
$invitationcode = $_POST['invitationcode']; $invitationcode = $_POST['invitationcode'];
} }
@@ -195,7 +195,7 @@ if( !empty($_POST['btn_submit']) ) {
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); $dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
if($onlyuser === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){
$query = $dbh->prepare('SELECT * FROM invitation WHERE code = :code limit 1'); $query = $dbh->prepare('SELECT * FROM invitation WHERE code = :code limit 1');
$query->execute(array(':code' => $invitationcode)); $query->execute(array(':code' => $invitationcode));
@@ -435,12 +435,12 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="../image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="../image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>管理者アカウント登録 - <?php echo file_get_contents($servernamefile);?></title> <title>管理者アカウント登録 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -514,7 +514,7 @@ $pdo = null;
<div class="p2">プロフィールページに掲載され公開されます。<br>※サービス管理者が確認できます。</div> <div class="p2">プロフィールページに掲載され公開されます。<br>※サービス管理者が確認できます。</div>
<input id="profile" type="text" placeholder="" class="inbox" name="profile" value="<?php if( !empty($_SESSION['profile']) ){ echo htmlspecialchars( $_SESSION['profile'], ENT_QUOTES, 'UTF-8'); } ?>"> <input id="profile" type="text" placeholder="" class="inbox" name="profile" value="<?php if( !empty($_SESSION['profile']) ){ echo htmlspecialchars( $_SESSION['profile'], ENT_QUOTES, 'UTF-8'); } ?>">
</div> </div>
<?php if($onlyuser === "true"){?> <?php if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){?>
<div> <div>
<p>招待コード</p> <p>招待コード</p>
<div class="p2">招待コードがないとこのサーバーには登録できません。</div> <div class="p2">招待コードがないとこのサーバーには登録できません。</div>
+7 -8
View File
@@ -20,12 +20,11 @@ for( $i=0;$i<$cnt;$i++ ){
$uwuzuinfo[$i] = ($softwaredata[$i]); $uwuzuinfo[$i] = ($softwaredata[$i]);
} }
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$onlyuserfile = "../server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
// 変数の初期化 // 変数の初期化
@@ -84,13 +83,13 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="../image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="../image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>uwuzuへようこそ!!! - <?php echo file_get_contents($servernamefile);?></title> <title>uwuzuへようこそ!!! - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+7 -8
View File
@@ -10,12 +10,11 @@ function createUniqId(){
require('../db.php'); require('../db.php');
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$onlyuserfile = "../server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
// 変数の初期化 // 変数の初期化
@@ -79,13 +78,13 @@ if(!(empty($_SESSION['backupcode']))){
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>アカウント登録完了!!! - <?php echo file_get_contents($servernamefile);?></title> <title>アカウント登録完了!!! - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<script src="back.js"></script> <script src="back.js"></script>
+204 -163
View File
@@ -8,6 +8,9 @@ $banurldomainfile = "../server/banurldomain.txt";
$banurl_info = file_get_contents($banurldomainfile); $banurl_info = file_get_contents($banurldomainfile);
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info); $banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
//投稿及び返信レート制限↓(分):デフォで60件/分まで
$max_ueuse_rate_limit = 60;
header("Content-Type: application/json; charset=utf-8; Access-Control-Allow-Origin: *;"); header("Content-Type: application/json; charset=utf-8; Access-Control-Allow-Origin: *;");
function createUniqId(){ function createUniqId(){
@@ -152,105 +155,124 @@ if(isset($_GET['token'])&&isset($_GET['type'])) {
echo json_encode($response, JSON_UNESCAPED_UNICODE); echo json_encode($response, JSON_UNESCAPED_UNICODE);
exit; exit;
}else{ }else{
// 書き込み日時を取得
$username = $userData["username"];
$userid = $userData["userid"];
$datetime = date("Y-m-d H:i:s");
$uniqid = createUniqId();
$abi = "none";
$nones = "none";
// トランザクション開始 $old_datetime = date("Y-m-d H:i:00");
$pdo->beginTransaction(); $now_datetime = date("Y-m-d H:i:00",strtotime("+1 minute"));
$rate_Query = $dbh->prepare("SELECT * FROM ueuse WHERE account = :userid AND TIME(datetime) BETWEEN :old_datetime AND :now_datetime");
$rate_Query->bindValue(':userid', $userData["userid"]);
$rate_Query->bindValue(':old_datetime', $old_datetime);
$rate_Query->bindValue(':now_datetime', $now_datetime);
$rate_Query->execute();
$rate_count = $rate_Query->rowCount();
if(!($rate_count > $max_ueuse_rate_limit-1)){
try { // 書き込み日時を取得
$username = $userData["username"];
$userid = $userData["userid"];
$datetime = date("Y-m-d H:i:s");
$uniqid = createUniqId();
$abi = "none";
$nones = "none";
// SQL作成 // トランザクション開始
$stmt = $pdo->prepare("INSERT INTO ueuse (username, account, uniqid, ueuse, photo1, photo2, video1, datetime, abi) VALUES (:username, :account, :uniqid, :ueuse, :photo1, :photo2, :video1, :datetime, :abi)"); $pdo->beginTransaction();
$stmt->bindParam(':username', $username, PDO::PARAM_STR); try {
$stmt->bindParam(':account', $userid, PDO::PARAM_STR);
$stmt->bindParam(':uniqid', $uniqid, PDO::PARAM_STR);
$stmt->bindParam(':ueuse', $ueuse, PDO::PARAM_STR);
$stmt->bindParam(':photo1', $nones, PDO::PARAM_STR); // SQL作成
$stmt->bindParam(':photo2', $nones, PDO::PARAM_STR); $stmt = $pdo->prepare("INSERT INTO ueuse (username, account, uniqid, ueuse, photo1, photo2, video1, datetime, abi) VALUES (:username, :account, :uniqid, :ueuse, :photo1, :photo2, :video1, :datetime, :abi)");
$stmt->bindParam(':video1', $nones, PDO::PARAM_STR);
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR); $stmt->bindParam(':username', $username, PDO::PARAM_STR);
$stmt->bindParam(':account', $userid, PDO::PARAM_STR);
$stmt->bindParam(':uniqid', $uniqid, PDO::PARAM_STR);
$stmt->bindParam(':ueuse', $ueuse, PDO::PARAM_STR);
$stmt->bindParam(':abi', $abi, PDO::PARAM_STR); $stmt->bindParam(':photo1', $nones, PDO::PARAM_STR);
$stmt->bindParam(':photo2', $nones, PDO::PARAM_STR);
$stmt->bindParam(':video1', $nones, PDO::PARAM_STR);
// SQLクエリの実行 $stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
$res = $stmt->execute();
// コミット $stmt->bindParam(':abi', $abi, PDO::PARAM_STR);
$res = $pdo->commit();
$mentionedUsers = get_mentions_userid($ueuse); // SQLクエリの実行
$res = $stmt->execute();
foreach ($mentionedUsers as $mentionedUser) { // コミット
$res = $pdo->commit();
$pdo->beginTransaction(); $mentionedUsers = get_mentions_userid($ueuse);
try { foreach ($mentionedUsers as $mentionedUser) {
$touserid = $mentionedUser;
$datetime = date("Y-m-d H:i:s");
$msg = "" . $ueuse . "";
$title = "" . $username . "さんにメンションされました!";
$url = "/!" . $uniqid . "~" . $userid . "";
$userchk = 'none';
// 通知用SQL作成 $pdo->beginTransaction();
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
try {
$touserid = $mentionedUser;
$datetime = date("Y-m-d H:i:s");
$msg = "" . $ueuse . "";
$title = "" . $username . "さんにメンションされました!";
$url = "/!" . $uniqid . "~" . $userid . "";
$userchk = 'none';
// 通知用SQL作成
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
$stmt->bindParam(':touserid', $touserid, PDO::PARAM_STR); $stmt->bindParam(':touserid', $touserid, PDO::PARAM_STR);
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR); $stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
$stmt->bindParam(':url', $url, PDO::PARAM_STR); $stmt->bindParam(':url', $url, PDO::PARAM_STR);
$stmt->bindParam(':userchk', $userchk, PDO::PARAM_STR); $stmt->bindParam(':userchk', $userchk, PDO::PARAM_STR);
$stmt->bindParam(':title', $title, PDO::PARAM_STR); $stmt->bindParam(':title', $title, PDO::PARAM_STR);
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR); $stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
// SQLクエリの実行 // SQLクエリの実行
$res = $stmt->execute(); $res = $stmt->execute();
// コミット // コミット
$res = $pdo->commit(); $res = $pdo->commit();
} catch(Exception $e) { } catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
// エラーが発生した時はロールバック
$pdo->rollBack();
} }
} catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
} }
} catch(Exception $e) { if( $res ) {
$response = array(
'uniqid' => $uniqid,
'userid' => $userid,
);
// エラーが発生した時はロールバック echo json_encode($response, JSON_UNESCAPED_UNICODE);
$pdo->rollBack(); } else {
} $err = "db_error_".$e->getMessage();
$response = array(
'error_code' => $err,
);
if( $res ) { echo json_encode($response, JSON_UNESCAPED_UNICODE);
$response = array( }
'uniqid' => $uniqid,
'userid' => $userid,
);
echo json_encode($response, JSON_UNESCAPED_UNICODE); // プリペアドステートメントを削除
} else { $stmt = null;
$err = "db_error_".$e->getMessage(); }else{
$err = "over_rate_limit ";
$response = array( $response = array(
'error_code' => $err, 'error_code' => $err,
); );
echo json_encode($response, JSON_UNESCAPED_UNICODE); echo json_encode($response, JSON_UNESCAPED_UNICODE);
} }
// プリペアドステートメントを削除
$stmt = null;
} }
} }
}else{ }else{
@@ -365,151 +387,170 @@ if(isset($_GET['token'])&&isset($_GET['type'])) {
echo json_encode($response, JSON_UNESCAPED_UNICODE); echo json_encode($response, JSON_UNESCAPED_UNICODE);
exit; exit;
}else{ }else{
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array( $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_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
)); ));
$resultQuery = $dbh->prepare("SELECT * FROM ueuse WHERE uniqid = :uniqid"); $old_datetime = date("Y-m-d H:i:00");
$resultQuery->bindValue(':uniqid', $rpuniqid); $now_datetime = date("Y-m-d H:i:00",strtotime("+1 minute"));
$resultQuery->execute(); $rate_Query = $dbh->prepare("SELECT * FROM ueuse WHERE account = :userid AND TIME(datetime) BETWEEN :old_datetime AND :now_datetime");
$resultData = $resultQuery->fetch(); $rate_Query->bindValue(':userid', $userData["userid"]);
$rate_Query->bindValue(':old_datetime', $old_datetime);
$rate_Query->bindValue(':now_datetime', $now_datetime);
$rate_Query->execute();
$rate_count = $rate_Query->rowCount();
if(!($rate_count > $max_ueuse_rate_limit-1)){
if($resultData > 0){ $resultQuery = $dbh->prepare("SELECT * FROM ueuse WHERE uniqid = :uniqid");
$resultQuery->bindValue(':uniqid', $rpuniqid);
$resultQuery->execute();
$resultData = $resultQuery->fetch();
// 書き込み日時を取得 if($resultData > 0){
$username = $userData["username"];
$userid = $userData["userid"];
$datetime = date("Y-m-d H:i:s");
$uniqid = createUniqId();
$abi = "none";
$nones = "none";
$touserid2 = $resultData["account"]; // 書き込み日時を取得
$username = $userData["username"];
$userid = $userData["userid"];
$datetime = date("Y-m-d H:i:s");
$uniqid = createUniqId();
$abi = "none";
$nones = "none";
// トランザクション開始 $touserid2 = $resultData["account"];
$pdo->beginTransaction();
try {
// SQL作成
$stmt = $pdo->prepare("INSERT INTO ueuse (username, account, rpuniqid, uniqid, ueuse, photo1, photo2, video1, datetime, abi) VALUES (:username, :account, :rpuniqid, :uniqid, :ueuse, :photo1, :photo2, :video1, :datetime, :abi)");
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
$stmt->bindParam(':account', $userid, PDO::PARAM_STR);
$stmt->bindParam(':rpuniqid', $rpuniqid, PDO::PARAM_STR);
$stmt->bindParam(':uniqid', $uniqid, PDO::PARAM_STR);
$stmt->bindParam(':ueuse', $ueuse, PDO::PARAM_STR);
$stmt->bindParam(':photo1', $nones, PDO::PARAM_STR);
$stmt->bindParam(':photo2', $nones, PDO::PARAM_STR);
$stmt->bindParam(':video1', $nones, PDO::PARAM_STR);
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
$stmt->bindParam(':abi', $abi, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
// トランザクション開始
$pdo->beginTransaction(); $pdo->beginTransaction();
$msg = ''.$ueuse.''; try {
$title = ''.$username.'さんが返信しました!';
$url = "https://".$domain."/!".$uniqid."~".$userid."";
$userchk = 'none';
// 通知用SQL作成
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
$stmt->bindParam(':touserid', $touserid2, PDO::PARAM_STR); // SQL作成
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR); $stmt = $pdo->prepare("INSERT INTO ueuse (username, account, rpuniqid, uniqid, ueuse, photo1, photo2, video1, datetime, abi) VALUES (:username, :account, :rpuniqid, :uniqid, :ueuse, :photo1, :photo2, :video1, :datetime, :abi)");
$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); $stmt->bindParam(':username', $username, PDO::PARAM_STR);
$stmt->bindParam(':account', $userid, PDO::PARAM_STR);
$stmt->bindParam(':rpuniqid', $rpuniqid, PDO::PARAM_STR);
$stmt->bindParam(':uniqid', $uniqid, PDO::PARAM_STR);
$stmt->bindParam(':ueuse', $ueuse, PDO::PARAM_STR);
// SQLクエリの実行 $stmt->bindParam(':photo1', $nones, PDO::PARAM_STR);
$res = $stmt->execute(); $stmt->bindParam(':photo2', $nones, PDO::PARAM_STR);
$stmt->bindParam(':video1', $nones, PDO::PARAM_STR);
// コミット $stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
$res = $pdo->commit();
$mentionedUsers = get_mentions_userid($ueuse); $stmt->bindParam(':abi', $abi, PDO::PARAM_STR);
foreach ($mentionedUsers as $mentionedUser) { // SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
$pdo->beginTransaction(); $pdo->beginTransaction();
try { $msg = ''.$ueuse.'';
$touserid = $mentionedUser; $title = ''.$username.'さんが返信しました!';
$datetime = date("Y-m-d H:i:s"); $url = "https://".$domain."/!".$uniqid."~".$userid."";
$msg = "" . $ueuse . ""; $userchk = 'none';
$title = "" . $username . "さんにメンションされました!"; // 通知用SQL作成
$url = "/!" . $uniqid . "~" . $userid . ""; $stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
$userchk = 'none';
// 通知用SQL作成 $stmt->bindParam(':touserid', $touserid2, PDO::PARAM_STR);
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)"); $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();
$mentionedUsers = get_mentions_userid($ueuse);
foreach ($mentionedUsers as $mentionedUser) {
$pdo->beginTransaction();
try {
$touserid = $mentionedUser;
$datetime = date("Y-m-d H:i:s");
$msg = "" . $ueuse . "";
$title = "" . $username . "さんにメンションされました!";
$url = "/!" . $uniqid . "~" . $userid . "";
$userchk = 'none';
// 通知用SQL作成
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
$stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR); $stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR);
$stmt->bindParam(':msg', htmlentities($msg), PDO::PARAM_STR); $stmt->bindParam(':msg', htmlentities($msg), PDO::PARAM_STR);
$stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR); $stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR);
$stmt->bindParam(':userchk', htmlentities($userchk), PDO::PARAM_STR); $stmt->bindParam(':userchk', htmlentities($userchk), PDO::PARAM_STR);
$stmt->bindParam(':title', htmlentities($title), PDO::PARAM_STR); $stmt->bindParam(':title', htmlentities($title), PDO::PARAM_STR);
$stmt->bindParam(':datetime', htmlentities($datetime), PDO::PARAM_STR); $stmt->bindParam(':datetime', htmlentities($datetime), PDO::PARAM_STR);
// SQLクエリの実行 // SQLクエリの実行
$res = $stmt->execute(); $res = $stmt->execute();
// コミット // コミット
$res = $pdo->commit(); $res = $pdo->commit();
} catch(Exception $e) { } catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
// エラーが発生した時はロールバック
$pdo->rollBack();
} }
} catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
} }
} catch(Exception $e) { if( $res ) {
$response = array(
'uniqid' => $uniqid,
'userid' => $userid,
);
// エラーが発生した時はロールバック echo json_encode($response, JSON_UNESCAPED_UNICODE);
$pdo->rollBack(); } else {
} $err = "db_error_".$e->getMessage();
$response = array(
'error_code' => $err,
);
if( $res ) { echo json_encode($response, JSON_UNESCAPED_UNICODE);
$response = array( }
'uniqid' => $uniqid, // プリペアドステートメントを削除
'userid' => $userid, $stmt = null;
);
echo json_encode($response, JSON_UNESCAPED_UNICODE); }else{
} else { $err = "post_not_found";
$err = "db_error_".$e->getMessage();
$response = array( $response = array(
'error_code' => $err, 'error_code' => $err,
); );
echo json_encode($response, JSON_UNESCAPED_UNICODE); echo json_encode($response, JSON_UNESCAPED_UNICODE);
exit;
} }
// プリペアドステートメントを削除
$stmt = null;
}else{ }else{
$err = "post_not_found"; $err = "over_rate_limit ";
$response = array( $response = array(
'error_code' => $err, 'error_code' => $err,
); );
echo json_encode($response, JSON_UNESCAPED_UNICODE); echo json_encode($response, JSON_UNESCAPED_UNICODE);
exit;
} }
} }
} }
+2 -1
View File
@@ -36,7 +36,7 @@ if(isset($_GET['limit'])) {
if (!empty($pdo)) { if (!empty($pdo)) {
$sql = "SELECT account, username, uniqid, rpuniqid, ueuse, datetime, photo1, photo2, video1, favorite, abi, abidate FROM ueuse WHERE rpuniqid = '' ORDER BY datetime DESC LIMIT " . intval($offset) . ", " . intval($itemsPerPage); $sql = "SELECT account, username, uniqid, rpuniqid, ueuse, datetime, photo1, photo2, video1, favorite, abi, abidate, nsfw FROM ueuse WHERE rpuniqid = '' ORDER BY datetime DESC LIMIT " . intval($offset) . ", " . intval($itemsPerPage);
$message_array = $pdo->query($sql); $message_array = $pdo->query($sql);
while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) { while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) {
@@ -77,6 +77,7 @@ if(isset($_GET['limit'])) {
'datetime' => htmlentities($ueusedata["datetime"]), 'datetime' => htmlentities($ueusedata["datetime"]),
'abi' => htmlentities($ueusedata["abi"]), 'abi' => htmlentities($ueusedata["abi"]),
'abidatetime' => htmlentities($ueusedata["abidate"]), 'abidatetime' => htmlentities($ueusedata["abidate"]),
'nsfw' => htmlentities($ueusedata["nsfw"]),
]; ];
$response[$ueusedata["uniqid"]] = $item; // ループ内で $response にデータを追加 $response[$ueusedata["uniqid"]] = $item; // ループ内で $response にデータを追加
+9 -17
View File
@@ -3,25 +3,17 @@ header("Content-Type: application/json; charset=utf-8; Access-Control-Allow-Orig
$mojisizefile = "../server/textsize.txt"; $mojisizefile = "../server/textsize.txt";
$adminfile = "../server/admininfo.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$servernamefile = "../server/servername.txt";
$servericonfile = "../server/servericon.txt";
$serverinfofile = '../server/info.txt'; $serverinfofile = '../server/info.txt';
$serverinfo = file_get_contents($serverinfofile); $serverinfo = file_get_contents($serverinfofile);
$contactfile = "../server/contact.txt";
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
$softwarefile = "../server/uwuzuinfo.txt"; $softwarefile = "../server/uwuzuinfo.txt";
$softwaredata = file_get_contents($softwarefile); $softwaredata = file_get_contents($softwarefile);
$onlyuserfile = "../server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
$softwaredata = explode( "\n", $softwaredata ); $softwaredata = explode( "\n", $softwaredata );
$cnt = count( $softwaredata ); $cnt = count( $softwaredata );
for( $i=0;$i<$cnt;$i++ ){ for( $i=0;$i<$cnt;$i++ ){
@@ -69,15 +61,15 @@ for( $i=0;$i<$cnt;$i++ ){
$notices[] = $row; $notices[] = $row;
} }
if($onlyuser === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8') === "true"){
$openregit = false; $openregit = false;
}elseif($onlyuser === "false"){ }elseif(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8') === "false"){
$openregit = true; $openregit = true;
}else{ }else{
$openregit = false; $openregit = false;
} }
if($onlyuser === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8') === "true"){
$invitation_code = true; $invitation_code = true;
}else{ }else{
$invitation_code = false; $invitation_code = false;
@@ -96,13 +88,13 @@ for( $i=0;$i<$cnt;$i++ ){
$item = [ $item = [
"server_info" => array( "server_info" => array(
"server_name" => file_get_contents($servernamefile), "server_name" => htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8'),
"server_icon" => file_get_contents($servericonfile), "server_icon" => htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'),
"server_description" => $serverinfo, "server_description" => $serverinfo,
"adminstor" => array( "adminstor" => array(
"name" => file_get_contents($adminfile), "name" => htmlspecialchars($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8'),
"email" => file_get_contents($contactfile), "email" => htmlspecialchars($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8'),
), ),
"terms_url" => "https://".$domain."/rule/terms", "terms_url" => "https://".$domain."/rule/terms",
+8 -16
View File
@@ -11,20 +11,12 @@ function createUniqId(){
require('db.php'); require('db.php');
$servernamefile = "server/servername.txt"; $serversettings_file = "server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverlogofile = "server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
$onlyuserfile = "server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
// 変数の初期化 // 変数の初期化
@@ -137,12 +129,12 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="js/unsupported.js"></script> <script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>アカウント登録 - <?php echo file_get_contents($servernamefile);?></title> <title>アカウント登録 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -151,9 +143,9 @@ $pdo = null;
<div class="leftbox2"> <div class="leftbox2">
<?php if(!empty($serverlogo_link[1])){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
+13 -15
View File
@@ -1,14 +1,7 @@
<?php <?php
$servernamefile = "server/servername.txt"; $serversettings_file = "server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverlogofile = "server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
require('db.php'); require('db.php');
@@ -30,7 +23,9 @@ $rpassword = "";
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true);
$userid = $_SESSION['userid']; $userid = $_SESSION['userid'];
@@ -217,12 +212,15 @@ if( !empty($_POST['btn_submit']) ) {
$pdo->rollBack(); $pdo->rollBack();
} }
clearstatcache();
$_SESSION['admin_login'] = true; $_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['loginid'] = $row["loginid"]; $_SESSION['loginid'] = $row["loginid"];
$_SESSION['username'] = $row["username"]; $_SESSION['username'] = $row["username"];
$_SESSION['password'] = ""; $_SESSION['password'] = null;
// リダイレクト先のURLへ転送する // リダイレクト先のURLへ転送する
$url = '/home'; $url = '/home';
@@ -250,21 +248,21 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="js/unsupported.js"></script> <script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>ログイン - <?php echo file_get_contents($servernamefile);?></title> <title>ログイン - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<script src="js/back.js"></script> <script src="js/back.js"></script>
<body> <body>
<div class="leftbox"> <div class="leftbox">
<?php if(!empty($serverlogo_link[1])){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
+12 -18
View File
@@ -1,14 +1,7 @@
<?php <?php
$servernamefile = "server/servername.txt"; $serversettings_file = "server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverlogofile = "server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
require('db.php'); require('db.php');
@@ -30,7 +23,9 @@ $ruserid = array();
$rpassword = array(); $rpassword = array();
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true);
// データベースに接続 // データベースに接続
try { try {
@@ -41,9 +36,6 @@ try {
); );
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); $pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
//$row['userid'] = "daichimarukn";
$userid = $_SESSION['userid']; $userid = $_SESSION['userid'];
@@ -177,12 +169,14 @@ if( !empty($_POST['btn_submit']) ) {
$pdo->rollBack(); $pdo->rollBack();
} }
clearstatcache();
$_SESSION['admin_login'] = true; $_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['loginid'] = $userData["loginid"]; $_SESSION['loginid'] = $userData["loginid"];
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['password'] = ""; $_SESSION['password'] = null;
// リダイレクト先のURLへ転送する // リダイレクト先のURLへ転送する
$url = '/home'; $url = '/home';
@@ -218,21 +212,21 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="js/unsupported.js"></script> <script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<title>確認 - <?php echo file_get_contents($servernamefile);?></title> <title>確認 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<script src="js/back.js"></script> <script src="js/back.js"></script>
<body> <body>
<div class="leftbox"> <div class="leftbox">
<?php if(!empty($serverlogo_link[1])){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
+103 -13
View File
@@ -515,6 +515,17 @@ main h1{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05); box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
} }
.userheader .icon h2 img{
margin-top: 0px;
margin-bottom: 0px;
margin-left: 4px;
margin-right: 4px;
max-height: 32px;
width: auto;
vertical-align: text-top;
border-radius: 0px;
}
.userheader h2{ .userheader h2{
word-wrap: break-word; word-wrap: break-word;
margin-left: 12px; margin-left: 12px;
@@ -996,6 +1007,16 @@ main h1{
font-weight: bold; font-weight: bold;
} }
.ueuse .flebox a .u_name img{
margin-top: 0px;
margin-bottom: 0px;
margin-left: 4px;
margin-right: 4px;
max-height: 18px;
width: auto;
vertical-align: text-top;
border-radius: 0px;
}
@@ -2463,6 +2484,16 @@ label>input {
font-family: 'BIZ UDPGothic', sans-serif; font-family: 'BIZ UDPGothic', sans-serif;
font-weight: bold; font-weight: bold;
} }
.modal-content p img{
margin-top: 0px;
margin-bottom: 0px;
margin-left: 4px;
margin-right: 4px;
max-height: 18px;
width: auto;
vertical-align: text-top;
border-radius: 0px;
}
.modal-content h1{ .modal-content h1{
font-size: 24px; font-size: 24px;
@@ -2471,6 +2502,16 @@ label>input {
font-family: 'BIZ UDPGothic', sans-serif; font-family: 'BIZ UDPGothic', sans-serif;
font-weight: bold; font-weight: bold;
} }
.modal-content h1 img{
margin-top: 0px;
margin-bottom: 0px;
margin-left: 4px;
margin-right: 4px;
max-height: 24px;
width: auto;
vertical-align: middle;
border-radius: 0px;
}
.modal-content .btn_area{ .modal-content .btn_area{
display: flex; display: flex;
@@ -2591,6 +2632,16 @@ label>input {
font-family: 'BIZ UDPGothic', sans-serif; font-family: 'BIZ UDPGothic', sans-serif;
font-weight: bold; font-weight: bold;
} }
.modal-content .action_userlist .userabout .username a img{
margin-top: 0px;
margin-bottom: 0px;
margin-left: 4px;
margin-right: 4px;
max-height: 18px;
width: auto;
vertical-align: text-top;
border-radius: 0px;
}
.modal-content .action_userlist .userabout .userid a{ .modal-content .action_userlist .userabout .userid a{
line-height: 20px; line-height: 20px;
overflow-wrap: break-word; overflow-wrap: break-word;
@@ -3262,6 +3313,15 @@ label>input {
font-weight: bold; font-weight: bold;
} }
.notification2 p img{
margin-top: auto;
margin-bottom: auto;
margin-left: 4px;
margin-right: 4px;
height: 32px;
vertical-align: middle;
}
.notification2 h3{ .notification2 h3{
overflow-wrap: break-word; overflow-wrap: break-word;
margin-top: auto; margin-top: auto;
@@ -3371,6 +3431,15 @@ label>input {
font-weight: bold; font-weight: bold;
} }
.notification p img{
margin-top: auto;
margin-bottom: auto;
margin-left: 4px;
margin-right: 4px;
height: 32px;
vertical-align: middle;
}
.notification h3{ .notification h3{
overflow-wrap: break-word; overflow-wrap: break-word;
margin-top: auto; margin-top: auto;
@@ -3630,7 +3699,7 @@ hr{
padding-right: 24px; padding-right: 24px;
padding-top: 8px; padding-top: 8px;
padding-bottom: 8px; padding-bottom: 8px;
color:#FCFAF2; color:#F5F4F0;
font-family: 'BIZ UDPGothic', sans-serif; font-family: 'BIZ UDPGothic', sans-serif;
font-weight: bold; font-weight: bold;
} }
@@ -3642,7 +3711,7 @@ hr{
padding-right: 24px; padding-right: 24px;
} }
.hny .textmain h1{ .hny .textmain h1{
background-color: var(--main-color); background-color: #dcae64;
text-align: left; text-align: left;
color:#FCFAF2; color:#FCFAF2;
font-family: 'BIZ UDPGothic', sans-serif; font-family: 'BIZ UDPGothic', sans-serif;
@@ -4317,6 +4386,34 @@ summary {
text-shadow: 0 0 0 var(--tl-color); text-shadow: 0 0 0 var(--tl-color);
text-align: center; text-align: center;
} }
.new_ueuse{
position: absolute;
animation: slideDownOffline 5.0s ease-in-out forwards;
margin-top: 32px;
margin-right: auto;
margin-left: auto;
right: 0;
left: 0;
width: fit-content;
height: 32px;
z-index: 9999;
background-color: var(--main-color);
border-radius: 20px;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .3);
}
.new_ueuse p{
margin-top: 4px;
margin-bottom: 4px;
margin-left: 12px;
margin-right: 12px;
line-height: 24px;
font-family: 'BIZ UDPGothic', sans-serif;
font-size: 16px;
color:var(--tl-color);
color: transparent;
text-shadow: 0 0 0 var(--tl-color);
text-align: center;
}
/*------------------------------------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------スマホ向け--------------------------------------------------*/ /*--------------------------------------------------スマホ向け--------------------------------------------------*/
@@ -5595,18 +5692,11 @@ summary {
} }
.hny{ .hny{
position: absolute;
animation: slideDownhny 5.0s ease-in-out forwards;
border-radius: 10px; border-radius: 10px;
overflow: hidden; overflow: hidden;
box-shadow:0 0px 32px 0 rgba(0, 0, 0, .15);
margin: 12px; margin: 12px;
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
} }
@keyframes slideDownhny {
0%, 100% { transform: translateY(-40dvh); }
20%, 90% { transform: translateY(0px); }
}
.hny .top{ .hny .top{
background-color: #CB4042; background-color: #CB4042;
padding-left: 24px; padding-left: 24px;
@@ -5618,7 +5708,7 @@ summary {
font-weight: bold; font-weight: bold;
} }
.hny .textmain{ .hny .textmain{
background-color: var(--border-color); background-color: #f5f4f0;
padding-top: 8px; padding-top: 8px;
padding-bottom: 8px; padding-bottom: 8px;
padding-left: 24px; padding-left: 24px;
@@ -5629,7 +5719,7 @@ summary {
text-align: left; text-align: left;
color:var(--text-color); color:var(--text-color);
font-family: 'BIZ UDPGothic', sans-serif; font-family: 'BIZ UDPGothic', sans-serif;
word-wrap: break-word; overflow-wrap:break-word;
font-size: 22px; font-size: 22px;
line-height: 32px; line-height: 32px;
padding: 0px; padding: 0px;
@@ -5640,7 +5730,7 @@ summary {
text-align: left; text-align: left;
color:var(--text-color); color:var(--text-color);
font-family: 'BIZ UDPGothic', sans-serif; font-family: 'BIZ UDPGothic', sans-serif;
word-wrap: break-word; overflow-wrap:break-word;
font-size: 16px; font-size: 16px;
line-height: 22px; line-height: 22px;
font-weight: bold; font-weight: bold;
@@ -5650,7 +5740,7 @@ summary {
text-align: right; text-align: right;
color:var(--text-color); color:var(--text-color);
font-family: 'BIZ UDPGothic', sans-serif; font-family: 'BIZ UDPGothic', sans-serif;
word-wrap: break-word; overflow-wrap:break-word;
font-size: 14px; font-size: 14px;
line-height: 22px; line-height: 22px;
font-weight: normal; font-weight: normal;
+103 -22
View File
@@ -1,6 +1,8 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000); $hashCreateTime = $sec.floor($msec*1000000);
@@ -24,6 +26,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -41,7 +44,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -50,7 +53,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -67,21 +70,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -98,7 +109,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -115,21 +126,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -192,15 +211,87 @@ if( !empty($pdo) ) {
} }
function rotate($image, $exif)
{
$orientation = $exif['Orientation'] ?? 1;
switch ($orientation) {
case 1: //no rotate
break;
case 2: //FLIP_HORIZONTAL
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 3: //ROTATE 180
$image = imagerotate($image, 180, 0);
break;
case 4: //FLIP_VERTICAL
imageflip($image, IMG_FLIP_VERTICAL);
break;
case 5: //ROTATE 270 FLIP_HORIZONTAL
$image = imagerotate($image, 270, 0);
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 6: //ROTATE 90
$image = imagerotate($image, 270, 0);
break;
case 7: //ROTATE 90 FLIP_HORIZONTAL
$image = imagerotate($image, 90, 0);
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 8: //ROTATE 270
$image = imagerotate($image, 90, 0);
break;
}
return $image;
}
if( !empty($_POST['btn_submit']) ) { if( !empty($_POST['btn_submit']) ) {
$emojiname = $_POST['emojiname']; $emojiname = $_POST['emojiname'];
$emojiinfo = $_POST['emojiinfo']; $emojiinfo = $_POST['emojiinfo'];
if (!empty($_FILES['image']['name'])) { if (!empty($_FILES['image']['name'])) {
$img = $_FILES['image']; // アップロードされたファイル情報
$uploadedFile = $_FILES['image'];
// アップロードされたファイルの拡張子を取得
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
// 新しいファイル名を生成(uniqid + 拡張子)
$newFilename = uniqid() . '.' . $extension;
// 保存先のパスを生成
$uploadedPath = 'emojiimage/' . $newFilename;
// ファイルを移動
$result = move_uploaded_file($uploadedFile['tmp_name'], '../'.$uploadedPath);
// EXIF削除
if($extension == "jpg" || $extension == "jpeg"){
$gd = imagecreatefromjpeg('../'.$uploadedPath);
$w = imagesx($gd);
$h = imagesy($gd);
$gd_out = imagecreatetruecolor($w,$h);
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
$exif = exif_read_data('../'.$uploadedPath);
$gd_out = rotate($gd_out, $exif);
imagejpeg($gd_out, '../'.$uploadedPath);
imagedestroy($gd_out);
}
if ($result) {
$emoji_path = $uploadedPath; // 保存されたファイルのパスを使用
} else {
$errnum = $uploadedFile['error'];
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
}
}else{ }else{
$error_message[] = '画像を選択してください'; $error_message[] = '画像を選択してください';
} }
@@ -251,19 +342,9 @@ if( !empty($_POST['btn_submit']) ) {
try { try {
// SQL作成 // SQL作成
$stmt = $pdo->prepare("INSERT INTO emoji (emojifile, emojitype, emojicontent, emojisize, emojiname, emojiinfo, emojidate) VALUES ( :emojifile, :emojitype, :emojicontent, :emojisize, :emojiname, :emojiinfo, :emojidate)"); $stmt = $pdo->prepare("INSERT INTO emoji (emojifile, emojiname, emojiinfo, emojidate) VALUES ( :emojifile, :emojiname, :emojiinfo, :emojidate)");
$stmt->bindValue(':emojifile', $emoji_path, PDO::PARAM_STR);
$name = $img['name'];
$type = $img['type'];
$content = file_get_contents($img['tmp_name']);
$size = $img['size'];
$stmt->bindValue(':emojifile', $name, PDO::PARAM_STR);
$stmt->bindValue(':emojitype', $type, PDO::PARAM_STR);
$stmt->bindValue(':emojicontent', $content, PDO::PARAM_STR);
$stmt->bindValue(':emojisize', $size, PDO::PARAM_INT);
// 値をセット // 値をセット
$stmt->bindParam( ':emojiname', $emojiname, PDO::PARAM_STR); $stmt->bindParam( ':emojiname', $emojiname, PDO::PARAM_STR);
@@ -312,14 +393,14 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>絵文字登録 - <?php echo file_get_contents($servernamefile);?></title> <title>絵文字登録 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+29 -10
View File
@@ -1,5 +1,7 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
@@ -23,6 +25,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -43,7 +46,7 @@ try {
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -52,7 +55,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -69,21 +72,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -100,7 +111,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -117,21 +128,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -160,7 +179,7 @@ $notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
$notificationcount = $notiData['notification_count']; $notificationcount = $notiData['notification_count'];
if (!empty($pdo)) { if (!empty($pdo)) {
$sql = "SELECT emojiname,emojiinfo,emojidate FROM emoji ORDER BY emojidate DESC"; $sql = "SELECT emojifile,emojiname,emojiinfo,emojidate FROM emoji ORDER BY emojidate DESC";
$message_array = $pdo->query($sql); $message_array = $pdo->query($sql);
while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) { while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) {
@@ -181,13 +200,13 @@ $pdo = null;
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<title>絵文字一覧 - <?php echo file_get_contents($servernamefile);?></title> <title>絵文字一覧 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -211,7 +230,7 @@ $pdo = null;
foreach ($messages as $value) { foreach ($messages as $value) {
echo '<div class="emjtex">'; echo '<div class="emjtex">';
echo '<div class="fx">'; echo '<div class="fx">';
echo '<img src="../emoji/emojiimage.php?emoji=' . urlencode($value["emojiname"]) . '">'; echo '<img src="../' . $value["emojifile"] . '">';
echo '<h3>:'.$value["emojiname"].':</h3>'; echo '<h3>:'.$value["emojiname"].':</h3>';
echo '</div>'; echo '</div>';
echo '<p>'.$value["emojiinfo"].'</p>'; echo '<p>'.$value["emojiinfo"].'</p>';
+8 -11
View File
@@ -1,7 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
//------------------------------------- //-------------------------------------
@@ -9,24 +11,19 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?> ?>
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css"> <link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>400 Bad Request - <?php echo file_get_contents($servernamefile);?></title> <title>400 Bad Request - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<body> <body>
@@ -39,7 +36,7 @@ $termsdata = file_get_contents($termsfile);
<div class="terms"> <div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<div class="err404"> <div class="err404">
+8 -11
View File
@@ -1,7 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
//------------------------------------- //-------------------------------------
@@ -9,24 +11,19 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?> ?>
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css"> <link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>401 Unauthorized - <?php echo file_get_contents($servernamefile);?></title> <title>401 Unauthorized - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<body> <body>
@@ -39,7 +36,7 @@ $termsdata = file_get_contents($termsfile);
<div class="terms"> <div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<div class="err404"> <div class="err404">
+8 -11
View File
@@ -1,7 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
//------------------------------------- //-------------------------------------
@@ -9,24 +11,19 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?> ?>
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css"> <link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>403 Forbidden - <?php echo file_get_contents($servernamefile);?></title> <title>403 Forbidden - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<body> <body>
@@ -39,7 +36,7 @@ $termsdata = file_get_contents($termsfile);
<div class="terms"> <div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<div class="err404"> <div class="err404">
+7 -11
View File
@@ -5,7 +5,8 @@ $custom404file = "../server/404imagepath.txt";
//------------------------ //------------------------
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
//------------------------------------- //-------------------------------------
@@ -13,23 +14,18 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?> ?>
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css"> <link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>404 Not found - <?php echo file_get_contents($servernamefile);?></title> <title>404 Not found - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<body> <body>
@@ -42,7 +38,7 @@ $termsdata = file_get_contents($termsfile);
<div class="terms"> <div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<div class="err404"> <div class="err404">
+7 -11
View File
@@ -1,7 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
//------------------------------------- //-------------------------------------
@@ -9,24 +10,19 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?> ?>
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css"> <link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>500 Internal Server Error - <?php echo file_get_contents($servernamefile);?></title> <title>500 Internal Server Error - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<body> <body>
@@ -39,7 +35,7 @@ $termsdata = file_get_contents($termsfile);
<div class="terms"> <div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<div class="err404"> <div class="err404">
+8 -11
View File
@@ -6,7 +6,9 @@ $custom503file = "../server/503imagepath.txt";
//------------------------- //-------------------------
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
//------------------------------------- //-------------------------------------
@@ -14,24 +16,19 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?> ?>
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css"> <link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>503 Service Unavailable - <?php echo file_get_contents($servernamefile);?></title> <title>503 Service Unavailable - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<body> <body>
@@ -44,7 +41,7 @@ $termsdata = file_get_contents($termsfile);
<div class="terms"> <div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<div class="err404"> <div class="err404">
+7 -6
View File
@@ -1,7 +1,8 @@
<?php <?php
$serverstopfile = "../server/serverstop.txt"; $serverstopfile = "../server/serverstop.txt";
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
@@ -17,14 +18,14 @@ if(!empty(file_get_contents($serverstopfile))){
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css"> <link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="/js/console_notice.js"></script> <script src="/js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>サーバー停止中 - <?php echo file_get_contents($servernamefile);?></title> <title>サーバー停止中 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -38,7 +39,7 @@ if(!empty(file_get_contents($serverstopfile))){
<div class="terms"> <div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<div class="err404"> <div class="err404">
<h1>サーバー停止中</h1> <h1>サーバー停止中</h1>
+34 -11
View File
@@ -1,5 +1,6 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$mojisizefile = "../server/textsize.txt"; $mojisizefile = "../server/textsize.txt";
@@ -29,6 +30,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -49,7 +51,7 @@ try {
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -58,7 +60,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -75,21 +77,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -106,7 +116,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -123,21 +133,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -164,6 +182,10 @@ $notiQuery->execute();
$notiData = $notiQuery->fetch(PDO::FETCH_ASSOC); $notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
$notificationcount = $notiData['notification_count']; $notificationcount = $notiData['notification_count'];
//-----------------URLから取得----------------
if(isset($_GET['text'])) {
$ueuse = htmlentities($_GET['text']);
}
//------------------------------------------- //-------------------------------------------
function get_mentions_userid($postText) { function get_mentions_userid($postText) {
@@ -590,7 +612,7 @@ if( !empty($_POST['btn_submit']) ) {
} }
if( $res ) { if( $res ) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
header("Location:".$url.""); header("Location:".$url."");
exit; exit;
} else { } else {
@@ -617,9 +639,9 @@ $pdo = null;
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/nsfw_event.js"></script> <script src="../js/nsfw_event.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="manifest" href="../manifest/manifest.json" /> <link rel="manifest" href="../manifest/manifest.json" />
<script> <script>
if ("serviceWorker" in navigator) { if ("serviceWorker" in navigator) {
@@ -633,8 +655,8 @@ if ("serviceWorker" in navigator) {
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<title>フォロータイムライン - <?php echo file_get_contents($servernamefile);?></title> <title>フォロータイムライン - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -825,10 +847,11 @@ function loadPosts() {
isLoading = true; isLoading = true;
$("#loading").show(); $("#loading").show();
var userid = '<?php echo $userid; ?>'; var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
$.ajax({ $.ajax({
url: '../nextpage/ftlpage.php', // PHPファイルへのパス url: '../nextpage/ftlpage.php', // PHPファイルへのパス
method: 'GET', method: 'GET',
data: { page: pageNumber, userid: userid }, data: { page: pageNumber, userid: userid , account_id: account_id },
dataType: 'html', dataType: 'html',
timeout: 300000, timeout: 300000,
success: function(response) { success: function(response) {
+37 -13
View File
@@ -1,5 +1,6 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$mojisizefile = "../server/textsize.txt"; $mojisizefile = "../server/textsize.txt";
@@ -29,6 +30,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -47,7 +49,7 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -56,7 +58,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -73,21 +75,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -104,7 +114,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -121,21 +131,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -163,6 +181,11 @@ $notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
$notificationcount = $notiData['notification_count']; $notificationcount = $notiData['notification_count'];
//-----------------URLから取得----------------
if(isset($_GET['text'])) {
$ueuse = htmlentities($_GET['text']);
}
//------------------------------------------- //-------------------------------------------
function get_mentions_userid($postText) { function get_mentions_userid($postText) {
// @useridを検出する // @useridを検出する
@@ -589,7 +612,7 @@ if( !empty($_POST['btn_submit']) ) {
} }
if( $res ) { if( $res ) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];;
header("Location:".$url.""); header("Location:".$url."");
exit; exit;
} else { } else {
@@ -616,9 +639,9 @@ $pdo = null;
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/nsfw_event.js"></script> <script src="../js/nsfw_event.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="manifest" href="../manifest/manifest.json" /> <link rel="manifest" href="../manifest/manifest.json" />
<script> <script>
if ("serviceWorker" in navigator) { if ("serviceWorker" in navigator) {
@@ -632,8 +655,8 @@ if ("serviceWorker" in navigator) {
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<title>ローカルタイムライン - <?php echo file_get_contents($servernamefile);?></title> <title>ローカルタイムライン - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -676,7 +699,7 @@ if ("serviceWorker" in navigator) {
document.write(msg); document.write(msg);
</script></p> </script></p>
<div class="rp"><?php echo date("Y年n月j日")?></div> <div class="rp"><?php echo date("Y年n月j日")?></div>
<button class="os_exit_btn">とじる</button> <button id="os_exit_btn" class="ueusebtn">とじる</button>
</div> </div>
</div> </div>
<?php }?> <?php }?>
@@ -849,10 +872,11 @@ $(document).ready(function() {
isLoading = true; isLoading = true;
$("#loading").show(); $("#loading").show();
var userid = '<?php echo $userid; ?>'; var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
$.ajax({ $.ajax({
url: '../nextpage/nextpage.php', // PHPファイルへのパス url: '../nextpage/nextpage.php', // PHPファイルへのパス
method: 'GET', method: 'GET',
data: { page: pageNumber, userid: userid }, data: { page: pageNumber, userid: userid , account_id: account_id },
dataType: 'html', dataType: 'html',
timeout: 300000, timeout: 300000,
success: function(response) { success: function(response) {
@@ -1094,7 +1118,7 @@ $(document).ready(function() {
}); });
var osho_gats = document.getElementById('osho_gats'); var osho_gats = document.getElementById('osho_gats');
$(document).on('click', '.os_exit_btn', function (event) { $('#os_exit_btn').on('click', function() {
document.cookie = "event=done; max-age=86400"; document.cookie = "event=done; max-age=86400";
osho_gats.style.display = 'none'; osho_gats.style.display = 'none';
}); });
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

+20 -31
View File
@@ -4,6 +4,7 @@
require('db.php'); require('db.php');
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
@@ -50,19 +51,10 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset
} }
} }
} }
$servericonfile = "server/servericon.txt";
//------------------------- $serversettings_file = "server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$servernamefile = "server/servername.txt";
$serverlogofile = "server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
//------------------------ //------------------------
@@ -75,13 +67,6 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "server/contact.txt";
//------------------------
$onlyuserfile = "server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
// データベースに接続 // データベースに接続
try { try {
$option = array( $option = array(
@@ -113,15 +98,19 @@ $count2 = $result2->num_rows;
<head prefix="og:http://ogp.me/ns#"> <head prefix="og:http://ogp.me/ns#">
<meta charset="utf-8"> <meta charset="utf-8">
<!--OGPはじまり--> <!--OGPはじまり-->
<meta property="og:title" content="<?php echo file_get_contents($servernamefile);?>"> <meta property="og:title" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>">
<meta property="og:description" content="<?php echo htmlentities($serverinfo);?>"> <meta property="og:description" content="<?php echo htmlentities($serverinfo);?>">
<meta property="og:url" content="https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8'); ?>/"> <meta property="og:url" content="https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8'); ?>/">
<meta property="og:image" content="<?php echo htmlspecialchars(file_get_contents($servericonfile), ENT_QUOTES, 'UTF-8'); ?>"> <meta property="og:image" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8');?>">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
<meta property="og:site_name" content="<?php echo file_get_contents($servernamefile);?>"> <meta property="og:site_name" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>"/>
<meta name="twitter:description" content="<?php echo htmlentities($serverinfo);?>"/>
<!--OGPここまで--> <!--OGPここまで-->
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="js/unsupported.js"></script> <script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<link rel="manifest" href="manifest/manifest.json" /> <link rel="manifest" href="manifest/manifest.json" />
@@ -135,7 +124,7 @@ if ("serviceWorker" in navigator) {
} }
</script> </script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title><?php echo file_get_contents($servernamefile);?></title> <title><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -165,17 +154,17 @@ if ("serviceWorker" in navigator) {
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
<h1><?php echo htmlspecialchars(file_get_contents($servernamefile));?>へようこそ!</h1> <h1><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>へようこそ!</h1>
<?php if( !empty(file_get_contents($servericonfile)) ){ ?> <?php if( !empty(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8')) ){ ?>
<div class="servericon"> <div class="servericon">
<img src="<?php echo htmlspecialchars(file_get_contents($servericonfile), ENT_QUOTES, 'UTF-8'); ?>"> <img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8');?>">
<div class="textzone"> <div class="textzone">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
</div> </div>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="p3"><?php echo htmlspecialchars(file_get_contents($servernamefile));?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<?php }?> <?php }?>
@@ -185,9 +174,9 @@ if ("serviceWorker" in navigator) {
echo $info.'<br>'; echo $info.'<br>';
}?></p> }?></p>
<a class="maillink" href="mailto:<?php echo htmlspecialchars(file_get_contents($contactfile));?>">お問い合わせ : <?php echo file_get_contents($contactfile);?></a> <a class="maillink" href="mailto:<?php echo htmlspecialchars($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8');?>">お問い合わせ : <?php echo htmlspecialchars($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8');?></a>
<?php if($onlyuser === "true"){?> <?php if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){?>
<p>このサーバーには招待コードがないと登録できません。<br>招待コードはお手元にありますか?</p> <p>このサーバーには招待コードがないと登録できません。<br>招待コードはお手元にありますか?</p>
<div class="btnbox"> <div class="btnbox">
<a href="new.php" class="irobutton">アカウント登録</a> <a href="new.php" class="irobutton">アカウント登録</a>
+9 -2
View File
@@ -62,7 +62,11 @@ if(ua2.indexOf("windows nt") !== -1) {
/*SSL*/ /*SSL*/
if (location.protocol == 'http:') { if (location.protocol == 'http:') {
user_agent_ssl = "not_ssl"; if (location.hostname == 'localhost'){
user_agent_ssl = "not_ssl";
}else{
user_agent_ssl = "not_ssl_bad";
}
} else if (location.protocol == 'https:') { } else if (location.protocol == 'https:') {
user_agent_ssl = "ssl"; user_agent_ssl = "ssl";
} else { } else {
@@ -89,7 +93,10 @@ if (user_agent_browser == 'Microsoft_Internet_Explorer' || user_agent_browser ==
} else if (user_agent_ssl == 'Other') { } else if (user_agent_ssl == 'Other') {
user_agent_access = 'bad'; user_agent_access = 'bad';
errcode = 'NONE_SSL'; errcode = 'NONE_SSL';
} else { } else if (user_agent_ssl == 'not_ssl_bad') {
user_agent_access = 'bad';
errcode = 'NONE_SSL_SERVER';
}else{
user_agent_access = 'ok'; user_agent_access = 'ok';
errcode = 'NONE_ERROR'; errcode = 'NONE_ERROR';
} }
+17 -26
View File
@@ -1,14 +1,7 @@
<?php <?php
$servericonfile = "server/servericon.txt"; $serversettings_file = "server/serversettings.ini";
$servernamefile = "server/servername.txt"; $serversettings = parse_ini_file($serversettings_file, true);
$serverlogofile = "server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
require('db.php'); require('db.php');
@@ -35,6 +28,7 @@ $password = null;
$_SESSION["password"]=""; $_SESSION["password"]="";
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
try { try {
@@ -96,9 +90,6 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset
if( !empty($_POST['btn_submit']) ) { if( !empty($_POST['btn_submit']) ) {
//$row['userid'] = "daichimarukn";
$userid = $_POST['userid']; $userid = $_POST['userid'];
$password = $_POST['password']; $password = $_POST['password'];
@@ -188,28 +179,32 @@ $pdo = null;
<head prefix="og:http://ogp.me/ns#"> <head prefix="og:http://ogp.me/ns#">
<meta charset="utf-8"> <meta charset="utf-8">
<!--OGPはじまり--> <!--OGPはじまり-->
<meta property="og:title" content="ログイン - <?php echo file_get_contents($servernamefile);?>"> <meta property="og:title" content="ログイン - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>">
<meta property="og:description" content="<?php echo file_get_contents($servernamefile);?>にログイン"> <meta property="og:description" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>にログイン">
<meta property="og:url" content="https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8'); ?>/login"> <meta property="og:url" content="https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8'); ?>/login">
<meta property="og:image" content="<?php echo htmlspecialchars(file_get_contents($servericonfile), ENT_QUOTES, 'UTF-8'); ?>"> <meta property="og:image" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8');?>">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
<meta property="og:site_name" content="ログイン - <?php echo file_get_contents($servernamefile);?>"> <meta property="og:site_name" content="ログイン - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="ログイン - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>"/>
<meta name="twitter:description" content="<?php echo htmlentities($serverinfo);?>"/>
<!--OGPここまで--> <!--OGPここまで-->
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="js/unsupported.js"></script> <script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>ログイン - <?php echo file_get_contents($servernamefile);?></title> <title>ログイン - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<script src="js/back.js"></script> <script src="js/back.js"></script>
<body> <body>
<div class="leftbox"> <div class="leftbox">
<?php if(!empty($serverlogo_link[1])){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
@@ -231,17 +226,13 @@ $pdo = null;
<?php endif; ?> <?php endif; ?>
<form class="formarea" method="post"> <form class="formarea" method="post">
<!--ユーザーネーム関係-->
<div> <div>
<label for="userid">ユーザーID</label> <label for="userid">ユーザーID</label>
<input onInput="checkForm(this)" id="userid" class="inbox" type="text" name="userid" value="<?php if( !empty($_SESSION['userid']) ){ echo htmlentities( $_SESSION['userid'], ENT_QUOTES, 'UTF-8'); } ?>"> <input onInput="checkForm(this)" id="userid" class="inbox" type="text" name="userid" value="<?php if( !empty($_SESSION['userid']) ){ echo htmlentities( $_SESSION['userid'], ENT_QUOTES, 'UTF-8'); } ?>">
</div> </div>
<!--個人情報関係-->
<!--アカウント関連-->
<div> <div>
<label for="password">パスワード</label> <label for="password">パスワード</label>
<input onInput="checkForm(this)" id="password" class="inbox" type="password" name="password" maxlength="32" value="<?php if( !empty($_SESSION['password']) ){ echo htmlentities( $_SESSION['password'], ENT_QUOTES, 'UTF-8'); } ?>"> <input id="password" class="inbox" type="password" name="password" maxlength="32" value="<?php if( !empty($_SESSION['password']) ){ echo htmlentities( $_SESSION['password'], ENT_QUOTES, 'UTF-8'); } ?>">
</div> </div>
<input type="submit" name="btn_submit" class="irobutton" value="ログイン"> <input type="submit" name="btn_submit" class="irobutton" value="ログイン">
+7 -4
View File
@@ -1,5 +1,7 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
if (isset($_SERVER['HTTP_COOKIE'])) { if (isset($_SERVER['HTTP_COOKIE'])) {
$cookies = explode(';', $_SERVER['HTTP_COOKIE']); $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
foreach($cookies as $cookie) { foreach($cookies as $cookie) {
@@ -23,6 +25,7 @@ if (isset($_SERVER['HTTP_COOKIE'])) {
setcookie('username', '', time()-1000, ''); setcookie('username', '', time()-1000, '');
} }
} }
$_SESSION = null;
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@@ -30,12 +33,12 @@ if (isset($_SERVER['HTTP_COOKIE'])) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>ログアウト完了 - <?php echo file_get_contents($servernamefile);?></title> <title>ログアウト完了 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<script src="../js/back.js"></script> <script src="../js/back.js"></script>
+23 -28
View File
@@ -15,22 +15,13 @@ function createUniqId(){
} }
require('db.php'); require('db.php');
$servericonfile = "server/servericon.txt";
$servernamefile = "server/servername.txt"; $serversettings_file = "server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverlogofile = "server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
$onlyuserfile = "server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
// 変数の初期化 // 変数の初期化
@@ -149,7 +140,7 @@ if( !empty($_POST['btn_submit']) ) {
$profile = $_POST['profile']; $profile = $_POST['profile'];
if($onlyuser === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){
$invitationcode = $_POST['invitationcode']; $invitationcode = $_POST['invitationcode'];
} }
@@ -273,7 +264,7 @@ if( !empty($_POST['btn_submit']) ) {
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); $dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
if($onlyuser === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){
$query = $dbh->prepare('SELECT * FROM invitation WHERE code = :code limit 1'); $query = $dbh->prepare('SELECT * FROM invitation WHERE code = :code limit 1');
$query->execute(array(':code' => $invitationcode)); $query->execute(array(':code' => $invitationcode));
@@ -308,8 +299,8 @@ if( !empty($_POST['btn_submit']) ) {
$error_message[] = '表示名を入力してください。'; $error_message[] = '表示名を入力してください。';
} else { } else {
// 文字数を確認 // 文字数を確認
if( 25 < mb_strlen($username, 'UTF-8') ) { if( 50 < mb_strlen($username, 'UTF-8') ) {
$error_message[] = 'ユーザーネームは25文字以内で入力してください。'; $error_message[] = 'ユーザーネームは50文字以内で入力してください。';
} }
} }
@@ -518,19 +509,23 @@ $pdo = null;
<head prefix="og:http://ogp.me/ns#"> <head prefix="og:http://ogp.me/ns#">
<meta charset="utf-8"> <meta charset="utf-8">
<!--OGPはじまり--> <!--OGPはじまり-->
<meta property="og:title" content="アカウント登録 - <?php echo file_get_contents($servernamefile);?>"> <meta property="og:title" content="アカウント登録 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>">
<meta property="og:description" content="<?php echo file_get_contents($servernamefile);?>にアカウント登録"> <meta property="og:description" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>にアカウント登録">
<meta property="og:url" content="https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8'); ?>/new"> <meta property="og:url" content="https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8'); ?>/new">
<meta property="og:image" content="<?php echo htmlspecialchars(file_get_contents($servericonfile), ENT_QUOTES, 'UTF-8'); ?>"> <meta property="og:image" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8');?>">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
<meta property="og:site_name" content="アカウント登録 - <?php echo file_get_contents($servernamefile);?>"> <meta property="og:site_name" content="アカウント登録 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="アカウント登録 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>"/>
<meta name="twitter:description" content="<?php echo htmlentities($serverinfo);?>"/>
<!--OGPここまで--> <!--OGPここまで-->
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="js/unsupported.js"></script> <script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>アカウント登録 - <?php echo file_get_contents($servernamefile);?></title> <title>アカウント登録 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -539,9 +534,9 @@ $pdo = null;
<div class="leftbox"> <div class="leftbox">
<?php if(!empty($serverlogo_link[1])){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
@@ -591,12 +586,12 @@ $pdo = null;
<div> <div>
<p>パスワード *</p> <p>パスワード *</p>
<div class="p2">ログイン時に必要となります。<br>※サービス管理者が確認できません。</div> <div class="p2">ログイン時に必要となります。<br>※サービス管理者が確認できません。</div>
<input onInput="checkForm(this)" placeholder="" class="inbox" id="password" type="text" name="password" value="<?php if( !empty($_SESSION['password']) ){ echo htmlspecialchars( $_SESSION['password'], ENT_QUOTES, 'UTF-8'); } ?>"> <input placeholder="" class="inbox" id="password" type="text" name="password" value="<?php if( !empty($_SESSION['password']) ){ echo htmlspecialchars( $_SESSION['password'], ENT_QUOTES, 'UTF-8'); } ?>">
</div> </div>
<div> <div>
<p>パスワード再確認 *</p> <p>パスワード再確認 *</p>
<input onInput="checkForm(this)" placeholder="" class="inbox" oncopy="return false" onpaste="return false" oncontextmenu="return false" id="chkpass" type="text" style="-webkit-text-security:disc;" name="chkpass" value="<?php if( !empty($_SESSION['chkpass']) ){ echo htmlspecialchars( $_SESSION['chkpass'], ENT_QUOTES, 'UTF-8'); } ?>"> <input placeholder="" class="inbox" oncopy="return false" onpaste="return false" oncontextmenu="return false" id="chkpass" type="text" style="-webkit-text-security:disc;" name="chkpass" value="<?php if( !empty($_SESSION['chkpass']) ){ echo htmlspecialchars( $_SESSION['chkpass'], ENT_QUOTES, 'UTF-8'); } ?>">
</div> </div>
<div> <div>
@@ -617,7 +612,7 @@ $pdo = null;
</div> </div>
<p>登録を押すと利用規約とプライバシーポリシーに同意したこととなります。<br>未確認の場合は上のボタンよりお読みください。</p> <p>登録を押すと利用規約とプライバシーポリシーに同意したこととなります。<br>未確認の場合は上のボタンよりお読みください。</p>
<?php if($onlyuser === "true"){?> <?php if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){?>
<div> <div>
<p>招待コード</p> <p>招待コード</p>
<div class="p2">招待コードがないとこのサーバーには登録できません。</div> <div class="p2">招待コードがないとこのサーバーには登録できません。</div>
+116 -88
View File
@@ -25,119 +25,147 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
$userid = htmlentities($_GET['userid']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid"); if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$aduserinfoQuery->bindValue(':userid', htmlentities($userid)); $userid = htmlentities($_GET['userid']);
$aduserinfoQuery->execute(); $loginid = htmlentities($_GET['account_id']);
$res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]);
$itemsPerPage = 15; // 1ページあたりのユーズ数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array();
if (!empty($pdo)) {
// データベース接続の設定
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array( $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_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
)); ));
// フォローしているユーザーIDを取得し、カンマで区切る $query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
$followQuery = $dbh->prepare("SELECT follow FROM account WHERE userid = :userid");
$followQuery->bindValue(':userid', $userid);
$followQuery->execute();
$followData = $followQuery->fetch();
$follow = $followData['follow'];
$followList = explode(',', $follow);
// フォローしているユーザーの投稿を取得し、日時順に並び替える $query->execute(array(':userid' => $userid));
$messages = array(); // 初期化
foreach ($followList as $followUserId) { $result2 = $query->fetch();
$sql = "SELECT * FROM ueuse WHERE rpuniqid = '' AND account = :follow_account ORDER BY datetime DESC LIMIT $offset, $itemsPerPage";
$stmt = $dbh->prepare($sql); if(!(empty($result2["loginid"]))){
$stmt->bindValue(':follow_account', $followUserId, PDO::PARAM_STR); if($result2["loginid"] === $loginid){
$stmt->execute(); $userid = htmlentities($_GET['userid']);
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$messages[] = $row; $aduserinfoQuery->bindValue(':userid', htmlentities($userid));
} $aduserinfoQuery->execute();
} $res = $aduserinfoQuery->fetch();
usort($messages, function($a, $b) { $myblocklist = htmlentities($res["blocklist"]);
return strtotime($b['datetime']) - strtotime($a['datetime']);
});
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) { $itemsPerPage = 15; // 1ページあたりのユーズ数
$message['iconname'] = $userData['iconname']; $pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$message['headname'] = $userData['headname']; $offset = ($pageNumber - 1) * $itemsPerPage;
$message['username'] = $userData['username'];
$message['sacinfo'] = $userData['sacinfo'];
$message['role'] = $userData['role'];
}
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid"); $messages = array();
$rpQuery->bindValue(':rpuniqid', $message['uniqid']);
$rpQuery->execute();
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC);
if ($rpData){ if (!empty($pdo)) {
$message['reply_count'] = $rpData['reply_count'];
}
}
//adsystem------------------
$message['ads'] = "false"; $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,
));
$today = date("Y-m-d H:i:s"); // フォローしているユーザーIDを取得し、カンマで区切る
$followQuery = $dbh->prepare("SELECT follow FROM account WHERE userid = :userid");
$followQuery->bindValue(':userid', $userid);
$followQuery->execute();
$followData = $followQuery->fetch();
$follow = $followData['follow'];
$followList = explode(',', $follow);
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()"); // フォローしているユーザーの投稿を取得し、日時順に並び替える
$adsQuery->bindValue(':today', $today); $messages = array(); // 初期化
$adsQuery->execute();
$adsresult = $adsQuery->fetch();
if(!(empty($adsresult))){
$message['ads'] = "true";
$message['ads_url'] = $adsresult["url"];
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){ foreach ($followList as $followUserId) {
foreach ($messages as $value) { $sql = "SELECT * FROM ueuse WHERE rpuniqid = '' AND account = :follow_account ORDER BY datetime DESC LIMIT $offset, $itemsPerPage";
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) {
if(!($value["role"] === "ice")){
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える $stmt = $dbh->prepare($sql);
$favIds = explode(',', $fav); $stmt->bindValue(':follow_account', $followUserId, PDO::PARAM_STR);
$value["favcnt"] = count($favIds)-1; $stmt->execute();
$messageDisplay = new MessageDisplay($value, $userid); // $userid をコンストラクタに渡す while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$messageDisplay->display(); $messages[] = $row;
}
} }
usort($messages, function($a, $b) {
return strtotime($b['datetime']) - strtotime($a['datetime']);
});
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) {
$message['iconname'] = $userData['iconname'];
$message['headname'] = $userData['headname'];
$message['username'] = $userData['username'];
$message['sacinfo'] = $userData['sacinfo'];
$message['role'] = $userData['role'];
}
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid");
$rpQuery->bindValue(':rpuniqid', $message['uniqid']);
$rpQuery->execute();
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC);
if ($rpData){
$message['reply_count'] = $rpData['reply_count'];
}
}
//adsystem------------------
$message['ads'] = "false";
$today = date("Y-m-d H:i:s");
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()");
$adsQuery->bindValue(':today', $today);
$adsQuery->execute();
$adsresult = $adsQuery->fetch();
if(!(empty($adsresult))){
$message['ads'] = "true";
$message['ads_url'] = $adsresult["url"];
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){
foreach ($messages as $value) {
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) {
if(!($value["role"] === "ice")){
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid); // $userid をコンストラクタに渡す
$messageDisplay->display();
}
}
}
if($message['ads'] === "true"){
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
}
}else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
}
$pdo = null;
} }
} }else{
if($message['ads'] === "true"){ echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
} }
}else{ }else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>'; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
}else{
$pdo = null; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
?> ?>
+100 -74
View File
@@ -25,96 +25,122 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
$userid = htmlentities($_GET['userid']); if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$userid = htmlentities($_GET['userid']);
$loginid = htmlentities($_GET['account_id']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid"); // データベース接続の設定
$aduserinfoQuery->bindValue(':userid', htmlentities($userid)); $dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
$aduserinfoQuery->execute(); PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
$res = $aduserinfoQuery->fetch(); PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
$myblocklist = htmlentities($res["blocklist"]); PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
));
$itemsPerPage = 15; // 1ページあたりのユーズ数 $query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array(); $query->execute(array(':userid' => $userid));
if (!empty($pdo)) { $result2 = $query->fetch();
$sql = "SELECT * FROM ueuse WHERE rpuniqid = '' ORDER BY datetime DESC LIMIT $offset, $itemsPerPage"; if(!(empty($result2["loginid"]))){
$message_array = $pdo->query($sql); if($result2["loginid"] === $loginid){
while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) { $aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]);
$messages[] = $row; $itemsPerPage = 15; // 1ページあたりのユーズ数
} $pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える $messages = array();
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) { if (!empty($pdo)) {
$message['iconname'] = $userData['iconname'];
$message['headname'] = $userData['headname'];
$message['username'] = $userData['username'];
$message['sacinfo'] = $userData['sacinfo'];
$message['role'] = $userData['role'];
}
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid"); $sql = "SELECT * FROM ueuse WHERE rpuniqid = '' ORDER BY datetime DESC LIMIT $offset, $itemsPerPage";
$rpQuery->bindValue(':rpuniqid', $message['uniqid']); $message_array = $pdo->query($sql);
$rpQuery->execute();
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC);
if ($rpData){ while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) {
$message['reply_count'] = $rpData['reply_count'];
}
}
//adsystem------------------
$message['ads'] = "false"; $messages[] = $row;
$today = date("Y-m-d H:i:s");
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()");
$adsQuery->bindValue(':today', $today);
$adsQuery->execute();
$adsresult = $adsQuery->fetch();
if(!(empty($adsresult))){
$message['ads'] = "true";
$message['ads_url'] = $adsresult["url"];
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){
foreach ($messages as $value) {
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) {
if(!($value["role"] === "ice")){
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid); // $userid をコンストラクタに渡す
$messageDisplay->display();
} }
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) {
$message['iconname'] = $userData['iconname'];
$message['headname'] = $userData['headname'];
$message['username'] = $userData['username'];
$message['sacinfo'] = $userData['sacinfo'];
$message['role'] = $userData['role'];
}
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid");
$rpQuery->bindValue(':rpuniqid', $message['uniqid']);
$rpQuery->execute();
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC);
if ($rpData){
$message['reply_count'] = $rpData['reply_count'];
}
}
//adsystem------------------
$message['ads'] = "false";
$today = date("Y-m-d H:i:s");
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()");
$adsQuery->bindValue(':today', $today);
$adsQuery->execute();
$adsresult = $adsQuery->fetch();
if(!(empty($adsresult))){
$message['ads'] = "true";
$message['ads_url'] = $adsresult["url"];
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){
foreach ($messages as $value) {
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) {
if(!($value["role"] === "ice")){
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid); // $userid をコンストラクタに渡す
$messageDisplay->display();
}
}
}
if($message['ads'] === "true"){
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
}
}else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
}
$pdo = null;
} }
} }else{
if($message['ads'] === "true"){ echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
} }
}else{ }else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>'; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
}else{
$pdo = null; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
?> ?>
+62 -36
View File
@@ -24,51 +24,77 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$userid = htmlentities($_GET['userid']);
$loginid = htmlentities($_GET['account_id']);
$userid = htmlentities($_GET['userid']); // データベース接続の設定
$itemsPerPage = 15; // 1ページあたりの投稿数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array();
if (!empty($pdo)) {
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array( $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_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
)); ));
$messageQuery = $dbh->prepare("SELECT title,msg,url,datetime,userchk FROM notification WHERE touserid = :userid ORDER BY datetime DESC LIMIT $offset, $itemsPerPage"); $query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
$messageQuery->bindValue(':userid', $userid);
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
// トランザクション開始 $query->execute(array(':userid' => $userid));
$pdo->beginTransaction();
// SQL作成 $result2 = $query->fetch();
$stmt = $pdo->prepare("UPDATE notification SET userchk = 'done' WHERE touserid = :userid;");
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR); if(!(empty($result2["loginid"]))){
if($result2["loginid"] === $loginid){
$userid = htmlentities($_GET['userid']);
$res = $stmt->execute(); $itemsPerPage = 15; // 1ページあたりの投稿数
$res = $pdo->commit(); $pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
if (!empty($message_array)) { $messages = array();
foreach ($message_array as $value) {
$messageDisplay = new MessageDisplay($value); // userid を渡さない if (!empty($pdo)) {
$messageDisplay->display();
$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,
));
$messageQuery = $dbh->prepare("SELECT title,msg,url,datetime,userchk FROM notification WHERE touserid = :userid ORDER BY datetime DESC LIMIT $offset, $itemsPerPage");
$messageQuery->bindValue(':userid', $userid);
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
// トランザクション開始
$pdo->beginTransaction();
// SQL作成
$stmt = $pdo->prepare("UPDATE notification SET userchk = 'done' WHERE touserid = :userid;");
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR);
$res = $stmt->execute();
$res = $pdo->commit();
if (!empty($message_array)) {
foreach ($message_array as $value) {
$messageDisplay = new MessageDisplay($value); // userid を渡さない
$messageDisplay->display();
}
} else {
echo '<div class="tokonone" id="noueuse"><p>通知はありません</p></div>';
}
$pdo = null;
}
}else{
echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
} else { }else{
echo '<div class="tokonone" id="noueuse"><p>通知はありません</p></div>'; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
}else{
echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
$pdo = null;
} }
?> ?>
+57 -2
View File
@@ -1,4 +1,59 @@
<?php <?php
function replaceEmojisWithImages($postText) {
// ユーズ内で絵文字名(:emoji:)を検出して画像に置き換える
$emojiPattern = '/:(\w+):/';
$postTextWithImages = preg_replace_callback($emojiPattern, function($matches) {
$emojiName = $matches[1];
//絵文字path取得
$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,
));
$emoji_Query = $dbh->prepare("SELECT emojifile, emojiname FROM emoji WHERE emojiname = :emojiname");
$emoji_Query->bindValue(':emojiname', $emojiName);
$emoji_Query->execute();
$emoji_row = $emoji_Query->fetch();
if(empty($emoji_row["emojifile"])){
$emoji_path = "img/sysimage/errorimage/emoji_404.png";
}else{
$emoji_path = $emoji_row["emojifile"];
}
return "<img src='../".$emoji_path."' alt=':$emojiName:' title=':$emojiName:'>";
}, $postText);
// @username を検出してリンクに置き換える
$usernamePattern = '/@(\w+)/';
$postTextWithImagesAndUsernames = preg_replace_callback($usernamePattern, function($matches) {
$username = $matches[1];
$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,
));
$mentionsuserQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
$mentionsuserQuery->bindValue(':userid', $username);
$mentionsuserQuery->execute();
$mentionsuserData = $mentionsuserQuery->fetch();
if(empty($mentionsuserData)){
return "@$username";
}else{
return "<a class = 'mta' href='/@".$mentionsuserData["userid"]."'>@".$mentionsuserData["username"]."</a>";
}
}, $postTextWithImages);
$hashtagsPattern = '/#([\p{Han}\p{Hiragana}\p{Katakana}A-Za-z0-9ー_]+)/u';
$postTextWithHashtags = preg_replace_callback($hashtagsPattern, function($matches) {
$hashtags = $matches[1];
return "<a class='hashtags' href='/search?q=" . urlencode('#') . $hashtags . "'>" . '#' . $hashtags . "</a>";
}, $postTextWithImagesAndUsernames);
return $postTextWithHashtags;
}
class MessageDisplay { class MessageDisplay {
private $value; private $value;
@@ -26,8 +81,8 @@ class MessageDisplay {
echo ' </div>'; echo ' </div>';
// 投稿内のHTMLコードを表示する部分 // 投稿内のHTMLコードを表示する部分
echo ' <h3>' . $this->value['title'] . '</h3>'; echo ' <h3>' . replaceEmojisWithImages($this->value['title']) . '</h3>';
echo ' <p>' . nl2br($this->value['msg']) . '</p>'; echo ' <p>' . replaceEmojisWithImages(nl2br($this->value['msg'])) . '</p>';
echo ' <a href="' . htmlentities($this->value['url']) . '">詳細をみる</a>'; echo ' <a href="' . htmlentities($this->value['url']) . '">詳細をみる</a>';
echo '</div>'; echo '</div>';
+110 -84
View File
@@ -27,112 +27,138 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$userid = htmlentities($_GET['userid']);
$loginid = htmlentities($_GET['account_id']);
$keyword = htmlentities(isset($_GET['keyword'])) ? htmlentities($_GET['keyword']) : ''; // データベース接続の設定
$userid = htmlentities($_GET['userid']); $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,
));
$messages = array(); $query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
if (!empty($pdo)) { $query->execute(array(':userid' => $userid));
if (!empty($keyword)) {
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array( $result2 = $query->fetch();
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
));
$keywordPattern = '/from:@(\w+)\s+(.+)/'; if(!(empty($result2["loginid"]))){
if (preg_match($keywordPattern, $keyword, $matches)) { if($result2["loginid"] === $loginid){
$username = $matches[1]; $keyword = htmlentities(isset($_GET['keyword'])) ? htmlentities($_GET['keyword']) : '';
$searchKeyword = $matches[2]; $userid = htmlentities($_GET['userid']);
$messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE account = :username AND (ueuse LIKE :searchKeyword OR abi LIKE :searchKeyword) ORDER BY datetime DESC"); $messages = array();
$messageQuery->bindValue(':username', $username, PDO::PARAM_STR);
$messageQuery->bindValue(':searchKeyword', '%' . $searchKeyword . '%', PDO::PARAM_STR);
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
} else {
$messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE ueuse LIKE :keyword OR abi LIKE :keyword ORDER BY datetime DESC");
$messageQuery->bindValue(':keyword', '%' . $keyword . '%', PDO::PARAM_STR);
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
}
$user_keyword = str_replace('@', '', $keyword); if (!empty($pdo)) {
$usersQuery = $dbh->prepare("SELECT * FROM account WHERE username LIKE :keyword OR userid LIKE :keyword OR profile LIKE :keyword ORDER BY datetime DESC"); if (!empty($keyword)) {
$usersQuery->bindValue(':keyword', '%' . $user_keyword . '%', PDO::PARAM_STR);
$usersQuery->execute();
$users_array = $usersQuery->fetchAll();
$users = array(); $dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
foreach ($users_array as $row) { PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
$users[] = $row; PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
} PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
));
$messages = array(); $keywordPattern = '/from:@(\w+)\s+(.+)/';
foreach ($message_array as $row) { if (preg_match($keywordPattern, $keyword, $matches)) {
$messages[] = $row; $username = $matches[1];
} $searchKeyword = $matches[2];
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) { $messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE account = :username AND (ueuse LIKE :searchKeyword OR abi LIKE :searchKeyword) ORDER BY datetime DESC");
$message['iconname'] = $userData['iconname']; $messageQuery->bindValue(':username', $username, PDO::PARAM_STR);
$message['headname'] = $userData['headname']; $messageQuery->bindValue(':searchKeyword', '%' . $searchKeyword . '%', PDO::PARAM_STR);
$message['username'] = $userData['username']; $messageQuery->execute();
$message['sacinfo'] = $userData['sacinfo']; $message_array = $messageQuery->fetchAll();
$message['role'] = $userData['role']; } else {
} $messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE ueuse LIKE :keyword OR abi LIKE :keyword ORDER BY datetime DESC");
$messageQuery->bindValue(':keyword', '%' . $keyword . '%', PDO::PARAM_STR);
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
}
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid"); $user_keyword = str_replace('@', '', $keyword);
$rpQuery->bindValue(':rpuniqid', $message['uniqid']); $usersQuery = $dbh->prepare("SELECT * FROM account WHERE username LIKE :keyword OR userid LIKE :keyword OR profile LIKE :keyword ORDER BY datetime DESC");
$rpQuery->execute(); $usersQuery->bindValue(':keyword', '%' . $user_keyword . '%', PDO::PARAM_STR);
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC); $usersQuery->execute();
$users_array = $usersQuery->fetchAll();
if ($rpData){ $users = array();
$message['reply_count'] = $rpData['reply_count']; foreach ($users_array as $row) {
} $users[] = $row;
} }
if(!empty($users)){ $messages = array();
foreach ($users as $uservalue) { foreach ($message_array as $row) {
$flw = $uservalue['follow']; $messages[] = $row;
$flwIds = explode(',', $flw); }
$uservalue["follow_cnt"] = count($flwIds)-1; // ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
$flr = $uservalue['follower']; if ($userData) {
$flrIds = explode(',', $flr); $message['iconname'] = $userData['iconname'];
$uservalue["follower_cnt"] = count($flrIds)-1; $message['headname'] = $userData['headname'];
$message['username'] = $userData['username'];
$message['sacinfo'] = $userData['sacinfo'];
$message['role'] = $userData['role'];
}
$messageDisplay = new UserdataDisplay($uservalue, $userid); $rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid");
$messageDisplay->display(); $rpQuery->bindValue(':rpuniqid', $message['uniqid']);
} $rpQuery->execute();
} $rpData = $rpQuery->fetch(PDO::FETCH_ASSOC);
if(!empty($messages)){
foreach ($messages as $value) {
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数 if ($rpData){
$message['reply_count'] = $rpData['reply_count'];
}
}
// コンマで区切って配列に分割し、要素数を数える if(!empty($users)){
$favIds = explode(',', $fav); foreach ($users as $uservalue) {
$value["favcnt"] = count($favIds)-1; $flw = $uservalue['follow'];
$flwIds = explode(',', $flw);
$uservalue["follow_cnt"] = count($flwIds)-1;
$messageDisplay = new MessageDisplay($value, $userid); $flr = $uservalue['follower'];
$messageDisplay->display(); $flrIds = explode(',', $flr);
$uservalue["follower_cnt"] = count($flrIds)-1;
$messageDisplay = new UserdataDisplay($uservalue, $userid);
$messageDisplay->display();
}
}
if(!empty($messages)){
foreach ($messages as $value) {
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid);
$messageDisplay->display();
}
}else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
}
$pdo = null;
}else{
echo '<div class="tokonone" id="noueuse"><p>検索ワードを入力してください。</p></div>';
}
} }
}else{ }else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>'; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
$pdo = null;
}else{ }else{
echo '<div class="tokonone" id="noueuse"><p>検索ワードを入力してください。</p></div>'; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
}else{
echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
?> ?>
+123 -81
View File
@@ -24,25 +24,9 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$userid = htmlentities($_GET['userid']); $userid = htmlentities($_GET['userid']);
$loginid = htmlentities($_GET['account_id']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]);
$ueuseid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
$itemsPerPage = 15; // 1ページあたりの投稿数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array();
if (!empty($pdo)) {
// データベース接続の設定 // データベース接続の設定
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array( $dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
@@ -51,85 +35,143 @@ if (!empty($pdo)) {
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
)); ));
// 投稿内容の取得(新しい順に取得) $query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
$messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE uniqid = :ueuseid OR rpuniqid = :rpueuseid ORDER BY datetime ASC LIMIT $offset, $itemsPerPage");
$messageQuery->bindValue(':ueuseid', $ueuseid);
$messageQuery->bindValue(':rpueuseid', $ueuseid);
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
$messages = array(); $query->execute(array(':userid' => $userid));
$result2 = $query->fetch();
if(!(empty($result2["loginid"]))){
if($result2["loginid"] === $loginid){
$userid = htmlentities($_GET['userid']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]);
$ueuseid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
$itemsPerPage = 15; // 1ページあたりの投稿数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array();
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,
));
// 投稿内容の取得(新しい順に取得)
$messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE uniqid = :ueuseid OR rpuniqid = :rpueuseid ORDER BY datetime ASC LIMIT $offset, $itemsPerPage");
$messageQuery->bindValue(':ueuseid', $ueuseid);
$messageQuery->bindValue(':rpueuseid', $ueuseid);
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
$messages = array();
foreach ($message_array as $row) {
$messages[] = $row;
}
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) { foreach ($message_array as $row) {
$message['iconname'] = $userData['iconname']; if(!(empty($row["rpuniqid"]))){
$message['headname'] = $userData['headname']; if(!($row["rpuniqid"] == $ueuseid)){
$message['username'] = $userData['username']; $up_messageQuery = $pdo->prepare("SELECT * FROM ueuse WHERE uniqid = :ueuseid ORDER BY datetime ASC LIMIT $offset, $itemsPerPage");
$message['sacinfo'] = $userData['sacinfo']; $up_messageQuery->bindValue(':ueuseid', $row["rpuniqid"]);
$message['role'] = $userData['role']; $up_messageQuery->execute();
} $up_messageData = $up_messageQuery->fetchAll();
if(!(empty($up_messageData))){
foreach ($up_messageData as $up_row) {
$up_row["up_uniqid"] = $up_row["uniqid"];
$messages[] = $up_row;
}
}
}
}
$messages[] = $row;
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid"); }
$rpQuery->bindValue(':rpuniqid', $message['uniqid']); // ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
$rpQuery->execute(); foreach ($messages as &$message) {
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC); $userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($rpData){ if ($userData) {
$message['reply_count'] = $rpData['reply_count']; $message['iconname'] = $userData['iconname'];
} $message['headname'] = $userData['headname'];
} $message['username'] = $userData['username'];
$message['sacinfo'] = $userData['sacinfo'];
$message['role'] = $userData['role'];
}
//adsystem------------------ $rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid");
$rpQuery->bindValue(':rpuniqid', $message['uniqid']);
$rpQuery->execute();
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC);
$message['ads'] = "false"; if ($rpData){
$message['reply_count'] = $rpData['reply_count'];
}
}
$today = date("Y-m-d H:i:s"); //adsystem------------------
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()"); $message['ads'] = "false";
$adsQuery->bindValue(':today', $today);
$adsQuery->execute();
$adsresult = $adsQuery->fetch();
if(!(empty($adsresult))){
$message['ads'] = "true";
$message['ads_url'] = $adsresult["url"];
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){ $today = date("Y-m-d H:i:s");
foreach ($messages as $value) {
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) {
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える $adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()");
$favIds = explode(',', $fav); $adsQuery->bindValue(':today', $today);
$value["favcnt"] = count($favIds)-1; $adsQuery->execute();
$adsresult = $adsQuery->fetch();
if(!(empty($adsresult))){
$message['ads'] = "true";
$message['ads_url'] = $adsresult["url"];
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){
foreach ($messages as $value) {
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) {
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid);
$messageDisplay->display();
}
}
if($message['ads'] === "true"){
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
}
}else{
echo '<div class="tokonone" id="noueuse"><p>投稿がありません</p></div>';
}
$pdo = null;
$messageDisplay = new MessageDisplay($value, $userid);
$messageDisplay->display();
} }
} }else{
if($message['ads'] === "true"){ echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
} }
}else{ }else{
echo '<div class="tokonone" id="noueuse"><p>投稿がありません</p></div>'; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
}else{
$pdo = null; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
?> ?>
+111 -84
View File
@@ -25,110 +25,137 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$userid = htmlentities($_GET['userid']);
$loginid = htmlentities($_GET['account_id']);
$uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : ''; // データベース接続の設定
$userid = htmlentities($_GET['userid']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]);
$itemsPerPage = 15; // 1ページあたりのユーズ数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array();
if (!empty($pdo)) {
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array( $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_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
)); ));
$userQuery = $dbh->prepare("SELECT username, userid, profile, role, follower FROM account WHERE userid = :userid"); $query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
$userQuery->bindValue(':userid', $uwuzuid);
$userQuery->execute();
$userData = $userQuery->fetch();
$messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE favorite LIKE :userid ORDER BY datetime DESC LIMIT $offset, $itemsPerPage"); $query->execute(array(':userid' => $userid));
$messageQuery->bindValue(':userid', '%,' . $uwuzuid . '%', PDO::PARAM_STR);
$messageQuery->execute(); $result2 = $query->fetch();
$message_array = $messageQuery->fetchAll();
$messages = array(); if(!(empty($result2["loginid"]))){
foreach ($message_array as $row) { if($result2["loginid"] === $loginid){
$messages[] = $row; $uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
} $userid = htmlentities($_GET['userid']);
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) { $aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$message['iconname'] = $userData['iconname']; $aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$message['headname'] = $userData['headname']; $aduserinfoQuery->execute();
$message['username'] = $userData['username']; $res = $aduserinfoQuery->fetch();
$message['sacinfo'] = $userData['sacinfo']; $myblocklist = htmlentities($res["blocklist"]);
$message['role'] = $userData['role'];
}
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid"); $itemsPerPage = 15; // 1ページあたりのユーズ数
$rpQuery->bindValue(':rpuniqid', $message['uniqid']); $pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$rpQuery->execute(); $offset = ($pageNumber - 1) * $itemsPerPage;
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC);
if ($rpData){ $messages = array();
$message['reply_count'] = $rpData['reply_count'];
}
}
//adsystem------------------
$message['ads'] = "false"; if (!empty($pdo)) {
$today = date("Y-m-d H:i:s"); $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,
));
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()"); $userQuery = $dbh->prepare("SELECT username, userid, profile, role, follower FROM account WHERE userid = :userid");
$adsQuery->bindValue(':today', $today); $userQuery->bindValue(':userid', $uwuzuid);
$adsQuery->execute(); $userQuery->execute();
$adsresult = $adsQuery->fetch(); $userData = $userQuery->fetch();
if(!(empty($adsresult))){
$message['ads'] = "true";
$message['ads_url'] = $adsresult["url"];
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){ $messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE favorite LIKE :userid ORDER BY datetime DESC LIMIT $offset, $itemsPerPage");
foreach ($messages as $value) { $messageQuery->bindValue(':userid', '%,' . $uwuzuid . '%', PDO::PARAM_STR);
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) {
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数 $messageQuery->execute();
$message_array = $messageQuery->fetchAll();
// コンマで区切って配列に分割し、要素数を数える $messages = array();
$favIds = explode(',', $fav); foreach ($message_array as $row) {
$value["favcnt"] = count($favIds)-1; $messages[] = $row;
}
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) {
$message['iconname'] = $userData['iconname'];
$message['headname'] = $userData['headname'];
$message['username'] = $userData['username'];
$message['sacinfo'] = $userData['sacinfo'];
$message['role'] = $userData['role'];
}
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid");
$rpQuery->bindValue(':rpuniqid', $message['uniqid']);
$rpQuery->execute();
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC);
if ($rpData){
$message['reply_count'] = $rpData['reply_count'];
}
}
//adsystem------------------
$message['ads'] = "false";
$today = date("Y-m-d H:i:s");
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()");
$adsQuery->bindValue(':today', $today);
$adsQuery->execute();
$adsresult = $adsQuery->fetch();
if(!(empty($adsresult))){
$message['ads'] = "true";
$message['ads_url'] = $adsresult["url"];
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){
foreach ($messages as $value) {
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) {
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid);
$messageDisplay->display();
}
}
if($message['ads'] === "true"){
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
}
}else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
}
$pdo = null;
$messageDisplay = new MessageDisplay($value, $userid);
$messageDisplay->display();
} }
} }else{
if($message['ads'] === "true"){ echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
} }
}else{ }else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>'; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
}else{
$pdo = null; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
?> ?>
+117 -90
View File
@@ -25,116 +25,143 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$userid = htmlentities($_GET['userid']);
$loginid = htmlentities($_GET['account_id']);
$uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : ''; // データベース接続の設定
$userid = htmlentities($_GET['userid']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]);
$itemsPerPage = 15; // 1ページあたりのユーズ数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array();
if (!empty($pdo)) {
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array( $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_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
)); ));
$userQuery = $dbh->prepare("SELECT username, userid, profile, role, follower FROM account WHERE userid = :userid"); $query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
$userQuery->bindValue(':userid', $uwuzuid);
$userQuery->execute();
$userData = $userQuery->fetch();
$messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE account = :userid AND rpuniqid = '' AND ( $query->execute(array(':userid' => $userid));
(photo1 IS NOT NULL AND photo1 != '' AND photo1 != 'none') OR
(photo2 IS NOT NULL AND photo2 != '' AND photo2 != 'none') OR
(photo3 IS NOT NULL AND photo3 != '' AND photo3 != 'none') OR
(photo4 IS NOT NULL AND photo4 != '' AND photo4 != 'none') OR
(video1 IS NOT NULL AND video1 != '' AND video1 != 'none')
) ORDER BY datetime DESC LIMIT $offset, $itemsPerPage");
$messageQuery->bindValue(':userid', $uwuzuid); $result2 = $query->fetch();
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
$messages = array(); if(!(empty($result2["loginid"]))){
foreach ($message_array as $row) { if($result2["loginid"] === $loginid){
$messages[] = $row; $uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
} $userid = htmlentities($_GET['userid']);
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) { $aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$message['iconname'] = $userData['iconname']; $aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$message['headname'] = $userData['headname']; $aduserinfoQuery->execute();
$message['username'] = $userData['username']; $res = $aduserinfoQuery->fetch();
$message['sacinfo'] = $userData['sacinfo']; $myblocklist = htmlentities($res["blocklist"]);
$message['role'] = $userData['role'];
}
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid"); $itemsPerPage = 15; // 1ページあたりのユーズ数
$rpQuery->bindValue(':rpuniqid', $message['uniqid']); $pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$rpQuery->execute(); $offset = ($pageNumber - 1) * $itemsPerPage;
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC);
if ($rpData){ $messages = array();
$message['reply_count'] = $rpData['reply_count'];
}
}
//adsystem------------------ if (!empty($pdo)) {
$message['ads'] = "false"; $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,
));
$today = date("Y-m-d H:i:s"); $userQuery = $dbh->prepare("SELECT username, userid, profile, role, follower FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $uwuzuid);
$userQuery->execute();
$userData = $userQuery->fetch();
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()"); $messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE account = :userid AND rpuniqid = '' AND (
$adsQuery->bindValue(':today', $today); (photo1 IS NOT NULL AND photo1 != '' AND photo1 != 'none') OR
$adsQuery->execute(); (photo2 IS NOT NULL AND photo2 != '' AND photo2 != 'none') OR
$adsresult = $adsQuery->fetch(); (photo3 IS NOT NULL AND photo3 != '' AND photo3 != 'none') OR
if(!(empty($adsresult))){ (photo4 IS NOT NULL AND photo4 != '' AND photo4 != 'none') OR
$message['ads'] = "true"; (video1 IS NOT NULL AND video1 != '' AND video1 != 'none')
$message['ads_url'] = $adsresult["url"]; ) ORDER BY datetime DESC LIMIT $offset, $itemsPerPage");
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){ $messageQuery->bindValue(':userid', $uwuzuid);
foreach ($messages as $value) { $messageQuery->execute();
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) { $message_array = $messageQuery->fetchAll();
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える $messages = array();
$favIds = explode(',', $fav); foreach ($message_array as $row) {
$value["favcnt"] = count($favIds)-1; $messages[] = $row;
}
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) {
$message['iconname'] = $userData['iconname'];
$message['headname'] = $userData['headname'];
$message['username'] = $userData['username'];
$message['sacinfo'] = $userData['sacinfo'];
$message['role'] = $userData['role'];
}
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid");
$rpQuery->bindValue(':rpuniqid', $message['uniqid']);
$rpQuery->execute();
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC);
if ($rpData){
$message['reply_count'] = $rpData['reply_count'];
}
}
//adsystem------------------
$message['ads'] = "false";
$today = date("Y-m-d H:i:s");
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()");
$adsQuery->bindValue(':today', $today);
$adsQuery->execute();
$adsresult = $adsQuery->fetch();
if(!(empty($adsresult))){
$message['ads'] = "true";
$message['ads_url'] = $adsresult["url"];
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){
foreach ($messages as $value) {
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) {
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid);
$messageDisplay->display();
}
}
if($message['ads'] === "true"){
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
}
}else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
}
$pdo = null;
$messageDisplay = new MessageDisplay($value, $userid);
$messageDisplay->display();
} }
} }else{
if($message['ads'] === "true"){ echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
} }
}else{ }else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>'; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
}else{
$pdo = null; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
?> ?>
+111 -84
View File
@@ -25,109 +25,136 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$userid = htmlentities($_GET['userid']);
$loginid = htmlentities($_GET['account_id']);
$uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : ''; // データベース接続の設定
$userid = htmlentities($_GET['userid']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]);
$itemsPerPage = 15; // 1ページあたりのユーズ数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array();
if (!empty($pdo)) {
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array( $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_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
)); ));
$userQuery = $dbh->prepare("SELECT username, userid, profile, role, follower FROM account WHERE userid = :userid"); $query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
$userQuery->bindValue(':userid', $uwuzuid);
$userQuery->execute();
$userData = $userQuery->fetch();
$messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE account = :userid AND rpuniqid = ''ORDER BY datetime DESC LIMIT $offset, $itemsPerPage"); $query->execute(array(':userid' => $userid));
$messageQuery->bindValue(':userid', $uwuzuid);
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
$messages = array(); $result2 = $query->fetch();
foreach ($message_array as $row) {
$messages[] = $row;
}
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) { if(!(empty($result2["loginid"]))){
$message['iconname'] = $userData['iconname']; if($result2["loginid"] === $loginid){
$message['headname'] = $userData['headname']; $uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
$message['username'] = $userData['username']; $userid = htmlentities($_GET['userid']);
$message['sacinfo'] = $userData['sacinfo'];
$message['role'] = $userData['role'];
}
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid"); $aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$rpQuery->bindValue(':rpuniqid', $message['uniqid']); $aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$rpQuery->execute(); $aduserinfoQuery->execute();
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC); $res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]);
if ($rpData){ $itemsPerPage = 15; // 1ページあたりのユーズ数
$message['reply_count'] = $rpData['reply_count']; $pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
} $offset = ($pageNumber - 1) * $itemsPerPage;
}
//adsystem------------------ $messages = array();
$message['ads'] = "false"; if (!empty($pdo)) {
$today = date("Y-m-d H:i:s"); $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,
));
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()"); $userQuery = $dbh->prepare("SELECT username, userid, profile, role, follower FROM account WHERE userid = :userid");
$adsQuery->bindValue(':today', $today); $userQuery->bindValue(':userid', $uwuzuid);
$adsQuery->execute(); $userQuery->execute();
$adsresult = $adsQuery->fetch(); $userData = $userQuery->fetch();
if(!(empty($adsresult))){
$message['ads'] = "true";
$message['ads_url'] = $adsresult["url"];
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){ $messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE account = :userid AND rpuniqid = ''ORDER BY datetime DESC LIMIT $offset, $itemsPerPage");
foreach ($messages as $value) { $messageQuery->bindValue(':userid', $uwuzuid);
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) { $messageQuery->execute();
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数 $message_array = $messageQuery->fetchAll();
// コンマで区切って配列に分割し、要素数を数える $messages = array();
$favIds = explode(',', $fav); foreach ($message_array as $row) {
$value["favcnt"] = count($favIds)-1; $messages[] = $row;
}
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) {
$message['iconname'] = $userData['iconname'];
$message['headname'] = $userData['headname'];
$message['username'] = $userData['username'];
$message['sacinfo'] = $userData['sacinfo'];
$message['role'] = $userData['role'];
}
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid");
$rpQuery->bindValue(':rpuniqid', $message['uniqid']);
$rpQuery->execute();
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC);
if ($rpData){
$message['reply_count'] = $rpData['reply_count'];
}
}
//adsystem------------------
$message['ads'] = "false";
$today = date("Y-m-d H:i:s");
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()");
$adsQuery->bindValue(':today', $today);
$adsQuery->execute();
$adsresult = $adsQuery->fetch();
if(!(empty($adsresult))){
$message['ads'] = "true";
$message['ads_url'] = $adsresult["url"];
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){
foreach ($messages as $value) {
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) {
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid);
$messageDisplay->display();
}
}
if($message['ads'] === "true"){
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
}
}else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
}
$pdo = null;
$messageDisplay = new MessageDisplay($value, $userid);
$messageDisplay->display();
} }
} }else{
if($message['ads'] === "true"){ echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
} }
}else{ }else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>'; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
}else{
$pdo = null; echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
} }
?> ?>
+64 -15
View File
@@ -17,14 +17,53 @@ function processMarkdownAndWrapEmptyLines($markdownText){
return $markdownText; return $markdownText;
} }
//Profile
// ユーズ内の絵文字を画像に置き換える function replaceProfileEmojiImages($postText) {
// プロフィール名で絵文字名(:emoji:)を検出して画像に置き換える
$emojiPattern = '/:(\w+):/';
$postTextWithImages = preg_replace_callback($emojiPattern, function($matches) {
$emojiName = $matches[1];
//絵文字path取得
$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,
));
$emoji_Query = $dbh->prepare("SELECT emojifile, emojiname FROM emoji WHERE emojiname = :emojiname");
$emoji_Query->bindValue(':emojiname', $emojiName);
$emoji_Query->execute();
$emoji_row = $emoji_Query->fetch();
if(empty($emoji_row["emojifile"])){
$emoji_path = "img/sysimage/errorimage/emoji_404.png";
}else{
$emoji_path = $emoji_row["emojifile"];
}
return "<img src='../".$emoji_path."' alt=':$emojiName:' title=':$emojiName:'>";
}, $postText);
return $postTextWithImages;
}
// ユーズ内の絵文字やhashtagを画像に置き換える
function replaceEmojisWithImages($postText) { function replaceEmojisWithImages($postText) {
// ユーズ内で絵文字名(:emoji:)を検出して画像に置き換える // ユーズ内で絵文字名(:emoji:)を検出して画像に置き換える
$emojiPattern = '/:(\w+):/'; $emojiPattern = '/:(\w+):/';
$postTextWithImages = preg_replace_callback($emojiPattern, function($matches) { $postTextWithImages = preg_replace_callback($emojiPattern, function($matches) {
$emojiName = $matches[1]; $emojiName = $matches[1];
return "<img src='../emoji/emojiimage.php?emoji=" . urlencode($emojiName) . "' alt=':$emojiName:' title=':$emojiName:'>"; //絵文字path取得
$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,
));
$emoji_Query = $dbh->prepare("SELECT emojifile, emojiname FROM emoji WHERE emojiname = :emojiname");
$emoji_Query->bindValue(':emojiname', $emojiName);
$emoji_Query->execute();
$emoji_row = $emoji_Query->fetch();
if(empty($emoji_row["emojifile"])){
$emoji_path = "img/sysimage/errorimage/emoji_404.png";
}else{
$emoji_path = $emoji_row["emojifile"];
}
return "<img src='../".$emoji_path."' alt=':$emojiName:' title=':$emojiName:'>";
}, $postText); }, $postText);
// @username を検出してリンクに置き換える // @username を検出してリンクに置き換える
@@ -73,7 +112,17 @@ function replaceURLsWithLinks($postText) {
if (!isset($parsedUrl['path'])) { if (!isset($parsedUrl['path'])) {
$parsedUrl['path'] = ''; $parsedUrl['path'] = '';
} }
$domain = $parsedUrl['host'].(strlen($parsedUrl['path']) > 24 ? substr($parsedUrl['path'], 0, 24) . '...' : $parsedUrl['path']); if (!isset($parsedUrl['query'])) {
$parsedUrl['query'] = '';
}
$nochk_domain = $parsedUrl['host'].$parsedUrl['path'].$parsedUrl['query'];
if(strlen($nochk_domain) > 47){
$domain = mb_substr($nochk_domain, 0, 48, "UTF-8")."...";
}else{
$domain = $nochk_domain;
}
// 不要な文字を削除してaタグを生成 // 不要な文字を削除してaタグを生成
$urlWithoutSpaces = preg_replace('/\s+/', '', $url); $urlWithoutSpaces = preg_replace('/\s+/', '', $url);
@@ -169,7 +218,7 @@ class MessageDisplay {
echo ' <div class="flebox">'; echo ' <div class="flebox">';
echo ' <a href="/@' . htmlentities($this->value['account']) . '"><img src="'. htmlentities('../'.$this->value['iconname']) . '"></a>'; echo ' <a href="/@' . htmlentities($this->value['account']) . '"><img src="'. htmlentities('../'.$this->value['iconname']) . '"></a>';
echo ' <a href="/@' . htmlentities($this->value['account']) . '">' . htmlentities($this->value['username']) . '</a>'; echo ' <a href="/@' . htmlentities($this->value['account']) . '"><div class="u_name">' . replaceProfileEmojiImages(htmlentities($this->value['username'])) . '</div></a>';
echo ' <div class="idbox">'; echo ' <div class="idbox">';
echo ' <a href="/@' . htmlentities($this->value['account']) . '">@' . htmlentities($this->value['account']) . '</a>'; echo ' <a href="/@' . htmlentities($this->value['account']) . '">@' . htmlentities($this->value['account']) . '</a>';
echo ' </div>'; echo ' </div>';
@@ -219,27 +268,27 @@ class MessageDisplay {
if (!empty($this->value['photo4']) && $this->value['photo4'] !== 'none') { if (!empty($this->value['photo4']) && $this->value['photo4'] !== 'none') {
echo ' <div class="photo4">'; echo ' <div class="photo4">';
echo ' <a href="'.htmlentities($this->value['photo1']).'" target=”_blank”><img src="'.htmlentities($this->value['photo1']).'" alt="画像1" title="画像1"></a>'; echo ' <a href="'.htmlentities($this->value['photo1']).'" target=”_blank”><img src="'.htmlentities($this->value['photo1']).'" alt="画像1" title="画像1" onerror="this.onerror=null;this.src=\'../img/sysimage/errorimage/image_404.png\'"></a>';
echo ' <a href="'.htmlentities($this->value['photo2']).'" target=”_blank”><img src="'.htmlentities($this->value['photo2']).'" alt="画像2" title="画像2"></a>'; echo ' <a href="'.htmlentities($this->value['photo2']).'" target=”_blank”><img src="'.htmlentities($this->value['photo2']).'" alt="画像2" title="画像2" onerror="this.onerror=null;this.src=\'../img/sysimage/errorimage/image_404.png\'"></a>';
echo ' <a href="'.htmlentities($this->value['photo3']).'" target=”_blank”><img src="'.htmlentities($this->value['photo3']).'" alt="画像3" title="画像3"></a>'; echo ' <a href="'.htmlentities($this->value['photo3']).'" target=”_blank”><img src="'.htmlentities($this->value['photo3']).'" alt="画像3" title="画像3" onerror="this.onerror=null;this.src=\'../img/sysimage/errorimage/image_404.png\'"></a>';
echo ' <a href="'.htmlentities($this->value['photo4']).'" target=”_blank”><img src="'.htmlentities($this->value['photo4']).'" alt="画像4" title="画像4"></a>'; echo ' <a href="'.htmlentities($this->value['photo4']).'" target=”_blank”><img src="'.htmlentities($this->value['photo4']).'" alt="画像4" title="画像4" onerror="this.onerror=null;this.src=\'../img/sysimage/errorimage/image_404.png\'"></a>';
echo ' </div>'; echo ' </div>';
} elseif (!empty($this->value['photo3']) && $this->value['photo3'] !== 'none') { } elseif (!empty($this->value['photo3']) && $this->value['photo3'] !== 'none') {
echo ' <div class="photo3">'; echo ' <div class="photo3">';
echo ' <a href="'.htmlentities($this->value['photo1']).'" target=”_blank”><img src="'.htmlentities($this->value['photo1']).'" alt="画像1" title="画像1"></a>'; echo ' <a href="'.htmlentities($this->value['photo1']).'" target=”_blank”><img src="'.htmlentities($this->value['photo1']).'" alt="画像1" title="画像1" onerror="this.onerror=null;this.src=\'../img/sysimage/errorimage/image_404.png\'"></a>';
echo ' <a href="'.htmlentities($this->value['photo2']).'" target=”_blank”><img src="'.htmlentities($this->value['photo2']).'" alt="画像2" title="画像2"></a>'; echo ' <a href="'.htmlentities($this->value['photo2']).'" target=”_blank”><img src="'.htmlentities($this->value['photo2']).'" alt="画像2" title="画像2" onerror="this.onerror=null;this.src=\'../img/sysimage/errorimage/image_404.png\'"></a>';
echo ' <div class="photo3_btm">'; echo ' <div class="photo3_btm">';
echo ' <a href="'.htmlentities($this->value['photo3']).'" target=”_blank”><img src="'.htmlentities($this->value['photo3']).'" alt="画像3" title="画像3"></a>'; echo ' <a href="'.htmlentities($this->value['photo3']).'" target=”_blank”><img src="'.htmlentities($this->value['photo3']).'" alt="画像3" title="画像3" onerror="this.onerror=null;this.src=\'../img/sysimage/errorimage/image_404.png\'"></a>';
echo ' </div>'; echo ' </div>';
echo ' </div>'; echo ' </div>';
} elseif (!empty($this->value['photo2']) && $this->value['photo2'] !== 'none') { } elseif (!empty($this->value['photo2']) && $this->value['photo2'] !== 'none') {
echo ' <div class="photo2">'; echo ' <div class="photo2">';
echo ' <a href="'.htmlentities($this->value['photo1']).'" target=”_blank”><img src="'.htmlentities($this->value['photo1']).'" alt="画像1" title="画像1"></a>'; echo ' <a href="'.htmlentities($this->value['photo1']).'" target=”_blank”><img src="'.htmlentities($this->value['photo1']).'" alt="画像1" title="画像1" onerror="this.onerror=null;this.src=\'../img/sysimage/errorimage/image_404.png\'"></a>';
echo ' <a href="'.htmlentities($this->value['photo2']).'" target=”_blank”><img src="'.htmlentities($this->value['photo2']).'" alt="画像2" title="画像2"></a>'; echo ' <a href="'.htmlentities($this->value['photo2']).'" target=”_blank”><img src="'.htmlentities($this->value['photo2']).'" alt="画像2" title="画像2" onerror="this.onerror=null;this.src=\'../img/sysimage/errorimage/image_404.png\'"></a>';
echo ' </div>'; echo ' </div>';
} elseif (!empty($this->value['photo1']) && $this->value['photo1'] !== 'none') { } elseif (!empty($this->value['photo1']) && $this->value['photo1'] !== 'none') {
echo ' <div class="photo1">'; echo ' <div class="photo1">';
echo ' <a href="'.htmlentities($this->value['photo1']).'" target=”_blank”><img src="'.htmlentities($this->value['photo1']).'" alt="画像1" title="画像1"></a>'; echo ' <a href="'.htmlentities($this->value['photo1']).'" target=”_blank”><img src="'.htmlentities($this->value['photo1']).'" alt="画像1" title="画像1" onerror="this.onerror=null;this.src=\'../img/sysimage/errorimage/image_404.png\'"></a>';
echo ' </div>'; echo ' </div>';
} }
if (!empty($this->value['video1']) && $this->value['video1'] !== 'none') { if (!empty($this->value['video1']) && $this->value['video1'] !== 'none') {
+3 -2
View File
@@ -1,6 +1,7 @@
<?php <?php
$activitypub_file = "../../server/activitypub.txt"; $serversettings_file = "../server/serversettings.ini";
if(file_get_contents($activitypub_file) === "true"){ $serversettings = parse_ini_file($serversettings_file, true);
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/json; charset=utf-8"); header("Content-Type: application/json; charset=utf-8");
$mojisizefile = "../../server/textsize.txt"; $mojisizefile = "../../server/textsize.txt";
+27 -8
View File
@@ -1,6 +1,8 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000); $hashCreateTime = $sec.floor($msec*1000000);
@@ -24,6 +26,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -41,7 +44,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -50,7 +53,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -67,21 +70,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -98,7 +109,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -115,21 +126,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -271,14 +290,14 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>お知らせ配信 - <?php echo file_get_contents($servernamefile);?></title> <title>お知らせ配信 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+29 -10
View File
@@ -1,6 +1,8 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
@@ -25,9 +27,9 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
try { try {
$option = array( $option = array(
@@ -42,7 +44,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -51,7 +53,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -68,21 +70,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -99,7 +109,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -116,21 +126,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -169,13 +187,13 @@ $pdo = null;
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>通知 - <?php echo file_get_contents($servernamefile);?></title> <title>通知 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -223,10 +241,11 @@ $(document).ready(function() {
isLoading = true; isLoading = true;
$("#loading").show(); $("#loading").show();
var userid = '<?php echo $userid; ?>'; var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
$.ajax({ $.ajax({
url: '../nextpage/notification.php', // PHPファイルへのパス url: '../nextpage/notification.php', // PHPファイルへのパス
method: 'GET', method: 'GET',
data: { page: pageNumber, userid: userid }, data: { page: pageNumber, userid: userid , account_id: account_id },
dataType: 'html', dataType: 'html',
success: function(response) { success: function(response) {
$('#postContainer').append(response); $('#postContainer').append(response);
+34 -23
View File
@@ -4,8 +4,10 @@ function random_token($length = 64)
{ {
return substr(str_shuffle('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, $length); return substr(str_shuffle('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, $length);
} }
$domain = $_SERVER['HTTP_HOST'];
$serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$servernamefile = "../server/servername.txt";
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000); $hashCreateTime = $sec.floor($msec*1000000);
@@ -29,17 +31,10 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
// 管理者としてログインしているか確認
if( empty($_SESSION['admin_login']) || $_SESSION['admin_login'] !== true ) {
// ログインページへリダイレクト
header("Location: ../login.php");
exit;
}
try { try {
$option = array( $option = array(
@@ -54,7 +49,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -63,7 +58,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -80,21 +75,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -111,7 +114,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -128,21 +131,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -476,14 +487,14 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>その他の項目 - <?php echo file_get_contents($servernamefile);?></title> <title>その他の項目 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -521,29 +532,29 @@ require('../logout/logout.php');
<p>APIの簡単な使用法です。</p> <p>APIの簡単な使用法です。</p>
<hr> <hr>
<li>サーバー情報取得API</li> <li>サーバー情報取得API</li>
<p>https://[ドメイン名(uwuzu.netなど)]/api/serverinfo-api</p> <p>https://<?php echo htmlspecialchars($domain, ENT_QUOTES, 'UTF-8');?>/api/serverinfo-api</p>
<p>これによりサーバーの各種情報を取得できます。</p> <p>これによりサーバーの各種情報を取得できます。</p>
<hr> <hr>
<li>ユーザー情報取得API</li> <li>ユーザー情報取得API</li>
<p>https://[ドメイン名(uwuzu.netなど)]/api/userdata-api?userid=[ユーザーID]</p> <p>https://<?php echo htmlspecialchars($domain, ENT_QUOTES, 'UTF-8');?>/api/userdata-api?userid=[ユーザーID]</p>
<p>これによりユーザーのユーザーネーム(user_name)、プロフィール(profile)、登録日時(registered_date)、フォローしている人一覧(follow)、フォロワー一覧(follower)、フォロー・フォロワー数(follow_cnt,follower_cnt)が取得できます。</p> <p>これによりユーザーのユーザーネーム(user_name)、プロフィール(profile)、登録日時(registered_date)、フォローしている人一覧(follow)、フォロワー一覧(follower)、フォロー・フォロワー数(follow_cnt,follower_cnt)が取得できます。</p>
<hr> <hr>
<li>単独投稿取得API</li> <li>単独投稿取得API</li>
<p>https://[ドメイン名(uwuzu.netなど)]/api/ueuse-api?ueuseid=[投稿の詳細ページのリンクより投稿のID(!より後、~より手前の文字列)]</p> <p>https://<?php echo htmlspecialchars($domain, ENT_QUOTES, 'UTF-8');?>/api/ueuse-api?ueuseid=[投稿の詳細ページのリンクより投稿のID(!より後、~より手前の文字列)]</p>
<p>これにより投稿内容(ueuse)と、ユーザーネーム(user_name)、ユーザーID(userid)、投稿ID(uniqid)、写真・動画URL(photo1,photo2,video1)、いいねした人一覧(favorite)、いいね数(favorite_cnt)、投稿日時(datetime)、追記内容(abi)、追記日時(abidatetime)が取得できます。</p> <p>これにより投稿内容(ueuse)と、ユーザーネーム(user_name)、ユーザーID(userid)、投稿ID(uniqid)、写真・動画URL(photo1,photo2,video1)、いいねした人一覧(favorite)、いいね数(favorite_cnt)、投稿日時(datetime)、追記内容(abi)、追記日時(abidatetime)が取得できます。</p>
<hr> <hr>
<li>ローカルタイムライン投稿取得API</li> <li>ローカルタイムライン投稿取得API</li>
<p>https://[ドメイン名(uwuzu.netなど)]/api/ltl-api?limit=[取得件数]&page=[ページ切り替え]</p> <p>https://<?php echo htmlspecialchars($domain, ENT_QUOTES, 'UTF-8');?>/api/ltl-api?limit=[取得件数]&page=[ページ切り替え]</p>
<p>これにより投稿内容(ueuse)と、ユーザーネーム(user_name)、ユーザーID(userid)、投稿ID(uniqid)、写真・動画URL(photo1,photo2,video1)、いいねした人一覧(favorite)、いいね数(favorite_cnt)、投稿日時(datetime)、追記内容(abi)、追記日時(abidatetime)が取得できます。<br>page=は指定しなくても動作します。(https://[ドメイン名(uwuzu.netなど)]/api/ltl-api?limit=[取得件数])</p> <p>これにより投稿内容(ueuse)と、ユーザーネーム(user_name)、ユーザーID(userid)、投稿ID(uniqid)、写真・動画URL(photo1,photo2,video1)、いいねした人一覧(favorite)、いいね数(favorite_cnt)、投稿日時(datetime)、追記内容(abi)、追記日時(abidatetime)が取得できます。<br>page=は指定しなくても動作します。(https://[ドメイン名(uwuzu.netなど)]/api/ltl-api?limit=[取得件数])</p>
<hr> <hr>
<li>投稿API</li> <li>投稿API</li>
<p>https://[ドメイン名(uwuzu.netなど)]/api/bot-api?token=[アクセストークン]&type=post&ueuse=[投稿の内容]</p> <p>https://<?php echo htmlspecialchars($domain, ENT_QUOTES, 'UTF-8');?>/api/bot-api?token=[アクセストークン]&type=post&ueuse=[投稿の内容]</p>
<hr> <hr>
<li>アクセストークンからユーザー情報取得API</li> <li>アクセストークンからユーザー情報取得API</li>
<p>https://[ドメイン名(uwuzu.netなど)]/api/bot-api?token=[アクセストークン]&type=getuser</p> <p>https://<?php echo htmlspecialchars($domain, ENT_QUOTES, 'UTF-8');?>/api/bot-api?token=[アクセストークン]&type=getuser</p>
<hr> <hr>
<li>返信API</li> <li>返信API</li>
<p>https://[ドメイン名(uwuzu.netなど)]/api/bot-api?token=[アクセストークン]&type=reply&uniqid=[返信先のuniqid]&ueuse=[返信の内容]</p> <p>https://<?php echo htmlspecialchars($domain, ENT_QUOTES, 'UTF-8');?>/api/bot-api?token=[アクセストークン]&type=reply&uniqid=[返信先のuniqid]&ueuse=[返信の内容]</p>
<hr> <hr>
<?php <?php
if(empty($userData['token'])){ if(empty($userData['token'])){
+26 -12
View File
@@ -1,14 +1,12 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
require('../db.php'); require('../db.php');
$onlyuserfile = "../server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -41,7 +39,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -50,7 +48,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -67,21 +65,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -98,7 +104,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -115,21 +121,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -165,13 +179,13 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>アクセストークン発行完了 - <?php echo file_get_contents($servernamefile);?></title> <title>アクセストークン発行完了 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+7 -13
View File
@@ -1,13 +1,7 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverlogofile = "../server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@@ -15,12 +9,12 @@ for( $i=0;$i<$cnt;$i++ ){
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>残念なお知らせ - <?php echo file_get_contents($servernamefile);?></title> <title>残念なお知らせ - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<script src="back.js"></script> <script src="back.js"></script>
@@ -29,9 +23,9 @@ for( $i=0;$i<$cnt;$i++ ){
<div class="leftbox2"> <div class="leftbox2">
<?php if(!empty(htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8'))){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
+7 -13
View File
@@ -1,13 +1,7 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverlogofile = "../server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@@ -15,12 +9,12 @@ for( $i=0;$i<$cnt;$i++ ){
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>パスワード変更完了 - <?php echo file_get_contents($servernamefile);?></title> <title>パスワード変更完了 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<script src="back.js"></script> <script src="back.js"></script>
@@ -29,9 +23,9 @@ for( $i=0;$i<$cnt;$i++ ){
<div class="leftbox2"> <div class="leftbox2">
<?php if(!empty(htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8'))){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
+8 -13
View File
@@ -1,14 +1,8 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverlogofile = "../server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
require('../db.php'); require('../db.php');
@@ -35,6 +29,7 @@ $password = null;
$_SESSION["password"]=""; $_SESSION["password"]="";
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
// データベースに接続 // データベースに接続
try { try {
@@ -141,21 +136,21 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>パスワードの復元 - <?php echo file_get_contents($servernamefile);?></title> <title>パスワードの復元 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<script src="back.js"></script> <script src="back.js"></script>
<body> <body>
<div class="leftbox"> <div class="leftbox">
<?php if(!empty(htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8'))){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
+8 -13
View File
@@ -1,14 +1,8 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverlogofile = "../server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
require('../db.php'); require('../db.php');
@@ -35,6 +29,7 @@ $password = null;
$_SESSION["password"]=""; $_SESSION["password"]="";
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
$userid = $_SESSION['userid']; $userid = $_SESSION['userid'];
@@ -238,21 +233,21 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>ログイン - <?php echo file_get_contents($servernamefile);?></title> <title>ログイン - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<script src="back.js"></script> <script src="back.js"></script>
<body> <body>
<div class="leftbox"> <div class="leftbox">
<?php if(!empty(htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8'))){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
-1
View File
@@ -16,7 +16,6 @@
<div class="modal-content"> <div class="modal-content">
<p>メニュー</p> <p>メニュー</p>
<div class="bot_menu_area"> <div class="bot_menu_area">
<a href="/others" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/others.svg#others"></use></svg><div>その他</div></a>
<a href="/emoji" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/emoji.svg#emoji"></use></svg><div>絵文字</div></a> <a href="/emoji" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/emoji.svg#emoji"></use></svg><div>絵文字</div></a>
<a href="/@<?php echo $userid; ?>" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/profile.svg#profile"></use></svg><div>プロフィール</div></a> <a href="/@<?php echo $userid; ?>" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/profile.svg#profile"></use></svg><div>プロフィール</div></a>
<a href="/settings" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/settings.svg#settings"></use></svg><div>設定</div></a> <a href="/settings" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/settings.svg#settings"></use></svg><div>設定</div></a>
+4 -9
View File
@@ -1,16 +1,11 @@
<?php <?php
$serverlogofile = "../server/serverlogo.txt"; $serversettings_file = "../server/serversettings.ini";
$serverlogodata = file_get_contents($serverlogofile); $serversettings = parse_ini_file($serversettings_file, true);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
?> ?>
<div class="userleftbox"> <div class="userleftbox">
<?php if(!empty($serverlogo_link[0])){ ?> <?php if(!empty($serversettings["serverinfo"]["server_logo_home"])){ ?>
<div class="logo"> <div class="logo">
<img src=<?php echo htmlspecialchars($serverlogo_link[0], ENT_QUOTES, 'UTF-8');?>> <img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_home"], ENT_QUOTES, 'UTF-8');?>>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
+33 -20
View File
@@ -2,7 +2,8 @@
<?php <?php
require('../notice/notice.php'); require('../notice/notice.php');
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
//------------------------------------- //-------------------------------------
@@ -19,28 +20,40 @@
$uwuzuinfo[$i] = ($softwaredata[$i]); $uwuzuinfo[$i] = ($softwaredata[$i]);
} }
function replaceURLsWithLinks_forRightbox($postText) { function replaceURLsWithLinks_forRightbox($postText) {
// URLを正規表現を使って検出 $postText = str_replace('&#039;', '\'', $postText);
$pattern = '/(https:\/\/[^\s<>\[\]\'"]+)/'; // 改良された正規表現
preg_match_all($pattern, $postText, $matches);
// 検出したURLごとに処理を行う // URLを正規表現を使って検出
foreach ($matches[0] as $url) { $pattern = '/(https:\/\/[^\s<>\[\]\'"]+)/'; // 改良された正規表現
// ドメイン部分を抽出 preg_match_all($pattern, $postText, $matches);
$parsedUrl = parse_url($url);
if (!isset($parsedUrl['path'])) {
$parsedUrl['path'] = '';
}
$domain = $parsedUrl['host'].(strlen($parsedUrl['path']) > 24 ? substr($parsedUrl['path'], 0, 24) . '...' : $parsedUrl['path']);
// 不要な文字を削除してaタグを生成 // 検出したURLごとに処理を行う
$urlWithoutSpaces = preg_replace('/\s+/', '', $url); foreach ($matches[0] as $url) {
$link = "<a href='$urlWithoutSpaces' target='_blank' title='$urlWithoutSpaces'>$domain</a>"; // ドメイン部分を抽出
$parsedUrl = parse_url($url);
if (!isset($parsedUrl['path'])) {
$parsedUrl['path'] = '';
}
if (!isset($parsedUrl['query'])) {
$parsedUrl['query'] = '';
}
// URLをドメインのみを表示するaタグで置き換え $nochk_domain = $parsedUrl['host'].$parsedUrl['path'].$parsedUrl['query'];
$postText = preg_replace('/' . preg_quote($url, '/') . '/', $link, $postText);
}
return $postText; if(strlen($nochk_domain) > 47){
$domain = mb_substr($nochk_domain, 0, 48, "UTF-8")."...";
}else{
$domain = $nochk_domain;
}
// 不要な文字を削除してaタグを生成
$urlWithoutSpaces = preg_replace('/\s+/', '', $url);
$link = "<a href='$urlWithoutSpaces' target='_blank' title='$urlWithoutSpaces'>$domain</a>";
// URLをドメインのみを表示するaタグで置き換え
$postText = preg_replace('/' . preg_quote($url, '/') . '/', $link, $postText);
}
return $postText;
} }
?> ?>
<div class="noticearea"> <div class="noticearea">
@@ -65,7 +78,7 @@
<div class="btmbox"> <div class="btmbox">
<h1>サーバー情報</h1> <h1>サーバー情報</h1>
<h2>Server</h2> <h2>Server</h2>
<h3><?php echo file_get_contents($servernamefile);?></h3> <h3><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></h3>
<p><?php echo $domain;?></p> <p><?php echo $domain;?></p>
<a href="/rule/terms">利用規約</a><a href="/rule/privacypolicy">プライバシーポリシー</a><a href="/rule/serverabout">詳細</a> <a href="/rule/terms">利用規約</a><a href="/rule/privacypolicy">プライバシーポリシー</a><a href="/rule/serverabout">詳細</a>
<h2>Software</h2> <h2>Software</h2>
+10 -19
View File
@@ -1,15 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<?php <?php
$serverlogofile = "../server/serverlogo.txt"; $serversettings_file = "../server/serversettings.ini";
$serverlogodata = file_get_contents($serverlogofile); $serversettings = parse_ini_file($serversettings_file, true);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
$servernamefile = "../server/servername.txt";
//------------------------------------- //-------------------------------------
@@ -17,8 +10,6 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "../server/contact.txt";
$privacypolicyfile = "../server/privacypolicy.txt"; $privacypolicyfile = "../server/privacypolicy.txt";
$privacypolicydata = file_get_contents($privacypolicyfile); $privacypolicydata = file_get_contents($privacypolicyfile);
@@ -59,21 +50,21 @@ foreach ($sprivacypolicy as $privacypolicy) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>プライバシーポリシー - <?php echo file_get_contents($servernamefile);?></title> <title>プライバシーポリシー - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<body> <body>
<div class="topbox"> <div class="topbox">
<?php if(!empty($serverlogo_link[1])){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
@@ -84,8 +75,8 @@ foreach ($sprivacypolicy as $privacypolicy) {
<div class="terms"> <div class="terms">
<h1><?php echo file_get_contents($servernamefile);?>プライバシーポリシー</h1> <h1><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>プライバシーポリシー</h1>
<div class="p3"><?php echo file_get_contents($servernamefile);?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<p><?php echo $htmltext;?></p> <p><?php echo $htmltext;?></p>
+9 -18
View File
@@ -1,15 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<?php <?php
$serverlogofile = "../server/serverlogo.txt"; $serversettings_file = "../server/serversettings.ini";
$serverlogodata = file_get_contents($serverlogofile); $serversettings = parse_ini_file($serversettings_file, true);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
$servernamefile = "../server/servername.txt";
//------------------------------------- //-------------------------------------
@@ -17,8 +10,6 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "../server/contact.txt";
$releasefile = "../server/uwuzurelease.txt"; $releasefile = "../server/uwuzurelease.txt";
$releasedata = file_get_contents($releasefile); $releasedata = file_get_contents($releasefile);
@@ -76,22 +67,22 @@ foreach ($srelease as $release) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title><?php echo $uwuzuinfo[0]?> リリースノート - <?php echo file_get_contents($servernamefile);?></title> <title><?php echo $uwuzuinfo[0]?> リリースノート - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<body> <body>
<div class="topbox"> <div class="topbox">
<?php if(!empty($serverlogo_link[1])){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
@@ -103,7 +94,7 @@ foreach ($srelease as $release) {
<div class="terms"> <div class="terms">
<h1><?php echo $uwuzuinfo[0]?>リリースノート</h1> <h1><?php echo $uwuzuinfo[0]?>リリースノート</h1>
<div class="p3"><?php echo file_get_contents($servernamefile);?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<div class="p3"><?php echo $uwuzuinfo[0];?></div> <div class="p3"><?php echo $uwuzuinfo[0];?></div>
<div class="p2c">Version : <?php echo $uwuzuinfo[1];?><br>Developer : <?php echo $uwuzuinfo[3];?><br>Last Update : <?php echo $uwuzuinfo[2];?></div> <div class="p2c">Version : <?php echo $uwuzuinfo[1];?><br>Developer : <?php echo $uwuzuinfo[3];?><br>Last Update : <?php echo $uwuzuinfo[2];?></div>
+14 -31
View File
@@ -7,25 +7,10 @@ require('../db.php');
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_start(); session_start();
$servericonfile = "../server/servericon.txt";
//------------------------- $serversettings_file = "../server/serversettings.ini";
$serverlogofile = "../server/serverlogo.txt"; $serversettings = parse_ini_file($serversettings_file, true);
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
$contactfile = "../server/contact.txt";
$adminfile = "../server/admininfo.txt";
$onlyuserfile = "../server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
$servernamefile = "../server/servername.txt";
//------------------------------------- //-------------------------------------
@@ -33,8 +18,6 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/uwuzuabout.txt"; $termsfile = "../server/uwuzuabout.txt";
$termsdata = file_get_contents($termsfile); $termsdata = file_get_contents($termsfile);
@@ -82,22 +65,22 @@ $count2 = $result2->num_rows;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>サーバー情報 - <?php echo file_get_contents($servernamefile);?></title> <title>サーバー情報 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<body> <body>
<div class="topbox"> <div class="topbox">
<?php if(!empty($serverlogo_link[1])){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
@@ -109,12 +92,12 @@ $count2 = $result2->num_rows;
<div class="terms"> <div class="terms">
<h1>サーバー情報</h1> <h1>サーバー情報</h1>
<?php if( !empty(file_get_contents($servericonfile)) ){ ?> <?php if( !empty(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8')) ){ ?>
<div class="servericon"> <div class="servericon">
<img src="<?php echo htmlspecialchars(file_get_contents($servericonfile), ENT_QUOTES, 'UTF-8'); ?>"> <img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
</div> </div>
<?php }?> <?php }?>
<div class="sp3"><?php echo file_get_contents($servernamefile);?></div> <div class="sp3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="sp2c"><?php echo $domain;?></div> <div class="sp2c"><?php echo $domain;?></div>
<hr> <hr>
<h4>説明</h4> <h4>説明</h4>
@@ -126,8 +109,8 @@ $count2 = $result2->num_rows;
<hr> <hr>
<h4>管理者情報</h4> <h4>管理者情報</h4>
<p>管理者名 : <?php echo htmlspecialchars(file_get_contents($adminfile), ENT_QUOTES, 'UTF-8');?></p> <p>管理者名 : <?php echo htmlspecialchars($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8');?></p>
<p>連絡用メールアドレス : <?php echo htmlspecialchars(file_get_contents($contactfile), ENT_QUOTES, 'UTF-8');?></p> <p>連絡用メールアドレス : <?php echo htmlspecialchars($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8');?></p>
<hr> <hr>
@@ -135,7 +118,7 @@ $count2 = $result2->num_rows;
<p>ユーザー数 : <?php echo $count1."<br>"?></p> <p>ユーザー数 : <?php echo $count1."<br>"?></p>
<p>投稿数 : <?php echo $count2."<br>"?></p> <p>投稿数 : <?php echo $count2."<br>"?></p>
<?php if($onlyuser =="true"){?> <?php if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') == "true"){?>
<hr> <hr>
<h4>注意</h4> <h4>注意</h4>
<p>このサーバーにアカウント登録するには招待コードが必要です。</p> <p>このサーバーにアカウント登録するには招待コードが必要です。</p>
+10 -19
View File
@@ -1,15 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<?php <?php
$serverlogofile = "../server/serverlogo.txt"; $serversettings_file = "../server/serversettings.ini";
$serverlogodata = file_get_contents($serverlogofile); $serversettings = parse_ini_file($serversettings_file, true);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
$servernamefile = "../server/servername.txt";
//------------------------------------- //-------------------------------------
@@ -17,8 +10,6 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt"; $termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile); $termsdata = file_get_contents($termsfile);
@@ -59,21 +50,21 @@ foreach ($sterms as $terms) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>利用規約 - <?php echo file_get_contents($servernamefile);?></title> <title>利用規約 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<body> <body>
<div class="topbox"> <div class="topbox">
<?php if(!empty($serverlogo_link[1])){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
@@ -84,8 +75,8 @@ foreach ($sterms as $terms) {
<div class="terms"> <div class="terms">
<h1><?php echo file_get_contents($servernamefile);?>利用規約</h1> <h1><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>利用規約</h1>
<div class="p3"><?php echo file_get_contents($servernamefile);?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<p><?php echo $htmltext;?></p> <p><?php echo $htmltext;?></p>
+9 -18
View File
@@ -1,15 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<?php <?php
$serverlogofile = "../server/serverlogo.txt"; $serversettings_file = "../server/serversettings.ini";
$serverlogodata = file_get_contents($serverlogofile); $serversettings = parse_ini_file($serversettings_file, true);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
$servernamefile = "../server/servername.txt";
//------------------------------------- //-------------------------------------
@@ -17,8 +10,6 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/uwuzuabout.txt"; $termsfile = "../server/uwuzuabout.txt";
$termsdata = file_get_contents($termsfile); $termsdata = file_get_contents($termsfile);
@@ -68,22 +59,22 @@ foreach ($sterms as $terms) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title><?php echo $uwuzuinfo[0]?>について - <?php echo file_get_contents($servernamefile);?></title> <title><?php echo $uwuzuinfo[0]?>について - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<body> <body>
<div class="topbox"> <div class="topbox">
<?php if(!empty($serverlogo_link[1])){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
@@ -95,7 +86,7 @@ foreach ($sterms as $terms) {
<div class="terms"> <div class="terms">
<h1><?php echo $uwuzuinfo[0]?>について</h1> <h1><?php echo $uwuzuinfo[0]?>について</h1>
<div class="p3"><?php echo file_get_contents($servernamefile);?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<div class="p3"><?php echo $uwuzuinfo[0];?></div> <div class="p3"><?php echo $uwuzuinfo[0];?></div>
<div class="p2c">Version : <?php echo $uwuzuinfo[1];?><br>Developer : <?php echo $uwuzuinfo[3];?><br>Last Update : <?php echo $uwuzuinfo[2];?></div> <div class="p2c">Version : <?php echo $uwuzuinfo[1];?><br>Developer : <?php echo $uwuzuinfo[3];?><br>Last Update : <?php echo $uwuzuinfo[2];?></div>
+29 -10
View File
@@ -1,5 +1,6 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
@@ -23,6 +24,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -42,7 +44,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -51,7 +53,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -68,21 +70,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -99,7 +109,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -116,21 +126,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -182,14 +200,14 @@ $pdo = null;
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/nsfw_event.js"></script> <script src="../js/nsfw_event.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<title>検索 - <?php echo file_get_contents($servernamefile);?></title> <title>検索 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -294,6 +312,7 @@ $(document).ready(function() {
var ueusetext = document.getElementById('ueusetext'); var ueusetext = document.getElementById('ueusetext');
var userid = '<?php echo $userid; ?>'; var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
var keyword = ueusetext.value; var keyword = ueusetext.value;
// 前回の検索結果をクリア // 前回の検索結果をクリア
@@ -303,7 +322,7 @@ $(document).ready(function() {
$.ajax({ $.ajax({
url: '../nextpage/searchpage.php', // PHPファイルへのパス url: '../nextpage/searchpage.php', // PHPファイルへのパス
method: 'GET', method: 'GET',
data: { keyword: keyword, userid: userid }, data: { keyword: keyword, userid: userid , account_id: account_id},
dataType: 'html', dataType: 'html',
timeout: 300000, timeout: 300000,
success: function(response) { success: function(response) {
+18
View File
@@ -0,0 +1,18 @@
;サーバーの基本情報
[serverinfo]
;サーバー名
server_name = "新規さば"
;サーバーアイコンのアドレス
server_icon = ""
;サーバーロゴのアドレス
server_logo_home = ""
server_logo_login = ""
;管理者関係
server_admin = "admin"
server_admin_mailadds = "admin@localhost"
;招待のオンオフ
server_invitation = "false"
;ActivityPubのオンオフ
server_activitypub = "false"
+5 -9
View File
@@ -36,6 +36,8 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
テーブルの中身は以下のとおりです。 テーブルの中身は以下のとおりです。
照合順序は全て標準でutf8mb4_general_ciです。 照合順序は全て標準でutf8mb4_general_ciです。
【追記】v1.2.28からSSLが必須項目になりました。localhostでアクセスする分には大丈夫ですが、他の端末からのアクセス時にはSSLの設定をしてください。
## 簡単に構築できるようSQLの構造ファイルがリリースに添付されています!そちらをインポートしていただけますと大幅に簡単に導入できます! ## 簡単に構築できるようSQLの構造ファイルがリリースに添付されています!そちらをインポートしていただけますと大幅に簡単に導入できます!
(userロールとofficialロールとiceロールの設定は別途必要です。お手数ですがそこの設定だけよろしくお願いいたします。) (userロールとofficialロールとiceロールの設定は別途必要です。お手数ですがそこの設定だけよろしくお願いいたします。)
@@ -61,9 +63,7 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
### emoji ### emoji
- sysid(INT)(AUTO_INCREMENT) アカウントが追加されるとカウントされるシステム用ID - sysid(INT)(AUTO_INCREMENT) アカウントが追加されるとカウントされるシステム用ID
- emojifile(varchar(512)) 絵文字ファイル保存用 - emojifile(varchar(512)) 絵文字ファイルパス保存用
- emojitype(varchar(256)) 絵文字拡張子保存用
- emojicontent(mediumblob) 絵文字画像保存用
- emojiname(varchar(512)) 「:emoji:」のような絵文字名保存用 - emojiname(varchar(512)) 「:emoji:」のような絵文字名保存用
- emojiinfo(text) 絵文字についての説明保存用 - emojiinfo(text) 絵文字についての説明保存用
- emojidate(datetime) 絵文字登録日時保存用 - emojidate(datetime) 絵文字登録日時保存用
@@ -145,18 +145,14 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
- 404imagepath.txt : 404ページに表示する画像パス保存用 - 404imagepath.txt : 404ページに表示する画像パス保存用
- 503imagepath.txt : 503ページに表示する画像パス保存用 - 503imagepath.txt : 503ページに表示する画像パス保存用
- activitypub.txt : ActivityPub機能のオンオフ(trueまたはfalse)
- admininfo.txt : 管理者名(てすとまる/@sampledayo)
- banurldomain.txt : 投稿禁止URLドメイン - banurldomain.txt : 投稿禁止URLドメイン
- banuserid.txt : 登録禁止ユーザーid - banuserid.txt : 登録禁止ユーザーid
- contact.txt : 管理者への連絡用メアド(sample@test.com)
- info.txt : サーバー登録時に表示されるメッセージ(好きな内容) - info.txt : サーバー登録時に表示されるメッセージ(好きな内容)
- privacypolicy.txt : プライバシーポリシー(サーバーのプライバシーポリシーを記載) - privacypolicy.txt : プライバシーポリシー(サーバーのプライバシーポリシーを記載)
- servaricon.txt : サーバーアイコンのURL
- servername.txt : サーバー名(てすとさば)
- serverstop.txt : サーバー停止ページで表示するメッセージ - serverstop.txt : サーバー停止ページで表示するメッセージ
- terms.txt : 利用規約(サーバーの利用規約を記載) - terms.txt : 利用規約(サーバーの利用規約を記載)
- textsize.txt : 最大文字数 - textsize.txt : 最大文字数
- serversettings.ini : サーバー情報保存ファイル
- uwuzuabout.txt : このファイル(uwuzuを改造した場合は書き換え) - uwuzuabout.txt : このファイル(uwuzuを改造した場合は書き換え)
- uwuzuinfo.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え) - uwuzuinfo.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え)
- uwuzurelease.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え) - uwuzurelease.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え)
@@ -185,4 +181,4 @@ daichimarukanaと一緒に開発したいよ~って人は私のHPからメー
編集者 : daichimarukana 編集者 : daichimarukana
最終更新日 : 2023/11/15 21:57 最終更新日 : 2023/12/20 22:10
+2 -2
View File
@@ -1,4 +1,4 @@
uwuzu uwuzu
1.2.27 1.2.28
2023/11/29 2023/12/20
daichimarukana,putonfps daichimarukana,putonfps
+27
View File
@@ -1,6 +1,33 @@
## リリースノートだぜぇぇぇぇぇぇい!!!!!!! ## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...) ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
## Version 1.2.28
リリース日:2023/12/20
fix: モバイル表示時にメニューを開くとその他が2つになってしまっている問題を修正しました!
fix: 安定性を向上させました。
fix: APIの脆弱性を修正しました。
fix: ある条件下でログインできなくなる問題を修正しました。
fix: ある条件下でログアウトボタンからログアウトができない問題を修正しました。
fix: 脆弱性を修正しました。
chg: 全体的にURLの表示を若干変更しました。
chg: サーバー設定をiniファイルにぎゅってしました。
chg: 通報画面の表示を少し変更しました。
chg: 返信画面にて返信先idと表示しているユーズのひとつ上の階層のユーズも表示するようにしました。
chg: カスタム絵文字のシステムを変更し、これまでと比べ高速で絵文字の読み込みを行えるようにしました!
これにより、今までの絵文字を新しい絵文字のシステムに移行する必要があります。
まずこれまでの絵文字idのメモを取り、絵文字の画像をダウンロードしておいてください。
メモとDLが完了したらSQL管理ツールから、emojiテーブルの構造から「emojitype」、「emojicontent」、「emojisize」を削除してください。
構造の削除が完了したらSQL管理ツールから古い絵文字を全て削除してください。
絵文字の削除が完了しましたら、uwuzuから絵文字の再登録を行ってください。
お手数ですが、ご協力よろしくお願いします。
chg: SSLがサーバー側で設定されていない場合にアクセスできないようにしました。(localhostは許可してあります)
本バージョンからSSLの設定をしていないと動作しないようになっております。
chg: ユーザーネームの文字数上限を50文字に引き上げました。
new: ホーム画面のURLに「?text=投稿欄に入れたい文字列」とすることにより文字列の共有を可能にしました!
new: ユーザー名にカスタム絵文字を使用できるようになりました!
new: 存在しない絵文字を指定した際やユーズに画像ファイルが存在しない際に「404」という画像を表示するようにしました。
new: 通報時にサーバー管理者に通知が送信されるようにしました。
## Version 1.2.27 ## Version 1.2.27
リリース日:2023/11/29 リリース日:2023/11/29
fix: 検索時にシェアボタンが使用できない問題を修正しました! fix: 検索時にシェアボタンが使用できない問題を修正しました!
+27 -12
View File
@@ -16,12 +16,11 @@ function random($length = 32)
require('../db.php'); require('../db.php');
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$onlyuserfile = "../server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -54,7 +53,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -63,7 +62,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -80,21 +79,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -111,7 +118,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -128,21 +135,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -247,14 +262,14 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>設定 - <?php echo file_get_contents($servernamefile);?></title> <title>設定 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -282,7 +297,7 @@ $pdo = null;
<?php <?php
$title = file_get_contents($servernamefile); $title = htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');
$name = $userid; $name = $userid;
+34 -12
View File
@@ -1,6 +1,7 @@
<?php <?php
$serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$servernamefile = "../server/servername.txt";
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000); $hashCreateTime = $sec.floor($msec*1000000);
@@ -24,6 +25,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -41,7 +43,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -50,7 +52,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -67,21 +69,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -98,7 +108,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -115,21 +125,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -190,7 +208,11 @@ if( !empty($pdo) ) {
if( !empty($_POST['btn_submit']) ) { if( !empty($_POST['btn_submit']) ) {
$im_bot = $_POST['im_bot']; if( !empty($_POST['im_bot']) ) {
$im_bot = $_POST['im_bot'];
}else{
$im_bot = "false";
}
if($im_bot === "true"){ if($im_bot === "true"){
$saveim_bot = "bot"; $saveim_bot = "bot";
@@ -230,8 +252,8 @@ if( !empty($_POST['btn_submit']) ) {
$error_message[] = '表示名を入力してください。'; $error_message[] = '表示名を入力してください。';
} else { } else {
// 文字数を確認 // 文字数を確認
if( 25 < mb_strlen($username, 'UTF-8') ) { if( 50 < mb_strlen($username, 'UTF-8') ) {
$error_message[] = 'ユーザーネームは25文字以内で入力してください。'; $error_message[] = 'ユーザーネームは50文字以内で入力してください。';
} }
} }
@@ -768,14 +790,14 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>設定 - <?php echo file_get_contents($servernamefile);?></title> <title>設定 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -854,7 +876,7 @@ $pdo = null;
<hr> <hr>
<div> <div>
<p>ユーザーid</p> <p>ユーザーid</p>
<input id="passchk_userid" type="text" class="inbox" name="passchk_userid" oncopy="return false" onpaste="return false" oncontextmenu="return false" style="-webkit-text-security:disc;" value=""> <input id="passchk_userid" type="text" class="inbox" name="passchk_userid" oncopy="return false" onpaste="return false" oncontextmenu="return false" value="">
</div> </div>
<div> <div>
<p>新しいパスワード</p> <p>新しいパスワード</p>
+26 -12
View File
@@ -1,14 +1,12 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
require('../db.php'); require('../db.php');
$onlyuserfile = "../server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -41,7 +39,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -50,7 +48,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -67,21 +65,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -98,7 +104,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -115,21 +121,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -165,14 +179,14 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>設定 - <?php echo file_get_contents($servernamefile);?></title> <title>設定 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+26 -29
View File
@@ -1,27 +1,7 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverinfofile = '../server/info.txt';
$serverinfo = file_get_contents($serverinfofile);
$servertermsfile = '../server/terms.txt';
$serverterms = file_get_contents($servertermsfile);
$serverprvfile = '../server/privacypolicy.txt';
$serverprv = file_get_contents($serverprvfile);
$contactfile = "../server/contact.txt";
$adminfile = "../server/admininfo.txt";
$serverstopfile = "../server/serverstop.txt";
$onlyuserfile = "../server/onlyuser.txt";
$err404imagefile = "../server/404imagepath.txt";
$robots = "../robots.txt";
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
@@ -49,6 +29,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -65,7 +46,7 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -74,7 +55,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -91,21 +72,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -122,7 +111,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -139,21 +128,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -306,14 +303,14 @@ if (!empty($pdo)) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>広告 - <?php echo file_get_contents($servernamefile);?></title> <title>広告 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+27 -28
View File
@@ -1,25 +1,7 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverinfofile = '../server/info.txt';
$serverinfo = file_get_contents($serverinfofile);
$servertermsfile = '../server/terms.txt';
$serverterms = file_get_contents($servertermsfile);
$serverprvfile = '../server/privacypolicy.txt';
$serverprv = file_get_contents($serverprvfile);
$contactfile = "../server/contact.txt";
$adminfile = "../server/admininfo.txt";
$serverstopfile = "../server/serverstop.txt";
$onlyuserfile = "../server/onlyuser.txt";
$err404imagefile = "../server/404imagepath.txt";
$robots = "../robots.txt"; $robots = "../robots.txt";
@@ -49,6 +31,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -65,7 +48,7 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -74,7 +57,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -91,21 +74,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -122,7 +113,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -139,21 +130,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -275,14 +274,14 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>招待コード発行所 - <?php echo file_get_contents($servernamefile);?></title> <title>招待コード発行所 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -303,7 +302,7 @@ require('../logout/logout.php');
<div class="admin_right"> <div class="admin_right">
<form class="formarea" enctype="multipart/form-data" method="post"> <form class="formarea" enctype="multipart/form-data" method="post">
<h1>招待コード発行所</h1> <h1>招待コード発行所</h1>
<?php if(file_get_contents($onlyuserfile) === "true"){?> <?php if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){?>
<p>下の発行ボタンで新しくコードを発行できます!<br>なお、コードは一回限り有効です。</p> <p>下の発行ボタンで新しくコードを発行できます!<br>なお、コードは一回限り有効です。</p>
<div> <div>
<p>発行数</p> <p>発行数</p>
+26 -16
View File
@@ -1,14 +1,7 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$contactfile = "../server/contact.txt";
$adminfile = "../server/admininfo.txt";
$serverstopfile = "../server/serverstop.txt";
$mojisizefile = "../server/textsize.txt";
$colorfile = "../css/color.css"; $colorfile = "../css/color.css";
$color_info = file_get_contents($colorfile); $color_info = file_get_contents($colorfile);
@@ -46,6 +39,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -62,7 +56,7 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -71,7 +65,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -88,21 +82,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -119,7 +121,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -136,21 +138,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -251,14 +261,14 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>サーバーカスタマイズ - <?php echo file_get_contents($servernamefile);?></title> <title>サーバーカスタマイズ - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+26 -12
View File
@@ -1,10 +1,7 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$contactfile = "../server/contact.txt";
$adminfile = "../server/admininfo.txt";
$serverstopfile = "../server/serverstop.txt"; $serverstopfile = "../server/serverstop.txt";
@@ -42,6 +39,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -58,7 +56,7 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -67,7 +65,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -84,21 +82,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -115,7 +121,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -132,21 +138,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -269,14 +283,14 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>メンテナンス - <?php echo file_get_contents($servernamefile);?></title> <title>メンテナンス - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+26 -18
View File
@@ -1,12 +1,7 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$contactfile = "../server/contact.txt";
$adminfile = "../server/admininfo.txt";
$serverstopfile = "../server/serverstop.txt";
$mojisizefile = "../server/textsize.txt"; $mojisizefile = "../server/textsize.txt";
@@ -16,10 +11,6 @@ $banuserid_info = file_get_contents($banuseridfile);
$banurldomainfile = "../server/banurldomain.txt"; $banurldomainfile = "../server/banurldomain.txt";
$banurldomain_info = file_get_contents($banurldomainfile); $banurldomain_info = file_get_contents($banurldomainfile);
$err404imagefile = "../server/404imagepath.txt";
$robots = "../robots.txt";
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000); $hashCreateTime = $sec.floor($msec*1000000);
@@ -46,6 +37,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -62,7 +54,7 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -71,7 +63,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -88,21 +80,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -119,7 +119,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -136,21 +136,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -260,14 +268,14 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>モデレーション - <?php echo file_get_contents($servernamefile);?></title> <title>モデレーション - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+31 -28
View File
@@ -1,7 +1,6 @@
<?php <?php
$servericonfile = "../server/servericon.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$servernamefile = "../server/servername.txt";
$serverinfofile = '../server/info.txt'; $serverinfofile = '../server/info.txt';
$serverinfo = file_get_contents($serverinfofile); $serverinfo = file_get_contents($serverinfofile);
@@ -12,19 +11,6 @@ $serverterms = file_get_contents($servertermsfile);
$serverprvfile = '../server/privacypolicy.txt'; $serverprvfile = '../server/privacypolicy.txt';
$serverprv = file_get_contents($serverprvfile); $serverprv = file_get_contents($serverprvfile);
$contactfile = "../server/contact.txt";
$adminfile = "../server/admininfo.txt";
$serverstopfile = "../server/serverstop.txt";
$onlyuserfile = "../server/onlyuser.txt";
$err404imagefile = "../server/404imagepath.txt";
$robots = "../robots.txt";
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000); $hashCreateTime = $sec.floor($msec*1000000);
@@ -51,6 +37,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -67,7 +54,7 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -76,7 +63,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -93,21 +80,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -124,7 +119,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -141,21 +136,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -211,14 +214,14 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>サーバー概要 - <?php echo file_get_contents($servernamefile);?></title> <title>サーバー概要 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -239,22 +242,22 @@ require('../logout/logout.php');
<div class="admin_right"> <div class="admin_right">
<div class="formarea"> <div class="formarea">
<h1>サーバー概要</h1> <h1>サーバー概要</h1>
<?php if( !empty(file_get_contents($servericonfile)) ){ ?> <?php if( !empty(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8')) ){ ?>
<div class="servericon"> <div class="servericon">
<img src="<?php echo htmlspecialchars(file_get_contents($servericonfile), ENT_QUOTES, 'UTF-8'); ?>"> <img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
</div> </div>
<?php }?> <?php }?>
<p>サーバー名</p> <p>サーバー名</p>
<p><?php if( !empty(file_get_contents($servernamefile)) ){ echo htmlspecialchars(file_get_contents($servernamefile), ENT_QUOTES, 'UTF-8'); } ?></p> <p><?php if( !empty(htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8')) ){ echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8'); } ?></p>
<hr> <hr>
<p>サーバー紹介メッセージ</p> <p>サーバー紹介メッセージ</p>
<p><?php $sinfo = explode("\n", $serverinfo); foreach ($sinfo as $info) { echo nl2br(htmlspecialchars($info)); }?></p> <p><?php $sinfo = explode("\n", $serverinfo); foreach ($sinfo as $info) { echo nl2br(htmlspecialchars($info)); }?></p>
<hr> <hr>
<p>サーバー管理者の名前</p> <p>サーバー管理者の名前</p>
<p><?php if( !empty(file_get_contents($adminfile)) ){ echo htmlspecialchars(file_get_contents($adminfile), ENT_QUOTES, 'UTF-8'); } ?></p> <p><?php if( !empty(htmlspecialchars($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8')) ){ echo htmlspecialchars($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8'); } ?></p>
<hr> <hr>
<p>サーバーへのお問い合わせ用メールアドレス</p> <p>サーバーへのお問い合わせ用メールアドレス</p>
<p><?php if( !empty(file_get_contents($contactfile)) ){ echo htmlspecialchars(file_get_contents($contactfile), ENT_QUOTES, 'UTF-8'); } ?></p> <p><?php if( !empty(htmlspecialchars($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8')) ){ echo htmlspecialchars($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8'); } ?></p>
<hr> <hr>
<p>統計情報</p> <p>統計情報</p>
<div class="overview"> <div class="overview">
+26 -29
View File
@@ -1,27 +1,7 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverinfofile = '../server/info.txt';
$serverinfo = file_get_contents($serverinfofile);
$servertermsfile = '../server/terms.txt';
$serverterms = file_get_contents($servertermsfile);
$serverprvfile = '../server/privacypolicy.txt';
$serverprv = file_get_contents($serverprvfile);
$contactfile = "../server/contact.txt";
$adminfile = "../server/admininfo.txt";
$serverstopfile = "../server/serverstop.txt";
$onlyuserfile = "../server/onlyuser.txt";
$err404imagefile = "../server/404imagepath.txt";
$robots = "../robots.txt";
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
@@ -49,6 +29,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -65,7 +46,7 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -74,7 +55,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -91,21 +72,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -122,7 +111,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -139,21 +128,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -366,14 +363,14 @@ if (!empty($pdo)) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>ロール - <?php echo file_get_contents($servernamefile);?></title> <title>ロール - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+67 -123
View File
@@ -1,15 +1,6 @@
<?php <?php
$servericonfile = "../server/servericon.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverlogofile = "../server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
$servernamefile = "../server/servername.txt";
$serverinfofile = '../server/info.txt'; $serverinfofile = '../server/info.txt';
$serverinfo = file_get_contents($serverinfofile); $serverinfo = file_get_contents($serverinfofile);
@@ -20,16 +11,6 @@ $serverterms = file_get_contents($servertermsfile);
$serverprvfile = '../server/privacypolicy.txt'; $serverprvfile = '../server/privacypolicy.txt';
$serverprv = file_get_contents($serverprvfile); $serverprv = file_get_contents($serverprvfile);
$contactfile = "../server/contact.txt";
$adminfile = "../server/admininfo.txt";
$serverstopfile = "../server/serverstop.txt";
$onlyuserfile = "../server/onlyuser.txt";
$activitypub_file = "../server/activitypub.txt";
$err404imagefile = "../server/404imagepath.txt"; $err404imagefile = "../server/404imagepath.txt";
$robots = "../robots.txt"; $robots = "../robots.txt";
@@ -60,6 +41,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -76,7 +58,7 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -85,7 +67,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -102,21 +84,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -133,7 +123,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -150,21 +140,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -239,8 +237,6 @@ if (!empty($pdo)) {
if( !empty($_POST['btn_submit']) ) { if( !empty($_POST['btn_submit']) ) {
// 空白除去
$servericon = $_POST['servericon']; $servericon = $_POST['servericon'];
$serverlogo_onoff = $_POST['serverlogo_onoff']; $serverlogo_onoff = $_POST['serverlogo_onoff'];
@@ -248,10 +244,9 @@ if( !empty($_POST['btn_submit']) ) {
$serverlogo_light = $_POST['serverlogo_light']; $serverlogo_light = $_POST['serverlogo_light'];
$serverlogo_dark = $_POST['serverlogo_dark']; $serverlogo_dark = $_POST['serverlogo_dark'];
if($serverlogo_onoff === "true"){ if(!($serverlogo_onoff === "true")){
$saveserverlogo = $serverlogo_light."\n".$serverlogo_dark; $serverlogo_light = "";
}else{ $serverlogo_dark = "";
$saveserverlogo = "";
} }
$servername = $_POST['servername']; $servername = $_POST['servername'];
@@ -263,15 +258,19 @@ if( !empty($_POST['btn_submit']) ) {
$servermailadds = $_POST['servermailadds']; $servermailadds = $_POST['servermailadds'];
$onlyuser = $_POST['onlyuser']; $onlyuser = $_POST['onlyuser'];
if($onlyuser === "true"){ if($onlyuser === "true"){
$saveonlyuser = "true"; $saveonlyuser = "true";
}else{ }else{
$saveonlyuser = "false"; $saveonlyuser = "false";
} }
$activitypub = $_POST['activitypub'];
if($activitypub === "true"){
$saveactivitypub = "true";
}else{
$saveactivitypub = "false";
}
$postrobots = $_POST['robots']; $postrobots = $_POST['robots'];
if($postrobots === "true"){ if($postrobots === "true"){
//GPTBotによるクロールを拒否 //GPTBotによるクロールを拒否
$file = fopen($robots, 'w'); $file = fopen($robots, 'w');
@@ -286,36 +285,34 @@ if( !empty($_POST['btn_submit']) ) {
fclose($file); fclose($file);
} }
$activitypub = $_POST['activitypub'];
if($activitypub === "true"){
$saveactivitypub = "true";
}else{
$saveactivitypub = "false";
}
$serverterms = $_POST['serverterms']; $serverterms = $_POST['serverterms'];
$serverprv = $_POST['serverprv']; $serverprv = $_POST['serverprv'];
//鯖icon $server_new_settings = '
$file = fopen($servericonfile, 'w'); ;サーバーの基本情報
$data = $servericon; [serverinfo]
;サーバー名
server_name = "'.$servername.'"
;サーバーアイコンのアドレス
server_icon = "'.$servericon.'"
;サーバーロゴのアドレス
server_logo_home = "'.$serverlogo_light.'"
server_logo_login = "'.$serverlogo_dark.'"
;管理者関係
server_admin = "'.$serveradminname.'"
server_admin_mailadds = "'.$servermailadds.'"
;招待のオンオフ
server_invitation = "'.$saveonlyuser.'"
server_activitypub = "'.$saveactivitypub.'"
';
//サーバー設定上書き
$file = fopen($serversettings_file, 'w');
$data = $server_new_settings;
fputs($file, $data); fputs($file, $data);
fclose($file); fclose($file);
//鯖ロゴ
$file = fopen($serverlogofile, 'w');
$data = $saveserverlogo;
fputs($file, $data);
fclose($file);
//鯖名
$file = fopen($servernamefile, 'w');
$data = $servername;
fputs($file, $data);
fclose($file);
//鯖紹介 //鯖紹介
$file = fopen($serverinfofile, 'w'); $file = fopen($serverinfofile, 'w');
@@ -323,30 +320,6 @@ if( !empty($_POST['btn_submit']) ) {
fputs($file, $data); fputs($file, $data);
fclose($file); fclose($file);
//鯖管理者名
$file = fopen($adminfile, 'w');
$data = $serveradminname;
fputs($file, $data);
fclose($file);
//鯖管理者メアド
$file = fopen($contactfile, 'w');
$data = $servermailadds;
fputs($file, $data);
fclose($file);
//招待制にするか
$file = fopen($onlyuserfile, 'w');
$data = $saveonlyuser;
fputs($file, $data);
fclose($file);
//ActivityPub
$file = fopen($activitypub_file, 'w');
$data = $saveactivitypub;
fputs($file, $data);
fclose($file);
//利用規約 //利用規約
$file = fopen($servertermsfile, 'w'); $file = fopen($servertermsfile, 'w');
$data = $serverterms; $data = $serverterms;
@@ -369,14 +342,14 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>サーバー設定 - <?php echo file_get_contents($servernamefile);?></title> <title>サーバー設定 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -397,21 +370,21 @@ require('../logout/logout.php');
<div class="admin_right"> <div class="admin_right">
<form class="formarea" enctype="multipart/form-data" method="post"> <form class="formarea" enctype="multipart/form-data" method="post">
<h1>サーバー設定</h1> <h1>サーバー設定</h1>
<?php if( !empty(file_get_contents($servericonfile)) ){ ?> <?php if( !empty($serversettings["serverinfo"]["server_icon"]) ){ ?>
<div class="servericon"> <div class="servericon">
<img src="<?php echo htmlspecialchars(file_get_contents($servericonfile), ENT_QUOTES, 'UTF-8'); ?>"> <img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
</div> </div>
<?php }?> <?php }?>
<div> <div>
<p>サーバーアイコン</p> <p>サーバーアイコン</p>
<div class="p2">サーバー登録画面などに表示されます。<br>自動的に角が丸くなります。<br>URLより設定してください。</div> <div class="p2">サーバー登録画面などに表示されます。<br>自動的に角が丸くなります。<br>URLより設定してください。</div>
<input id="servericon" placeholder="https://~" class="inbox" type="text" name="servericon" value="<?php if( !empty(file_get_contents($servericonfile)) ){ echo htmlspecialchars(file_get_contents($servericonfile), ENT_QUOTES, 'UTF-8'); } ?>"> <input id="servericon" placeholder="https://~" class="inbox" type="text" name="servericon" value="<?php if( !empty($serversettings["serverinfo"]["server_icon"]) ){ echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); } ?>">
</div> </div>
<div> <div>
<p>サーバーロゴ機能のオンオフ</p> <p>サーバーロゴ機能のオンオフ</p>
<div class="switch_button"> <div class="switch_button">
<?php if(!empty(file_get_contents($serverlogofile))){?> <?php if(!empty($serversettings["serverinfo"]["server_logo_home"]&&$serversettings["serverinfo"]["server_logo_login"])){?>
<input id="serverlogo_onoff" class="switch_input" type='checkbox' name="serverlogo_onoff" value="true" checked/> <input id="serverlogo_onoff" class="switch_input" type='checkbox' name="serverlogo_onoff" value="true" checked/>
<label for="serverlogo_onoff" class="switch_label"></label> <label for="serverlogo_onoff" class="switch_label"></label>
<?php }else{?> <?php }else{?>
@@ -424,9 +397,9 @@ require('../logout/logout.php');
<p>サーバーロゴ</p> <p>サーバーロゴ</p>
<div class="p2">サーバーの左上に表示されているuwuzuのロゴを独自のロゴに置き換えるときに使用します。<br>自動的に角が丸くなります。<br>URLより設定してください。<br>背景透過画像を推奨します。</div> <div class="p2">サーバーの左上に表示されているuwuzuのロゴを独自のロゴに置き換えるときに使用します。<br>自動的に角が丸くなります。<br>URLより設定してください。<br>背景透過画像を推奨します。</div>
<div class="p2">ログイン後のロゴ</div> <div class="p2">ログイン後のロゴ</div>
<input id="serverlogo" placeholder="https://~" class="inbox" type="text" name="serverlogo_light" value="<?php if( !empty($serverlogo_link[0]) ){ echo htmlspecialchars($serverlogo_link[0], ENT_QUOTES, 'UTF-8'); } ?>"> <input id="serverlogo" placeholder="https://~" class="inbox" type="text" name="serverlogo_light" value="<?php if( !empty($serversettings["serverinfo"]["server_logo_home"]) ){ echo htmlspecialchars($serversettings["serverinfo"]["server_logo_home"], ENT_QUOTES, 'UTF-8'); } ?>">
<div class="p2">ログイン画面と利用規約などドキュメントページのロゴ</div> <div class="p2">ログイン画面と利用規約などドキュメントページのロゴ</div>
<input id="serverlogo" placeholder="https://~" class="inbox" type="text" name="serverlogo_dark" value="<?php if( !empty($serverlogo_link[1]) ){ echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8'); } ?>"> <input id="serverlogo" placeholder="https://~" class="inbox" type="text" name="serverlogo_dark" value="<?php if( !empty($serversettings["serverinfo"]["server_logo_login"]) ){ echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'); } ?>">
</div> </div>
<script> <script>
if ($("#serverlogo_onoff").prop("checked")) { if ($("#serverlogo_onoff").prop("checked")) {
@@ -442,7 +415,7 @@ require('../logout/logout.php');
<div> <div>
<p>サーバー名</p> <p>サーバー名</p>
<div class="p2">サーバー名です。</div> <div class="p2">サーバー名です。</div>
<input id="servername" placeholder="uwuzuさ~ば~" class="inbox" type="text" name="servername" value="<?php if( !empty(file_get_contents($servernamefile)) ){ echo htmlspecialchars(file_get_contents($servernamefile), ENT_QUOTES, 'UTF-8'); } ?>"> <input id="servername" placeholder="uwuzuさ~ば~" class="inbox" type="text" name="servername" value="<?php if( !empty($serversettings["serverinfo"]["server_name"]) ){ echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8'); } ?>">
</div> </div>
<div> <div>
@@ -454,19 +427,19 @@ require('../logout/logout.php');
<div> <div>
<p>サーバー管理者の名前</p> <p>サーバー管理者の名前</p>
<div class="p2">サーバー管理者名です。</div> <div class="p2">サーバー管理者名です。</div>
<input id="serveradminname" placeholder="わたし" class="inbox" type="text" name="serveradminname" value="<?php if( !empty(file_get_contents($adminfile)) ){ echo htmlspecialchars(file_get_contents($adminfile), ENT_QUOTES, 'UTF-8'); } ?>"> <input id="serveradminname" placeholder="わたし" class="inbox" type="text" name="serveradminname" value="<?php if( !empty($serversettings["serverinfo"]["server_admin"]) ){ echo htmlspecialchars($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8'); } ?>">
</div> </div>
<div> <div>
<p>サーバーへのお問い合わせ用メールアドレス</p> <p>サーバーへのお問い合わせ用メールアドレス</p>
<div class="p2">ユーザーからのお問い合わせメアドです。</div> <div class="p2">ユーザーからのお問い合わせメアドです。</div>
<input id="servermailadds" placeholder="" class="inbox" type="text" name="servermailadds" value="<?php if( !empty(file_get_contents($contactfile)) ){ echo htmlspecialchars(file_get_contents($contactfile), ENT_QUOTES, 'UTF-8'); } ?>"> <input id="servermailadds" placeholder="" class="inbox" type="text" name="servermailadds" value="<?php if( !empty($serversettings["serverinfo"]["server_admin_mailadds"]) ){ echo htmlspecialchars($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8'); } ?>">
</div> </div>
<div> <div>
<p>招待制にするかどうか</p> <p>招待制にするかどうか</p>
<div class="switch_button"> <div class="switch_button">
<?php if(file_get_contents($onlyuserfile) === "true"){?> <?php if($serversettings["serverinfo"]["server_invitation"] === "true"){?>
<input id="onlyuser" class="switch_input" type='checkbox' name="onlyuser" value="true" checked/> <input id="onlyuser" class="switch_input" type='checkbox' name="onlyuser" value="true" checked/>
<label for="onlyuser" class="switch_label"></label> <label for="onlyuser" class="switch_label"></label>
<?php }else{?> <?php }else{?>
@@ -493,7 +466,7 @@ require('../logout/logout.php');
<p>ActivityPubサーバーとして認識されるようにするか</p> <p>ActivityPubサーバーとして認識されるようにするか</p>
<div class="p2">ActivityPubの仮実装をオンにするかです。inboxに入ってきた内容には今現在これといったレスポンスを返しません。<br>また、publicKeyも返却しません。<br>現状ActivityPubサーバーと連合を組むことは出来ません。(リモートユーザーの確認程度なら出来ます。)<br>オフの状態だと410 Goneを返します。</div> <div class="p2">ActivityPubの仮実装をオンにするかです。inboxに入ってきた内容には今現在これといったレスポンスを返しません。<br>また、publicKeyも返却しません。<br>現状ActivityPubサーバーと連合を組むことは出来ません。(リモートユーザーの確認程度なら出来ます。)<br>オフの状態だと410 Goneを返します。</div>
<div class="switch_button"> <div class="switch_button">
<?php if(file_get_contents($activitypub_file) === "true"){?> <?php if($serversettings["serverinfo"]["server_activitypub"] === "true"){?>
<input id="activitypub" class="switch_input" type='checkbox' name="activitypub" value="true" checked/> <input id="activitypub" class="switch_input" type='checkbox' name="activitypub" value="true" checked/>
<label for="activitypub" class="switch_label"></label> <label for="activitypub" class="switch_label"></label>
<?php }else{?> <?php }else{?>
@@ -521,35 +494,6 @@ require('../logout/logout.php');
<?php require('../require/rightbox.php');?> <?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?> <?php require('../require/botbox.php');?>
<script>
$(document).ready(function() {
$(document).on('click', '.delbtn', function (event) {
var code = $(this).attr('del-code');
var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
var codeElement = $(this).closest('.server_code');
$.ajax({
url: 'code_delete.php',
method: 'POST',
data: { code: code, userid: userid, account_id: account_id },
dataType: 'json',
success: function (response) {
if (response.success) {
codeElement.remove();
} else {
// 削除失敗時の処理
}
},
error: function () {
// エラー時の処理
}
});
});
});
</script>
</body> </body>
</html> </html>
+26 -29
View File
@@ -1,27 +1,7 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverinfofile = '../server/info.txt';
$serverinfo = file_get_contents($serverinfofile);
$servertermsfile = '../server/terms.txt';
$serverterms = file_get_contents($servertermsfile);
$serverprvfile = '../server/privacypolicy.txt';
$serverprv = file_get_contents($serverprvfile);
$contactfile = "../server/contact.txt";
$adminfile = "../server/admininfo.txt";
$serverstopfile = "../server/serverstop.txt";
$onlyuserfile = "../server/onlyuser.txt";
$err404imagefile = "../server/404imagepath.txt";
$robots = "../robots.txt";
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
@@ -49,6 +29,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -65,7 +46,7 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -74,7 +55,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -91,21 +72,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -122,7 +111,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -139,21 +128,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -292,14 +289,14 @@ if (!empty($pdo)) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>ユーザー管理 - <?php echo file_get_contents($servernamefile);?></title> <title>ユーザー管理 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+26 -29
View File
@@ -1,27 +1,7 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverinfofile = '../server/info.txt';
$serverinfo = file_get_contents($serverinfofile);
$servertermsfile = '../server/terms.txt';
$serverterms = file_get_contents($servertermsfile);
$serverprvfile = '../server/privacypolicy.txt';
$serverprv = file_get_contents($serverprvfile);
$contactfile = "../server/contact.txt";
$adminfile = "../server/admininfo.txt";
$serverstopfile = "../server/serverstop.txt";
$onlyuserfile = "../server/onlyuser.txt";
$err404imagefile = "../server/404imagepath.txt";
$robots = "../robots.txt";
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
@@ -49,6 +29,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -67,7 +48,7 @@ try {
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -76,7 +57,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -93,21 +74,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -124,7 +113,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -141,21 +130,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -523,14 +520,14 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>ユーザー管理 - <?php echo file_get_contents($servernamefile);?></title> <title>ユーザー管理 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+7 -13
View File
@@ -1,13 +1,7 @@
<?php <?php
$servernamefile = "server/servername.txt"; $serversettings_file = "server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverlogofile = "server/serverlogo.txt";
$serverlogodata = file_get_contents($serverlogofile);
$serverlogodata = explode( "\n", $serverlogodata );
$cnt = count( $serverlogodata );
for( $i=0;$i<$cnt;$i++ ){
$serverlogo_link[$i] = ($serverlogodata[$i]);
}
if(!(empty($_SESSION['backupcode']))){ if(!(empty($_SESSION['backupcode']))){
$backupcode = $_SESSION['backupcode']; $backupcode = $_SESSION['backupcode'];
@@ -21,12 +15,12 @@ if(!(empty($_SESSION['backupcode']))){
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>">
<script src="js/unsupported.js"></script> <script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>アカウント登録完了!!! - <?php echo file_get_contents($servernamefile);?></title> <title>アカウント登録完了!!! - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<script src="js/back.js"></script> <script src="js/back.js"></script>
@@ -35,9 +29,9 @@ if(!(empty($_SESSION['backupcode']))){
<div class="leftbox2"> <div class="leftbox2">
<?php if(!empty($serverlogo_link[1])){ ?> <?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src=<?php echo htmlspecialchars($serverlogo_link[1], ENT_QUOTES, 'UTF-8');?>></a> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
+3 -2
View File
@@ -1,6 +1,7 @@
<?php <?php
$activitypub_file = "../../server/activitypub.txt"; $serversettings_file = "../server/serversettings.ini";
if(file_get_contents($activitypub_file) === "true"){ $serversettings = parse_ini_file($serversettings_file, true);
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/json; charset=utf-8"); header("Content-Type: application/json; charset=utf-8");
+31 -12
View File
@@ -1,9 +1,10 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
$mojisizefile = "../server/textsize.txt"; $mojisizefile = "../server/textsize.txt";
$servericonfile = "../server/servericon.txt";
$banurldomainfile = "../server/banurldomain.txt"; $banurldomainfile = "../server/banurldomain.txt";
$banurl_info = file_get_contents($banurldomainfile); $banurl_info = file_get_contents($banurldomainfile);
@@ -35,6 +36,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -52,7 +54,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -61,7 +63,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -78,21 +80,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -109,7 +119,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -126,21 +136,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -673,16 +691,16 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/nsfw_event.js"></script> <script src="../js/nsfw_event.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>ID <?php echo htmlentities($ueuseid, ENT_QUOTES, 'UTF-8'); ?> のユーズ - <?php echo file_get_contents($servernamefile);?></title> <title>ID <?php echo htmlentities($ueuseid, ENT_QUOTES, 'UTF-8'); ?> のユーズ - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -704,7 +722,7 @@ $pdo = null;
<div class="emojibox"> <div class="emojibox">
<?php if(!empty($touserid)){?> <?php if(!empty($touserid)){?>
<h1>返信</h1> <h1>@<?php echo htmlentities($touserid, ENT_QUOTES, 'UTF-8'); ?>さんに返信</h1>
</div> </div>
<?php if(!($role ==="ice")){?> <?php if(!($role ==="ice")){?>
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data">
@@ -863,10 +881,11 @@ $(document).ready(function() {
isLoading = true; isLoading = true;
var ueuseid = '<?php echo $ueuseid; ?>'; var ueuseid = '<?php echo $ueuseid; ?>';
var userid = '<?php echo $userid; ?>'; var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
$.ajax({ $.ajax({
url: '../nextpage/ueusepage.php', // PHPファイルへのパス url: '../nextpage/ueusepage.php', // PHPファイルへのパス
method: 'GET', method: 'GET',
data: { page: pageNumber, id: ueuseid ,userid: userid}, data: { page: pageNumber, id: ueuseid ,userid: userid ,account_id: account_id},
dataType: 'html', dataType: 'html',
timeout: 300000, timeout: 300000,
success: function(response) { success: function(response) {
+7 -10
View File
@@ -1,10 +1,7 @@
<?php <?php
$servericonfile = "server/servericon.txt"; $serversettings_file = "server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
//-------------------------
$servernamefile = "server/servername.txt";
//------------------------ //------------------------
@@ -17,8 +14,6 @@ $domain = $_SERVER['HTTP_HOST'];
//------------------------ //------------------------
$contactfile = "server/contact.txt";
$softwarefile = "server/uwuzuinfo.txt"; $softwarefile = "server/uwuzuinfo.txt";
$softwaredata = file_get_contents($softwarefile); $softwaredata = file_get_contents($softwarefile);
@@ -50,6 +45,8 @@ if($errcode == "UNSUPPORTED_BROWSER"){
$errabout = "Cookieが無効になっています。"; $errabout = "Cookieが無効になっています。";
}elseif($errcode == "NONE_SSL"){ }elseif($errcode == "NONE_SSL"){
$errabout = "http通信で表示されていません。"; $errabout = "http通信で表示されていません。";
}elseif($errcode == "NONE_SSL_SERVER"){
$errabout = "サーバー側でSSLが設定されていません。サーバー管理者にuwuzuの動作にSSLの設定が必要であることを伝えてください。";
}else{ }else{
$errabout = "エラーコードの説明はありません。"; $errabout = "エラーコードの説明はありません。";
} }
@@ -63,14 +60,14 @@ if($errcode == "UNSUPPORTED_BROWSER"){
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title><?php echo file_get_contents($servernamefile);?></title> <title><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
<body> <body>
<main> <main>
<div class="server_icon_zone"> <div class="server_icon_zone">
<img src=<?php echo htmlentities(file_get_contents($servericonfile));?>> <img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8');?>>
</div> </div>
<h1>お使いの環境での利用はできません</h1> <h1>お使いの環境での利用はできません</h1>
<div class="maintext"> <div class="maintext">
@@ -96,7 +93,7 @@ if($errcode == "UNSUPPORTED_BROWSER"){
</main> </main>
<hr> <hr>
<div class="center_text"> <div class="center_text">
<p><?php echo htmlentities(file_get_contents($servernamefile));?></p> <p><?php echo htmlentities($serversettings["serverinfo"]["server_name"]);?></p>
<p><?php echo $domain;?></p> <p><?php echo $domain;?></p>
<div class="p2"><?php echo htmlentities($uwuzuinfo[0]);?><br>Version <?php echo htmlentities($uwuzuinfo[1]);?></div> <div class="p2"><?php echo htmlentities($uwuzuinfo[0]);?><br>Version <?php echo htmlentities($uwuzuinfo[1]);?></div>
</div> </div>
+3 -2
View File
@@ -1,6 +1,7 @@
<?php <?php
$activitypub_file = "../../server/activitypub.txt"; $serversettings_file = "../server/serversettings.ini";
if(file_get_contents($activitypub_file) === "true"){ $serversettings = parse_ini_file($serversettings_file, true);
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/json; charset=utf-8"); header("Content-Type: application/json; charset=utf-8");
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
+100 -28
View File
@@ -1,6 +1,8 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
@@ -27,6 +29,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -44,7 +47,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -53,7 +56,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -70,21 +73,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -101,7 +112,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -118,21 +129,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -180,13 +199,53 @@ if( !empty($pdo) ) {
$uwuzuid = htmlentities(str_replace('@'.$domain, '', $uwuzuid2)); $uwuzuid = htmlentities(str_replace('@'.$domain, '', $uwuzuid2));
// プロフィールの絵文字対応
function replaceProfileEmojiImages($postText) {
// プロフィール名で絵文字名(:emoji:)を検出して画像に置き換える
$emojiPattern = '/:(\w+):/';
$postTextWithImages = preg_replace_callback($emojiPattern, function($matches) {
$emojiName = $matches[1];
//絵文字path取得
$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,
));
$emoji_Query = $dbh->prepare("SELECT emojifile, emojiname FROM emoji WHERE emojiname = :emojiname");
$emoji_Query->bindValue(':emojiname', $emojiName);
$emoji_Query->execute();
$emoji_row = $emoji_Query->fetch();
if(empty($emoji_row["emojifile"])){
$emoji_path = "img/sysimage/errorimage/emoji_404.png";
}else{
$emoji_path = $emoji_row["emojifile"];
}
return "<img src='../".$emoji_path."' alt=':$emojiName:' title=':$emojiName:'>";
}, $postText);
return $postTextWithImages;
}
// ユーズ内の絵文字を画像に置き換える // ユーズ内の絵文字を画像に置き換える
function replaceEmojisWithImages($postText) { function replaceEmojisWithImages($postText) {
// ユーズ内で絵文字名(:emoji:)を検出して画像に置き換える // ユーズ内で絵文字名(:emoji:)を検出して画像に置き換える
$emojiPattern = '/:(\w+):/'; $emojiPattern = '/:(\w+):/';
$postTextWithImages = preg_replace_callback($emojiPattern, function($matches) { $postTextWithImages = preg_replace_callback($emojiPattern, function($matches) {
$emojiName = $matches[1]; $emojiName = $matches[1];
return "<img src='../emoji/emojiimage.php?emoji=" . urlencode($emojiName) . "' alt=':$emojiName:' title=':$emojiName:'>"; //絵文字path取得
$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,
));
$emoji_Query = $dbh->prepare("SELECT emojifile, emojiname FROM emoji WHERE emojiname = :emojiname");
$emoji_Query->bindValue(':emojiname', $emojiName);
$emoji_Query->execute();
$emoji_row = $emoji_Query->fetch();
if(empty($emoji_row["emojifile"])){
$emoji_path = "img/sysimage/errorimage/emoji_404.png";
}else{
$emoji_path = $emoji_row["emojifile"];
}
return "<img src='../".$emoji_path."' alt=':$emojiName:' title=':$emojiName:'>";
}, $postText); }, $postText);
// @username を検出してリンクに置き換える // @username を検出してリンクに置き換える
@@ -212,16 +271,18 @@ if( !empty($pdo) ) {
} }
}, $postTextWithImages); }, $postTextWithImages);
$hashtagsPattern = '/#([\p{Han}\p{Hiragana}\p{Katakana}A-Za-z0-9_]+)/u'; $hashtagsPattern = '/#([\p{Han}\p{Hiragana}\p{Katakana}A-Za-z0-9_]+)/u';
$postTextWithHashtags = preg_replace_callback($hashtagsPattern, function($matches) { $postTextWithHashtags = preg_replace_callback($hashtagsPattern, function($matches) {
$hashtags = $matches[1]; $hashtags = $matches[1];
return "<a class = 'hashtags' href='/search?q=".urlencode('#').$hashtags."'>".'#'.$hashtags."</a>"; return "<a class='hashtags' href='/search?q=" . urlencode('#') . $hashtags . "'>" . '#' . $hashtags . "</a>";
}, $postTextWithImagesAndUsernames); }, $postTextWithImagesAndUsernames);
return $postTextWithHashtags; return $postTextWithHashtags;
} }
function replaceURLsWithLinks($postText) { function replaceURLsWithLinks($postText) {
$postText = str_replace('&#039;', '\'', $postText);
// URLを正規表現を使って検出 // URLを正規表現を使って検出
$pattern = '/(https:\/\/[^\s<>\[\]\'"]+)/'; // 改良された正規表現 $pattern = '/(https:\/\/[^\s<>\[\]\'"]+)/'; // 改良された正規表現
preg_match_all($pattern, $postText, $matches); preg_match_all($pattern, $postText, $matches);
@@ -233,7 +294,17 @@ if( !empty($pdo) ) {
if (!isset($parsedUrl['path'])) { if (!isset($parsedUrl['path'])) {
$parsedUrl['path'] = ''; $parsedUrl['path'] = '';
} }
$domain = $parsedUrl['host'].(strlen($parsedUrl['path']) > 24 ? substr($parsedUrl['path'], 0, 24) . '...' : $parsedUrl['path']); if (!isset($parsedUrl['query'])) {
$parsedUrl['query'] = '';
}
$nochk_domain = $parsedUrl['host'].$parsedUrl['path'].$parsedUrl['query'];
if(strlen($nochk_domain) > 47){
$domain = mb_substr($nochk_domain, 0, 48, "UTF-8")."...";
}else{
$domain = $nochk_domain;
}
// 不要な文字を削除してaタグを生成 // 不要な文字を削除してaタグを生成
$urlWithoutSpaces = preg_replace('/\s+/', '', $url); $urlWithoutSpaces = preg_replace('/\s+/', '', $url);
@@ -544,16 +615,16 @@ $pdo = null;
<head> <head>
<script src="//cdnjs.cloudflare.com/ajax/libs/push.js/1.0.12/push.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/push.js/1.0.12/push.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script> <script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<script src="../js/nsfw_event.js"></script> <script src="../js/nsfw_event.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title><?php echo htmlentities($userData['username'], ENT_QUOTES, 'UTF-8'); ?> さんのプロフィール - <?php echo file_get_contents($servernamefile);?></title> <title><?php echo htmlentities($userData['username'], ENT_QUOTES, 'UTF-8'); ?> さんのプロフィール - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -617,7 +688,7 @@ $pdo = null;
</div> </div>
<div class="icon"> <div class="icon">
<img src="<?php echo htmlentities('../'.$userdata['iconname']); ?>"> <img src="<?php echo htmlentities('../'.$userdata['iconname']); ?>">
<h2><?php echo htmlentities($userData['username'], ENT_QUOTES, 'UTF-8'); ?></h2> <h2><?php echo replaceProfileEmojiImages(htmlentities($userData['username'], ENT_QUOTES, 'UTF-8')); ?></h2>
<p>@<?php echo htmlentities($userData['userid'], ENT_QUOTES, 'UTF-8'); ?><!--<span>@<?php /*echo htmlentities($domain, ENT_QUOTES, 'UTF-8'); */?></span>--></p> <p>@<?php echo htmlentities($userData['userid'], ENT_QUOTES, 'UTF-8'); ?><!--<span>@<?php /*echo htmlentities($domain, ENT_QUOTES, 'UTF-8'); */?></span>--></p>
</div> </div>
@@ -708,7 +779,7 @@ $pdo = null;
<?php if(!($role === "ice")){?> <?php if(!($role === "ice")){?>
<div id="myModal" class="modal"> <div id="myModal" class="modal">
<div class="modal-content"> <div class="modal-content">
<p><?php echo htmlentities($userData['username'], ENT_QUOTES, 'UTF-8'); ?>さんをフォロー解除しますか?</p> <p><?php echo replaceProfileEmojiImages(htmlentities($userData['username'], ENT_QUOTES, 'UTF-8')); ?>さんをフォロー解除しますか?</p>
<form class="btn_area" method="post"> <form class="btn_area" method="post">
<input type="submit" id="openModalButton" class="fbtn_no" name="unfollow" value="フォロー解除"> <input type="submit" id="openModalButton" class="fbtn_no" name="unfollow" value="フォロー解除">
<input type="button" id="closeModal" class="fbtn" value="キャンセル"> <input type="button" id="closeModal" class="fbtn" value="キャンセル">
@@ -784,8 +855,8 @@ $pdo = null;
<div id="account_BlockModal" class="modal"> <div id="account_BlockModal" class="modal">
<div class="modal-content"> <div class="modal-content">
<h1><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんをブロックしますか?</h1> <h1><?php echo replaceProfileEmojiImages(htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8')); ?>さんをブロックしますか?</h1>
<p><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんのアカウントをブロックしますか?<br>ブロックするとフォローが解除され、検索以外のLTL、FTL等で<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんの投稿が表示されなくなります。<br>また、相手からこのアカウントを閲覧することもできなくなります。<br>※ブロックしたことは相手には通知されません。<br><br>ブロックを解除するときはこのアカウントのユーザーページ(このページ)から解除を行ってください。</p> <p><?php echo replaceProfileEmojiImages(htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8')); ?>さんのアカウントをブロックしますか?<br>ブロックするとフォローが解除され、検索以外のLTL、FTL等で<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんの投稿が表示されなくなります。<br>また、相手からこのアカウントを閲覧することもできなくなります。<br>※ブロックしたことは相手には通知されません。<br><br>ブロックを解除するときはこのアカウントのユーザーページ(このページ)から解除を行ってください。</p>
<form class="btn_area" method="post"> <form class="btn_area" method="post">
<input type="submit" id="deleteButton2" class="fbtn_no" name="send_block_submit" value="ブロック"> <input type="submit" id="deleteButton2" class="fbtn_no" name="send_block_submit" value="ブロック">
<input type="button" id="cancelButton2" class="fbtn" value="キャンセル"> <input type="button" id="cancelButton2" class="fbtn" value="キャンセル">
@@ -795,8 +866,8 @@ $pdo = null;
<div id="account_un_BlockModal" class="modal"> <div id="account_un_BlockModal" class="modal">
<div class="modal-content"> <div class="modal-content">
<h1><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんのブロックを解除しますか?</h1> <h1><?php echo replaceProfileEmojiImages(htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8')); ?>さんのブロックを解除しますか?</h1>
<p><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんのアカウントをブロック解除しますか?<br>ブロック解除すると<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんの投稿の閲覧が可能になりフォローすることもできるようになります。</p> <p><?php echo replaceProfileEmojiImages(htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8')); ?>さんのアカウントをブロック解除しますか?<br>ブロック解除すると<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんの投稿の閲覧が可能になりフォローすることもできるようになります。</p>
<form class="btn_area" method="post"> <form class="btn_area" method="post">
<input type="submit" id="deleteButton3" class="fbtn_no" name="send_un_block_submit" value="ブロック解除"> <input type="submit" id="deleteButton3" class="fbtn_no" name="send_un_block_submit" value="ブロック解除">
<input type="button" id="cancelButton3" class="fbtn" value="キャンセル"> <input type="button" id="cancelButton3" class="fbtn" value="キャンセル">
@@ -807,7 +878,7 @@ $pdo = null;
<div id="FollowerUserModal" class="modal"> <div id="FollowerUserModal" class="modal">
<div class="modal-content"> <div class="modal-content">
<p><?php echo htmlentities($userData["username"], ENT_QUOTES, 'UTF-8');?>さんをフォローしているユーザー</p> <p><?php echo replaceProfileEmojiImages(htmlentities($userData["username"], ENT_QUOTES, 'UTF-8'));?>さんをフォローしているユーザー</p>
<?php <?php
if(!empty($follower_userdata)){ if(!empty($follower_userdata)){
foreach ($follower_userdata as $value) { foreach ($follower_userdata as $value) {
@@ -815,14 +886,14 @@ $pdo = null;
echo "<div class='action_userlist'>"; echo "<div class='action_userlist'>";
echo "<a href='/@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."'><img src=".htmlentities($value['iconname'], ENT_QUOTES, 'UTF-8')."></a>"; echo "<a href='/@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."'><img src=".htmlentities($value['iconname'], ENT_QUOTES, 'UTF-8')."></a>";
echo "<div class='userabout'>"; echo "<div class='userabout'>";
echo "<div class='username'><a href='/@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."'>".htmlentities($value['username'], ENT_QUOTES, 'UTF-8')."</a></div>"; echo "<div class='username'><a href='/@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."'>".replaceEmojisWithImages(htmlentities($value['username'], ENT_QUOTES, 'UTF-8'))."</a></div>";
echo "<div class='userid'><a href='/@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."'>@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."</a></div>"; echo "<div class='userid'><a href='/@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."'>@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."</a></div>";
echo "</div>"; echo "</div>";
echo "</div>"; echo "</div>";
} }
} }
}else{ }else{
echo "<p>".htmlentities($userData["username"], ENT_QUOTES, 'UTF-8')."さんは誰にもフォローされていません。</p>"; echo "<p>".replaceProfileEmojiImages(htmlentities($userData["username"], ENT_QUOTES, 'UTF-8'))."さんは誰にもフォローされていません。</p>";
} }
?> ?>
<div class="btn_area"> <div class="btn_area">
@@ -833,7 +904,7 @@ $pdo = null;
<div id="FollowUserModal" class="modal"> <div id="FollowUserModal" class="modal">
<div class="modal-content"> <div class="modal-content">
<p><?php echo htmlentities($userData["username"], ENT_QUOTES, 'UTF-8');?>さんがフォローしているユーザー</p> <p><?php echo replaceProfileEmojiImages(htmlentities($userData["username"], ENT_QUOTES, 'UTF-8'));?>さんがフォローしているユーザー</p>
<?php <?php
if(!empty($follow_userdata)){ if(!empty($follow_userdata)){
foreach ($follow_userdata as $value) { foreach ($follow_userdata as $value) {
@@ -841,14 +912,14 @@ $pdo = null;
echo "<div class='action_userlist'>"; echo "<div class='action_userlist'>";
echo "<a href='/@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."'><img src=".htmlentities($value['iconname'], ENT_QUOTES, 'UTF-8')."></a>"; echo "<a href='/@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."'><img src=".htmlentities($value['iconname'], ENT_QUOTES, 'UTF-8')."></a>";
echo "<div class='userabout'>"; echo "<div class='userabout'>";
echo "<div class='username'><a href='/@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."'>".htmlentities($value['username'], ENT_QUOTES, 'UTF-8')."</a></div>"; echo "<div class='username'><a href='/@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."'>".replaceEmojisWithImages(htmlentities($value['username'], ENT_QUOTES, 'UTF-8'))."</a></div>";
echo "<div class='userid'><a href='/@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."'>@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."</a></div>"; echo "<div class='userid'><a href='/@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."'>@".htmlentities($value['userid'], ENT_QUOTES, 'UTF-8')."</a></div>";
echo "</div>"; echo "</div>";
echo "</div>"; echo "</div>";
} }
} }
}else{ }else{
echo "<p>".htmlentities($userData["username"], ENT_QUOTES, 'UTF-8')."さんは誰もフォローしていません。</p>"; echo "<p>".replaceProfileEmojiImages(htmlentities($userData["username"], ENT_QUOTES, 'UTF-8'))."さんは誰もフォローしていません。</p>";
} }
?> ?>
<div class="btn_area"> <div class="btn_area">
@@ -884,11 +955,12 @@ $(document).ready(function() {
$("#error").hide(); $("#error").hide();
var uwuzuid = '<?php echo $uwuzuid; ?>'; var uwuzuid = '<?php echo $uwuzuid; ?>';
var userid = '<?php echo $userid; ?>'; var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
if(mode == 'allueuse'){ if(mode == 'allueuse'){
$.ajax({ $.ajax({
url: '../nextpage/userpage.php', // PHPファイルへのパス url: '../nextpage/userpage.php', // PHPファイルへのパス
method: 'GET', method: 'GET',
data: { page: pageNumber, id: uwuzuid ,userid: userid}, data: { page: pageNumber, id: uwuzuid ,userid: userid, account_id: account_id},
dataType: 'html', dataType: 'html',
timeout: 300000, timeout: 300000,
success: function(response) { success: function(response) {
@@ -907,7 +979,7 @@ $(document).ready(function() {
$.ajax({ $.ajax({
url: '../nextpage/usermediapage.php', // PHPファイルへのパス url: '../nextpage/usermediapage.php', // PHPファイルへのパス
method: 'GET', method: 'GET',
data: { page: pageNumber, id: uwuzuid ,userid: userid}, data: { page: pageNumber, id: uwuzuid ,userid: userid, account_id: account_id},
dataType: 'html', dataType: 'html',
timeout: 300000, timeout: 300000,
success: function(response) { success: function(response) {
@@ -926,7 +998,7 @@ $(document).ready(function() {
$.ajax({ $.ajax({
url: '../nextpage/userlikepage.php', // PHPファイルへのパス url: '../nextpage/userlikepage.php', // PHPファイルへのパス
method: 'GET', method: 'GET',
data: { page: pageNumber, id: uwuzuid ,userid: userid}, data: { page: pageNumber, id: uwuzuid ,userid: userid, account_id: account_id},
dataType: 'html', dataType: 'html',
timeout: 300000, timeout: 300000,
success: function(response) { success: function(response) {
@@ -946,7 +1018,7 @@ $(document).ready(function() {
$.ajax({ $.ajax({
url: '../nextpage/userpage.php', // PHPファイルへのパス url: '../nextpage/userpage.php', // PHPファイルへのパス
method: 'GET', method: 'GET',
data: { page: pageNumber, id: uwuzuid ,userid: userid}, data: { page: pageNumber, id: uwuzuid ,userid: userid, account_id: account_id},
dataType: 'html', dataType: 'html',
timeout: 300000, timeout: 300000,
success: function(response) { success: function(response) {
+3 -2
View File
@@ -1,6 +1,7 @@
<?php <?php
$activitypub_file = "../../server/activitypub.txt"; $serversettings_file = "../server/serversettings.ini";
if(file_get_contents($activitypub_file) === "true"){ $serversettings = parse_ini_file($serversettings_file, true);
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/json; charset=utf-8"); header("Content-Type: application/json; charset=utf-8");
+72 -11
View File
@@ -1,6 +1,6 @@
<?php <?php
$serversettings_file = "../server/serversettings.ini";
$servernamefile = "../server/servername.txt"; $serversettings = parse_ini_file($serversettings_file, true);
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
@@ -25,6 +25,7 @@ $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -45,7 +46,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -54,7 +55,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -71,21 +72,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -102,7 +111,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -119,21 +128,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -312,6 +329,12 @@ if (!empty($_POST['report'])) {
$admin_chk = "none"; $admin_chk = "none";
$touserid = $userData['userid']; $touserid = $userData['userid'];
//管理者取得
$adminQuery = $pdo->prepare("SELECT userid FROM account WHERE admin = :adminid");
$adminQuery->bindValue(':adminid', "yes");
$adminQuery->execute();
$admin_res = $adminQuery->fetchAll();
// トランザクション開始 // トランザクション開始
$pdo->beginTransaction(); $pdo->beginTransaction();
@@ -334,6 +357,44 @@ if (!empty($_POST['report'])) {
// コミット // コミット
$res = $pdo->commit(); $res = $pdo->commit();
foreach ($admin_res as $to_admin) {
$pdo->beginTransaction();
try {
$touserid2 = $to_admin["userid"];//管理者宛通知
$datetime = date("Y-m-d H:i:s");
$msg = "通報情報をご確認ください!";
$title = "🚨" . $touserid . "さんが通報されました!🚨";
$url = "/settings_admin/useradmin";
$userchk = 'none';
// 通知用SQL作成
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
$stmt->bindParam(':touserid', htmlentities($touserid2), PDO::PARAM_STR);
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
$stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR);
$stmt->bindParam(':userchk', htmlentities($userchk), PDO::PARAM_STR);
$stmt->bindParam(':title', htmlentities($title), PDO::PARAM_STR);
$stmt->bindParam(':datetime', htmlentities($datetime), PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
} catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
}
} catch(Exception $e) { } catch(Exception $e) {
// エラーが発生した時はロールバック // エラーが発生した時はロールバック
@@ -341,7 +402,7 @@ if (!empty($_POST['report'])) {
} }
if( $res ) { if( $res ) {
header("Location:success"); header("Location:success?q=".var_dump($admin_res["userid"]));
exit; exit;
} else { } else {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
@@ -363,14 +424,14 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title><?php echo htmlentities($userData['username'], ENT_QUOTES, 'UTF-8'); ?> さんを通報 - <?php echo file_get_contents($servernamefile);?></title> <title><?php echo htmlentities($userData['username'], ENT_QUOTES, 'UTF-8'); ?> さんを通報 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
@@ -389,9 +450,9 @@ $pdo = null;
<form class="formarea" enctype="multipart/form-data" method="post"> <form class="formarea" enctype="multipart/form-data" method="post">
<h1>通報</h1> <h1>通報</h1>
<div class="p2">通報先アカウント名</div> <div class="p2">通報先アカウント名</div>
<p><?php echo htmlentities($userData['username'], ENT_QUOTES, 'UTF-8'); ?></p> <p>@<?php echo htmlentities($userData['username'], ENT_QUOTES, 'UTF-8'); ?></p>
<div class="p2">通報先id</div> <div class="p2">通報先id</div>
<p><?php echo htmlentities($userData['userid'], ENT_QUOTES, 'UTF-8'); ?></p> <p>@<?php echo htmlentities($userData['userid'], ENT_QUOTES, 'UTF-8'); ?></p>
<div class="p2">プロフィール</div> <div class="p2">プロフィール</div>
<p><?php echo nl2br(htmlentities($userData['profile'], ENT_QUOTES, 'UTF-8')); ?></p> <p><?php echo nl2br(htmlentities($userData['profile'], ENT_QUOTES, 'UTF-8')); ?></p>
<hr> <hr>
+25 -11
View File
@@ -1,14 +1,12 @@
<?php <?php
$servernamefile = "../server/servername.txt"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
require('../db.php'); require('../db.php');
$onlyuserfile = "../server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id'); session_name('uwuzu_s_id');
session_set_cookie_params(0, '', '', true, true);
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -36,7 +34,7 @@ try {
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
@@ -45,7 +43,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){ }elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
@@ -62,21 +60,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -93,7 +99,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
if(empty($res["userid"])){ if(empty($res["userid"])){
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){ }elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット // セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット $username = htmlentities($res['username']); // クッキーから取得した値をセット
@@ -110,21 +116,29 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('username', $username,[ setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('loginid', $res["loginid"],[ setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
setcookie('admin_login', true,[ setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14, 'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/', 'path' => '/',
'samesite' => 'lax', 'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]); ]);
}else{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
@@ -161,12 +175,12 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css"> <link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="../js/console_notice.js"></script> <script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>設定 - <?php echo file_get_contents($servernamefile);?></title> <title>設定 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head> </head>
+4 -7
View File
@@ -2,10 +2,10 @@
-- version 5.2.1 -- version 5.2.1
-- https://www.phpmyadmin.net/ -- https://www.phpmyadmin.net/
-- --
-- ホスト: ひみつ -- ホスト: 127.0.0.1
-- 生成日時: 2023-11-15 14:03:33 -- 生成日時: 2023-12-20 14:33:47
-- サーバのバージョン: 10.4.28-MariaDB -- サーバのバージョン: 10.4.32-MariaDB
-- PHP のバージョン: 8.2.4 -- PHP のバージョン: 8.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION; START TRANSACTION;
@@ -75,9 +75,6 @@ CREATE TABLE `ads` (
CREATE TABLE `emoji` ( CREATE TABLE `emoji` (
`sysid` int(11) NOT NULL, `sysid` int(11) NOT NULL,
`emojifile` varchar(512) NOT NULL, `emojifile` varchar(512) NOT NULL,
`emojitype` varchar(256) NOT NULL,
`emojicontent` mediumblob NOT NULL,
`emojisize` int(11) NOT NULL,
`emojiname` varchar(512) NOT NULL, `emojiname` varchar(512) NOT NULL,
`emojiinfo` text NOT NULL, `emojiinfo` text NOT NULL,
`emojidate` datetime NOT NULL `emojidate` datetime NOT NULL