From 0666b6b2c41080929b7c4cf82729f71dbfdf345e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=A0=E3=81=84=E3=81=A1=E3=81=BE=E3=82=8B?= <98202777+Daichimarukana@users.noreply.github.com> Date: Fri, 26 Dec 2025 12:12:47 +0900 Subject: [PATCH] uwuzu v1.6.7 Hapuego --- admin/index.php | 92 ++++++++++++++------- admin/setup_db_php.php | 17 +--- admin/setup_uwuzu_db.php | 24 ++---- admin/success.php | 17 +--- bookmark/bookmark.php | 23 ++++-- bookmark/index.php | 11 +-- css/home.css | 2 +- function/function.php | 13 ++- home/index.php | 4 +- img/sysimage/errorimage/icon_404.png | Bin 0 -> 3579 bytes js/view_function.js | 118 +++++++++++++++++---------- nextpage/notification.php | 9 +- passrecovery/badrecovery.php | 6 ++ passrecovery/donerecovery.php | 14 ++++ passrecovery/index.php | 39 ++++++--- passrecovery/startrecovery.php | 25 +++++- server/uwuzuinfo.txt | 4 +- server/uwuzurelease.txt | 12 +++ settings/index.php | 6 +- settings_admin/api/update_query.php | 81 +++++++++--------- ueuse/index.php | 3 +- update.json | 26 +++++- user/index.php | 7 +- 23 files changed, 349 insertions(+), 204 deletions(-) create mode 100644 img/sysimage/errorimage/icon_404.png diff --git a/admin/index.php b/admin/index.php index ee034a3..f8f8bbe 100644 --- a/admin/index.php +++ b/admin/index.php @@ -33,8 +33,36 @@ $pdo = null; $stmt = null; $res = null; $option = null; +$db_error = false; -if(!(empty(DB_NAME) && empty(DB_HOST) && empty(DB_USER) && empty(DB_PASS))){ +if(!(defined("DB_NAME")) || !(defined("DB_HOST")) || !(defined("DB_USER")) || !(defined("DB_PASS"))){ + $db_new_settings = " + + "; + + //サーバー設定上書き + $file = fopen("../db.php", 'w'); + $data = $db_new_settings; + fputs($file, $data); + fclose($file); + + $error_message[] = "db.phpを初期化しました。ページを再読込してください。"; + $db_error = true; + $db_php = false; +}else if(!(empty(DB_NAME) && empty(DB_HOST) && empty(DB_USER) && empty(DB_PASS))){ try { $option = array( @@ -44,9 +72,8 @@ if(!(empty(DB_NAME) && empty(DB_HOST) && empty(DB_USER) && empty(DB_PASS))){ $pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); } catch(PDOException $e) { - - // 接続エラーのときエラー内容を取得する $error_message[] = $e->getMessage(); + $db_error = true; } if(empty($error_message)){ @@ -66,34 +93,24 @@ if(!(empty(DB_NAME) && empty(DB_HOST) && empty(DB_USER) && empty(DB_PASS))){ if ($exists) { blockedIP($_SERVER['REMOTE_ADDR']); } + + $aduser = "yes"; + + $query = $pdo->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1'); + + $query->execute(array(':adminuser' => $aduser)); + + $result2 = $query->fetch(); + + if($result2 > 0){ + header("Location: ../login.php"); + exit; + } + + $db_php = true; + }else{ + $db_php = false; } - - $aduser = "yes"; - - $options = array( - // SQL実行失敗時に例外をスルー - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - // デフォルトフェッチモードを連想配列形式に設定 - PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, - // バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減) - // SELECTで得た結果に対してもrowCountメソッドを使えるようにする - PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, - ); - - $dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); - - $query = $dbh->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1'); - - $query->execute(array(':adminuser' => $aduser)); - - $result2 = $query->fetch(); - - if($result2 > 0){ - header("Location: ../login.php"); - exit; - } - - $db_php = true; }else{ $db_php = false; } @@ -156,11 +173,22 @@ $pdo = null;
おめでとうございます!!!
uwuzuの導入が完了しました!
+ + +uwuzuのセットアップをしたいところですが...
+ データベースの接続にエラーが発生しているようです。
+ 上の赤枠のエラーコードへの対応をお願いします。
+
+ なお、データベースの接続設定をやり直す場合は、db.phpを空欄のファイルにしてください。
+
これよりuwuzuのセットアップを開始します! ${line} 二段階認証コードと新しいパスワードを入力してください。 二段階認証コードと新しいパスワードを入力してください。 ユーザーネーム メールアドレス ユーザーid 新しいパスワード パスワードを表示する
セットアップを始める前に、PHPの必須モジュールがインストールされているか、以下の欄をみてご確認ください。
Not setが一つでもある場合は再度モジュールの設定を行ってください!
-
+
db.phpの設定は済んでいるようですね、それでは早速セットアップを開始しましょう!
また、uwuzuのセットアップを始める前に、以下の情報をあなたが知っている必要があります!
@@ -194,6 +222,8 @@ $pdo = null;
セットアップ開始!
+
+
diff --git a/admin/setup_db_php.php b/admin/setup_db_php.php
index 0a51a06..12c01c8 100644
--- a/admin/setup_db_php.php
+++ b/admin/setup_db_php.php
@@ -66,23 +66,14 @@ if(!(empty(DB_NAME) && empty(DB_HOST) && empty(DB_USER) && empty(DB_PASS))){
if ($exists) {
blockedIP($_SERVER['REMOTE_ADDR']);
}
+ }else{
+ header("Location: index.php");
+ exit;
}
$aduser = "yes";
- $options = array(
- // SQL実行失敗時に例外をスルー
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
- // デフォルトフェッチモードを連想配列形式に設定
- PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
- // バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
- // SELECTで得た結果に対してもrowCountメソッドを使えるようにする
- PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
- );
-
- $dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
-
- $query = $dbh->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1');
+ $query = $pdo->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1');
$query->execute(array(':adminuser' => $aduser));
diff --git a/admin/setup_uwuzu_db.php b/admin/setup_uwuzu_db.php
index c455449..60b622e 100644
--- a/admin/setup_uwuzu_db.php
+++ b/admin/setup_uwuzu_db.php
@@ -65,28 +65,18 @@ if(!(empty(DB_NAME) && empty(DB_HOST) && empty(DB_USER) && empty(DB_PASS))){
if ($exists) {
blockedIP($_SERVER['REMOTE_ADDR']);
}
+ }else{
+ header("Location: index.php");
+ exit;
}
$aduser = "yes";
- $options = array(
- // SQL実行失敗時に例外をスルー
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
- // デフォルトフェッチモードを連想配列形式に設定
- PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
- // バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
- // SELECTで得た結果に対してもrowCountメソッドを使えるようにする
- PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
- );
-
- $dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
-
try{
- $table_query = $dbh->prepare('SELECT 1 FROM role LIMIT 1;');
- $table_query->execute();
+ $table_query = $pdo->query("SHOW TABLES LIKE 'account'");
$table_result = $table_query->fetch();
- if($table_result > 0){
- $query = $dbh->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1');
+ if($table_result){
+ $query = $pdo->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1');
$query->execute(array(':adminuser' => $aduser));
@@ -100,7 +90,7 @@ if(!(empty(DB_NAME) && empty(DB_HOST) && empty(DB_USER) && empty(DB_PASS))){
exit;
}
} catch(PDOException $e) {
-
+ $error_message[] = "データベースの操作に失敗しました。(".$e.")";
}
$db_php = true;
diff --git a/admin/success.php b/admin/success.php
index c0560b8..8efc757 100644
--- a/admin/success.php
+++ b/admin/success.php
@@ -56,23 +56,14 @@ if(empty($error_message)){
if ($exists) {
blockedIP($_SERVER['REMOTE_ADDR']);
}
+}else{
+ header("Location: index.php");
+ exit;
}
$aduser = "yes";
-$options = array(
- // SQL実行失敗時に例外をスルー
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
- // デフォルトフェッチモードを連想配列形式に設定
- PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
- // バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
- // SELECTで得た結果に対してもrowCountメソッドを使えるようにする
- PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
-);
-
-$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
-
-$query = $dbh->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1');
+$query = $pdo->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1');
$query->execute(array(':adminuser' => $aduser));
diff --git a/bookmark/bookmark.php b/bookmark/bookmark.php
index 394df64..efdcb8c 100644
--- a/bookmark/bookmark.php
+++ b/bookmark/bookmark.php
@@ -69,16 +69,21 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && sa
// 新しいいいね情報を更新
$newbookmark = implode(',', $bookmarkList);
- $updateQuery = $pdo->prepare("UPDATE account SET bookmark = :bookmark WHERE userid = :userid");
- $updateQuery->bindValue(':bookmark', $newbookmark, PDO::PARAM_STR);
- $updateQuery->bindValue(':userid', $userId, PDO::PARAM_STR);
- $res = $updateQuery->execute();
+ if(!(mb_strlen($newbookmark) >= 16777215)){
+ $updateQuery = $pdo->prepare("UPDATE account SET bookmark = :bookmark WHERE userid = :userid");
+ $updateQuery->bindValue(':bookmark', $newbookmark, PDO::PARAM_STR);
+ $updateQuery->bindValue(':userid', $userId, PDO::PARAM_STR);
+ $res = $updateQuery->execute();
- if ($res) {
- echo json_encode(['success' => true, 'newbookmark' => 'success']);
- exit;
- } else {
- echo json_encode(['success' => false, 'error' => 'ブックマークの更新に失敗しました。']);
+ if ($res) {
+ echo json_encode(['success' => true, 'newbookmark' => 'success']);
+ exit;
+ } else {
+ echo json_encode(['success' => false, 'error' => 'ブックマークの更新に失敗しました。']);
+ exit;
+ }
+ }else{
+ echo json_encode(['success' => false, 'error' => 'ブックマーク数が多すぎます。']);
exit;
}
} else {
diff --git a/bookmark/index.php b/bookmark/index.php
index 6a26686..f9daedd 100644
--- a/bookmark/index.php
+++ b/bookmark/index.php
@@ -344,12 +344,13 @@ $(document).ready(function () {
dataType: 'json',
success: function (response) {
if (response.success) {
- // いいね成功時の処理
if (isLiked) {
- $this.removeClass('bookmark_after'); // クラスを削除していいねを取り消す
- } else {
- $this.addClass('bookmark_after'); // クラスを追加していいねを追加する
- }
+ $this.removeClass('bookmark_after'); // クラスを削除していいねを取り消す
+ view_notify("ブックマークを解除しました");
+ } else {
+ $this.addClass('bookmark_after'); // クラスを追加していいねを追加する
+ view_notify("ユーズをブックマークしました!");
+ }
} else {
// いいね失敗時の処理
}
diff --git a/css/home.css b/css/home.css
index b733f4c..94f5972 100644
--- a/css/home.css
+++ b/css/home.css
@@ -4459,7 +4459,7 @@ label>input {
.notification .flebox .username img {
margin-left: 6px;
margin-right: 6px;
- width: 14px;
+ width: fit-content;
height: 14px;
}
diff --git a/function/function.php b/function/function.php
index 9759b3c..0c4994d 100644
--- a/function/function.php
+++ b/function/function.php
@@ -566,8 +566,10 @@ function resizeImage($filePath, $maxWidth, $maxHeight) {
list($originalWidth, $originalHeight) = getimagesize($filePath);
if ($originalWidth <= $maxWidth && $originalHeight <= $maxHeight) {
- imagewebp($originalImage, $filePath, 90);
- imagedestroy($originalImage);
+ $originalImage_webp = imagecreatetruecolor($originalWidth, $originalHeight);
+ imagecopyresampled($originalImage_webp, $originalImage, 0, 0, 0, 0, $originalWidth, $originalHeight, $originalWidth, $originalHeight);
+
+ imagewebp($originalImage_webp, $filePath, 90);
return true;
}
@@ -588,11 +590,8 @@ function resizeImage($filePath, $maxWidth, $maxHeight) {
// 画像をリサイズ
imagecopyresampled($resizedImage, $originalImage, 0, 0, 0, 0, $newWidth, $newHeight, $originalWidth, $originalHeight);
// リサイズされた画像を表示
- imagewebp($resizedImage, $filePath);
- // メモリの解放
- imagedestroy($originalImage);
- imagedestroy($resizedImage);
-
+ imagewebp($resizedImage, $filePath, 90);
+
return true;
}
}
diff --git a/home/index.php b/home/index.php
index a86c164..5ae4c34 100644
--- a/home/index.php
+++ b/home/index.php
@@ -638,11 +638,12 @@ $(document).ready(function() {
dataType: 'json',
success: function(response) {
if (response.success) {
- // いいね成功時の処理
if (isLiked) {
$this.removeClass('bookmark_after'); // クラスを削除していいねを取り消す
+ view_notify("ブックマークを解除しました");
} else {
$this.addClass('bookmark_after'); // クラスを追加していいねを追加する
+ view_notify("ユーズをブックマークしました!");
}
} else {
// いいね失敗時の処理
@@ -686,6 +687,7 @@ $(document).ready(function() {
success: function (response) {
if (response.success) {
postElement.remove();
+ view_notify("ユーズを削除しました!");
} else {
view_notify("ユーズの削除に失敗しました");
}
diff --git a/img/sysimage/errorimage/icon_404.png b/img/sysimage/errorimage/icon_404.png
new file mode 100644
index 0000000000000000000000000000000000000000..fb33e9a56b689670a37c39b2d04b8ee11d0bf505
GIT binary patch
literal 3579
zcmeHKYfzI{8a_$0S#Yh%z;0!gRbm%V%Vi5xL9P;AE`>mm)=A|eE{KQ(3Y1)c5ZpCU
zDWnQ(Bnbgpz#Ak$1dTxgf=v+`; // ここで生成
+ return `
`; // ここで生成
});
return text;
@@ -265,6 +265,7 @@ function deleteLocalstorage(key, pagepath) {
}
}
+/*
function a_link(text) {
const placeholders = {};
let placeholderIndex = 0;
@@ -298,54 +299,74 @@ function a_link(text) {
return text;
}
+*/
function formatMarkdown(text) {
const placeholders = {};
let placeholderIndex = 0;
- // URLをプレースホルダーに退避
- text = text.replace(/]*>[\s\S]*?<\/a>/g, (match) => {
+ // ヘルパー関数: プレースホルダーを作成して保存
+ function createPlaceholder(content) {
const key = `\u2063{{PLACEHOLDER${placeholderIndex++}}}\u2063`;
- placeholders[key] = match; // 元の文字列を保存
+ placeholders[key] = content;
return key;
- });
+ }
- // 複数行インラインコード(バッククォート3つ)を検出して、
で囲む
+ // 複数行コードブロック (```)
text = text.replace(/```([\s\S]+?)```/g, (match, code) => {
- const key = `\u2063{{PLACEHOLDER${placeholderIndex++}}}\u2063`;
- placeholders[key] = `
`;
- return key;
+ // 先頭の改行のみ削除
+ const cleanCode = code.replace(/^\s*\n/, '');
+ // ${code.replace(/^\s*\n/, '')} で包んで退避
+ return createPlaceholder(`
`);
});
- // コードブロックの退避
+ // インラインコード (`)
text = text.replace(/`([^`\n]+)`/g, (_, code) => {
- const key = `\u2063{{PLACEHOLDER${placeholderIndex++}}}\u2063`;
- placeholders[key] = `${code}`;
- return key;
+ return createPlaceholder(`${code}`);
});
- // コロンで囲まれた絵文字をプレースホルダーに退避
+ // 既存のaタグ
+ text = text.replace(/]*>[\s\S]*?<\/a>/gi, (match) => {
+ return createPlaceholder(match);
+ });
+
+ // ユーザーメンション (@user)
+ text = text.replace(/@([a-zA-Z0-9_]+)(?:@([a-zA-Z0-9_.-]+))?/g, (match) => {
+ return createPlaceholder(match);
+ });
+
+ // カスタム絵文字 (:emoji:)
text = text.replace(/:([a-zA-Z0-9_]+):/g, (match) => {
- const key = `\u2063{{PLACEHOLDER${placeholderIndex++}}}\u2063`;
- placeholders[key] = match; // 元の文字列を保存
- return key;
+ return createPlaceholder(match);
});
- // ユーザーIDをプレースホルダーに退避
- text = text.replace(/@([a-zA-Z0-9_]+)/g, (match) => {
- const key = `\u2063{{PLACEHOLDER${placeholderIndex++}}}\u2063`;
- placeholders[key] = match; // 元の文字列を保存
- return key;
+ // a_link
+ text = text.replace(/(https:\/\/[\w!?\/+\-_~;.,*&@#$%()+|https:\/\/[ぁ-んァ-ヶ一ー-龠々\w\-\/?=&%.]+)/g, function (url) {
+ const escapedUrl = url;
+ const no_https_link = escapedUrl.replace("https://", "");
+ let linkText = no_https_link;
+
+ if (no_https_link.length > 48) {
+ linkText = no_https_link.substring(0, 48) + '...';
+ }
+
+ return `${linkText}`;
});
- // 独自構文などの装飾
+ // ハッシュタグ
+ text = text.replace(/(^|[^a-zA-Z0-9_])#([a-zA-Z0-9ぁ-んァ-ン一-龥ー_]+)/gu, function (match, before, tag) {
+ const encodedTag = encodeURIComponent("#" + tag);
+ return `${before}#${tag}`;
+ });
+
+ // 独自構文
text = text.replace(/\[\[buruburu (.+?)\]\]/g, '$1');
text = text.replace(/\[\[time (\d+)\]\]/g, (_, ts) => {
const d = new Date(parseInt(ts, 10) * 1000);
return `${d.toLocaleString()}`;
});
- // マークダウン風装飾
+ // 文字装飾
text = text
.replace(/\*\*\*(.+?)\*\*\*/g, '$1')
.replace(/___(.+?)___/g, '$1')
@@ -354,7 +375,7 @@ function formatMarkdown(text) {
.replace(/\*(.+?)\*/g, '$1')
.replace(/_(.+?)_/g, '$1')
.replace(/~~(.+?)~~/g, '${cleanCode}$1')
- .replace(/^>>> ?(.*)$/gm, '$1') // ここを修正
+ .replace(/^>>> ?(.*)$/gm, '$1')
.replace(/\|\|(.+?)\|\|/g, '$1')
.replace(/^# (.+)/gm, '$1
')
.replace(/^## (.+)/gm, '$1
')
@@ -366,10 +387,11 @@ function formatMarkdown(text) {
line = line.trim();
return line === '' ? '
' : `
+
+
+
`+ await replaceCustomEmojis(title) + `
diff --git a/nextpage/notification.php b/nextpage/notification.php
index 70929fa..3fca8c7 100644
--- a/nextpage/notification.php
+++ b/nextpage/notification.php
@@ -78,8 +78,13 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
$value['fromusername'] = "でふぉると";
}
}else{
- $value['fromusericon'] = safetext($value["servericon"]);
- $value['fromusername'] = "uwuzu";
+ if(!empty($value["servericon"])){
+ $value['fromusericon'] = safetext($value["servericon"]);
+ $value['fromusername'] = "uwuzu";
+ }else{
+ $value['fromusericon'] = "../img/uwuzuicon.png";
+ $value['fromusername'] = "uwuzu";
+ }
}
}
diff --git a/passrecovery/badrecovery.php b/passrecovery/badrecovery.php
index 8fcc98c..754b422 100644
--- a/passrecovery/badrecovery.php
+++ b/passrecovery/badrecovery.php
@@ -24,6 +24,12 @@ if(!($is_login === false)){
exit;
}
//-------------------------------------------------------------
+if(isset($_SESSION['auth_status'])){
+ if($_SESSION['auth_status'] === "go_recovery"){
+ header("Location: startrecovery.php");
+ exit;
+ }
+}
?>
diff --git a/passrecovery/donerecovery.php b/passrecovery/donerecovery.php
index 353ed22..de0a8f0 100644
--- a/passrecovery/donerecovery.php
+++ b/passrecovery/donerecovery.php
@@ -24,6 +24,20 @@ if(!($is_login === false)){
exit;
}
//-------------------------------------------------------------
+if(isset($_SESSION['auth_status'])){
+ if(!($_SESSION['auth_status'] === "done_recovery")){
+ if($_SESSION['auth_status'] === "bad_recovery"){
+ $_SESSION = array();
+ header("Location: badrecovery.php");
+ exit;
+ }else{
+ $_SESSION = array();
+ header("Location: index.php");
+ exit;
+ }
+ }
+}
+
?>
diff --git a/passrecovery/index.php b/passrecovery/index.php
index a79664e..200162b 100644
--- a/passrecovery/index.php
+++ b/passrecovery/index.php
@@ -73,6 +73,10 @@ if(!($is_login === false)){
header("Location: ../home/");
exit;
}
+//パスワード試行回数制限-------------------------------------------
+if (!isset($_SESSION['login_passtry'])) {
+ $_SESSION['login_passtry'] = 0;
+}
//-------------------------------------------------------------
if( !empty($_POST['btn_submit']) ) {
@@ -153,10 +157,6 @@ if( !empty($_POST['btn_submit']) ) {
// SQL実行
$result->execute();
-
-
- // ... (前略)
- // IDの入力チェック
if( empty($userid) ) {
$error_message[] = 'ユーザーIDを入力してください。(USERID_INPUT_PLEASE)';
} else {
@@ -167,6 +167,21 @@ if( !empty($_POST['btn_submit']) ) {
if(!(preg_match("/^[a-zA-Z0-9_]+$/", $userid))){
$error_message[] = "IDは半角英数字で入力してください。(「_」は使用可能です。)(USERID_DONT_USE_WORD)";
}
+
+ if ($_SESSION["login_passtry"] <= 5) {
+ $delay = $_SESSION["login_passtry"] * 2;
+ } else {
+ $delay = min(pow(2, $_SESSION["login_passtry"] - 2), 60);
+ }
+ sleep($delay);
+
+ $locknow_loginLog = isUserLockedByloginLog($pdo, $userid, $_SERVER['REMOTE_ADDR']);
+ if($locknow_loginLog[0] === true){
+ $_SESSION["login_passtry"]++;
+ addloginLog($pdo, $userid, $_SERVER['REMOTE_ADDR']);
+ $error_message[] = '現在あなたのアカウントは保護のためロックされています。しばらく時間を開けてから再度お試しください。';
+ }
+
if(empty($error_message)){
if($result->rowCount() > 0) {
$row = $result->fetch(); // ここでデータベースから取得した値を $row に代入する
@@ -184,40 +199,44 @@ if( !empty($_POST['btn_submit']) ) {
if(MAIL_CHKS == "true"){
$_SESSION['userid'] = $userid;
$_SESSION['mailadds'] = $dec_mailadds;
+ $_SESSION['auth_status'] = 'go_recovery';
$url = 'startrecovery.php';
header('Location: ' . $url, true, 303);
- // すべての出力を終了
exit;
}
}
if(empty($row["authcode"])){
-
$_SESSION['userid'] = "";
+ $_SESSION['auth_status'] = 'bad_recovery';
$url = 'badrecovery.php';
header('Location: ' . $url, true, 303);
- // すべての出力を終了
exit;
}else{
$_SESSION['userid'] = $userid;
$_SESSION['mailadds'] = $dec_mailadds;
+ $_SESSION['auth_status'] = 'go_recovery';
$url = 'startrecovery.php';
header('Location: ' . $url, true, 303);
- // すべての出力を終了
exit;
}
- }
- else{
+ }else{
+ $_SESSION["login_passtry"]++;
+ addloginLog($pdo, $userid, $_SERVER['REMOTE_ADDR']);
$error_message[] = 'IDまたはメールアドレスが違います(ID_OR_MAILADDS_CHIGAUYANKE)';
}
}else{
+ $_SESSION["login_passtry"]++;
+ addloginLog($pdo, $userid, $_SERVER['REMOTE_ADDR']);
$error_message[] = 'IDまたはメールアドレスが違います(ID_OR_MAILADDS_CHIGAUYANKE)';
}
}
else {
+ $_SESSION["login_passtry"]++;
+ addloginLog($pdo, $userid, $_SERVER['REMOTE_ADDR']);
$error_message[] = 'IDまたはメールアドレスが違います(ID_OR_MAILADDS_CHIGAUYANKE)';
}
}
diff --git a/passrecovery/startrecovery.php b/passrecovery/startrecovery.php
index d311063..e1d412a 100644
--- a/passrecovery/startrecovery.php
+++ b/passrecovery/startrecovery.php
@@ -73,6 +73,25 @@ if(!($is_login === false)){
//-------------------------------------------------------------
if(!($userid == null)){
+ if($_SESSION['auth_status'] === "go_recovery"){
+ $userData = getUserData($pdo, $_SESSION['userid']);
+ if(!(empty($userData))){
+ $userid = $userData["userid"];
+ }else{
+ $_SESSION = array();
+ header("Location: badrecovery.php");
+ exit;
+ }
+ }elseif($_SESSION['auth_status'] === "bad_recovery"){
+ $_SESSION = array();
+ header("Location: badrecovery.php");
+ exit;
+ }else{
+ $_SESSION = array();
+ header("Location: badrecovery.php");
+ exit;
+ }
+
if( !empty($_SESSION['mailadds']) ) {
$result = $pdo->prepare("SELECT userid, username, mailadds, loginid, authcode, encryption_ivkey, datetime FROM account WHERE userid = :userid");
$result->bindValue(':userid', $userid);
@@ -157,6 +176,7 @@ if(!($userid == null)){
send_notification($userid,"uwuzu-fromsys","🔴アカウントのパスワードが復元により変更されました。🔴",$msg,"/others", "system");
$_SESSION['userid'] = "";
+ $_SESSION['auth_status'] = 'done_recovery';
$url = 'donerecovery.php';
header('Location: ' . $url, true, 303);
@@ -258,6 +278,7 @@ if(!($userid == null)){
send_notification($userid,"uwuzu-fromsys","🔴アカウントのパスワードが復元により変更されました。🔴",$msg,"/others", "system");
$_SESSION['userid'] = "";
+ $_SESSION['auth_status'] = 'done_recovery';
$url = 'donerecovery.php';
header('Location: ' . $url, true, 303);
@@ -306,6 +327,7 @@ if(!($userid == null)){
}else{
$_SESSION['mailadds'] = "";
$_SESSION['userid'] = "";
+ $_SESSION['auth_status'] = 'bad_recovery';
$url = 'badrecovery.php';
header('Location: ' . $url, true, 303);
exit;
@@ -346,7 +368,8 @@ $pdo = null;
二段階認証
-
メールで認証することも可能です。
diff --git a/server/uwuzuinfo.txt b/server/uwuzuinfo.txt
index 24319fd..3bcfbad 100644
--- a/server/uwuzuinfo.txt
+++ b/server/uwuzuinfo.txt
@@ -1,4 +1,4 @@
uwuzu
-1.6.6
-2025/11/08
+1.6.7
+2025/12/26
daichimarukana,putonfps
\ No newline at end of file
diff --git a/server/uwuzurelease.txt b/server/uwuzurelease.txt
index 6f89d47..24bdc3f 100644
--- a/server/uwuzurelease.txt
+++ b/server/uwuzurelease.txt
@@ -1,6 +1,18 @@
## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
+## Version 1.6.7 (Hapuego)
+2025/12/26
+fix: 通知ページにてユーザー名に含まれるカスタム絵文字が横にぎゅっと表示されてしまう問題を修正しました!
+fix: パレットイメージがアップロードできない問題を修正しました!
+fix: サーバーアイコンが設定されていない状態でuwuzuから通知が届くとアイコンが表示されない問題を修正しました!
+fix: ユーズの装飾のコードブロック内でURLやハッシュタグなどを使用した際にPLACEHOLER(数字)と表示されてしまう問題を修正しました。
+fix: パスワードの復元に関する脆弱性を修正しました!
+new: uwuzuのセットアップ時に、データベース周りでエラーが発生した際に簡単なエラーで伝え、db.phpの中身が空になった際には自動で再生成する機能を追加しました!
+new: ブックマーク追加時に画面上からお知らせするようにしました!
+chg: uwuzuから通知を受け取った際に、ユーザー名部分のリンク先をサーバー情報ページに変更しました!
+chg: その他微調整を行いました!
+
## Version 1.6.6 (Hapuego)
2025/11/08
fix: アカウント削除時にフォロー情報が削除されない問題を修正しました!
diff --git a/settings/index.php b/settings/index.php
index ecc5f69..fa009cf 100644
--- a/settings/index.php
+++ b/settings/index.php
@@ -545,7 +545,7 @@ $pdo = null;
パスワード