mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-04 19:14:41 +00:00
uwuzu v1.6.14 Hapuego
This commit is contained in:
+5
-35
@@ -132,39 +132,9 @@ if( !empty($pdo) ) {
|
|||||||
$backuplogin = false;
|
$backuplogin = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($backuplogin === true || uwuzu_password_verify($userbackupcode,$row["backupcode"])){
|
if($backuplogin === true || uwuzu_password_verify($userbackupcode,$row["backupcode"])){
|
||||||
$pdo->beginTransaction();
|
$msg = "バックアップコードを使用しログインされました!\nバックアップコード変更のために二段階認証を再設定することを強くおすすめします。\nまた、もしバックアップコードを利用してログインした覚えがない場合は「その他」よりセッショントークンを再生成し、設定画面よりパスワードを変更し、二段階認証を再設定してください!\n\nログインした端末 : ".$device;
|
||||||
|
send_notification($userid,"uwuzu-fromsys","🔴バックアップコード使用のお知らせ🔴",$msg,"/settings", "login");
|
||||||
try {
|
|
||||||
$touserid = $userid;
|
|
||||||
$datetime = date("Y-m-d H:i:s");
|
|
||||||
$msg = "バックアップコードを使用しログインされました!\nバックアップコード変更のために二段階認証を再設定することを強くおすすめします。\nまた、もしバックアップコードを利用してログインした覚えがない場合は「その他」よりセッショントークンを再生成し、設定画面よりパスワードを変更し、二段階認証を再設定してください!\n\nログインした端末 : ".$device;
|
|
||||||
$title = '🔴バックアップコード使用のお知らせ🔴';
|
|
||||||
$url = '/settings';
|
|
||||||
$userchk = 'none';
|
|
||||||
// 通知用SQL作成
|
|
||||||
$stmt = $pdo->prepare("INSERT INTO notification (fromuserid, touserid, msg, url, datetime, userchk, title) VALUES (:fromuserid, :touserid, :msg, :url, :datetime, :userchk, :title)");
|
|
||||||
|
|
||||||
$stmt->bindParam(':fromuserid', safetext("uwuzu-fromsys"), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':touserid', safetext($touserid), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':msg', safetext($msg), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':url', safetext($url), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':userchk', safetext($userchk), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':title', safetext($title), PDO::PARAM_STR);
|
|
||||||
|
|
||||||
$stmt->bindParam(':datetime', safetext($datetime), PDO::PARAM_STR);
|
|
||||||
|
|
||||||
// SQLクエリの実行
|
|
||||||
$res = $stmt->execute();
|
|
||||||
|
|
||||||
// コミット
|
|
||||||
$res = $pdo->commit();
|
|
||||||
|
|
||||||
} catch(Exception $e) {
|
|
||||||
|
|
||||||
// エラーが発生した時はロールバック
|
|
||||||
$pdo->rollBack();
|
|
||||||
}
|
|
||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
@@ -199,7 +169,7 @@ if( !empty($pdo) ) {
|
|||||||
$_SESSION['loginid'] = $userData["loginid"];
|
$_SESSION['loginid'] = $userData["loginid"];
|
||||||
$_SESSION['loginkey'] = $userLoginKey;
|
$_SESSION['loginkey'] = $userLoginKey;
|
||||||
|
|
||||||
$_SESSION['username'] = $username;
|
$_SESSION['username'] = $userData["username"];
|
||||||
$_SESSION['password'] = null;
|
$_SESSION['password'] = null;
|
||||||
$_SESSION["login_passtry"] = 0;
|
$_SESSION["login_passtry"] = 0;
|
||||||
|
|
||||||
@@ -276,7 +246,7 @@ if( !empty($pdo) ) {
|
|||||||
$_SESSION['loginid'] = $userData["loginid"];
|
$_SESSION['loginid'] = $userData["loginid"];
|
||||||
$_SESSION['loginkey'] = $userLoginKey;
|
$_SESSION['loginkey'] = $userLoginKey;
|
||||||
|
|
||||||
$_SESSION['username'] = $username;
|
$_SESSION['username'] = $userData["username"];
|
||||||
$_SESSION['password'] = null;
|
$_SESSION['password'] = null;
|
||||||
$_SESSION["login_passtry"] = 0;
|
$_SESSION["login_passtry"] = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ $stmt = null;
|
|||||||
$res = null;
|
$res = null;
|
||||||
$option = null;
|
$option = null;
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
|
||||||
session_name('uwuzu_s_id');
|
session_name('uwuzu_s_id');
|
||||||
session_set_cookie_params([
|
session_set_cookie_params([
|
||||||
'lifetime' => 0,
|
'lifetime' => 0,
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ if( !empty($pdo) ) {
|
|||||||
$_SESSION['loginid'] = $userData["loginid"];
|
$_SESSION['loginid'] = $userData["loginid"];
|
||||||
$_SESSION['loginkey'] = $userLoginKey;
|
$_SESSION['loginkey'] = $userLoginKey;
|
||||||
|
|
||||||
$_SESSION['username'] = $username;
|
$_SESSION['username'] = $userData["username"];
|
||||||
$_SESSION['password'] = null;
|
$_SESSION['password'] = null;
|
||||||
|
|
||||||
//ログイン失敗履歴のお掃除
|
//ログイン失敗履歴のお掃除
|
||||||
|
|||||||
+61
-11
@@ -36,16 +36,9 @@ body {
|
|||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
padding-top: 12px;
|
padding-top: 12px;
|
||||||
background-color: var(--background-color);
|
background-color: var(--background-color);
|
||||||
/* 画像を常に天地左右の中央に配置 */
|
|
||||||
background-position: center center;
|
background-position: center center;
|
||||||
|
|
||||||
/* 画像をタイル状に繰り返し表示しない */
|
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
|
||||||
/* コンテンツの高さが画像の高さより大きい時、動かないように固定 */
|
|
||||||
background-attachment: fixed;
|
background-attachment: fixed;
|
||||||
|
|
||||||
/* 表示するコンテナの大きさに基づいて、背景画像を調整 */
|
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1130,6 +1123,7 @@ main h1 {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-family: var(--Text-fonts), sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ueuse .flebox a .u_name img {
|
.ueuse .flebox a .u_name img {
|
||||||
@@ -1143,7 +1137,28 @@ main h1 {
|
|||||||
border-radius: 0px;
|
border-radius: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ueuse .flebox a .status {
|
||||||
|
position: absolute;
|
||||||
|
left: calc(48px - 28px);
|
||||||
|
top: calc(48px - 16px);
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #CCC;
|
||||||
|
border: solid 4px var(--tl-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ueuse .flebox a .green {
|
||||||
|
background-color: #00cc4e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ueuse .flebox a .yellow {
|
||||||
|
background-color: #ffc400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ueuse .flebox a .gray {
|
||||||
|
background-color: #CCC;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.ueuse .flebox .idbox {
|
.ueuse .flebox .idbox {
|
||||||
@@ -1601,16 +1616,34 @@ main h1 {
|
|||||||
|
|
||||||
.ueuse .youtube_and_nicovideo_player {
|
.ueuse .youtube_and_nicovideo_player {
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
width: 100%;
|
width: calc(100% - 2px);
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
|
min-height: 152px;
|
||||||
|
background-color: var(--background-color);
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: solid 1px var(--border-color);
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ueuse .youtube_and_nicovideo_player p{
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
font-family: var(--Mono-fonts);
|
||||||
|
color: var(--text-color);
|
||||||
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ueuse .youtube_and_nicovideo_player iframe {
|
.ueuse .youtube_and_nicovideo_player iframe {
|
||||||
border: none;
|
border: none;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
max-height: 50dvh;
|
||||||
aspect-ratio: 16 / 9;
|
aspect-ratio: 16 / 9;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
border: 1px solid var(--border-color);
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ueuse .abi {
|
.ueuse .abi {
|
||||||
@@ -6792,6 +6825,7 @@ noscript .noscript_modal .inner .center_text p {
|
|||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
padding-top: 0px;
|
padding-top: 0px;
|
||||||
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.userleftbox {
|
.userleftbox {
|
||||||
@@ -7331,6 +7365,13 @@ noscript .noscript_modal .inner .center_text p {
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ueuse .youtube_and_nicovideo_player iframe {
|
||||||
|
max-height: 25dvh;
|
||||||
|
}
|
||||||
|
.youtube_and_nicovideo_player iframe[src*="spotify.com"] {
|
||||||
|
height: 152px;
|
||||||
|
}
|
||||||
|
|
||||||
.leftbox {
|
.leftbox {
|
||||||
display: block;
|
display: block;
|
||||||
border-radius: 17px;
|
border-radius: 17px;
|
||||||
@@ -8477,6 +8518,10 @@ noscript .noscript_modal .inner .center_text p {
|
|||||||
color: var(--main-color);
|
color: var(--main-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ueuse .flebox a .status {
|
||||||
|
border: solid 4px var(--dark-sub-color);
|
||||||
|
}
|
||||||
|
|
||||||
.ueuse p {
|
.ueuse p {
|
||||||
color: var(--dark-text-color);
|
color: var(--dark-text-color);
|
||||||
}
|
}
|
||||||
@@ -8765,8 +8810,13 @@ noscript .noscript_modal .inner .center_text p {
|
|||||||
background-color: var(--dark-sub-color);
|
background-color: var(--dark-sub-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ueuse .youtube_and_nicovideo_player iframe {
|
.ueuse .youtube_and_nicovideo_player p{
|
||||||
border: 1px solid var(--dark-border-color);
|
color: var(--dark-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ueuse .youtube_and_nicovideo_player {
|
||||||
|
background-color: var(--dark-background-color);
|
||||||
|
border: solid 1px var(--dark-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.userheader h2 {
|
.userheader h2 {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ require('../db.php');
|
|||||||
require("function.php");
|
require("function.php");
|
||||||
blockedIP($_SERVER['REMOTE_ADDR']);
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id'])) && safetext(isset($_COOKIE['loginkey']))) {
|
if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id'])) && safetext(isset($_COOKIE['loginkey']))) {
|
||||||
|
$userid = safetext($_POST['userid']);
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
@@ -15,8 +16,6 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && sa
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
actionLog($userid, "error", "ueuse", null, $e, 4);
|
actionLog($userid, "error", "ueuse", null, $e, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
$userid = safetext($_POST['userid']);
|
|
||||||
|
|
||||||
$uniqid = safetext($_POST['uniqid']);
|
$uniqid = safetext($_POST['uniqid']);
|
||||||
$loginid = safetext($_POST['account_id']);
|
$loginid = safetext($_POST['account_id']);
|
||||||
|
|||||||
+44
-7
@@ -1179,6 +1179,7 @@ function x1024($byte){
|
|||||||
}
|
}
|
||||||
function uwuzu_ver($select,$path){
|
function uwuzu_ver($select,$path){
|
||||||
$softwaredata = file_get_contents($path);
|
$softwaredata = file_get_contents($path);
|
||||||
|
$software_info = array();
|
||||||
|
|
||||||
$softwaredata = explode( "\n", $softwaredata );
|
$softwaredata = explode( "\n", $softwaredata );
|
||||||
$cnt = count( $softwaredata );
|
$cnt = count( $softwaredata );
|
||||||
@@ -3633,6 +3634,7 @@ function uwuzu_password_verify($password, $hash){
|
|||||||
//ユーザーのOther_Settings読み取り関数
|
//ユーザーのOther_Settings読み取り関数
|
||||||
function val_OtherSettings($dataname, $jsontext){
|
function val_OtherSettings($dataname, $jsontext){
|
||||||
$other_settings = json_decode($jsontext, true);
|
$other_settings = json_decode($jsontext, true);
|
||||||
|
$ret = false;
|
||||||
if(!(empty($other_settings[$dataname]))) {
|
if(!(empty($other_settings[$dataname]))) {
|
||||||
if(is_bool($other_settings[$dataname]) === true){
|
if(is_bool($other_settings[$dataname]) === true){
|
||||||
if($other_settings[$dataname] == true){
|
if($other_settings[$dataname] == true){
|
||||||
@@ -3653,6 +3655,7 @@ function val_OtherSettings($dataname, $jsontext){
|
|||||||
//ユーザーのOther_Settings追加関数
|
//ユーザーのOther_Settings追加関数
|
||||||
function val_AddOtherSettings($dataname, $data, $jsontext){
|
function val_AddOtherSettings($dataname, $data, $jsontext){
|
||||||
$other_settings = json_decode($jsontext, true);
|
$other_settings = json_decode($jsontext, true);
|
||||||
|
$ret = false;
|
||||||
if(empty($other_settings)){
|
if(empty($other_settings)){
|
||||||
$new_data = [$dataname=>$data];
|
$new_data = [$dataname=>$data];
|
||||||
$ret = json_encode($new_data);
|
$ret = json_encode($new_data);
|
||||||
@@ -3719,6 +3722,33 @@ function is_OtherSettings($pdo, $userid, $add = true){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getUserOnlineStatus(string $last_login_datetime, string $other_settings){
|
||||||
|
$isPublicOnlineStatus = val_OtherSettings("isPublicOnlineStatus", $other_settings);
|
||||||
|
if($isPublicOnlineStatus === true){
|
||||||
|
if (!(empty($last_login_datetime))) {
|
||||||
|
$lastLogin = new DateTime($last_login_datetime);
|
||||||
|
$now = new DateTime();
|
||||||
|
|
||||||
|
$interval = $now->diff($lastLogin);
|
||||||
|
|
||||||
|
$minutesPast = ($interval->days * 24 * 60) + ($interval->h * 60) + $interval->i;
|
||||||
|
|
||||||
|
if ($minutesPast <= 5) {
|
||||||
|
$OnlineStatus = "Online";
|
||||||
|
} elseif ($minutesPast <= 15) {
|
||||||
|
$OnlineStatus = "Away";
|
||||||
|
} else {
|
||||||
|
$OnlineStatus = "Offline";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$OnlineStatus = "Offline";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$OnlineStatus = "Private";
|
||||||
|
}
|
||||||
|
return $OnlineStatus;
|
||||||
|
}
|
||||||
|
|
||||||
function GetActivityPubJson($url) {
|
function GetActivityPubJson($url) {
|
||||||
$ch = curl_init($url);
|
$ch = curl_init($url);
|
||||||
curl_setopt_array($ch, [
|
curl_setopt_array($ch, [
|
||||||
@@ -3824,16 +3854,18 @@ function GetActivityPubUser($userid, $domain) {
|
|||||||
function FormatUeuseItem(array $value, string $myblocklist, string $mybookmark, $pdo, string $userId): ?array {
|
function FormatUeuseItem(array $value, string $myblocklist, string $mybookmark, $pdo, string $userId): ?array {
|
||||||
if ($value["role"] === "ice") return null;
|
if ($value["role"] === "ice") return null;
|
||||||
|
|
||||||
|
if(isset($value["other_settings"])) {
|
||||||
|
$value["isAIBlock"] = val_OtherSettings("isAIBlock", $value["other_settings"]);
|
||||||
|
$value["OnlineStatus"] = getUserOnlineStatus($value["last_login_datetime"], $value["other_settings"]);
|
||||||
|
} else {
|
||||||
|
$value["isAIBlock"] = false;
|
||||||
|
$value["OnlineStatus"] = null;
|
||||||
|
}
|
||||||
|
|
||||||
$value['iconname'] = filter_var($value['iconname'], FILTER_VALIDATE_URL)
|
$value['iconname'] = filter_var($value['iconname'], FILTER_VALIDATE_URL)
|
||||||
? $value['iconname']
|
? $value['iconname']
|
||||||
: "../" . $value['iconname'];
|
: "../" . $value['iconname'];
|
||||||
|
|
||||||
if(isset($value["other_settings"])) {
|
|
||||||
$value["isAIBlock"] = val_OtherSettings("isAIBlock", $value["other_settings"]);
|
|
||||||
} else {
|
|
||||||
$value["isAIBlock"] = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$value = to_null($value);
|
$value = to_null($value);
|
||||||
$value = to_array_safetext($value);
|
$value = to_array_safetext($value);
|
||||||
$value["role"] = explode(',', $value["role"]);
|
$value["role"] = explode(',', $value["role"]);
|
||||||
@@ -3862,8 +3894,10 @@ function FormatUeuseItem(array $value, string $myblocklist, string $mybookmark,
|
|||||||
|
|
||||||
if(isset($reusedUserData["other_settings"])) {
|
if(isset($reusedUserData["other_settings"])) {
|
||||||
$reusedUserData["isAIBlock"] = val_OtherSettings("isAIBlock", $reusedUserData["other_settings"]);
|
$reusedUserData["isAIBlock"] = val_OtherSettings("isAIBlock", $reusedUserData["other_settings"]);
|
||||||
|
$reusedUserData["OnlineStatus"] = getUserOnlineStatus($reusedUserData["last_login_datetime"], $reusedUserData["other_settings"]);
|
||||||
} else {
|
} else {
|
||||||
$reusedUserData["isAIBlock"] = false;
|
$reusedUserData["isAIBlock"] = false;
|
||||||
|
$reusedUserData["OnlineStatus"] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$reused = to_null($reused);
|
$reused = to_null($reused);
|
||||||
@@ -3889,6 +3923,7 @@ function FormatUeuseItem(array $value, string $myblocklist, string $mybookmark,
|
|||||||
"role" => $reusedUserData["role"],
|
"role" => $reusedUserData["role"],
|
||||||
"is_bot" => $reusedUserData["is_bot"],
|
"is_bot" => $reusedUserData["is_bot"],
|
||||||
"is_aiblock" => (bool)$reusedUserData["isAIBlock"],
|
"is_aiblock" => (bool)$reusedUserData["isAIBlock"],
|
||||||
|
"online_status" => $reusedUserData["OnlineStatus"],
|
||||||
],
|
],
|
||||||
"ueuse" => $reused["ueuse"],
|
"ueuse" => $reused["ueuse"],
|
||||||
"photo1" => $reused["photo1"],
|
"photo1" => $reused["photo1"],
|
||||||
@@ -3929,6 +3964,7 @@ function FormatUeuseItem(array $value, string $myblocklist, string $mybookmark,
|
|||||||
"role" => $value["role"],
|
"role" => $value["role"],
|
||||||
"is_bot" => $value["is_bot"],
|
"is_bot" => $value["is_bot"],
|
||||||
"is_aiblock" => (bool)$value["isAIBlock"],
|
"is_aiblock" => (bool)$value["isAIBlock"],
|
||||||
|
"online_status" => $value["OnlineStatus"],
|
||||||
],
|
],
|
||||||
"ueuse" => $value["ueuse"],
|
"ueuse" => $value["ueuse"],
|
||||||
"photo1" => $value["photo1"],
|
"photo1" => $value["photo1"],
|
||||||
@@ -4189,7 +4225,7 @@ function getDatasUeuse(PDO $pdo, array $messages): array {
|
|||||||
$users = [];
|
$users = [];
|
||||||
if (!empty($userIds)) {
|
if (!empty($userIds)) {
|
||||||
$placeholders = implode(',', array_fill(0, count($userIds), '?'));
|
$placeholders = implode(',', array_fill(0, count($userIds), '?'));
|
||||||
$stmt = $pdo->prepare("SELECT userid, username, profile, role, iconname, headname, sacinfo, other_settings FROM account WHERE userid IN ($placeholders)");
|
$stmt = $pdo->prepare("SELECT userid, username, profile, role, iconname, headname, sacinfo, other_settings, last_login_datetime FROM account WHERE userid IN ($placeholders)");
|
||||||
$stmt->execute($userIds);
|
$stmt->execute($userIds);
|
||||||
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$users[$row['userid']] = $row;
|
$users[$row['userid']] = $row;
|
||||||
@@ -4226,6 +4262,7 @@ function getDatasUeuse(PDO $pdo, array $messages): array {
|
|||||||
$message['iconname'] = $userRow['iconname'] ?? ($message['iconname'] ?? null);
|
$message['iconname'] = $userRow['iconname'] ?? ($message['iconname'] ?? null);
|
||||||
$message['headname'] = $userRow['headname'] ?? ($message['headname'] ?? null);
|
$message['headname'] = $userRow['headname'] ?? ($message['headname'] ?? null);
|
||||||
$message['sacinfo'] = $userRow['sacinfo'] ?? ($message['sacinfo'] ?? null);
|
$message['sacinfo'] = $userRow['sacinfo'] ?? ($message['sacinfo'] ?? null);
|
||||||
|
$message['last_login_datetime'] = $userRow['last_login_datetime'] ?? ($message['last_login_datetime'] ?? null);
|
||||||
$message['other_settings'] = $userRow['other_settings'] ?? ($message['other_settings'] ?? null);
|
$message['other_settings'] = $userRow['other_settings'] ?? ($message['other_settings'] ?? null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ $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);
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
|
||||||
// 変数の初期化
|
// 変数の初期化
|
||||||
$datetime = array();
|
$datetime = array();
|
||||||
$user_name = null;
|
$user_name = null;
|
||||||
|
|||||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
+52
-12
@@ -421,6 +421,20 @@ async function YouTube_and_nicovideo_Links(postText) {
|
|||||||
|
|
||||||
let embeddedOnce = false;
|
let embeddedOnce = false;
|
||||||
|
|
||||||
|
const fetchOEmbed = (url, providerName, placeholderId, endpoint) => {
|
||||||
|
$.ajax({
|
||||||
|
url: `${endpoint}?url=${encodeURIComponent(url)}&format=json`,
|
||||||
|
method: 'GET',
|
||||||
|
dataType: 'json'
|
||||||
|
}).then(response => {
|
||||||
|
if (response && response.html) {
|
||||||
|
$(`#${placeholderId}`).html(response.html);
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
$(`#${placeholderId}`).html(`<p style="font-size: 0.8rem;">Failed to load ${providerName}.</p>`);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
for (const url of urls) {
|
for (const url of urls) {
|
||||||
if (embeddedOnce) return;
|
if (embeddedOnce) return;
|
||||||
|
|
||||||
@@ -470,17 +484,19 @@ async function YouTube_and_nicovideo_Links(postText) {
|
|||||||
embedCode = `<div class="youtube_and_nicovideo_player"><iframe src="https://embed.nicovideo.jp/watch/${videoId}?from=${videoTime}" frameborder="0" allowfullscreen></iframe></div>`;
|
embedCode = `<div class="youtube_and_nicovideo_player"><iframe src="https://embed.nicovideo.jp/watch/${videoId}?from=${videoTime}" frameborder="0" allowfullscreen></iframe></div>`;
|
||||||
embeddedOnce = true;
|
embeddedOnce = true;
|
||||||
}
|
}
|
||||||
}else if (['soundcloud.com', 'on.soundcloud.com'].includes(host)) {
|
} else {
|
||||||
const oembedUrl = `https://soundcloud.com/oembed?format=json&maxheight=400&url=${encodeURIComponent(url)}`;
|
const isSoundCloud = ['soundcloud.com', 'on.soundcloud.com'].includes(host);
|
||||||
|
const isSpotify = host === 'open.spotify.com';
|
||||||
const response = await $.ajax({
|
|
||||||
url: oembedUrl,
|
|
||||||
method: 'GET',
|
|
||||||
dataType: 'json'
|
|
||||||
});
|
|
||||||
|
|
||||||
if (response && response.html) {
|
if (isSoundCloud || isSpotify) {
|
||||||
embedCode = `<div class="youtube_and_nicovideo_player">${response.html}</div>`;
|
const provider = isSoundCloud ? { name: 'SoundCloud', api: 'https://soundcloud.com/oembed' } : { name: 'Spotify', api: 'https://open.spotify.com/oembed' };
|
||||||
|
const placeholderId = `embed-${Math.random().toString(36).substring(2, 9)}`;
|
||||||
|
|
||||||
|
embedCode = `<div id="${placeholderId}" class="youtube_and_nicovideo_player">
|
||||||
|
<p>Loading ${provider.name}...</p>
|
||||||
|
</div>`;
|
||||||
|
|
||||||
|
fetchOEmbed(url, provider.name, placeholderId, provider.api);
|
||||||
embeddedOnce = true;
|
embeddedOnce = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -527,6 +543,22 @@ function formatSmartDate(datetimeStr) {
|
|||||||
return `${y}/${pad(m + 1)}/${pad(d)} ${hhmm}`;
|
return `${y}/${pad(m + 1)}/${pad(d)} ${hhmm}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getOnlineStatus(userdata) {
|
||||||
|
if (userdata["online_status"]){
|
||||||
|
if(userdata["online_status"] == "Online") {
|
||||||
|
return `<div class="status green" title="オンライン"></div>`;
|
||||||
|
}else if(userdata["online_status"] == "Away"){
|
||||||
|
return `<div class="status yellow" title="離席中"></div>`;
|
||||||
|
}else if(userdata["online_status"] == "Offline"){
|
||||||
|
return `<div class="status gray" title="オフライン"></div>`;
|
||||||
|
}else{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getCheckIcon(userdata) {
|
function getCheckIcon(userdata) {
|
||||||
if (userdata["role"] && userdata["role"].includes("official")) {
|
if (userdata["role"] && userdata["role"].includes("official")) {
|
||||||
return `<div class="checkicon"><div class="check"></div></div>`;
|
return `<div class="checkicon"><div class="check"></div></div>`;
|
||||||
@@ -554,6 +586,7 @@ async function createUeuseHtml(ueuse, selectedUniqid = null) {
|
|||||||
let check = "";
|
let check = "";
|
||||||
let bot = "";
|
let bot = "";
|
||||||
let AIBlock = "";
|
let AIBlock = "";
|
||||||
|
var online_status = "";
|
||||||
var reuse = "";
|
var reuse = "";
|
||||||
let contentHtml = "";
|
let contentHtml = "";
|
||||||
|
|
||||||
@@ -590,6 +623,7 @@ async function createUeuseHtml(ueuse, selectedUniqid = null) {
|
|||||||
check = getCheckIcon(ueuse["userdata"]);
|
check = getCheckIcon(ueuse["userdata"]);
|
||||||
bot = getBotIcon(ueuse["userdata"]);
|
bot = getBotIcon(ueuse["userdata"]);
|
||||||
AIBlock = getAIBlockFlag(ueuse["userdata"]);
|
AIBlock = getAIBlockFlag(ueuse["userdata"]);
|
||||||
|
online_status = getOnlineStatus(ueuse["userdata"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ueuse["ueuse"].length > 0) {
|
if (ueuse["ueuse"].length > 0) {
|
||||||
@@ -657,6 +691,7 @@ async function createUeuseHtml(ueuse, selectedUniqid = null) {
|
|||||||
check = getCheckIcon(ueuse["reuse"]["userdata"]);
|
check = getCheckIcon(ueuse["reuse"]["userdata"]);
|
||||||
bot = getBotIcon(ueuse["reuse"]["userdata"]);
|
bot = getBotIcon(ueuse["reuse"]["userdata"]);
|
||||||
AIBlock = getAIBlockFlag(ueuse["reuse"]["userdata"]);
|
AIBlock = getAIBlockFlag(ueuse["reuse"]["userdata"]);
|
||||||
|
online_status = getOnlineStatus(ueuse["reuse"]["userdata"]);
|
||||||
reuse = `<div class="ru">
|
reuse = `<div class="ru">
|
||||||
<a href="/@`+ ueuse["userdata"]["userid"] + `">
|
<a href="/@`+ ueuse["userdata"]["userid"] + `">
|
||||||
<img src="`+ ueuse["userdata"]["iconurl"] + `" onerror="this.onerror=null;this.src='../img/sysimage/errorimage/icon_404.png'">
|
<img src="`+ ueuse["userdata"]["iconurl"] + `" onerror="this.onerror=null;this.src='../img/sysimage/errorimage/icon_404.png'">
|
||||||
@@ -730,6 +765,7 @@ async function createUeuseHtml(ueuse, selectedUniqid = null) {
|
|||||||
check = getCheckIcon(ueuse["userdata"]);
|
check = getCheckIcon(ueuse["userdata"]);
|
||||||
bot = getBotIcon(ueuse["userdata"]);
|
bot = getBotIcon(ueuse["userdata"]);
|
||||||
AIBlock = getAIBlockFlag(ueuse["userdata"]);
|
AIBlock = getAIBlockFlag(ueuse["userdata"]);
|
||||||
|
online_status = getOnlineStatus(ueuse["userdata"]);
|
||||||
|
|
||||||
if (selectedUniqid != null && selectedUniqid == ueuse["uniqid"]) {
|
if (selectedUniqid != null && selectedUniqid == ueuse["uniqid"]) {
|
||||||
reuse = `<div class="rp"><div class="here"></div><div class="totop"></div><p>一番上のユーズに返信</p></div>`;
|
reuse = `<div class="rp"><div class="here"></div><div class="totop"></div><p>一番上のユーズに返信</p></div>`;
|
||||||
@@ -775,7 +811,7 @@ async function createUeuseHtml(ueuse, selectedUniqid = null) {
|
|||||||
<img src="`+ ueuse["userdata"]["iconurl"] + `" onerror="this.onerror=null;this.src='../img/sysimage/errorimage/icon_404.png'">
|
<img src="`+ ueuse["userdata"]["iconurl"] + `" onerror="this.onerror=null;this.src='../img/sysimage/errorimage/icon_404.png'">
|
||||||
</a>
|
</a>
|
||||||
<div class="u_name">
|
<div class="u_name">
|
||||||
<a href="/@`+ ueuse["userdata"]["userid"] + `">` + ueuse["userdata"]["username"] + `</a>
|
<a href="/@`+ ueuse["userdata"]["userid"] + `">` + await replaceCustomEmojis(ueuse["userdata"]["username"]) + `</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="idbox">
|
<div class="idbox">
|
||||||
<a href="/@`+ ueuse["userdata"]["userid"] + `">@` + ueuse["userdata"]["userid"] + `</a>
|
<a href="/@`+ ueuse["userdata"]["userid"] + `">@` + ueuse["userdata"]["userid"] + `</a>
|
||||||
@@ -795,6 +831,7 @@ async function createUeuseHtml(ueuse, selectedUniqid = null) {
|
|||||||
check = getCheckIcon(ueuse["userdata"]);
|
check = getCheckIcon(ueuse["userdata"]);
|
||||||
bot = getBotIcon(ueuse["userdata"]);
|
bot = getBotIcon(ueuse["userdata"]);
|
||||||
AIBlock = getAIBlockFlag(ueuse["userdata"]);
|
AIBlock = getAIBlockFlag(ueuse["userdata"]);
|
||||||
|
online_status = getOnlineStatus(ueuse["userdata"]);
|
||||||
|
|
||||||
reuse = ``;
|
reuse = ``;
|
||||||
inyo = ``;
|
inyo = ``;
|
||||||
@@ -997,7 +1034,10 @@ async function createUeuseHtml(ueuse, selectedUniqid = null) {
|
|||||||
<div class="ueuse" id="ueuse-`+ ueuse["uniqid"] + `">
|
<div class="ueuse" id="ueuse-`+ ueuse["uniqid"] + `">
|
||||||
`+ reuse + `
|
`+ reuse + `
|
||||||
<div class="flebox">
|
<div class="flebox">
|
||||||
<a href="/@`+ userid + `"><img src="` + iconurl + `" onerror="this.onerror=null;this.src='../img/sysimage/errorimage/icon_404.png'"></a>
|
<a href="/@`+ userid + `">
|
||||||
|
<img src="` + iconurl + `" onerror="this.onerror=null;this.src='../img/sysimage/errorimage/icon_404.png'">
|
||||||
|
`+ online_status +`
|
||||||
|
</a>
|
||||||
<a href="/@`+ userid + `"><div class="u_name">` + await replaceCustomEmojis(username) + `</div></a>
|
<a href="/@`+ userid + `"><div class="u_name">` + await replaceCustomEmojis(username) + `</div></a>
|
||||||
<div class="idbox">
|
<div class="idbox">
|
||||||
<a href="/@`+ userid + `">@` + userid + `</a>
|
<a href="/@`+ userid + `">@` + userid + `</a>
|
||||||
|
|||||||
+292
-327
@@ -44,9 +44,9 @@ $option = null;
|
|||||||
//ログイン認証---------------------------------------------------
|
//ログイン認証---------------------------------------------------
|
||||||
blockedIP($_SERVER['REMOTE_ADDR']);
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
if(!($is_login === false)){
|
if (!($is_login === false)) {
|
||||||
header("Location: ../home/");
|
header("Location: ../home/");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
@@ -55,19 +55,19 @@ try {
|
|||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
);
|
);
|
||||||
$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);
|
||||||
} catch(PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if (!empty($_POST['btn_submit'])) {
|
||||||
$_SESSION['form_data'] = $_POST;
|
$_SESSION['form_data'] = $_POST;
|
||||||
|
|
||||||
if(safetext($serversettings["serverinfo"]["server_account_migration"]) === "true"){
|
if (safetext($serversettings["serverinfo"]["server_account_migration"]) === "true") {
|
||||||
$new_userid = safetext($_POST['new_userid']);
|
$new_userid = safetext($_POST['new_userid']);
|
||||||
$password = safetext($_POST['password']);
|
$password = safetext($_POST['password']);
|
||||||
|
|
||||||
if(safetext($serversettings["serverinfo"]["server_invitation"]) === "true"){
|
if (safetext($serversettings["serverinfo"]["server_invitation"]) === "true") {
|
||||||
$invitationcode = safetext($_POST['invitationcode']);
|
$invitationcode = safetext($_POST['invitationcode']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,56 +75,55 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$check_code = safetext($_POST['moto_server_account_check']);
|
$check_code = safetext($_POST['moto_server_account_check']);
|
||||||
$key = safetext($_POST['moto_server_account_auth']);
|
$key = safetext($_POST['moto_server_account_auth']);
|
||||||
|
|
||||||
if(empty($domain)) {
|
if (empty($domain)) {
|
||||||
$error_message[] = '移行元のサーバードメインを入力してください。(INPUT_PLEASE)';
|
$error_message[] = '移行元のサーバードメインを入力してください。(INPUT_PLEASE)';
|
||||||
}else{
|
} else {
|
||||||
if (is_not_private_url("https://".$domain."/")) {
|
if (is_not_private_url("https://" . $domain . "/")) {
|
||||||
$domain_response = @file_get_contents("https://".$domain."/");
|
$domain_response = @file_get_contents("https://" . $domain . "/");
|
||||||
if (empty($domain_response)) {
|
if (empty($domain_response)) {
|
||||||
$error_message[] = '入力されたドメインに接続できませんでした。(INPUT_PLEASE)';
|
$error_message[] = '入力されたドメインに接続できませんでした。(INPUT_PLEASE)';
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$error_message[] = '入力されたドメインに接続できませんでした。(BAD_REQUEST)';
|
$error_message[] = '入力されたドメインに接続できませんでした。(BAD_REQUEST)';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($check_code)) {
|
if (empty($check_code)) {
|
||||||
$error_message[] = '識別コードを入力してください。(INPUT_PLEASE)';
|
$error_message[] = '識別コードを入力してください。(INPUT_PLEASE)';
|
||||||
}
|
}
|
||||||
if(empty($key)) {
|
if (empty($key)) {
|
||||||
$error_message[] = '認証コードを入力してください。(INPUT_PLEASE)';
|
$error_message[] = '認証コードを入力してください。(INPUT_PLEASE)';
|
||||||
}
|
}
|
||||||
|
|
||||||
//招待コードチェック
|
//招待コードチェック
|
||||||
if(safetext($serversettings["serverinfo"]["server_invitation"]) === "true"){
|
if (safetext($serversettings["serverinfo"]["server_invitation"]) === "true") {
|
||||||
$query = $pdo->prepare('SELECT * FROM invitation WHERE code = :code limit 1');
|
$query = $pdo->prepare('SELECT * FROM invitation WHERE code = :code limit 1');
|
||||||
|
|
||||||
$query->execute(array(':code' => $invitationcode));
|
$query->execute(array(':code' => $invitationcode));
|
||||||
|
|
||||||
$result = $query->fetch();
|
$result = $query->fetch();
|
||||||
|
|
||||||
// 招待コードの入力チェック
|
// 招待コードの入力チェック
|
||||||
if( empty($invitationcode) ) {
|
if (empty($invitationcode)) {
|
||||||
$error_message[] = '招待コードを入力してください。(INVITATION_CODE_INPUT_PLEASE)';
|
$error_message[] = '招待コードを入力してください。(INVITATION_CODE_INPUT_PLEASE)';
|
||||||
} else {
|
} else {
|
||||||
if($result > 0){
|
if ($result > 0) {
|
||||||
if($result["used"] === "true"){
|
if ($result["used"] === "true") {
|
||||||
$error_message[] = 'この招待コード('.$invitationcode.')は既に使用されています。(INVITATION_CODE_SHIYOUZUMI)';
|
$error_message[] = 'この招待コード(' . $invitationcode . ')は既に使用されています。(INVITATION_CODE_SHIYOUZUMI)';
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$error_message[] = 'この招待コード('.$invitationcode.')は使えません。(INVITATION_CODE_DEAD)';
|
$error_message[] = 'この招待コード(' . $invitationcode . ')は使えません。(INVITATION_CODE_DEAD)';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$key1_code = substr($key, 0, -16);//key1
|
$key1_code = substr($key, 0, -16); //key1
|
||||||
$key2_code = substr($key, -16);//key2
|
$key2_code = substr($key, -16); //key2
|
||||||
|
|
||||||
if(!empty(H_CAPTCHA_ONOFF && H_CAPTCHA_ONOFF == "true")){
|
if (!empty(H_CAPTCHA_ONOFF && H_CAPTCHA_ONOFF == "true")) {
|
||||||
if(isset($_POST['h-captcha-response'])){
|
if (isset($_POST['h-captcha-response'])) {
|
||||||
$hcaptcha_token = safetext($_POST['h-captcha-response']);
|
$hcaptcha_token = safetext($_POST['h-captcha-response']);
|
||||||
if($hcaptcha_token){
|
if ($hcaptcha_token) {
|
||||||
$captcha_data = [
|
$captcha_data = [
|
||||||
'secret' => safetext(H_CAPTCHA_SEAC_KEY),
|
'secret' => safetext(H_CAPTCHA_SEAC_KEY),
|
||||||
'response' => $hcaptcha_token,
|
'response' => $hcaptcha_token,
|
||||||
@@ -132,193 +131,147 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
];
|
];
|
||||||
$options = [
|
$options = [
|
||||||
'http' => [
|
'http' => [
|
||||||
'method'=> 'POST',
|
'method' => 'POST',
|
||||||
'header'=> 'Content-Type: application/x-www-form-urlencoded',
|
'header' => 'Content-Type: application/x-www-form-urlencoded',
|
||||||
'content' => http_build_query($captcha_data, '', '&')
|
'content' => http_build_query($captcha_data, '', '&')
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
$hCaptcha_result = json_decode(file_get_contents('https://hcaptcha.com/siteverify', false, stream_context_create($options)),true);
|
$hCaptcha_result = json_decode(file_get_contents('https://hcaptcha.com/siteverify', false, stream_context_create($options)), true);
|
||||||
if(!($hCaptcha_result["success"] == true)){
|
if (!($hCaptcha_result["success"] == true)) {
|
||||||
$error_message[] = "hCaptchaであなたが人間である確認ができませんでした。(ERROR)";
|
$error_message[] = "hCaptchaであなたが人間である確認ができませんでした。(ERROR)";
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$error_message[] = "hCaptchaであなたが人間である確認ができませんでした。(ERROR)";
|
$error_message[] = "hCaptchaであなたが人間である確認ができませんでした。(ERROR)";
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$error_message[] = "hCaptchaであなたが人間である確認ができませんでした。(ERROR)";
|
$error_message[] = "hCaptchaであなたが人間である確認ができませんでした。(ERROR)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!empty(CF_TURNSTILE_ONOFF && CF_TURNSTILE_ONOFF == "true")){
|
if (!empty(CF_TURNSTILE_ONOFF && CF_TURNSTILE_ONOFF == "true")) {
|
||||||
if(isset($_POST['cf-turnstile-response'])){
|
if (isset($_POST['cf-turnstile-response'])) {
|
||||||
$CF_Turnstile_token = safetext($_POST['cf-turnstile-response']);
|
$CF_Turnstile_token = safetext($_POST['cf-turnstile-response']);
|
||||||
if($CF_Turnstile_token){
|
if ($CF_Turnstile_token) {
|
||||||
$CF_Turnstile_data = [
|
$CF_Turnstile_data = [
|
||||||
'secret' => safetext(CF_TURNSTILE_SEAC_KEY),
|
'secret' => safetext(CF_TURNSTILE_SEAC_KEY),
|
||||||
'response' => $CF_Turnstile_token
|
'response' => $CF_Turnstile_token
|
||||||
];
|
];
|
||||||
$CF_Turnstile_options = [
|
$CF_Turnstile_options = [
|
||||||
'http' => [
|
'http' => [
|
||||||
'method'=> 'POST',
|
'method' => 'POST',
|
||||||
'header'=> 'Content-Type: application/x-www-form-urlencoded',
|
'header' => 'Content-Type: application/x-www-form-urlencoded',
|
||||||
'content' => http_build_query($CF_Turnstile_data, '', '&')
|
'content' => http_build_query($CF_Turnstile_data, '', '&')
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
$CF_Turnstile_result = json_decode(file_get_contents('https://challenges.cloudflare.com/turnstile/v0/siteverify', false, stream_context_create($CF_Turnstile_options)),true);
|
$CF_Turnstile_result = json_decode(file_get_contents('https://challenges.cloudflare.com/turnstile/v0/siteverify', false, stream_context_create($CF_Turnstile_options)), true);
|
||||||
if(!($CF_Turnstile_result["success"] == true)){
|
if (!($CF_Turnstile_result["success"] == true)) {
|
||||||
$error_message[] = "CloudflareTurnstileであなたが人間である確認ができませんでした。(ERROR)";
|
$error_message[] = "CloudflareTurnstileであなたが人間である確認ができませんでした。(ERROR)";
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$error_message[] = "CloudflareTurnstileであなたが人間である確認ができませんでした。(ERROR)";
|
$error_message[] = "CloudflareTurnstileであなたが人間である確認ができませんでした。(ERROR)";
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$error_message[] = "CloudflareTurnstileであなたが人間である確認ができませんでした。(ERROR)";
|
$error_message[] = "CloudflareTurnstileであなたが人間である確認ができませんでした。(ERROR)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($error_message)){
|
if (empty($error_message)) {
|
||||||
$data = array();
|
$data = array();
|
||||||
$options = [
|
$options = [
|
||||||
'http' => [
|
'http' => [
|
||||||
'method'=> 'POST',
|
'method' => 'POST',
|
||||||
'content' => http_build_query($data, '', '&')
|
'content' => http_build_query($data, '', '&')
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
$Check_result = json_decode(file_get_contents("https://".$domain."/api/serverinfo-api", false, stream_context_create($options)),true);
|
$Check_result = json_decode(file_get_contents("https://" . $domain . "/api/serverinfo-api", false, stream_context_create($options)), true);
|
||||||
if($Check_result["software"]["name"] == "uwuzu"){
|
if ($Check_result["software"]["name"] == "uwuzu") {
|
||||||
$version = str_pad(str_replace('.', '', $Check_result["software"]["version"]), 4, 0, STR_PAD_RIGHT);
|
$version = str_pad(str_replace('.', '', $Check_result["software"]["version"]), 4, 0, STR_PAD_RIGHT);
|
||||||
|
|
||||||
if($version >= 1360){
|
if ($version >= 1360) {
|
||||||
$Check_Link = "https://".$domain."/api/migration-api?migration_code=".$check_code;
|
$Check_Link = "https://" . $domain . "/api/migration-api?migration_code=" . $check_code;
|
||||||
$data = array();
|
$data = array();
|
||||||
$options = [
|
$options = [
|
||||||
'http' => [
|
'http' => [
|
||||||
'method'=> 'GET',
|
'method' => 'GET',
|
||||||
'content' => http_build_query($data, '', '&')
|
'content' => http_build_query($data, '', '&')
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
$Get_result = json_decode(file_get_contents($Check_Link, false, stream_context_create($options)),true);
|
$Get_result = json_decode(file_get_contents($Check_Link, false, stream_context_create($options)), true);
|
||||||
|
|
||||||
if(isset($Get_result["data"])){
|
if (isset($Get_result["data"])) {
|
||||||
$account_data = openssl_decrypt($Get_result["data"], "AES-256-CBC", $key1_code, 0, $key2_code);
|
$account_data = openssl_decrypt($Get_result["data"], "AES-256-CBC", $key1_code, 0, $key2_code);
|
||||||
if($account_data == false){
|
if ($account_data == false) {
|
||||||
$error_message[] = "認証コードもしくは確認コードが間違っているようです。(MIGRATION_BAD_AUTH_CODE)";
|
$error_message[] = "認証コードもしくは確認コードが間違っているようです。(MIGRATION_BAD_AUTH_CODE)";
|
||||||
}else{
|
} else {
|
||||||
$json_account_data = json_decode($account_data,true);
|
$json_account_data = json_decode($account_data, true);
|
||||||
if($json_account_data == false){
|
if ($json_account_data == false) {
|
||||||
$error_message[] = "アカウントの移行を最初からやり直してください。(MIGRATION_SORRY)";
|
$error_message[] = "アカウントの移行を最初からやり直してください。(MIGRATION_SORRY)";
|
||||||
}else{
|
} else {
|
||||||
//アイコン&ヘッダー
|
$iconName = "";
|
||||||
if (is_not_private_url("https://".$json_account_data["userdata"]["user_icon"]."/")) {
|
$headName = "";
|
||||||
$icondata = file_get_contents($json_account_data["userdata"]["user_icon"]);
|
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
|
||||||
$mime_type = finfo_buffer($finfo, $icondata);
|
|
||||||
$safe_img_mime = [
|
|
||||||
"image/gif" => 'gif',
|
|
||||||
"image/jpeg" => 'jpg',
|
|
||||||
"image/png" => 'png',
|
|
||||||
"image/svg+xml" => 'svg',
|
|
||||||
"image/webp" => 'webp',
|
|
||||||
"image/bmp" => 'bmp',
|
|
||||||
"image/x-icon" => 'ico',
|
|
||||||
"image/tiff" => 'tiff'
|
|
||||||
];
|
|
||||||
if(isset($safe_img_mime[$mime_type])){
|
|
||||||
$extension = $safe_img_mime[$mime_type];
|
|
||||||
$temp_file = tempnam(sys_get_temp_dir(), 'img');
|
|
||||||
file_put_contents($temp_file, $icondata);
|
|
||||||
|
|
||||||
delete_exif($extension, $temp_file);
|
// 処理対象の項目(アイコンとヘッダー)をループで回すとスッキリします
|
||||||
|
$targets = [
|
||||||
|
'user_icon' => ['dir' => 'usericons', 'size' => 512, 'ref' => &$iconName],
|
||||||
|
'user_header' => ['dir' => 'userheads', 'size' => 2048, 'ref' => &$headName]
|
||||||
|
];
|
||||||
|
|
||||||
// リサイズ
|
foreach ($targets as $key => $config) {
|
||||||
resizeImage($temp_file, 512, 512);
|
$img_url = $json_account_data["userdata"][$key] ?? '';
|
||||||
|
|
||||||
if(check_mime($temp_file) == "image/webp"){
|
if (empty($img_url)) continue;
|
||||||
// 新しいファイル名を生成(uniqid + 拡張子)
|
|
||||||
$newFilename = createUniqId() . '-'.$new_userid.'.webp';
|
if (is_not_private_url($img_url)) {
|
||||||
}else{
|
$img_content = @file_get_contents($img_url);
|
||||||
// 新しいファイル名を生成(uniqid + 拡張子)
|
|
||||||
$newFilename = createUniqId() . '-'.$new_userid.'.' . $extension;
|
if ($img_content === false) {
|
||||||
|
$error_message[] = "画像の取得に失敗しました。($key)";
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存先のパスを生成
|
// 一時ファイル作成
|
||||||
$uploadedPath = 'usericons/' . $newFilename;
|
$temp_file = tempnam(sys_get_temp_dir(), 'mig');
|
||||||
|
file_put_contents($temp_file, $img_content);
|
||||||
// ファイルを移動
|
|
||||||
$result = copy($temp_file, "../".$uploadedPath);
|
// MIMEチェックと拡張子変換(後半のコードのスタイルに合わせる)
|
||||||
|
$mime = check_mime($temp_file);
|
||||||
if ($result) {
|
if ($mime) {
|
||||||
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
$extension = convert_mime($mime);
|
||||||
|
delete_exif($extension, $temp_file);
|
||||||
|
|
||||||
|
// リサイズ(ヘッダーは 2048, アイコンは 512)
|
||||||
|
if ($key === 'user_header') {
|
||||||
|
resizeImage($temp_file, 2048, 1024);
|
||||||
|
} else {
|
||||||
|
resizeImage($temp_file, 512, 512);
|
||||||
|
}
|
||||||
|
|
||||||
|
// S3アップロード対応
|
||||||
|
if (defined('AMS3_CHKS') && AMS3_CHKS == "true") {
|
||||||
|
$s3result = uploadAmazonS3($temp_file);
|
||||||
|
if ($s3result == false) {
|
||||||
|
$error_message[] = "アップロード失敗!($key) エラーコード: S3ERROR";
|
||||||
|
} else {
|
||||||
|
$config['ref'] = $s3result;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// ローカル保存
|
||||||
|
$newFilename = createUniqId() . '-' . $new_userid . ($mime == "image/webp" ? '.webp' : '.' . $extension);
|
||||||
|
$uploadedPath = $config['dir'] . '/' . $newFilename;
|
||||||
|
|
||||||
|
if (copy($temp_file, "../" . $uploadedPath)) {
|
||||||
|
$config['ref'] = $uploadedPath;
|
||||||
|
} else {
|
||||||
|
$error_message[] = "ファイルの保存に失敗しました。($key)";
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$error_message[] = "使用できない画像形式です。($key)";
|
||||||
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[] = 'アップロード失敗!(1)エラーコード:' .$uploadedFile['error'].'';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (file_exists($temp_file)) unlink($temp_file);
|
||||||
|
} else {
|
||||||
|
$error_message[] = '入力されたドメインに接続できませんでした。(BAD_REQUEST)';
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
$error_message[] = '入力されたドメインに接続できませんでした。(BAD_REQUEST)';
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------
|
|
||||||
if (is_not_private_url("https://".$json_account_data["userdata"]["user_header"]."/")) {
|
|
||||||
$headdata = file_get_contents($json_account_data["userdata"]["user_header"]);
|
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
|
||||||
$mime_type = finfo_buffer($finfo, $headdata);
|
|
||||||
$safe_img_mime = [
|
|
||||||
"image/gif" => 'gif',
|
|
||||||
"image/jpeg" => 'jpg',
|
|
||||||
"image/png" => 'png',
|
|
||||||
"image/svg+xml" => 'svg',
|
|
||||||
"image/webp" => 'webp',
|
|
||||||
"image/bmp" => 'bmp',
|
|
||||||
"image/x-icon" => 'ico',
|
|
||||||
"image/tiff" => 'tiff'
|
|
||||||
];
|
|
||||||
if(isset($safe_img_mime[$mime_type])){
|
|
||||||
$extension = $safe_img_mime[$mime_type];
|
|
||||||
$temp_file = tempnam(sys_get_temp_dir(), 'img');
|
|
||||||
file_put_contents($temp_file, $headdata);
|
|
||||||
|
|
||||||
delete_exif($extension, $temp_file);
|
|
||||||
|
|
||||||
// リサイズ
|
|
||||||
resizeImage($temp_file, 2048, 1024);
|
|
||||||
|
|
||||||
if(check_mime($temp_file) == "image/webp"){
|
|
||||||
// 新しいファイル名を生成(uniqid + 拡張子)
|
|
||||||
$newFilename = createUniqId() . '-'.$new_userid.'.webp';
|
|
||||||
}else{
|
|
||||||
// 新しいファイル名を生成(uniqid + 拡張子)
|
|
||||||
$newFilename = createUniqId() . '-'.$new_userid.'.' . $extension;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存先のパスを生成
|
|
||||||
$uploadedPath = 'userheads/' . $newFilename;
|
|
||||||
|
|
||||||
// ファイルを移動
|
|
||||||
$result = copy($temp_file, "../".$uploadedPath);
|
|
||||||
|
|
||||||
if ($result) {
|
|
||||||
$headName = $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)エラーコード:' .$uploadedFile['error'].'';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$error_message[] = '入力されたドメインに接続できませんでした。(BAD_REQUEST)';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = $pdo->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
$query = $pdo->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
||||||
@@ -326,95 +279,94 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$result = $query->fetch();
|
$result = $query->fetch();
|
||||||
|
|
||||||
// ユーザーネームの入力チェック
|
// ユーザーネームの入力チェック
|
||||||
if( empty($json_account_data["userdata"]["user_name"]) ) {
|
if (empty($json_account_data["userdata"]["user_name"])) {
|
||||||
$error_message[] = '表示名を入力してください。(USERNAME_INPUT_PLEASE)';
|
$error_message[] = '表示名を入力してください。(USERNAME_INPUT_PLEASE)';
|
||||||
} else {
|
} else {
|
||||||
// 文字数を確認
|
// 文字数を確認
|
||||||
if( 50 < mb_strlen($json_account_data["userdata"]["user_name"], 'UTF-8') ) {
|
if (50 < mb_strlen($json_account_data["userdata"]["user_name"], 'UTF-8')) {
|
||||||
$error_message[] = 'ユーザーネームは50文字以内で入力してください。(USERNAME_OVER_MAX_COUNT)';
|
$error_message[] = 'ユーザーネームは50文字以内で入力してください。(USERNAME_OVER_MAX_COUNT)';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDの入力チェック
|
// IDの入力チェック
|
||||||
if( empty($new_userid) ) {
|
if (empty($new_userid)) {
|
||||||
$error_message[] = 'ユーザーIDを入力してください。(USERID_INPUT_PLEASE)';
|
$error_message[] = 'ユーザーIDを入力してください。(USERID_INPUT_PLEASE)';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// 文字数を確認
|
// 文字数を確認
|
||||||
if( 20 < mb_strlen($new_userid, 'UTF-8') ) {
|
if (20 < mb_strlen($new_userid, 'UTF-8')) {
|
||||||
$error_message[] = 'IDは20文字以内で入力してください。(USERID_OVER_MAX_COUNT)';
|
$error_message[] = 'IDは20文字以内で入力してください。(USERID_OVER_MAX_COUNT)';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(in_array(strtolower($userid), $banuserid) === true ){
|
if (in_array(strtolower($new_userid), $banuserid) === true) {
|
||||||
$error_message[] = 'そのIDは登録禁止になっています。(USERID_CONTAINS_PROHIBITED)';
|
$error_message[] = 'そのIDは登録禁止になっています。(USERID_CONTAINS_PROHIBITED)';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($result > 0){
|
if ($result > 0) {
|
||||||
$error_message[] = 'このID('.$new_userid.')は既に使用されています。他のIDを作成してください。(USERID_SHIYOUZUMI)';
|
$error_message[] = 'このID(' . $new_userid . ')は既に使用されています。他のIDを作成してください。(USERID_SHIYOUZUMI)';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(preg_match("/^[a-zA-Z0-9_]+$/", $new_userid))){
|
if (!(preg_match("/^[a-zA-Z0-9_]+$/", $new_userid))) {
|
||||||
$error_message[] = "IDは半角英数字で入力してください。(「_」は使用可能です。)(USERID_DONT_USE_WORD)";
|
$error_message[] = "IDは半角英数字で入力してください。(「_」は使用可能です。)(USERID_DONT_USE_WORD)";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// パスワードの入力チェック
|
// パスワードの入力チェック
|
||||||
if( empty($password) ) {
|
if (empty($password)) {
|
||||||
$error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
|
$error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if(in_array($password, $badpass) === true ){
|
if (in_array($password, $badpass) === true) {
|
||||||
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
|
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
|
||||||
}
|
}
|
||||||
|
|
||||||
if( 4 > mb_strlen($password, 'UTF-8') ) {
|
if (4 > mb_strlen($password, 'UTF-8')) {
|
||||||
$error_message[] = 'パスワードは4文字以上である必要があります。(PASSWORD_TODOITENAI_MIN_COUNT)';
|
$error_message[] = 'パスワードは4文字以上である必要があります。(PASSWORD_TODOITENAI_MIN_COUNT)';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 文字数を確認
|
// 文字数を確認
|
||||||
if( 256 < mb_strlen($password, 'UTF-8') ) {
|
if (256 < mb_strlen($password, 'UTF-8')) {
|
||||||
$error_message[] = 'パスワードは256文字以内で入力してください。(PASSWORD_OVER_MAX_COUNT)';
|
$error_message[] = 'パスワードは256文字以内で入力してください。(PASSWORD_OVER_MAX_COUNT)';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( empty($error_message) ) {
|
if (empty($error_message)) {
|
||||||
// トランザクション開始
|
// トランザクション開始
|
||||||
$pdo->beginTransaction();
|
$pdo->beginTransaction();
|
||||||
$datetime = date("Y-m-d H:i:s");
|
$datetime = date("Y-m-d H:i:s");
|
||||||
$username = safetext($json_account_data["userdata"]["user_name"]);
|
$username = safetext($json_account_data["userdata"]["user_name"]);
|
||||||
$mailadds = safetext($json_account_data["userdata"]["mail_adds"]);
|
$mailadds = safetext($json_account_data["userdata"]["mail_adds"]);
|
||||||
$profile = mb_substr(safetext($json_account_data["userdata"]["user_profile"]),0,1024);// 一応文字数制限
|
$profile = mb_substr(safetext($json_account_data["userdata"]["user_profile"]), 0, 1024); // 一応文字数制限
|
||||||
|
|
||||||
$userEnckey = GenUserEnckey($datetime);
|
$userEnckey = GenUserEnckey($datetime);
|
||||||
$ivLength = openssl_cipher_iv_length('aes-256-cbc');
|
$ivLength = openssl_cipher_iv_length('aes-256-cbc');
|
||||||
$randomBytes = random_bytes($ivLength);
|
$randomBytes = random_bytes($ivLength);
|
||||||
$randomhash = hash('sha3-512', $randomBytes);
|
$randomhash = hash('sha3-512', $randomBytes);
|
||||||
$iv = substr($randomhash, 0, $ivLength);
|
$iv = substr($randomhash, 0, $ivLength);
|
||||||
|
|
||||||
// メアドを暗号化する
|
// メアドを暗号化する
|
||||||
if(!(empty($mailadds))){
|
if (!(empty($mailadds))) {
|
||||||
$enc_mailadds = EncryptionUseEncrKey($mailadds, $userEnckey, $iv);
|
$enc_mailadds = EncryptionUseEncrKey($mailadds, $userEnckey, $iv);
|
||||||
}else{
|
} else {
|
||||||
$enc_mailadds = "";
|
$enc_mailadds = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$role = "user";
|
$role = "user";
|
||||||
$admin = "none";
|
$admin = "none";
|
||||||
$hashpassword = uwuzu_password_hash($password);
|
$hashpassword = uwuzu_password_hash($password);
|
||||||
$LoginIdBytes = random_bytes(64);
|
$LoginIdBytes = random_bytes(64);
|
||||||
$loginid = hash('sha3-512', $LoginIdBytes);
|
$loginid = hash('sha3-512', $LoginIdBytes);
|
||||||
|
|
||||||
// SQL作成
|
// SQL作成
|
||||||
$stmt = $pdo->prepare("INSERT INTO account (username, userid, password, loginid, mailadds, profile, iconname, headname, role, datetime, admin, encryption_ivkey) VALUES (:username, :userid, :password, :loginid, :mailadds, :profile, :iconname, :headname, :role, :datetime, :admin ,:encryption_ivkey)");
|
$stmt = $pdo->prepare("INSERT INTO account (username, userid, password, loginid, mailadds, profile, iconname, headname, role, datetime, admin, encryption_ivkey) VALUES (:username, :userid, :password, :loginid, :mailadds, :profile, :iconname, :headname, :role, :datetime, :admin ,:encryption_ivkey)");
|
||||||
|
|
||||||
// アイコン画像
|
// アイコン画像
|
||||||
$stmt->bindValue(':iconname', $iconName, PDO::PARAM_STR);
|
$stmt->bindValue(':iconname', $iconName, PDO::PARAM_STR);
|
||||||
|
|
||||||
// ヘッダー画像
|
// ヘッダー画像
|
||||||
$stmt->bindValue(':headname', $headName, PDO::PARAM_STR);
|
$stmt->bindValue(':headname', $headName, PDO::PARAM_STR);
|
||||||
|
|
||||||
// 他の値をセット
|
// 他の値をセット
|
||||||
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
|
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':userid', $new_userid, PDO::PARAM_STR);
|
$stmt->bindParam(':userid', $new_userid, PDO::PARAM_STR);
|
||||||
@@ -426,60 +378,60 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||||
|
|
||||||
$stmt->bindParam(':encryption_ivkey', $iv, PDO::PARAM_STR);
|
$stmt->bindParam(':encryption_ivkey', $iv, PDO::PARAM_STR);
|
||||||
|
|
||||||
$stmt->bindParam(':admin', $admin, PDO::PARAM_STR);
|
$stmt->bindParam(':admin', $admin, PDO::PARAM_STR);
|
||||||
|
|
||||||
// SQLクエリの実行
|
// SQLクエリの実行
|
||||||
$res = $stmt->execute();
|
$res = $stmt->execute();
|
||||||
|
|
||||||
// コミット
|
// コミット
|
||||||
$res = $pdo->commit();
|
$res = $pdo->commit();
|
||||||
|
|
||||||
if(safetext($serversettings["serverinfo"]["server_invitation"]) === "true"){
|
if (safetext($serversettings["serverinfo"]["server_invitation"]) === "true") {
|
||||||
$pdo->beginTransaction();
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
$stmt = $pdo->prepare("UPDATE invitation SET used = :used, datetime = :datetime WHERE code = :code;");
|
$stmt = $pdo->prepare("UPDATE invitation SET used = :used, datetime = :datetime WHERE code = :code;");
|
||||||
|
|
||||||
$true = "true";
|
$true = "true";
|
||||||
$stmt->bindParam(':used', $true, PDO::PARAM_STR);
|
$stmt->bindParam(':used', $true, PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||||
|
|
||||||
$stmt->bindValue(':code', $invitationcode, PDO::PARAM_STR);
|
$stmt->bindValue(':code', $invitationcode, 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($res) {
|
if ($res) {
|
||||||
//ここのながい文字列はアカウント移行が完了したことを認証するためのもの!かえないでください!
|
//ここのながい文字列はアカウント移行が完了したことを認証するためのもの!かえないでください!
|
||||||
$encriptdone = openssl_encrypt("QYrLCSQIHqOLHuhJ", "AES-256-CBC", $key1_code, 0, $key2_code);
|
$encriptdone = openssl_encrypt("QYrLCSQIHqOLHuhJ", "AES-256-CBC", $key1_code, 0, $key2_code);
|
||||||
|
|
||||||
$Done_Check_Link = "https://".$domain."/api/migration-api?migration_code=".$check_code."&check=".urlencode($encriptdone);
|
$Done_Check_Link = "https://" . $domain . "/api/migration-api?migration_code=" . $check_code . "&check=" . urlencode($encriptdone);
|
||||||
$data = array();
|
$data = array();
|
||||||
$options = [
|
$options = [
|
||||||
'http' => [
|
'http' => [
|
||||||
'method'=> 'GET',
|
'method' => 'GET',
|
||||||
'content' => http_build_query($data, '', '&')
|
'content' => http_build_query($data, '', '&')
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
$Done_result = json_decode(file_get_contents($Done_Check_Link, false, stream_context_create($options)),true);
|
$Done_result = json_decode(file_get_contents($Done_Check_Link, false, stream_context_create($options)), true);
|
||||||
|
|
||||||
if(isset($Done_result["data"])){
|
if (isset($Done_result["data"])) {
|
||||||
$done_chk = openssl_decrypt($Done_result["data"], "AES-256-CBC", $key1_code, 0, $key2_code);
|
$done_chk = openssl_decrypt($Done_result["data"], "AES-256-CBC", $key1_code, 0, $key2_code);
|
||||||
$done_data = json_decode($done_chk,true);
|
$done_data = json_decode($done_chk, true);
|
||||||
if($done_data["done"] == "success"){
|
if ($done_data["done"] == "success") {
|
||||||
$_SESSION['userid'] = $new_userid;
|
$_SESSION['userid'] = $new_userid;
|
||||||
$_SESSION['is_register_account'] = true;
|
$_SESSION['is_register_account'] = true;
|
||||||
$_SESSION['done'] = true;
|
$_SESSION['done'] = true;
|
||||||
}else{
|
} else {
|
||||||
$_SESSION['userid'] = $new_userid;
|
$_SESSION['userid'] = $new_userid;
|
||||||
$_SESSION['is_register_account'] = true;
|
$_SESSION['is_register_account'] = true;
|
||||||
$_SESSION['done'] = false;
|
$_SESSION['done'] = false;
|
||||||
@@ -488,7 +440,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$url = '../success';
|
$url = '../success';
|
||||||
header('Location: ' . $url, true, 303);
|
header('Location: ' . $url, true, 303);
|
||||||
exit;
|
exit;
|
||||||
}else{
|
} else {
|
||||||
$_SESSION['userid'] = $new_userid;
|
$_SESSION['userid'] = $new_userid;
|
||||||
$_SESSION['done'] = false;
|
$_SESSION['done'] = false;
|
||||||
$_SESSION['is_register_account'] = true;
|
$_SESSION['is_register_account'] = true;
|
||||||
@@ -500,26 +452,25 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
} else {
|
} else {
|
||||||
$error_message[] = '登録に失敗しました。(REGISTERED_DAME)';
|
$error_message[] = '登録に失敗しました。(REGISTERED_DAME)';
|
||||||
}
|
}
|
||||||
|
|
||||||
// プリペアドステートメントを削除
|
// プリペアドステートメントを削除
|
||||||
$stmt = null;
|
$stmt = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$error_message[] = "識別コードが間違っているようです。(MIGRATION_BAD_CHECK_CODE)";
|
$error_message[] = "識別コードが間違っているようです。(MIGRATION_BAD_CHECK_CODE)";
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$error_message[] = "移行元のサーバーのuwuzuバージョンが1.3.6未満のためアカウントの移行はできません。(MIGRATION_FROM_SERVER_BAD_UWUZU_VERSION)";
|
$error_message[] = "移行元のサーバーのuwuzuバージョンが1.3.6未満のためアカウントの移行はできません。(MIGRATION_FROM_SERVER_BAD_UWUZU_VERSION)";
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$error_message[] = "移行元のサーバーのソフトウェアがuwuzuではありません。(MIGRATION_FROM_SERVER_NOT_UWUZU)";
|
$error_message[] = "移行元のサーバーのソフトウェアがuwuzuではありません。(MIGRATION_FROM_SERVER_NOT_UWUZU)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$error_message[] = "このサーバーではアカウントの移行登録を受け入れていません。(MIGRATION_SORRY)";
|
$error_message[] = "このサーバーではアカウントの移行登録を受け入れていません。(MIGRATION_SORRY)";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// データベースの接続を閉じる
|
// データベースの接続を閉じる
|
||||||
@@ -528,130 +479,144 @@ $pdo = null;
|
|||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="ja">
|
<html lang="ja">
|
||||||
|
|
||||||
<head prefix="og:http://ogp.me/ns#">
|
<head prefix="og:http://ogp.me/ns#">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<link rel="stylesheet" href="/css/style.css">
|
<link rel="stylesheet" href="/css/style.css">
|
||||||
<script src="/js/jquery-min.js"></script>
|
<script src="/js/jquery-min.js"></script>
|
||||||
<script src="/js/unsupported.js"></script>
|
<script src="/js/unsupported.js"></script>
|
||||||
<?php if(!empty(H_CAPTCHA_ONOFF && H_CAPTCHA_ONOFF == "true")){?>
|
<?php if (!empty(H_CAPTCHA_ONOFF && H_CAPTCHA_ONOFF == "true")) { ?>
|
||||||
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
|
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
|
||||||
<?php }?>
|
<?php } ?>
|
||||||
<?php if(!empty(CF_TURNSTILE_ONOFF && CF_TURNSTILE_ONOFF == "true")){?>
|
<?php if (!empty(CF_TURNSTILE_ONOFF && CF_TURNSTILE_ONOFF == "true")) { ?>
|
||||||
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
|
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
|
||||||
<?php }?>
|
<?php } ?>
|
||||||
<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 safetext($serversettings["serverinfo"]["server_name"]);?></title>
|
<title>アカウントの移行登録 - <?php echo safetext($serversettings["serverinfo"]["server_name"]); ?></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(safetext($serversettings["serverinfo"]["server_logo_login"]))){ ?>
|
<?php if (!empty(safetext($serversettings["serverinfo"]["server_logo_login"]))) { ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="/index.php"><img src=<?php echo safetext($serversettings["serverinfo"]["server_logo_login"]);?>></a>
|
<a href="/index.php"><img src=<?php echo safetext($serversettings["serverinfo"]["server_logo_login"]); ?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php } else { ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="/index.php"><img src="/img/uwuzulogo.svg"></a>
|
<a href="/index.php"><img src="/img/uwuzulogo.svg"></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php } ?>
|
||||||
|
|
||||||
<div class="textbox">
|
<div class="textbox">
|
||||||
<h1>アカウントの移行登録</h1>
|
<h1>アカウントの移行登録</h1>
|
||||||
<p>ここからアカウントの移行登録が可能です!</p>
|
<p>ここからアカウントの移行登録が可能です!</p>
|
||||||
<?php if( !empty($error_message) ): ?>
|
<?php if (!empty($error_message)): ?>
|
||||||
<ul class="errmsg">
|
<ul class="errmsg">
|
||||||
<?php foreach( $error_message as $value ): ?>
|
<?php foreach ($error_message as $value): ?>
|
||||||
<p>・ <?php echo $value; ?></p>
|
<p>・ <?php echo $value; ?></p>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if(safetext($serversettings["serverinfo"]["server_account_migration"]) === "true"){?>
|
|
||||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
|
||||||
<div>
|
|
||||||
<p>新しいユーザーID</p>
|
|
||||||
<div class="p2">このサーバーで使用するユーザーIDを入力してください。</div>
|
|
||||||
<input id="new_userid" type="text" placeholder="" class="inbox" name="new_userid" value="<?php if( !empty($_SESSION['form_data']['new_userid']) ){ echo safetext($_SESSION['form_data']['new_userid']); } ?>">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>新しいパスワード</p>
|
|
||||||
<div class="p2">このサーバーで使用するパスワードを入力してください。</div>
|
|
||||||
<input id="password" type="text" placeholder="" class="inbox" name="password" value="<?php if( !empty($_SESSION['form_data']['password']) ){ echo safetext($_SESSION['form_data']['password']); } ?>">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>アカウント移行元のuwuzuサーバーのドメイン</p>
|
|
||||||
<div class="p2">アカウント移行元のサーバードメインを入力してください。</div>
|
|
||||||
<input id="moto_server_domain" type="text" placeholder="uwuzu.example.com" class="inbox" name="moto_server_domain" value="<?php if( !empty($_SESSION['form_data']['moto_server_domain']) ){ echo safetext($_SESSION['form_data']['moto_server_domain']); } ?>">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>識別コード</p>
|
|
||||||
<div class="p2">アカウント移行元のサーバーで発行された識別コードを入力してください。</div>
|
|
||||||
<input id="moto_server_account_check" type="text" placeholder="" class="inbox" name="moto_server_account_check" value="<?php if( !empty($_SESSION['form_data']['moto_server_account_check']) ){ echo safetext($_SESSION['form_data']['moto_server_account_check']); } ?>">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<?php if (safetext($serversettings["serverinfo"]["server_account_migration"]) === "true") { ?>
|
||||||
<p>認証コード</p>
|
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||||
<div class="p2">アカウント移行元のサーバーで発行された認証コードを入力してください。</div>
|
|
||||||
<input id="moto_server_account_auth" type="text" placeholder="" class="inbox" name="moto_server_account_auth" value="<?php if( !empty($_SESSION['form_data']['moto_server_account_auth']) ){ echo safetext($_SESSION['form_data']['moto_server_account_auth']); } ?>">
|
|
||||||
</div>
|
|
||||||
<?php if(!empty(H_CAPTCHA_ONOFF && H_CAPTCHA_ONOFF == "true")){?>
|
|
||||||
<div class="captcha_zone">
|
|
||||||
<div class="p2">あなたは人間ですか?<br>もし人間であれば下のチェックボックスにチェックしてください!</div>
|
|
||||||
<div class="h-captcha" data-sitekey="<?php echo safetext(H_CAPTCHA_SITE_KEY);?>"></div>
|
|
||||||
</div>
|
|
||||||
<?php }?>
|
|
||||||
<?php if(!empty(CF_TURNSTILE_ONOFF && CF_TURNSTILE_ONOFF == "true")){?>
|
|
||||||
<div class="captcha_zone">
|
|
||||||
<div class="cf-turnstile" data-sitekey="<?php echo safetext(CF_TURNSTILE_SITE_KEY);?>" data-callback="javascriptCallback" data-language="ja"></div>
|
|
||||||
</div>
|
|
||||||
<?php }?>
|
|
||||||
<?php if(safetext($serversettings["serverinfo"]["server_invitation"]) === "true"){?>
|
|
||||||
<div>
|
<div>
|
||||||
<p>招待コード</p>
|
<p>新しいユーザーID</p>
|
||||||
<div class="p2">招待コードがないとこのサーバーには登録できません。</div>
|
<div class="p2">このサーバーで使用するユーザーIDを入力してください。</div>
|
||||||
<input id="invitationcode" type="text" placeholder="" class="inbox" name="invitationcode" value="<?php if( !empty($_SESSION['form_data']['invitationcode']) ){ echo safetext($_SESSION['form_data']['invitationcode']); } ?>">
|
<input id="new_userid" type="text" placeholder="" class="inbox" name="new_userid" value="<?php if (!empty($_SESSION['form_data']['new_userid'])) {
|
||||||
|
echo safetext($_SESSION['form_data']['new_userid']);
|
||||||
|
} ?>">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>新しいパスワード</p>
|
||||||
|
<div class="p2">このサーバーで使用するパスワードを入力してください。</div>
|
||||||
|
<input id="password" type="text" placeholder="" class="inbox" name="password" value="<?php if (!empty($_SESSION['form_data']['password'])) {
|
||||||
|
echo safetext($_SESSION['form_data']['password']);
|
||||||
|
} ?>">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>アカウント移行元のuwuzuサーバーのドメイン</p>
|
||||||
|
<div class="p2">アカウント移行元のサーバードメインを入力してください。</div>
|
||||||
|
<input id="moto_server_domain" type="text" placeholder="uwuzu.example.com" class="inbox" name="moto_server_domain" value="<?php if (!empty($_SESSION['form_data']['moto_server_domain'])) {
|
||||||
|
echo safetext($_SESSION['form_data']['moto_server_domain']);
|
||||||
|
} ?>">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>識別コード</p>
|
||||||
|
<div class="p2">アカウント移行元のサーバーで発行された識別コードを入力してください。</div>
|
||||||
|
<input id="moto_server_account_check" type="text" placeholder="" class="inbox" name="moto_server_account_check" value="<?php if (!empty($_SESSION['form_data']['moto_server_account_check'])) {
|
||||||
|
echo safetext($_SESSION['form_data']['moto_server_account_check']);
|
||||||
|
} ?>">
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
|
||||||
|
|
||||||
<input type="submit" class = "irobutton" name="btn_submit" value="移行開始">
|
<div>
|
||||||
</form>
|
<p>認証コード</p>
|
||||||
<?php }else{?>
|
<div class="p2">アカウント移行元のサーバーで発行された認証コードを入力してください。</div>
|
||||||
<p>このサーバーではアカウントの移行登録を受け入れていません。</p>
|
<input id="moto_server_account_auth" type="text" placeholder="" class="inbox" name="moto_server_account_auth" value="<?php if (!empty($_SESSION['form_data']['moto_server_account_auth'])) {
|
||||||
<?php }?>
|
echo safetext($_SESSION['form_data']['moto_server_account_auth']);
|
||||||
|
} ?>">
|
||||||
|
</div>
|
||||||
|
<?php if (!empty(H_CAPTCHA_ONOFF && H_CAPTCHA_ONOFF == "true")) { ?>
|
||||||
|
<div class="captcha_zone">
|
||||||
|
<div class="p2">あなたは人間ですか?<br>もし人間であれば下のチェックボックスにチェックしてください!</div>
|
||||||
|
<div class="h-captcha" data-sitekey="<?php echo safetext(H_CAPTCHA_SITE_KEY); ?>"></div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if (!empty(CF_TURNSTILE_ONOFF && CF_TURNSTILE_ONOFF == "true")) { ?>
|
||||||
|
<div class="captcha_zone">
|
||||||
|
<div class="cf-turnstile" data-sitekey="<?php echo safetext(CF_TURNSTILE_SITE_KEY); ?>" data-callback="javascriptCallback" data-language="ja"></div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if (safetext($serversettings["serverinfo"]["server_invitation"]) === "true") { ?>
|
||||||
|
<div>
|
||||||
|
<p>招待コード</p>
|
||||||
|
<div class="p2">招待コードがないとこのサーバーには登録できません。</div>
|
||||||
|
<input id="invitationcode" type="text" placeholder="" class="inbox" name="invitationcode" value="<?php if (!empty($_SESSION['form_data']['invitationcode'])) {
|
||||||
|
echo safetext($_SESSION['form_data']['invitationcode']);
|
||||||
|
} ?>">
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<div class="btnbox">
|
<input type="submit" class="irobutton" name="btn_submit" value="移行開始">
|
||||||
|
</form>
|
||||||
|
<?php } else { ?>
|
||||||
|
<p>このサーバーではアカウントの移行登録を受け入れていません。</p>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="btnbox">
|
||||||
<a href="javascript:history.back();" class="sirobutton">戻る</a>
|
<a href="javascript:history.back();" class="sirobutton">戻る</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
function checkForm(inputElement) {
|
||||||
function checkForm(inputElement) {
|
var str = inputElement.value;
|
||||||
var str = inputElement.value;
|
while (str.match(/[^A-Za-z\d_]/)) {
|
||||||
while (str.match(/[^A-Za-z\d_]/)) {
|
str = str.replace(/[^A-Za-z\d_]/, "");
|
||||||
str = str.replace(/[^A-Za-z\d_]/, "");
|
}
|
||||||
}
|
inputElement.value = str;
|
||||||
inputElement.value = str;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', function(){
|
window.addEventListener('DOMContentLoaded', function() {
|
||||||
$('#file_upload').change(function(e) {
|
$('#file_upload').change(function(e) {
|
||||||
var file_reader = new FileReader();
|
var file_reader = new FileReader();
|
||||||
file_reader.addEventListener('load', function(e) {
|
file_reader.addEventListener('load', function(e) {
|
||||||
$('#img_select').show();
|
$('#img_select').show();
|
||||||
$('#iconimg').attr('src', file_reader.result);
|
$('#iconimg').attr('src', file_reader.result);
|
||||||
|
});
|
||||||
|
file_reader.readAsDataURL(e.target.files[0]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
file_reader.readAsDataURL(e.target.files[0]);
|
</script>
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -8,6 +8,11 @@ $badpassfile = "server/badpass.txt";
|
|||||||
$badpass_info = file_get_contents($badpassfile);
|
$badpass_info = file_get_contents($badpassfile);
|
||||||
$badpass = preg_split("/\r\n|\n|\r/", $badpass_info);
|
$badpass = preg_split("/\r\n|\n|\r/", $badpass_info);
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
|
||||||
|
$serverinfofile = 'server/info.txt';
|
||||||
|
$serverinfo = file_get_contents($serverinfofile);
|
||||||
|
|
||||||
require('db.php');
|
require('db.php');
|
||||||
//関数呼び出し
|
//関数呼び出し
|
||||||
//- EXIF
|
//- EXIF
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ $domain = $_SERVER['HTTP_HOST'];
|
|||||||
|
|
||||||
//------------------------
|
//------------------------
|
||||||
|
|
||||||
|
$serverinfofile = 'server/info.txt';
|
||||||
|
$serverinfo = file_get_contents($serverinfofile);
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
|||||||
"software" => array(
|
"software" => array(
|
||||||
"name" => "uwuzu",
|
"name" => "uwuzu",
|
||||||
"version" => "".str_replace("\r", '', $uwuzuinfo[1])."",
|
"version" => "".str_replace("\r", '', $uwuzuinfo[1])."",
|
||||||
"homepage" => "https://docs.uwuzu.xyz/",
|
"homepage" => "https://docs.uwuzu.com/",
|
||||||
"repository" => "https://github.com/Daichimarukana/uwuzu",
|
"repository" => "https://github.com/Daichimarukana/uwuzu",
|
||||||
),
|
),
|
||||||
"protocols" => [
|
"protocols" => [
|
||||||
|
|||||||
@@ -130,21 +130,21 @@ if( !empty($_POST['migration_submit']) ) {
|
|||||||
if($Check_result["server_info"]["account_migration"] == "true"){
|
if($Check_result["server_info"]["account_migration"] == "true"){
|
||||||
$pdo->beginTransaction();
|
$pdo->beginTransaction();
|
||||||
try {
|
try {
|
||||||
$account = $userid;
|
$account = safetext($userid);
|
||||||
$migration_code = createUniqId();
|
$migration_code = safetext(createUniqId());
|
||||||
$encryption_key = random(32);
|
$encryption_key = random(32);
|
||||||
$encryption_ivkey = random(16);
|
$encryption_ivkey = random(16);
|
||||||
$datetime = date("Y-m-d H:i:s");
|
$datetime = date("Y-m-d H:i:s");
|
||||||
$domain = $server_domain;
|
$domain = safetext($server_domain);
|
||||||
|
|
||||||
$stmt = $pdo->prepare("INSERT INTO migration (account, domain, migration_code, encryption_key, encryption_ivkey, datetime) VALUES (:account, :domain, :migration_code, :encryption_key, :encryption_ivkey, :datetime)");
|
$stmt = $pdo->prepare("INSERT INTO migration (account, domain, migration_code, encryption_key, encryption_ivkey, datetime) VALUES (:account, :domain, :migration_code, :encryption_key, :encryption_ivkey, :datetime)");
|
||||||
|
|
||||||
$stmt->bindParam(':account', safetext($account), PDO::PARAM_STR);
|
$stmt->bindParam(':account', $account, PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':domain', safetext($domain), PDO::PARAM_STR);
|
$stmt->bindParam(':domain', $domain, PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':migration_code', safetext($migration_code), PDO::PARAM_STR);
|
$stmt->bindParam(':migration_code', $migration_code, PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':encryption_key', safetext($encryption_key), PDO::PARAM_STR);
|
$stmt->bindParam(':encryption_key', $encryption_key, PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':encryption_ivkey', safetext($encryption_ivkey), PDO::PARAM_STR);
|
$stmt->bindParam(':encryption_ivkey', $encryption_ivkey, PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':datetime', safetext($datetime), PDO::PARAM_STR);
|
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||||
|
|
||||||
$res = $stmt->execute();
|
$res = $stmt->execute();
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -292,7 +292,7 @@ require('../logout/logout.php');
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<h1>API</h1>
|
<h1>API</h1>
|
||||||
<p>APIの使用方法はdocs.uwuzu.xyzよりAPIドキュメントをご確認ください。</p>
|
<p>APIの使用方法はdocs.uwuzu.comよりAPIドキュメントをご確認ください。</p>
|
||||||
|
|
||||||
<?php if (empty($userData['token'])) { ?>
|
<?php if (empty($userData['token'])) { ?>
|
||||||
<p>以下のボタンよりアクセストークンを取得すると使用できます。<br>アクセストークンは一度発行すると作り直すまで再度確認はできません。また、絶対に他人に知られないように保護してください。<br>
|
<p>以下のボタンよりアクセストークンを取得すると使用できます。<br>アクセストークンは一度発行すると作り直すまで再度確認はできません。また、絶対に他人に知られないように保護してください。<br>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<p>JavaScriptを無効にしている状態での使用はできません。</p>
|
<p>JavaScriptを無効にしている状態での使用はできません。</p>
|
||||||
<p>詳細は下記のリンクよりご確認ください。</p>
|
<p>詳細は下記のリンクよりご確認ください。</p>
|
||||||
|
|
||||||
<a href="https://docs.uwuzu.xyz/docs/uwuzusupport" class="infobtn">詳細</a>
|
<a href="https://docs.uwuzu.com/docs/uwuzusupport" class="infobtn">詳細</a>
|
||||||
<div class="p2">JS_BLOCKED_ERROR</div>
|
<div class="p2">JS_BLOCKED_ERROR</div>
|
||||||
|
|
||||||
<div class="center_text">
|
<div class="center_text">
|
||||||
|
|||||||
@@ -117,7 +117,7 @@
|
|||||||
<div class="page" id="page8" style="display:none;">
|
<div class="page" id="page8" style="display:none;">
|
||||||
<h1>お疲れ様でした!</h1>
|
<h1>お疲れ様でした!</h1>
|
||||||
<p style="text-align: center;">チュートリアルは終了です!<br>
|
<p style="text-align: center;">チュートリアルは終了です!<br>
|
||||||
まだ、このチュートリアルで紹介できていないuwuzuの機能や使い方も多くあるので、もっとuwuzuについて知りたい方はぜひdocs.uwuzu.xyzをご覧ください。</p>
|
まだ、このチュートリアルで紹介できていないuwuzuの機能や使い方も多くあるので、もっとuwuzuについて知りたい方はぜひdocs.uwuzu.comをご覧ください。</p>
|
||||||
<div class="btm_area">
|
<div class="btm_area">
|
||||||
<div class="iro_btn backcolor" id="back">戻る</div>
|
<div class="iro_btn backcolor" id="back">戻る</div>
|
||||||
<div class="iro_btn" id="end">閉じる</div>
|
<div class="iro_btn" id="end">閉じる</div>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ $serversettings = parse_ini_file($serversettings_file, true);
|
|||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
|
||||||
// 変数の初期化
|
// 変数の初期化
|
||||||
$datetime = array();
|
$datetime = array();
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ daichimarukanaと一緒に開発したいよ~って人は私のHPからメー
|
|||||||
|
|
||||||
## 9. ライセンス
|
## 9. ライセンス
|
||||||
UPULライセンスです!
|
UPULライセンスです!
|
||||||
UPULライセンスに関しては同梱されているUPUL_License.txtを確認するか、uwuzu.xyzより詳細をご確認ください。
|
UPULライセンスに関しては同梱されているUPUL_License.txtを確認するか、uwuzu.comより詳細をご確認ください。
|
||||||
|
|
||||||
## 10. 利用させていただいているライブラリなどのライセンス
|
## 10. 利用させていただいているライブラリなどのライセンス
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ Redistribution and use in source and binary forms, with or without modification,
|
|||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
なお、使わせていただいているコードは改変させていただいでおります。
|
なお、使わせていただいているコードは改変させていただいでおります。
|
||||||
|
|
||||||
### jQuery 3.7.1
|
### jQuery 4.0.0
|
||||||
MITライセンスで提供されているようです。
|
MITライセンスで提供されているようです。
|
||||||
詳細は以下のリンク先をご覧ください。
|
詳細は以下のリンク先をご覧ください。
|
||||||
https://jquery.com/license/
|
https://jquery.com/license/
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
uwuzu
|
uwuzu
|
||||||
1.6.13
|
1.6.14
|
||||||
2026/04/22
|
2026/05/04
|
||||||
daichimarukana,putonfps
|
daichimarukana,putonfps
|
||||||
@@ -1,6 +1,20 @@
|
|||||||
## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
|
## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
|
||||||
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
|
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
|
||||||
|
|
||||||
|
## Version 1.6.14 (Hapuego)
|
||||||
|
2026/05/04
|
||||||
|
fix: ホーム画面・ブックマークにて共有ボタンが正常に動作しなくなる恐れのある問題を修正しました!
|
||||||
|
fix: ログインやアカウント登録が正常にできなくなってしまう恐れのある問題を修正しました!
|
||||||
|
fix: 埋め込みを含むユーズを読み込んだ際のタイムラインの表示を高速化しました!
|
||||||
|
fix: アカウントの移行に関する処理を一部修正しました!
|
||||||
|
fix: 管理者向けページにてログの保存に失敗する恐れのある問題を修正しました。
|
||||||
|
fix: uwuzu.xyz宛のURLをuwuzu.comに変更しました!
|
||||||
|
fix: APIトークンの削除に関するエラーログの保存に失敗する恐れのある問題を修正しました!
|
||||||
|
chg: 一部UIを変更しました
|
||||||
|
chg: 同梱のjQueryをjQuery 4.0.0にアップデートしました!
|
||||||
|
new: Spotify埋め込みに対応しました!!!!
|
||||||
|
new: タイムラインへのオンラインステータス表示に対応しました!
|
||||||
|
|
||||||
## Version 1.6.13 (Hapuego)
|
## Version 1.6.13 (Hapuego)
|
||||||
2026/04/22
|
2026/04/22
|
||||||
fix: カスタム絵文字が表示されなくなる(使用できなくなる)問題を修正しました!
|
fix: カスタム絵文字が表示されなくなる(使用できなくなる)問題を修正しました!
|
||||||
|
|||||||
@@ -394,7 +394,7 @@ if( !empty($_POST['send_ban_submit']) ) {
|
|||||||
//------------
|
//------------
|
||||||
} else {
|
} else {
|
||||||
$error_message[] = 'アカウント削除に失敗しました。(ACCOUNT_DELETE_DAME)';
|
$error_message[] = 'アカウント削除に失敗しました。(ACCOUNT_DELETE_DAME)';
|
||||||
actionLog($userid, "error", "send_ban_submit", $userId2, $error_message[], 4);
|
actionLog($userid, "error", "send_ban_submit", $userId2, $error_message, 4);
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -88,7 +88,7 @@ if($errcode == "UNSUPPORTED_BROWSER"){
|
|||||||
<br>詳細は下記のリンクよりご確認ください。</p>
|
<br>詳細は下記のリンクよりご確認ください。</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a href="https://docs.uwuzu.xyz/docs/uwuzusupport" class="infobtn">詳細</a>
|
<a href="https://docs.uwuzu.com/docs/uwuzusupport" class="infobtn">詳細</a>
|
||||||
|
|
||||||
<div class="maintext">
|
<div class="maintext">
|
||||||
<h3>エラー内容</h3>
|
<h3>エラー内容</h3>
|
||||||
|
|||||||
+23
-4
@@ -1,12 +1,31 @@
|
|||||||
{
|
{
|
||||||
"software": "uwuzu",
|
"software": "uwuzu",
|
||||||
"version": "1.6.13",
|
"version": "1.6.14",
|
||||||
"release_date": "2026/04/22",
|
"release_date": "2026/05/04",
|
||||||
"release_notes": "このアップデートには、カスタム絵文字の表示がされなくなる問題の修正が含まれます。\n詳細はリリースノートをご確認ください。",
|
"release_notes": "このアップデートには、Spotify埋め込み機能、タイムラインへのオンラインステータス表示の対応とユーズの共有に関するバグを始めとする諸々のバグ修正が含まれます。\n詳細はリリースノートをご確認ください。",
|
||||||
"notices": "アップデート前にデータのバックアップを行うことをおすすめします!",
|
"notices": "アップデート前にデータのバックアップを行うことをおすすめします!",
|
||||||
"files": {
|
"files": {
|
||||||
"overwrite": [
|
"overwrite": [
|
||||||
"/function/get_customemoji.php",
|
"/authlogin.php",
|
||||||
|
"/check.php",
|
||||||
|
"/new_select.php",
|
||||||
|
"/new.php",
|
||||||
|
"/unsupported.php",
|
||||||
|
"/bookmark/index.php",
|
||||||
|
"/css/home.css",
|
||||||
|
"/function/delete_apitoken.php",
|
||||||
|
"/function/function.php",
|
||||||
|
"/home/index.php",
|
||||||
|
"/js/view_function.js",
|
||||||
|
"/js/jquery-min.js",
|
||||||
|
"/migration/index.php",
|
||||||
|
"/nodeinfo/2.1/index.php",
|
||||||
|
"/others/account_migration.php",
|
||||||
|
"/others/index.php",
|
||||||
|
"/require/noscript_modal.php",
|
||||||
|
"/require/tutorial.php",
|
||||||
|
"/search/index.php",
|
||||||
|
"/settings_admin/userinfo.php",
|
||||||
"/server/uwuzuabout.txt",
|
"/server/uwuzuabout.txt",
|
||||||
"/server/uwuzuinfo.txt",
|
"/server/uwuzuinfo.txt",
|
||||||
"/server/uwuzurelease.txt"
|
"/server/uwuzurelease.txt"
|
||||||
|
|||||||
Reference in New Issue
Block a user