mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-05 03:24:41 +00:00
uwuzu v1.3.6 new_planet
This commit is contained in:
@@ -3,6 +3,12 @@ RewriteCond %{REQUEST_FILENAME} !-d
|
|||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteCond %{REQUEST_FILENAME}\.php -f
|
RewriteCond %{REQUEST_FILENAME}\.php -f
|
||||||
RewriteRule ^(.*)$ $1.php [L]
|
RewriteRule ^(.*)$ $1.php [L]
|
||||||
|
RewriteRule ^\.htaccess$ - [F]
|
||||||
|
RewriteRule ^db\.php$ - [F]
|
||||||
|
RewriteRule ^settings_admin/CloudflareTurnstile_settings/ - [F]
|
||||||
|
RewriteRule ^settings_admin/hCaptcha_settings/ - [F]
|
||||||
|
RewriteRule ^settings_admin/plugin_settings/ - [F]
|
||||||
|
|
||||||
RewriteBase /
|
RewriteBase /
|
||||||
|
|
||||||
RewriteRule ^(@\w+)$ /user/index.php?uwuzuid=$1 [QSA,L]
|
RewriteRule ^(@\w+)$ /user/index.php?uwuzuid=$1 [QSA,L]
|
||||||
@@ -18,4 +24,4 @@ ErrorDocument 404 /errorpage/404.php
|
|||||||
ErrorDocument 500 /errorpage/500.php
|
ErrorDocument 500 /errorpage/500.php
|
||||||
ErrorDocument 503 /errorpage/503.php
|
ErrorDocument 503 /errorpage/503.php
|
||||||
|
|
||||||
Header set X-FRAME-OPTIONS “DENY”
|
Header set X-FRAME-OPTIONS "DENY"
|
||||||
+2
-2
@@ -201,11 +201,11 @@ $pdo = null;
|
|||||||
<div class="leftbox">
|
<div class="leftbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src="img/uwuzulogo.svg"></a>
|
<a href="index.php"><img src="img/uwuzulogo.svg"></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
|
||||||
|
|||||||
+16
-89
@@ -17,6 +17,10 @@ require('../function/function.php');
|
|||||||
$serversettings_file = "../server/serversettings.ini";
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
|
$badpassfile = "../server/badpass.txt";
|
||||||
|
$badpass_info = file_get_contents($badpassfile);
|
||||||
|
$badpass = preg_split("/\r\n|\n|\r/", $badpass_info);
|
||||||
|
|
||||||
session_name('uwuzu_s_id');
|
session_name('uwuzu_s_id');
|
||||||
session_set_cookie_params(0, '', '', true, true);
|
session_set_cookie_params(0, '', '', true, true);
|
||||||
session_start();
|
session_start();
|
||||||
@@ -74,9 +78,6 @@ if($result2 > 0){
|
|||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
|
|
||||||
|
|
||||||
//$row['userid'] = "daichimarukn";
|
|
||||||
|
|
||||||
// 空白除去
|
// 空白除去
|
||||||
$username = $_POST['username'];
|
$username = $_POST['username'];
|
||||||
$userid = $_POST['userid'];
|
$userid = $_POST['userid'];
|
||||||
@@ -260,74 +261,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
|
$error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$weakPasswords = array(
|
if(in_array($password, $badpass) === true ){
|
||||||
"password",
|
|
||||||
"123456",
|
|
||||||
"123456789",
|
|
||||||
"12345",
|
|
||||||
"12345678",
|
|
||||||
"123123",
|
|
||||||
"1234567890",
|
|
||||||
"1234567",
|
|
||||||
"1q2w3e",
|
|
||||||
"qwerty123",
|
|
||||||
"aa12345678",
|
|
||||||
"password1",
|
|
||||||
"1234",
|
|
||||||
"qwertyuiop",
|
|
||||||
"123321",
|
|
||||||
"12321",
|
|
||||||
"qwertyui",
|
|
||||||
"abcd1234",
|
|
||||||
"zaq12wsx",
|
|
||||||
"1q2w3e4r",
|
|
||||||
"qwer1234",
|
|
||||||
"sakura",
|
|
||||||
"asdf1234",
|
|
||||||
"asdfghjkl",
|
|
||||||
"asdfghjk",
|
|
||||||
"member",
|
|
||||||
"1qaz2wsx",
|
|
||||||
"doraemon",
|
|
||||||
"makoto",
|
|
||||||
"takeshi",
|
|
||||||
"machi1",
|
|
||||||
"machida",
|
|
||||||
"machida1",
|
|
||||||
"tokyo",
|
|
||||||
"arashi",
|
|
||||||
"dropbox",
|
|
||||||
"twitter",
|
|
||||||
"elonmusk",
|
|
||||||
"xcorp",
|
|
||||||
"1234qwer",
|
|
||||||
"japan",
|
|
||||||
"nippon",
|
|
||||||
"tukareta",
|
|
||||||
"tweet",
|
|
||||||
"discord",
|
|
||||||
"misskey",
|
|
||||||
"qwerty",
|
|
||||||
"123456789",
|
|
||||||
"abc123",
|
|
||||||
"password123",
|
|
||||||
"admin",
|
|
||||||
"letmein",
|
|
||||||
"iloveyou",
|
|
||||||
"111111",
|
|
||||||
"12345678910",
|
|
||||||
"user",
|
|
||||||
"root",
|
|
||||||
"system",
|
|
||||||
// 他にも弱いパスワードを追加できます
|
|
||||||
);
|
|
||||||
|
|
||||||
function isWeakPassword($passwords) {
|
|
||||||
global $weakPasswords;
|
|
||||||
return in_array($passwords, $weakPasswords);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isWeakPassword($password)) {
|
|
||||||
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
|
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -455,7 +389,7 @@ $pdo = null;
|
|||||||
<div class="textbox">
|
<div class="textbox">
|
||||||
<h1>アカウント登録</h1>
|
<h1>アカウント登録</h1>
|
||||||
|
|
||||||
<p>アカウント登録です。</p>
|
<p>管理者アカウント登録です。</p>
|
||||||
<p>必須項目には「*」があります。
|
<p>必須項目には「*」があります。
|
||||||
|
|
||||||
<?php if( !empty($error_message) ): ?>
|
<?php if( !empty($error_message) ): ?>
|
||||||
@@ -470,11 +404,12 @@ $pdo = null;
|
|||||||
|
|
||||||
<div id="wrap">
|
<div id="wrap">
|
||||||
<div class="iconimg">
|
<div class="iconimg">
|
||||||
<img src="../img/deficon/icon.png">
|
<img id="iconimg" src="../img/deficon/icon.png">
|
||||||
</div>
|
</div>
|
||||||
<label class="irobutton" for="file_upload">ファイル選択
|
<label class="irobutton" for="file_upload">ファイル選択
|
||||||
<input type="file" id="file_upload" name="image" accept="image/*">
|
<input type="file" id="file_upload" name="image" accept="image/*">
|
||||||
</label>
|
</label>
|
||||||
|
<p id="img_select" style="display:none;">画像を選択しました</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -545,22 +480,14 @@ function checkForm(inputElement) {
|
|||||||
|
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', function(){
|
window.addEventListener('DOMContentLoaded', function(){
|
||||||
|
$('#file_upload').change(function(e) {
|
||||||
// ファイルが選択されたら実行
|
var file_reader = new FileReader();
|
||||||
document.getElementById("file_upload").addEventListener('change', function(e){
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#img_select').show();
|
||||||
var file_reader = new FileReader();
|
$('#iconimg').attr('src', file_reader.result);
|
||||||
|
});
|
||||||
// ファイルの読み込みを行ったら実行
|
file_reader.readAsDataURL(e.target.files[0]);
|
||||||
file_reader.addEventListener('load', function(e) {
|
});
|
||||||
console.log(e.target.result);
|
|
||||||
const element = document.querySelector('#wrap');
|
|
||||||
const createElement = '<p>画像を選択しました。</p>';
|
|
||||||
element.insertAdjacentHTML('afterend', createElement);
|
|
||||||
});
|
|
||||||
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
+66
-62
@@ -36,43 +36,49 @@ $stmt = null;
|
|||||||
$res = null;
|
$res = null;
|
||||||
$option = null;
|
$option = null;
|
||||||
|
|
||||||
try {
|
if(!(empty(DB_NAME) && empty(DB_HOST) && empty(DB_USER) && empty(DB_PASS))){
|
||||||
|
try {
|
||||||
|
|
||||||
$option = array(
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$aduser = "yes";
|
||||||
|
|
||||||
|
$options = array(
|
||||||
|
// SQL実行失敗時に例外をスルー
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
// デフォルトフェッチモードを連想配列形式に設定
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
||||||
|
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
);
|
);
|
||||||
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
} catch(PDOException $e) {
|
|
||||||
|
$query = $dbh->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1');
|
||||||
// 接続エラーのときエラー内容を取得する
|
|
||||||
$error_message[] = $e->getMessage();
|
$query->execute(array(':adminuser' => $aduser));
|
||||||
}
|
|
||||||
|
$result2 = $query->fetch();
|
||||||
$aduser = "yes";
|
|
||||||
|
if($result2 > 0){
|
||||||
$options = array(
|
header("Location: ../login.php");
|
||||||
// SQL実行失敗時に例外をスルー
|
exit;
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
}
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
$db_php = true;
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
}else{
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
$db_php = false;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array("gd", get_loaded_extensions())) {
|
if (in_array("gd", get_loaded_extensions())) {
|
||||||
@@ -118,7 +124,7 @@ $pdo = null;
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
||||||
<div class="leftbox2">
|
<div class="leftbox">
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<img src="../img/uwuzulogo.svg">
|
<img src="../img/uwuzulogo.svg">
|
||||||
</div>
|
</div>
|
||||||
@@ -136,19 +142,37 @@ $pdo = null;
|
|||||||
|
|
||||||
<p>おめでとうございます!!!</p>
|
<p>おめでとうございます!!!</p>
|
||||||
<p>uwuzuの導入が完了しました!</p>
|
<p>uwuzuの導入が完了しました!</p>
|
||||||
<p>これより管理者アカウントの登録を行います。<br>userロールとofficialロール、iceロールの設定はお済みですか?<br>userロールとofficialロール、iceロールがないとuwuzuは正しく動作しないので設定をしていない方は一度このページを閉じて設定してください!<br>また、php.iniよりGDの有効化または導入はお済みですか?GDがないとuwuzuは二段階認証が正しく動作しないため絶対に設定してください!</p>
|
<p>これよりuwuzuのセットアップを開始します!<br>
|
||||||
|
セットアップを始める前に、PHPの必須モジュールがインストールされているか、以下の欄をみてご確認ください。<br>
|
||||||
|
Not setが一つでもある場合は再度モジュールの設定を行ってください!<br>
|
||||||
|
<br>
|
||||||
|
<?php if($db_php == true){?>
|
||||||
|
db.phpの設定は済んでいるようですね、それでは早速セットアップを開始しましょう!
|
||||||
|
<?php }else{?>
|
||||||
|
また、uwuzuのセットアップを始める前に、以下の情報をあなたが知っている必要があります!<br>
|
||||||
|
- データベース名(空のデータベースを用意してください。)<br>
|
||||||
|
- データベースを管理できるユーザー名<br>
|
||||||
|
- データベースへアクセスできるユーザーのパスワード<br>
|
||||||
|
- データベースのホストアドレス<br>
|
||||||
|
これらの情報はuwuzuがデータベースを使用するために必要で、uwuzu導入フォルダ内のdb.phpに保存されます。<br>
|
||||||
|
もしこのあとうまくセットアップが継続できなければ手動でdb.phpに上の情報を保存してください!<br>
|
||||||
|
これらのデータをあなたが知っているのであれば早速セットアップを開始しましょう!<br>
|
||||||
|
<?php }?>
|
||||||
|
<br>
|
||||||
|
セットアップ中にエラーに遭遇した場合はuwuzu.comを確認し、解消に向けて取り組みましょう!</p>
|
||||||
|
|
||||||
<div class="module_chk">
|
<div class="module_chk">
|
||||||
<p>GD : <?php if($check_gd == true){echo "OK";}else{echo "NG";}?></p>
|
<div class="p2">Already setが設定済みでNot setが未設定です。</div>
|
||||||
<p>Fileinfo : <?php if($check_fileinfo == true){echo "OK";}else{echo "NG";}?></p>
|
<p>GD : <?php if($check_gd == true){echo "Already set✅";}else{echo "Not set🟥";}?></p>
|
||||||
<p>mbstring : <?php if($check_mbstring == true){echo "OK";}else{echo "NG";}?></p>
|
<p>Fileinfo : <?php if($check_fileinfo == true){echo "Already set✅";}else{echo "Not set🟥";}?></p>
|
||||||
<p>pdo_mysql : <?php if($check_pdo_mysql == true){echo "OK";}else{echo "NG";}?></p>
|
<p>mbstring : <?php if($check_mbstring == true){echo "Already set✅";}else{echo "Not set🟥";}?></p>
|
||||||
|
<p>pdo_mysql : <?php if($check_pdo_mysql == true){echo "Already set✅";}else{echo "Not set🟥";}?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<p>uwuzu<br>Version : <?php echo $uwuzuinfo[1]?></p>
|
<p>uwuzu<br>Version : <?php echo $uwuzuinfo[1]?></p>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a href="addadmin.php" class="irobutton">次へ</a>
|
<a href="setup_db_php.php" class="irobutton">セットアップ開始!</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -165,26 +189,6 @@ function checkForm(inputElement) {
|
|||||||
}
|
}
|
||||||
inputElement.value = str;
|
inputElement.value = str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', function(){
|
|
||||||
|
|
||||||
// ファイルが選択されたら実行
|
|
||||||
document.getElementById("file_upload").addEventListener('change', function(e){
|
|
||||||
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
console.log(e.target.result);
|
|
||||||
const element = document.querySelector('#wrap');
|
|
||||||
const createElement = '<p>画像を選択しました。</p>';
|
|
||||||
element.insertAdjacentHTML('afterend', createElement);
|
|
||||||
});
|
|
||||||
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,235 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
|
||||||
|
require('../db.php');
|
||||||
|
|
||||||
|
$softwarefile = "../server/uwuzuinfo.txt";
|
||||||
|
$softwaredata = file_get_contents($softwarefile);
|
||||||
|
|
||||||
|
$softwaredata = explode( "\n", $softwaredata );
|
||||||
|
$cnt = count( $softwaredata );
|
||||||
|
for( $i=0;$i<$cnt;$i++ ){
|
||||||
|
$uwuzuinfo[$i] = ($softwaredata[$i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
|
session_name('uwuzu_s_id');
|
||||||
|
session_set_cookie_params(0, '', '', true, true);
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
// 変数の初期化
|
||||||
|
$current_date = null;
|
||||||
|
$message_array = array();
|
||||||
|
$error_message = array();
|
||||||
|
$pdo = null;
|
||||||
|
$stmt = null;
|
||||||
|
$res = null;
|
||||||
|
$option = null;
|
||||||
|
|
||||||
|
if(!(empty(DB_NAME) && empty(DB_HOST) && empty(DB_USER) && empty(DB_PASS))){
|
||||||
|
try {
|
||||||
|
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$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;
|
||||||
|
}else{
|
||||||
|
header("Location: setup_uwuzu_db.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db_php = true;
|
||||||
|
}else{
|
||||||
|
$db_php = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_POST['btn_submit']))){
|
||||||
|
$DataBase_Name = htmlentities($_POST['db_name'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$DataBase_User = htmlentities($_POST['db_user'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$DataBase_Pass = htmlentities($_POST['db_pass'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$DataBase_Host = htmlentities($_POST['db_host'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.$DataBase_Name.';host='.$DataBase_Host , $DataBase_User, $DataBase_Pass, $option);
|
||||||
|
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
$error_message[] = "データベースに接続できませんでした。\n設定は間違っていませんか?";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($error_message)){
|
||||||
|
$DB_Settings = "
|
||||||
|
<?php // データベースの接続情報
|
||||||
|
define( 'DB_HOST', '".$DataBase_Host."');
|
||||||
|
define( 'DB_USER', '".$DataBase_User."');
|
||||||
|
define( 'DB_PASS', '".$DataBase_Pass."');
|
||||||
|
define( 'DB_NAME', '".$DataBase_Name."');
|
||||||
|
|
||||||
|
// タイムゾーン設定
|
||||||
|
date_default_timezone_set('Asia/Tokyo');
|
||||||
|
?>
|
||||||
|
";
|
||||||
|
|
||||||
|
//設定上書き
|
||||||
|
$file = fopen('../db.php', 'w');
|
||||||
|
$data = $DB_Settings;
|
||||||
|
fputs($file, $data);
|
||||||
|
fclose($file);
|
||||||
|
|
||||||
|
header("Location: setup_uwuzu_db.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// データベースの接続を閉じる
|
||||||
|
$pdo = null;
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ja">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="stylesheet" href="../css/style.css">
|
||||||
|
<script src="../js/jquery-min.js"></script>
|
||||||
|
<script src="../js/unsupported.js"></script>
|
||||||
|
<script src="../js/console_notice.js"></script>
|
||||||
|
<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">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<title>db.phpのセットアップ - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
|
||||||
|
<script src="../js/back.js"></script>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="leftbox">
|
||||||
|
<div class="logo">
|
||||||
|
<img src="../img/uwuzulogo.svg">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="textbox">
|
||||||
|
<h1>db.phpのセットアップ</h1>
|
||||||
|
<?php if( !empty($error_message) ): ?>
|
||||||
|
<ul class="errmsg">
|
||||||
|
<?php foreach( $error_message as $value ): ?>
|
||||||
|
<p>・ <?php echo $value; ?></p>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
<script src="back.js"></script>
|
||||||
|
|
||||||
|
<p>db.phpのセットアップを行います。<br>
|
||||||
|
db.phpはuwuzuがデータベースへ接続するための設定ファイルです。<br>
|
||||||
|
これが設定されていないとuwuzuはデータベースに接続できません。</p>
|
||||||
|
|
||||||
|
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||||
|
<div>
|
||||||
|
<p>データベース名</p>
|
||||||
|
<div class="p2">空のデータベースを用意してください</div>
|
||||||
|
<input id="db_name" type="text" placeholder="uwuzu_db" class="inbox" name="db_name" value="<?php echo htmlentities(DB_NAME, ENT_QUOTES, 'UTF-8', false)?>">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>ユーザー名</p>
|
||||||
|
<div class="p2">データベースを操作できるユーザー名を入力してください。</div>
|
||||||
|
<input id="db_user" type="text" placeholder="root" class="inbox" name="db_user" value="<?php echo htmlentities(DB_USER, ENT_QUOTES, 'UTF-8', false)?>">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>パスワード</p>
|
||||||
|
<div class="p2">上のユーザーのパスワードを入力してください。</div>
|
||||||
|
<input id="db_pass" type="password" placeholder="********" class="inbox" name="db_pass" value="<?php echo htmlentities(DB_PASS, ENT_QUOTES, 'UTF-8', false)?>">
|
||||||
|
</div>
|
||||||
|
<div class="switch_flexbox">
|
||||||
|
<div class="switch_button">
|
||||||
|
<input id="passview" class="switch_input" type='checkbox' name="passview" value=""/>
|
||||||
|
<label for="passview" class="switch_label"></label>
|
||||||
|
</div>
|
||||||
|
<p>パスワードを表示する</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>データベースのホスト名</p>
|
||||||
|
<div class="p2">データベースのホスト名を入力してください。<br>localhostであることが多いです。</div>
|
||||||
|
<input id="db_host" type="text" placeholder="localhost" class="inbox" name="db_host" value="<?php echo htmlentities(DB_HOST, ENT_QUOTES, 'UTF-8', false)?>">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="submit" class = "irobutton" name="btn_submit" value="次へ">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="btnbox">
|
||||||
|
<a href="index.php" class="sirobutton">戻る</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function checkForm(inputElement) {
|
||||||
|
var str = inputElement.value;
|
||||||
|
while (str.match(/[^A-Za-z\d_]/)) {
|
||||||
|
str = str.replace(/[^A-Za-z\d_]/, "");
|
||||||
|
}
|
||||||
|
inputElement.value = str;
|
||||||
|
}
|
||||||
|
$("#passview").click(function () {
|
||||||
|
if ($("#passview").prop("checked") == true) {
|
||||||
|
$('#db_pass').get(0).type = 'text';
|
||||||
|
} else {
|
||||||
|
$('#db_pass').get(0).type = 'password';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,214 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
|
||||||
|
require('../db.php');
|
||||||
|
|
||||||
|
$softwarefile = "../server/uwuzuinfo.txt";
|
||||||
|
$softwaredata = file_get_contents($softwarefile);
|
||||||
|
|
||||||
|
$softwaredata = explode( "\n", $softwaredata );
|
||||||
|
$cnt = count( $softwaredata );
|
||||||
|
for( $i=0;$i<$cnt;$i++ ){
|
||||||
|
$uwuzuinfo[$i] = ($softwaredata[$i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
|
session_name('uwuzu_s_id');
|
||||||
|
session_set_cookie_params(0, '', '', true, true);
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
// 変数の初期化
|
||||||
|
$current_date = null;
|
||||||
|
$message_array = array();
|
||||||
|
$error_message = array();
|
||||||
|
$pdo = null;
|
||||||
|
$stmt = null;
|
||||||
|
$res = null;
|
||||||
|
$option = null;
|
||||||
|
|
||||||
|
if(!(empty(DB_NAME) && empty(DB_HOST) && empty(DB_USER) && empty(DB_PASS))){
|
||||||
|
try {
|
||||||
|
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$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_result = $table_query->fetch();
|
||||||
|
if($table_result > 0){
|
||||||
|
$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;
|
||||||
|
}
|
||||||
|
header("Location: addadmin.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$db_php = true;
|
||||||
|
}else{
|
||||||
|
$db_php = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_POST['btn_submit']))){
|
||||||
|
$sqlfile = "../uwuzu_database.sql";
|
||||||
|
$sqldata = file_get_contents($sqlfile);
|
||||||
|
if ($sqldata === false) {
|
||||||
|
$error_message[] = "SQLファイルの読み込みに失敗しました。";
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
if(empty($error_message)){
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
|
||||||
|
$pdo->exec($sqldata);
|
||||||
|
$db_setup = true;
|
||||||
|
|
||||||
|
$role_sql = "insert into role (rolename, roleauth, rolecolor, roleidname) VALUES ('凍結済み', 'ice', 'CCCCCC', 'ice');
|
||||||
|
insert into role (rolename, roleauth, rolecolor, roleidname) VALUES ('公式', 'official', 'CCCCCC', 'official');
|
||||||
|
insert into role (rolename, roleauth, rolecolor, roleidname) VALUES ('ゆーざー', 'user', 'CCCCCC', 'user');";
|
||||||
|
$pdo->exec($role_sql);
|
||||||
|
$role_setup = true;
|
||||||
|
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
$error_message[] = 'SQL実行エラー: ' . $e->getMessage();
|
||||||
|
}
|
||||||
|
if(empty($error_message)){
|
||||||
|
header("Location: addadmin.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// データベースの接続を閉じる
|
||||||
|
$pdo = null;
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ja">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="stylesheet" href="../css/style.css">
|
||||||
|
<script src="../js/jquery-min.js"></script>
|
||||||
|
<script src="../js/unsupported.js"></script>
|
||||||
|
<script src="../js/console_notice.js"></script>
|
||||||
|
<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">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<title>データベースのセットアップ - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
|
||||||
|
<script src="../js/back.js"></script>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="leftbox">
|
||||||
|
<div class="logo">
|
||||||
|
<img src="../img/uwuzulogo.svg">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="textbox">
|
||||||
|
<h1>データベースのセットアップ</h1>
|
||||||
|
<?php if( !empty($error_message) ): ?>
|
||||||
|
<ul class="errmsg">
|
||||||
|
<?php foreach( $error_message as $value ): ?>
|
||||||
|
<p>・ <?php echo $value; ?></p>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
<script src="back.js"></script>
|
||||||
|
|
||||||
|
<p>データベースのセットアップを行います。<br>
|
||||||
|
データベース内にテーブルというデータを保存する場所と必須ロールを作成します!<br>
|
||||||
|
作成にあたり、uwuzuにデフォルトで同梱されているuwuzu_database.sqlというファイルを使用します。<br>
|
||||||
|
このファイルに悪質な命令などが含まれているとあなたのサーバーが死んでしまうおそれがあります!<br>
|
||||||
|
<br>
|
||||||
|
uwuzuをuwuzuの公式ダウンロードページ(Github)からダウンロードしているならおそらく安全かと思われますが、<br>
|
||||||
|
uwuzu_database.sqlが安全なことを確認したうえで以下のデータベースのセットアップを実行してください。<br>
|
||||||
|
<br>
|
||||||
|
また、このセットアップには時間がかかる事があります!<br>
|
||||||
|
処理が終わるまで再起動などはせずに、そのままお待ち下さい!<br>
|
||||||
|
<br>
|
||||||
|
データベースのセットアップが完了すると、管理者アカウントの登録へ進みます。</p>
|
||||||
|
|
||||||
|
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||||
|
<input type="submit" class = "irobutton" name="btn_submit" value="セットアップ実行">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="btnbox">
|
||||||
|
<a href="index.php" class="sirobutton">戻る</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function checkForm(inputElement) {
|
||||||
|
var str = inputElement.value;
|
||||||
|
while (str.match(/[^A-Za-z\d_]/)) {
|
||||||
|
str = str.replace(/[^A-Za-z\d_]/, "");
|
||||||
|
}
|
||||||
|
inputElement.value = str;
|
||||||
|
}
|
||||||
|
$("#passview").click(function () {
|
||||||
|
if ($("#passview").prop("checked") == true) {
|
||||||
|
$('#db_pass').get(0).type = 'text';
|
||||||
|
} else {
|
||||||
|
$('#db_pass').get(0).type = 'password';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+8
-8
@@ -65,12 +65,12 @@ if($result2 > 0){
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$servernamefile = "../server/servername.txt";
|
$_SESSION = array();
|
||||||
if(!(empty($_SESSION['backupcode']))){
|
if (isset($_COOKIE[session_name()])) {
|
||||||
$backupcode = $_SESSION['backupcode'];
|
setcookie(session_name(), '', time()-1000, '/');
|
||||||
}else{
|
|
||||||
$backupcode = null;
|
|
||||||
}
|
}
|
||||||
|
session_destroy();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
@@ -85,7 +85,7 @@ if(!(empty($_SESSION['backupcode']))){
|
|||||||
<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 htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>管理者アカウント登録完了!!! - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<script src="back.js"></script>
|
<script src="back.js"></script>
|
||||||
@@ -99,9 +99,9 @@ if(!(empty($_SESSION['backupcode']))){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="textbox">
|
<div class="textbox">
|
||||||
<h1>アカウント作成完了!</h1>
|
<h1>管理者アカウント登録完了!</h1>
|
||||||
<p><br>いぇ~い!</p>
|
<p><br>いぇ~い!</p>
|
||||||
<p>88888888888</p>
|
<p>🎉🎉🎉🎊🎊🎊✨✨✨</p>
|
||||||
<p>管理者アカウントの登録が完了しました!</p>
|
<p>管理者アカウントの登録が完了しました!</p>
|
||||||
<p>以下のログインボタンよりログインしてください!<br>ログイン後は画面左側メニューの「サーバー設定」よりサーバーの情報を設定することをおすすめします!<br>また、左側メニューの「設定」から二段階認証の設定をすることもおすすめします。</p>
|
<p>以下のログインボタンよりログインしてください!<br>ログイン後は画面左側メニューの「サーバー設定」よりサーバーの情報を設定することをおすすめします!<br>また、左側メニューの「設定」から二段階認証の設定をすることもおすすめします。</p>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,228 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
require('../../db.php');
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
header("charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
function decode_yajirushi($postText){
|
||||||
|
$postText = str_replace('←', '←', $postText);
|
||||||
|
$postText = str_replace('↓', '↓', $postText);
|
||||||
|
$postText = str_replace('↑', '↑', $postText);
|
||||||
|
$postText = str_replace('→', '→', $postText);
|
||||||
|
return $postText;
|
||||||
|
}
|
||||||
|
function get_mentions_userid($postText) {
|
||||||
|
// @useridを検出する
|
||||||
|
$usernamePattern = '/@(\w+)/';
|
||||||
|
$mentionedUsers = [];
|
||||||
|
|
||||||
|
preg_replace_callback($usernamePattern, function($matches) use (&$mentionedUsers) {
|
||||||
|
$mention_username = $matches[1];
|
||||||
|
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$mention_userQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
|
||||||
|
$mention_userQuery->bindValue(':userid', $mention_username);
|
||||||
|
$mention_userQuery->execute();
|
||||||
|
$mention_userData = $mention_userQuery->fetch();
|
||||||
|
|
||||||
|
if (!empty($mention_userData)) {
|
||||||
|
$mentionedUsers[] = $mention_username;
|
||||||
|
}
|
||||||
|
}, $postText);
|
||||||
|
|
||||||
|
return $mentionedUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = null;
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$Get_Post_Json = file_get_contents("php://input");
|
||||||
|
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||||
|
//トークン取得
|
||||||
|
if(!(empty($_GET['token']))){
|
||||||
|
$token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$post_json = json_decode($Get_Post_Json, true);
|
||||||
|
if(isset($post_json["token"])){
|
||||||
|
$token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($token == ""){
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, role FROM account WHERE token = :token");
|
||||||
|
$userQuery->bindValue(':token', $token);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if(empty($userData["userid"])){
|
||||||
|
$err = "token_invalid";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}elseif($userData["role"] === "ice"){
|
||||||
|
$err = "this_account_has_been_frozen";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
$DataQuery = $pdo->prepare("SELECT username,userid,profile,datetime,follow,follower,iconname,headname,role,sacinfo,admin FROM account WHERE userid = :userid");
|
||||||
|
$DataQuery->bindValue(':userid', $userData["userid"]);
|
||||||
|
$DataQuery->execute();
|
||||||
|
$userdata = $DataQuery->fetch();
|
||||||
|
|
||||||
|
if (empty($userdata)){
|
||||||
|
$response = array(
|
||||||
|
'error_code' => "critical_error_userdata_not_found",
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
$roles = explode(',', $userdata["role"]);
|
||||||
|
if(!(empty($roles))){
|
||||||
|
foreach ($roles as $roleId) {
|
||||||
|
$Getrole = $pdo->prepare("SELECT roleidname, rolename, roleauth, rolecolor, roleeffect FROM role WHERE roleidname = :role");
|
||||||
|
$Getrole->bindValue(':role', $roleId);
|
||||||
|
$Getrole->execute();
|
||||||
|
$roleData[$roleId] = $Getrole->fetch();
|
||||||
|
|
||||||
|
if($roleData[$roleId]['roleeffect'] == '' || $roleData[$roleId]['roleeffect'] == 'none'){
|
||||||
|
$role_view_effect = "none";
|
||||||
|
}elseif($roleData[$roleId]['roleeffect'] == 'shine'){
|
||||||
|
$role_view_effect = "shine";
|
||||||
|
}elseif($roleData[$roleId]['roleeffect'] == 'rainbow'){
|
||||||
|
$role_view_effect = "rainbow";
|
||||||
|
}else{
|
||||||
|
$role_view_effect = "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
$roleinfo = array(
|
||||||
|
"name" => decode_yajirushi(htmlspecialchars_decode($roleData[$roleId]['rolename'])),
|
||||||
|
"color" => decode_yajirushi(htmlspecialchars_decode($roleData[$roleId]['rolecolor'])),
|
||||||
|
"effect" => decode_yajirushi(htmlspecialchars_decode($role_view_effect)),
|
||||||
|
"id" => decode_yajirushi(htmlspecialchars_decode($roleData[$roleId]['roleidname'])),
|
||||||
|
);
|
||||||
|
|
||||||
|
$role[] = $roleinfo;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$role[] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($userdata["sacinfo"]))){
|
||||||
|
if($userdata["sacinfo"] == "bot"){
|
||||||
|
$isBot = true;
|
||||||
|
}else{
|
||||||
|
$isBot = false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$isBot = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($userdata["admin"]))){
|
||||||
|
if($userdata["admin"] == "yes"){
|
||||||
|
$isAdmin = true;
|
||||||
|
}else{
|
||||||
|
$isAdmin = false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$isAdmin = false;
|
||||||
|
}
|
||||||
|
if(!(empty($userdata["follow"]))){
|
||||||
|
$followee = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($userdata["follow"])));
|
||||||
|
array_shift($followee);
|
||||||
|
}else{
|
||||||
|
$followee = array();
|
||||||
|
}
|
||||||
|
if(!(empty($userdata["follower"]))){
|
||||||
|
$follower = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($userdata["follower"])));
|
||||||
|
array_shift($follower);
|
||||||
|
}else{
|
||||||
|
$follower = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$followcnts = explode(',', $userdata["follow"]);
|
||||||
|
$userdata["follow_cnt"] = (int)count($followcnts)-1;
|
||||||
|
|
||||||
|
$followercnts = explode(',', $userdata["follower"]);
|
||||||
|
$userdata["follower_cnt"] = (int)count($followercnts)-1;
|
||||||
|
|
||||||
|
$allueuse = $pdo->prepare("SELECT account FROM ueuse WHERE account = :userid");
|
||||||
|
$allueuse->bindValue(':userid', $userdata["userid"]);
|
||||||
|
$allueuse->execute();
|
||||||
|
$All_ueuse = $allueuse->rowCount();
|
||||||
|
|
||||||
|
$response = array(
|
||||||
|
'username' => decode_yajirushi(htmlspecialchars_decode($userdata["username"])),
|
||||||
|
'userid' => decode_yajirushi(htmlspecialchars_decode($userdata["userid"])),
|
||||||
|
'profile' => decode_yajirushi(htmlspecialchars_decode($userdata["profile"])),
|
||||||
|
'user_icon' => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userdata["iconname"])),
|
||||||
|
'user_header' => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userdata["headname"])),
|
||||||
|
'registered_date' => decode_yajirushi(htmlspecialchars_decode($userdata["datetime"])),
|
||||||
|
'followee' => $followee,
|
||||||
|
'followee_cnt' => $userdata["follow_cnt"],
|
||||||
|
'follower' => $follower,
|
||||||
|
'follower_cnt' => $userdata["follower_cnt"],
|
||||||
|
'ueuse_cnt' => $All_ueuse,
|
||||||
|
'isBot' => $isBot,
|
||||||
|
'isAdmin' => $isAdmin,
|
||||||
|
'role' => $role,
|
||||||
|
'language' => "ja-JP",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,249 @@
|
|||||||
|
<?php
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
header("charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
function decode_yajirushi($postText){
|
||||||
|
$postText = str_replace('←', '←', $postText);
|
||||||
|
$postText = str_replace('↓', '↓', $postText);
|
||||||
|
$postText = str_replace('↑', '↑', $postText);
|
||||||
|
$postText = str_replace('→', '→', $postText);
|
||||||
|
return $postText;
|
||||||
|
}
|
||||||
|
function random_iv($length = 16){
|
||||||
|
return substr(str_shuffle('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'), 0, $length);
|
||||||
|
}
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
|
||||||
|
require('../db.php');
|
||||||
|
|
||||||
|
$datetime = array();
|
||||||
|
$pdo = null;
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
// データベースに接続
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname=' . DB_NAME . ';host=' . DB_HOST, DB_USER, DB_PASS, $option);
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($_GET['migration_code'])) {
|
||||||
|
if(isset($_GET['check'])) {
|
||||||
|
//移行後-----------------------------------------------------------------------------------------------
|
||||||
|
$migration_code = htmlentities($_GET['migration_code'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$check = urldecode($_GET['check']);
|
||||||
|
$request_domain = htmlentities($_SERVER['REMOTE_ADDR'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
|
$migrationQuery = $pdo->prepare("SELECT * FROM migration WHERE migration_code = :migration_code");
|
||||||
|
$migrationQuery->bindValue(':migration_code', $migration_code);
|
||||||
|
$migrationQuery->execute();
|
||||||
|
$migrationData = $migrationQuery->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
if(!(empty($migrationData))){
|
||||||
|
$UserdataQuery = $pdo->prepare("SELECT userid FROM account WHERE userid = :userid");
|
||||||
|
$UserdataQuery->bindValue(':userid', $migrationData['account'], PDO::PARAM_STR);
|
||||||
|
$UserdataQuery->execute();
|
||||||
|
$UserData = $UserdataQuery->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
$done_chk = openssl_decrypt($check, "AES-256-CBC", $migrationData['encryption_key'], 0, $migrationData['encryption_ivkey']);
|
||||||
|
//下の文字列はアカウント移行が完了しているかの確認用!変えないで!!!
|
||||||
|
if($done_chk == "QYrLCSQIHqOLHuhJ"){
|
||||||
|
$account = htmlentities($UserData["userid"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
try {
|
||||||
|
$deleteQuery = $pdo->prepare("DELETE FROM migration WHERE account = :account");
|
||||||
|
$deleteQuery->bindValue(':account',$account, PDO::PARAM_STR);
|
||||||
|
$res = $deleteQuery->execute();
|
||||||
|
$res = $pdo->commit();
|
||||||
|
} catch(Exception $e) {
|
||||||
|
$pdo->rollBack();
|
||||||
|
}
|
||||||
|
$newrole = "ice";
|
||||||
|
$newtoken = "ice";
|
||||||
|
$newadmin = "none";
|
||||||
|
|
||||||
|
// トランザクション開始
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
try {
|
||||||
|
$stmt = $pdo->prepare("UPDATE account SET role = :role,token = :newtoken,admin = :newadmin WHERE userid = :userid");
|
||||||
|
|
||||||
|
$stmt->bindValue(':role', $newrole, PDO::PARAM_STR);
|
||||||
|
$stmt->bindValue(':newtoken', $newtoken, PDO::PARAM_STR);
|
||||||
|
$stmt->bindValue(':newadmin', $newadmin, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$stmt->bindValue(':userid', $account, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// SQLクエリの実行
|
||||||
|
$res = $stmt->execute();
|
||||||
|
|
||||||
|
// コミット
|
||||||
|
$res = $pdo->commit();
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
|
||||||
|
// エラーが発生した時はロールバック
|
||||||
|
$pdo->rollBack();
|
||||||
|
}
|
||||||
|
//メール送信はナシ
|
||||||
|
//------------
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$datetime = date("Y-m-d H:i:s");
|
||||||
|
$msg = "アカウントの移行が完了したためこのアカウントの不正コピーを防ぐためアカウントを凍結しました!\n引き続きこのアカウントを利用するには管理者に凍結を解除してもらってください!";
|
||||||
|
$title = "✨アカウントの移行が完了しました!🔄️";
|
||||||
|
$url = "/rule/serverabout";
|
||||||
|
$userchk = 'none';
|
||||||
|
$from_userid = "uwuzu-fromsys";
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare("INSERT INTO notification (fromuserid, touserid, msg, url, datetime, userchk, title) VALUES (:fromuserid, :touserid, :msg, :url, :datetime, :userchk, :title)");
|
||||||
|
|
||||||
|
$stmt->bindParam(':fromuserid', $from_userid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':touserid', $account, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':url', $url, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':userchk', $userchk, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':title', $title, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// SQLクエリの実行
|
||||||
|
$res2 = $stmt->execute();
|
||||||
|
|
||||||
|
// コミット
|
||||||
|
$res2 = $pdo->commit();
|
||||||
|
|
||||||
|
} catch(Exception $e) {
|
||||||
|
|
||||||
|
// エラーが発生した時はロールバック
|
||||||
|
$pdo->rollBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($res) {
|
||||||
|
$item = array(
|
||||||
|
'done' => 'success',
|
||||||
|
);
|
||||||
|
$noencriptjson = json_encode($item, JSON_UNESCAPED_UNICODE);
|
||||||
|
$encriptjson = openssl_encrypt($noencriptjson, "AES-256-CBC", $migrationData['encryption_key'], 0, $migrationData['encryption_ivkey']);
|
||||||
|
$response = array(
|
||||||
|
'data' => $encriptjson,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
$err = "migration_bad_success";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
$err = "migration_bad_success";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "migration_notfound";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//移行データ
|
||||||
|
$migration_code = htmlentities($_GET['migration_code'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$request_domain = htmlentities($_SERVER['REMOTE_ADDR'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
|
$migrationQuery = $pdo->prepare("SELECT * FROM migration WHERE migration_code = :migration_code");
|
||||||
|
$migrationQuery->bindValue(':migration_code', $migration_code);
|
||||||
|
$migrationQuery->execute();
|
||||||
|
$migrationData = $migrationQuery->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
if(!(empty($migrationData))){
|
||||||
|
$UserdataQuery = $pdo->prepare("SELECT * FROM account WHERE userid = :userid");
|
||||||
|
$UserdataQuery->bindValue(':userid', $migrationData['account'], PDO::PARAM_STR);
|
||||||
|
$UserdataQuery->execute();
|
||||||
|
$UserData = $UserdataQuery->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
/*
|
||||||
|
// 投稿内容の取得(新しい順に1000件取得)
|
||||||
|
$ueuseQuery = $pdo->prepare("SELECT * FROM ueuse WHERE account = :userid AND rpuniqid = '' ORDER BY datetime DESC LIMIT 1000");
|
||||||
|
$ueuseQuery->bindValue(':userid', $migrationData['account'], PDO::PARAM_STR);
|
||||||
|
$ueuseQuery->execute();
|
||||||
|
$ueuse_array = $ueuseQuery->fetchAll();
|
||||||
|
*/
|
||||||
|
if(!(empty($UserData))){
|
||||||
|
/*
|
||||||
|
if(!(empty($ueuse_array))){
|
||||||
|
foreach ($ueuse_array as $value) {
|
||||||
|
$ueuses = array(
|
||||||
|
"username" => decode_yajirushi(htmlentities($value['username'], ENT_QUOTES, 'UTF-8', false)),
|
||||||
|
"account" => decode_yajirushi(htmlentities($value['account'], ENT_QUOTES, 'UTF-8', false)),
|
||||||
|
"uniqid" => decode_yajirushi(htmlentities($value['uniqid'], ENT_QUOTES, 'UTF-8', false)),
|
||||||
|
"ueuse" => decode_yajirushi(htmlentities($value['ueuse'], ENT_QUOTES, 'UTF-8', false)),
|
||||||
|
"datetime" => decode_yajirushi(htmlentities($value['datetime'], ENT_QUOTES, 'UTF-8', false)),
|
||||||
|
"abi" => decode_yajirushi(htmlentities($value['abi'], ENT_QUOTES, 'UTF-8', false)),
|
||||||
|
"abidate" => decode_yajirushi(htmlentities($value['abidate'], ENT_QUOTES, 'UTF-8', false)),
|
||||||
|
"nsfw" => decode_yajirushi(htmlentities($value['nsfw'], ENT_QUOTES, 'UTF-8', false)),
|
||||||
|
);
|
||||||
|
|
||||||
|
$ueuse[] = $ueuses;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$ueuse[] = "";
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
$item = [
|
||||||
|
"userdata" => array(
|
||||||
|
"user_name" => htmlentities($UserData["username"], ENT_QUOTES, 'UTF-8', false),
|
||||||
|
"user_id" => htmlentities($UserData["userid"], ENT_QUOTES, 'UTF-8', false),
|
||||||
|
"user_icon" => (empty($_SERVER['HTTPS']) ? 'http://' : 'https://').$domain."/".htmlentities($UserData["iconname"], ENT_QUOTES, 'UTF-8', false),
|
||||||
|
"user_header" => (empty($_SERVER['HTTPS']) ? 'http://' : 'https://').$domain."/".htmlentities($UserData["headname"], ENT_QUOTES, 'UTF-8', false),
|
||||||
|
"user_profile" => htmlentities($UserData["profile"], ENT_QUOTES, 'UTF-8', false),
|
||||||
|
"mail_adds" => htmlentities($UserData["mailadds"], ENT_QUOTES, 'UTF-8', false),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
$noencriptjson = json_encode($item, JSON_UNESCAPED_UNICODE);
|
||||||
|
$encriptjson = openssl_encrypt($noencriptjson, "AES-256-CBC", $migrationData['encryption_key'], 0, $migrationData['encryption_ivkey']);
|
||||||
|
|
||||||
|
$response = array(
|
||||||
|
'data' => $encriptjson,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}else{
|
||||||
|
$err = "data_notfound";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "migration_notfound";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$err = "migration_code_notfound";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
+18
-8
@@ -75,16 +75,25 @@ function decode_yajirushi($postText){
|
|||||||
}else{
|
}else{
|
||||||
$invitation_code = false;
|
$invitation_code = false;
|
||||||
}
|
}
|
||||||
|
if(htmlspecialchars($serversettings["serverinfo"]["server_account_migration"], ENT_QUOTES, 'UTF-8') === "true"){
|
||||||
|
$account_migration = true;
|
||||||
|
}else{
|
||||||
|
$account_migration = false;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($notices as $value) {
|
if(!(empty($notices))){
|
||||||
$notices = array(
|
foreach ($notices as $value) {
|
||||||
"title" => decode_yajirushi(htmlspecialchars_decode($value['title'])),
|
$notices = array(
|
||||||
"note" => decode_yajirushi(htmlspecialchars_decode($value['note'])),
|
"title" => decode_yajirushi(htmlspecialchars_decode($value['title'])),
|
||||||
"editor" => decode_yajirushi(htmlspecialchars_decode($value['account'])),
|
"note" => decode_yajirushi(htmlspecialchars_decode($value['note'])),
|
||||||
"datetime" => decode_yajirushi(htmlspecialchars_decode($value['datetime'])),
|
"editor" => decode_yajirushi(htmlspecialchars_decode($value['account'])),
|
||||||
);
|
"datetime" => decode_yajirushi(htmlspecialchars_decode($value['datetime'])),
|
||||||
|
);
|
||||||
|
|
||||||
$notice[] = $notices;
|
$notice[] = $notices;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$notice[] = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$item = [
|
$item = [
|
||||||
@@ -103,6 +112,7 @@ function decode_yajirushi($postText){
|
|||||||
"max_ueuse_length" => (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8'),
|
"max_ueuse_length" => (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8'),
|
||||||
|
|
||||||
"invitation_code" => $invitation_code,
|
"invitation_code" => $invitation_code,
|
||||||
|
"account_migration" => $account_migration,
|
||||||
|
|
||||||
"usage" => [
|
"usage" => [
|
||||||
"users" => $count1,
|
"users" => $count1,
|
||||||
|
|||||||
@@ -0,0 +1,379 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
require('../../db.php');
|
||||||
|
//関数呼び出し
|
||||||
|
//- Base64_mime
|
||||||
|
require('../../function/function.php');
|
||||||
|
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
||||||
|
$max_ueuse_rate_limit = 60;
|
||||||
|
|
||||||
|
$mojisizefile = "../../server/textsize.txt";
|
||||||
|
|
||||||
|
$banurldomainfile = "../../server/banurldomain.txt";
|
||||||
|
$banurl_info = file_get_contents($banurldomainfile);
|
||||||
|
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
header("charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
function decode_yajirushi($postText){
|
||||||
|
$postText = str_replace('←', '←', $postText);
|
||||||
|
$postText = str_replace('↓', '↓', $postText);
|
||||||
|
$postText = str_replace('↑', '↑', $postText);
|
||||||
|
$postText = str_replace('→', '→', $postText);
|
||||||
|
return $postText;
|
||||||
|
}
|
||||||
|
function get_mentions_userid($postText) {
|
||||||
|
// @useridを検出する
|
||||||
|
$usernamePattern = '/@(\w+)/';
|
||||||
|
$mentionedUsers = [];
|
||||||
|
|
||||||
|
preg_replace_callback($usernamePattern, function($matches) use (&$mentionedUsers) {
|
||||||
|
$mention_username = $matches[1];
|
||||||
|
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$mention_userQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
|
||||||
|
$mention_userQuery->bindValue(':userid', $mention_username);
|
||||||
|
$mention_userQuery->execute();
|
||||||
|
$mention_userData = $mention_userQuery->fetch();
|
||||||
|
|
||||||
|
if (!empty($mention_userData)) {
|
||||||
|
$mentionedUsers[] = $mention_username;
|
||||||
|
}
|
||||||
|
}, $postText);
|
||||||
|
|
||||||
|
return $mentionedUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = null;
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$Get_Post_Json = file_get_contents("php://input");
|
||||||
|
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||||
|
//トークン取得
|
||||||
|
if(!(empty($_GET['token']))){
|
||||||
|
$token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$post_json = json_decode($Get_Post_Json, true);
|
||||||
|
if(isset($post_json["token"])){
|
||||||
|
$token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($token == ""){
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, role FROM account WHERE token = :token");
|
||||||
|
$userQuery->bindValue(':token', $token);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if(empty($userData["userid"])){
|
||||||
|
$err = "token_invalid";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}elseif($userData["role"] === "ice"){
|
||||||
|
$err = "this_account_has_been_frozen";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
//本文取得
|
||||||
|
if(!(empty($_GET['text']))){
|
||||||
|
$ueuse = htmlentities($_GET['text'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}elseif(!(empty($post_json["text"]))){
|
||||||
|
$ueuse = htmlentities($post_json["text"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}
|
||||||
|
//リプライ先取得
|
||||||
|
if(!(empty($_GET['replyid']))){
|
||||||
|
$replyid = htmlentities($_GET['replyid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}elseif(!(empty($post_json["replyid"]))){
|
||||||
|
$replyid = htmlentities($post_json["replyid"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$replyid = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
//NSFWの有無
|
||||||
|
if(!(empty($_GET['nsfw']))){
|
||||||
|
$nsfwchk = htmlentities($_GET['nsfw'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
if($nsfwchk == "true"){
|
||||||
|
$nsfw = "true";
|
||||||
|
}else{
|
||||||
|
$nsfw = "false";
|
||||||
|
}
|
||||||
|
}elseif(!(empty($post_json["nsfw"]))){
|
||||||
|
$nsfwchk = htmlentities($post_json["nsfw"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
if($nsfwchk == true){
|
||||||
|
$nsfw = "true";
|
||||||
|
}else{
|
||||||
|
$nsfw = "false";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$nsfw = "false";
|
||||||
|
}
|
||||||
|
|
||||||
|
//Base64での画像送信の確認(POSTのみ&デコードは関数(Base64_mime)側でやってくれる)
|
||||||
|
$img_uid = htmlspecialchars($userData["userid"], ENT_QUOTES, 'UTF-8', false);//UserID必須
|
||||||
|
if(!(empty($post_json["image1"]))){
|
||||||
|
$image1 = htmlentities($post_json["image1"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$UploadPath1 = base64_mime($image1,$img_uid);
|
||||||
|
if($UploadPath1 == false){
|
||||||
|
$UploadPath1 = "none";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$UploadPath1 = "none";
|
||||||
|
}
|
||||||
|
if(!(empty($post_json["image2"]))){
|
||||||
|
$image2 = htmlentities($post_json["image2"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$UploadPath2 = base64_mime($image2,$img_uid);
|
||||||
|
if($UploadPath2 == false){
|
||||||
|
$UploadPath2 = "none";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$UploadPath2 = "none";
|
||||||
|
}
|
||||||
|
if(!(empty($post_json["image3"]))){
|
||||||
|
$image3 = htmlentities($post_json["image3"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$UploadPath3 = base64_mime($image3,$img_uid);
|
||||||
|
if($UploadPath3 == false){
|
||||||
|
$UploadPath3 = "none";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$UploadPath3 = "none";
|
||||||
|
}
|
||||||
|
if(!(empty($post_json["image4"]))){
|
||||||
|
$image4 = htmlentities($post_json["image4"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$UploadPath4 = base64_mime($image4,$img_uid);
|
||||||
|
if($UploadPath4 == false){
|
||||||
|
$UploadPath4 = "none";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$UploadPath4 = "none";
|
||||||
|
}
|
||||||
|
//ここまで-----------------------------------------
|
||||||
|
|
||||||
|
$old_datetime = date("Y-m-d H:i:00");
|
||||||
|
$now_datetime = date("Y-m-d H:i:00",strtotime("+1 minute"));
|
||||||
|
$rate_Query = $pdo->prepare("SELECT * FROM ueuse WHERE account = :userid AND TIME(datetime) BETWEEN :old_datetime AND :now_datetime");
|
||||||
|
$rate_Query->bindValue(':userid', $userData["userid"]);
|
||||||
|
$rate_Query->bindValue(':old_datetime', $old_datetime);
|
||||||
|
$rate_Query->bindValue(':now_datetime', $now_datetime);
|
||||||
|
$rate_Query->execute();
|
||||||
|
$rate_count = $rate_Query->rowCount();
|
||||||
|
if(!($rate_count > $max_ueuse_rate_limit-1)){
|
||||||
|
if( empty($ueuse) ) {
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
// 文字数を確認
|
||||||
|
if( (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8') < mb_strlen($ueuse, 'UTF-8') ) {
|
||||||
|
$err = "content_to_".htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8')."_characters";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
// 禁止url確認
|
||||||
|
for($i = 0; $i < count($banurl); $i++) {
|
||||||
|
if(!($banurl[$i] == "")){
|
||||||
|
if (false !== strpos($ueuse, 'https://'.$banurl[$i])) {
|
||||||
|
$err = "contains_prohibited_url";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!(empty($replyid))){
|
||||||
|
$rpChkQuery = $pdo->prepare("SELECT * FROM ueuse WHERE uniqid = :rpuniqid");
|
||||||
|
$rpChkQuery->bindValue(':rpuniqid', $replyid);
|
||||||
|
$rpChkQuery->execute();
|
||||||
|
$rpChkcount = $rpChkQuery->rowCount();
|
||||||
|
if(empty($rpChkcount)){
|
||||||
|
$err = "no_reply_destination";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 書き込み日時を取得
|
||||||
|
$username = htmlspecialchars($userData["username"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$userid = htmlspecialchars($userData["userid"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$datetime = htmlspecialchars(date("Y-m-d H:i:s"), ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$uniqid = htmlspecialchars(createUniqId(), ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$abi = "none";
|
||||||
|
$nones = "none";
|
||||||
|
|
||||||
|
// トランザクション開始
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
// SQL作成
|
||||||
|
$stmt = $pdo->prepare("INSERT INTO ueuse (username, account, uniqid, rpuniqid, ueuse, photo1, photo2, photo3, photo4, video1, datetime, abi, nsfw) VALUES (:username, :account, :uniqid, :rpuniqid, :ueuse, :photo1, :photo2, :photo3, :photo4, :video1, :datetime, :abi, :nsfw)");
|
||||||
|
|
||||||
|
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':account', $userid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':uniqid', $uniqid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':rpuniqid', $replyid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':ueuse', $ueuse, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$stmt->bindParam(':photo1', $UploadPath1, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':photo2', $UploadPath2, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':photo3', $UploadPath3, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':photo4', $UploadPath4, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':video1', $nones, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$stmt->bindParam(':abi', $abi, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':nsfw', $nsfw, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// SQLクエリの実行
|
||||||
|
$res = $stmt->execute();
|
||||||
|
|
||||||
|
// コミット
|
||||||
|
$res = $pdo->commit();
|
||||||
|
|
||||||
|
$mentionedUsers = array_unique(get_mentions_userid($ueuse));
|
||||||
|
|
||||||
|
foreach ($mentionedUsers as $mentionedUser) {
|
||||||
|
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$fromuserid = htmlspecialchars($userid, ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$touserid = htmlspecialchars($mentionedUser, ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$datetime = htmlspecialchars(date("Y-m-d H:i:s"), ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$msg = "" . $ueuse . "";
|
||||||
|
$title = "" . htmlspecialchars($username, ENT_QUOTES, 'UTF-8', false) . "さんにメンションされました!";
|
||||||
|
$url = "/!" . htmlspecialchars($uniqid, ENT_QUOTES, 'UTF-8', false) . "";
|
||||||
|
$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', $fromuserid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':touserid', $touserid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':url', $url, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':userchk', $userchk, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':title', $title, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// SQLクエリの実行
|
||||||
|
$res = $stmt->execute();
|
||||||
|
|
||||||
|
// コミット
|
||||||
|
$res = $pdo->commit();
|
||||||
|
|
||||||
|
} catch(Exception $e) {
|
||||||
|
|
||||||
|
// エラーが発生した時はロールバック
|
||||||
|
$pdo->rollBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch(Exception $e) {
|
||||||
|
|
||||||
|
// エラーが発生した時はロールバック
|
||||||
|
$pdo->rollBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $res ) {
|
||||||
|
$response = array(
|
||||||
|
'uniqid' => decode_yajirushi(htmlspecialchars_decode($uniqid)),
|
||||||
|
'userid' => decode_yajirushi(htmlspecialchars_decode($userid)),
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
$err = "db_error_".$e->getMessage();
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// プリペアドステートメントを削除
|
||||||
|
$stmt = null;
|
||||||
|
}else{
|
||||||
|
$err = "over_rate_limit";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,244 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
require('../../db.php');
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
header("charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
function decode_yajirushi($postText){
|
||||||
|
$postText = str_replace('←', '←', $postText);
|
||||||
|
$postText = str_replace('↓', '↓', $postText);
|
||||||
|
$postText = str_replace('↑', '↑', $postText);
|
||||||
|
$postText = str_replace('→', '→', $postText);
|
||||||
|
return $postText;
|
||||||
|
}
|
||||||
|
function get_mentions_userid($postText) {
|
||||||
|
// @useridを検出する
|
||||||
|
$usernamePattern = '/@(\w+)/';
|
||||||
|
$mentionedUsers = [];
|
||||||
|
|
||||||
|
preg_replace_callback($usernamePattern, function($matches) use (&$mentionedUsers) {
|
||||||
|
$mention_username = $matches[1];
|
||||||
|
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$mention_userQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
|
||||||
|
$mention_userQuery->bindValue(':userid', $mention_username);
|
||||||
|
$mention_userQuery->execute();
|
||||||
|
$mention_userData = $mention_userQuery->fetch();
|
||||||
|
|
||||||
|
if (!empty($mention_userData)) {
|
||||||
|
$mentionedUsers[] = $mention_username;
|
||||||
|
}
|
||||||
|
}, $postText);
|
||||||
|
|
||||||
|
return $mentionedUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = null;
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$Get_Post_Json = file_get_contents("php://input");
|
||||||
|
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||||
|
//トークン取得
|
||||||
|
if(!(empty($_GET['token']))){
|
||||||
|
$token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$post_json = json_decode($Get_Post_Json, true);
|
||||||
|
if(isset($post_json["token"])){
|
||||||
|
$token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($token == ""){
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['uniqid']))){
|
||||||
|
$ueuseid = $_GET['uniqid'];
|
||||||
|
}elseif(!(empty($post_json["uniqid"]))){
|
||||||
|
$ueuseid = $post_json["uniqid"];
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, role FROM account WHERE token = :token");
|
||||||
|
$userQuery->bindValue(':token', $token);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if(empty($userData["userid"])){
|
||||||
|
$err = "token_invalid";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}elseif($userData["role"] === "ice"){
|
||||||
|
$err = "this_account_has_been_frozen";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
$query = $pdo->prepare('SELECT * FROM ueuse WHERE uniqid = :uniqid limit 1');
|
||||||
|
|
||||||
|
$query->execute(array(':uniqid' => $ueuseid));
|
||||||
|
|
||||||
|
$result = $query->fetch();
|
||||||
|
|
||||||
|
if(!(empty($result))){
|
||||||
|
if($result["account"] === $userData["userid"]){
|
||||||
|
|
||||||
|
$Userid = $userData["userid"];
|
||||||
|
$photo_query = $pdo->prepare("SELECT * FROM ueuse WHERE account = :userid AND uniqid = :uniqid");
|
||||||
|
$photo_query->bindValue(':userid', $Userid);
|
||||||
|
$photo_query->bindValue(':uniqid', $ueuseid);
|
||||||
|
$photo_query->execute();
|
||||||
|
$photo_and_video = $photo_query->fetch();
|
||||||
|
|
||||||
|
if(!($photo_and_video["photo1"] == "none")){
|
||||||
|
$photoDelete1 = glob("../".$photo_and_video["photo1"]); // 「-ユーザーID.拡張子」というパターンを検索
|
||||||
|
foreach ($photoDelete1 as $photo1) {
|
||||||
|
if (is_file($photo1)) {
|
||||||
|
unlink($photo1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!($photo_and_video["photo2"] == "none")){
|
||||||
|
$photoDelete2 = glob("../".$photo_and_video["photo2"]); // 「-ユーザーID.拡張子」というパターンを検索
|
||||||
|
foreach ($photoDelete2 as $photo2) {
|
||||||
|
if (is_file($photo2)) {
|
||||||
|
unlink($photo2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!($photo_and_video["photo3"] == "none")){
|
||||||
|
$photoDelete3 = glob("../".$photo_and_video["photo3"]); // 「-ユーザーID.拡張子」というパターンを検索
|
||||||
|
foreach ($photoDelete3 as $photo3) {
|
||||||
|
if (is_file($photo3)) {
|
||||||
|
unlink($photo3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!($photo_and_video["photo4"] == "none")){
|
||||||
|
$photoDelete4 = glob("../".$photo_and_video["photo4"]); // 「-ユーザーID.拡張子」というパターンを検索
|
||||||
|
foreach ($photoDelete4 as $photo4) {
|
||||||
|
if (is_file($photo4)) {
|
||||||
|
unlink($photo4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!($photo_and_video["video1"] == "none")){
|
||||||
|
$videoDelete1 = glob("../".$photo_and_video["video1"]); // 「-ユーザーID.拡張子」というパターンを検索
|
||||||
|
foreach ($videoDelete1 as $video1) {
|
||||||
|
if (is_file($video1)) {
|
||||||
|
unlink($video1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
$deleteQuery = $pdo->prepare("DELETE FROM ueuse WHERE uniqid = :uniqid AND account = :userid");
|
||||||
|
$deleteQuery->bindValue(':uniqid', $ueuseid, PDO::PARAM_STR);
|
||||||
|
$deleteQuery->bindValue(':userid', $Userid, PDO::PARAM_STR);
|
||||||
|
$res = $deleteQuery->execute();
|
||||||
|
|
||||||
|
if ($res) {
|
||||||
|
$response = array(
|
||||||
|
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueuseid)),
|
||||||
|
'userid' => decode_yajirushi(htmlspecialchars_decode($userData["userid"])),
|
||||||
|
'success' => true
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
$response = array(
|
||||||
|
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueuseid)),
|
||||||
|
'userid' => decode_yajirushi(htmlspecialchars_decode($Userid)),
|
||||||
|
'success' => false
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
$response = array(
|
||||||
|
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueuseid)),
|
||||||
|
'userid' => decode_yajirushi(htmlspecialchars_decode($userData["userid"])),
|
||||||
|
'success' => false
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$err = "ueuse_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,213 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
require('../../db.php');
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
header("charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
function decode_yajirushi($postText){
|
||||||
|
$postText = str_replace('←', '←', $postText);
|
||||||
|
$postText = str_replace('↓', '↓', $postText);
|
||||||
|
$postText = str_replace('↑', '↑', $postText);
|
||||||
|
$postText = str_replace('→', '→', $postText);
|
||||||
|
return $postText;
|
||||||
|
}
|
||||||
|
function get_mentions_userid($postText) {
|
||||||
|
// @useridを検出する
|
||||||
|
$usernamePattern = '/@(\w+)/';
|
||||||
|
$mentionedUsers = [];
|
||||||
|
|
||||||
|
preg_replace_callback($usernamePattern, function($matches) use (&$mentionedUsers) {
|
||||||
|
$mention_username = $matches[1];
|
||||||
|
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$mention_userQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
|
||||||
|
$mention_userQuery->bindValue(':userid', $mention_username);
|
||||||
|
$mention_userQuery->execute();
|
||||||
|
$mention_userData = $mention_userQuery->fetch();
|
||||||
|
|
||||||
|
if (!empty($mention_userData)) {
|
||||||
|
$mentionedUsers[] = $mention_username;
|
||||||
|
}
|
||||||
|
}, $postText);
|
||||||
|
|
||||||
|
return $mentionedUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = null;
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$Get_Post_Json = file_get_contents("php://input");
|
||||||
|
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||||
|
//トークン取得
|
||||||
|
if(!(empty($_GET['token']))){
|
||||||
|
$token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$post_json = json_decode($Get_Post_Json, true);
|
||||||
|
if(isset($post_json["token"])){
|
||||||
|
$token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($token == ""){
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['uniqid']))){
|
||||||
|
$ueuseid = $_GET['uniqid'];
|
||||||
|
}elseif(!(empty($post_json["uniqid"]))){
|
||||||
|
$ueuseid = $post_json["uniqid"];
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, role FROM account WHERE token = :token");
|
||||||
|
$userQuery->bindValue(':token', $token);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if(empty($userData["userid"])){
|
||||||
|
$err = "token_invalid";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}elseif($userData["role"] === "ice"){
|
||||||
|
$err = "this_account_has_been_frozen";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
$sql = "SELECT * FROM ueuse WHERE uniqid = :ueuseid ORDER BY datetime ASC LIMIT 1";
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->bindValue(':ueuseid', $ueuseid, PDO::PARAM_STR);
|
||||||
|
$stmt->execute();
|
||||||
|
$message_array = $stmt;
|
||||||
|
|
||||||
|
while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
|
||||||
|
$messages[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($messages)) {
|
||||||
|
$response = array(); // ループ外で $response を初期化
|
||||||
|
|
||||||
|
foreach ($messages as $ueusedata) {
|
||||||
|
if(!(empty($ueusedata["favorite"]))){
|
||||||
|
$favorite = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"])));
|
||||||
|
array_shift($favorite);
|
||||||
|
}else{
|
||||||
|
$favorite = array();
|
||||||
|
}
|
||||||
|
$favcnts = explode(',', $ueusedata["favorite"]);
|
||||||
|
$ueusedata["favorite_cnt"] = count($favcnts) - 1;
|
||||||
|
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, iconname, headname, role FROM account WHERE userid = :userid");
|
||||||
|
$userQuery->bindValue(':userid', $ueusedata["account"]);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if ($userData) {
|
||||||
|
$now_userdata = array(
|
||||||
|
"username" => decode_yajirushi(htmlspecialchars_decode($userData['username'])),
|
||||||
|
"userid" => decode_yajirushi(htmlspecialchars_decode($userData['userid'])),
|
||||||
|
"user_icon" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['iconname'])),
|
||||||
|
"user_head" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['headname'])),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($ueusedata["nsfw"] == "true"){
|
||||||
|
$nsfw = true;
|
||||||
|
}else{
|
||||||
|
$nsfw = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$item = [
|
||||||
|
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])),
|
||||||
|
'replyid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["rpuniqid"])),
|
||||||
|
'text' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])),
|
||||||
|
'account' => $now_userdata,
|
||||||
|
'photo1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo1"]))),
|
||||||
|
'photo2' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo2"]))),
|
||||||
|
'photo3' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo3"]))),
|
||||||
|
'photo4' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo4"]))),
|
||||||
|
'video1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["video1"]))),
|
||||||
|
'favorite' => $favorite,
|
||||||
|
'favorite_cnt' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite_cnt"])),
|
||||||
|
'datetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["datetime"])),
|
||||||
|
'abi' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abi"])),
|
||||||
|
'abidatetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abidate"])),
|
||||||
|
'nsfw' => $nsfw,
|
||||||
|
];
|
||||||
|
|
||||||
|
$response[] = $item; // ループ内で $response にデータを追加
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
$err = "ueuse_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,226 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
require('../../db.php');
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
header("charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
function decode_yajirushi($postText){
|
||||||
|
$postText = str_replace('←', '←', $postText);
|
||||||
|
$postText = str_replace('↓', '↓', $postText);
|
||||||
|
$postText = str_replace('↑', '↑', $postText);
|
||||||
|
$postText = str_replace('→', '→', $postText);
|
||||||
|
return $postText;
|
||||||
|
}
|
||||||
|
function get_mentions_userid($postText) {
|
||||||
|
// @useridを検出する
|
||||||
|
$usernamePattern = '/@(\w+)/';
|
||||||
|
$mentionedUsers = [];
|
||||||
|
|
||||||
|
preg_replace_callback($usernamePattern, function($matches) use (&$mentionedUsers) {
|
||||||
|
$mention_username = $matches[1];
|
||||||
|
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$mention_userQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
|
||||||
|
$mention_userQuery->bindValue(':userid', $mention_username);
|
||||||
|
$mention_userQuery->execute();
|
||||||
|
$mention_userData = $mention_userQuery->fetch();
|
||||||
|
|
||||||
|
if (!empty($mention_userData)) {
|
||||||
|
$mentionedUsers[] = $mention_username;
|
||||||
|
}
|
||||||
|
}, $postText);
|
||||||
|
|
||||||
|
return $mentionedUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = null;
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$Get_Post_Json = file_get_contents("php://input");
|
||||||
|
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||||
|
//トークン取得
|
||||||
|
if(!(empty($_GET['token']))){
|
||||||
|
$token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$post_json = json_decode($Get_Post_Json, true);
|
||||||
|
if(isset($post_json["token"])){
|
||||||
|
$token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($token == ""){
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['limit']))){
|
||||||
|
$limit = (int)$_GET['limit'];
|
||||||
|
}elseif(!(empty($post_json["limit"]))){
|
||||||
|
$limit = (int)$post_json["limit"];
|
||||||
|
}else{
|
||||||
|
$limit = 25;
|
||||||
|
}
|
||||||
|
if($limit > 100){
|
||||||
|
$limit = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['page']))){
|
||||||
|
$page = (int)$_GET['page'];
|
||||||
|
}elseif(!(empty($post_json["page"]))){
|
||||||
|
$page = (int)$post_json["page"];
|
||||||
|
}else{
|
||||||
|
$page = 1;
|
||||||
|
}
|
||||||
|
$offset = ($page - 1) * $limit;
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, role FROM account WHERE token = :token");
|
||||||
|
$userQuery->bindValue(':token', $token);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if(empty($userData["userid"])){
|
||||||
|
$err = "token_invalid";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}elseif($userData["role"] === "ice"){
|
||||||
|
$err = "this_account_has_been_frozen";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
$sql = "SELECT ueuse.*
|
||||||
|
FROM ueuse
|
||||||
|
LEFT JOIN account ON ueuse.account = account.userid
|
||||||
|
WHERE ueuse.rpuniqid = '' AND account.role != 'ice'
|
||||||
|
ORDER BY ueuse.datetime DESC
|
||||||
|
LIMIT :offset, :itemsPerPage";
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->bindValue(':offset', $offset, PDO::PARAM_INT);
|
||||||
|
$stmt->bindValue(':itemsPerPage', $limit, PDO::PARAM_INT);
|
||||||
|
$stmt->execute();
|
||||||
|
$message_array = $stmt;
|
||||||
|
|
||||||
|
while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
|
||||||
|
$messages[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($messages)) {
|
||||||
|
$response = array(); // ループ外で $response を初期化
|
||||||
|
|
||||||
|
foreach ($messages as $ueusedata) {
|
||||||
|
if(!(empty($ueusedata["favorite"]))){
|
||||||
|
$favorite = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"])));
|
||||||
|
array_shift($favorite);
|
||||||
|
}else{
|
||||||
|
$favorite = array();
|
||||||
|
}
|
||||||
|
$favcnts = explode(',', $ueusedata["favorite"]);
|
||||||
|
$ueusedata["favorite_cnt"] = count($favcnts) - 1;
|
||||||
|
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, iconname, headname, role FROM account WHERE userid = :userid");
|
||||||
|
$userQuery->bindValue(':userid', $ueusedata["account"]);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if ($userData) {
|
||||||
|
$now_userdata = array(
|
||||||
|
"username" => decode_yajirushi(htmlspecialchars_decode($userData['username'])),
|
||||||
|
"userid" => decode_yajirushi(htmlspecialchars_decode($userData['userid'])),
|
||||||
|
"user_icon" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['iconname'])),
|
||||||
|
"user_head" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['headname'])),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($ueusedata["nsfw"] == "true"){
|
||||||
|
$nsfw = true;
|
||||||
|
}else{
|
||||||
|
$nsfw = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$item = [
|
||||||
|
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])),
|
||||||
|
'replyid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["rpuniqid"])),
|
||||||
|
'text' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])),
|
||||||
|
'account' => $now_userdata,
|
||||||
|
'photo1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo1"]))),
|
||||||
|
'photo2' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo2"]))),
|
||||||
|
'photo3' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo3"]))),
|
||||||
|
'photo4' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo4"]))),
|
||||||
|
'video1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["video1"]))),
|
||||||
|
'favorite' => $favorite,
|
||||||
|
'favorite_cnt' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite_cnt"])),
|
||||||
|
'datetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["datetime"])),
|
||||||
|
'abi' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abi"])),
|
||||||
|
'abidatetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abidate"])),
|
||||||
|
'nsfw' => $nsfw,
|
||||||
|
];
|
||||||
|
|
||||||
|
$response[] = $item; // ループ内で $response にデータを追加
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
$err = "ueuse_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,224 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
require('../../db.php');
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
header("charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
function decode_yajirushi($postText){
|
||||||
|
$postText = str_replace('←', '←', $postText);
|
||||||
|
$postText = str_replace('↓', '↓', $postText);
|
||||||
|
$postText = str_replace('↑', '↑', $postText);
|
||||||
|
$postText = str_replace('→', '→', $postText);
|
||||||
|
return $postText;
|
||||||
|
}
|
||||||
|
function get_mentions_userid($postText) {
|
||||||
|
// @useridを検出する
|
||||||
|
$usernamePattern = '/@(\w+)/';
|
||||||
|
$mentionedUsers = [];
|
||||||
|
|
||||||
|
preg_replace_callback($usernamePattern, function($matches) use (&$mentionedUsers) {
|
||||||
|
$mention_username = $matches[1];
|
||||||
|
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$mention_userQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
|
||||||
|
$mention_userQuery->bindValue(':userid', $mention_username);
|
||||||
|
$mention_userQuery->execute();
|
||||||
|
$mention_userData = $mention_userQuery->fetch();
|
||||||
|
|
||||||
|
if (!empty($mention_userData)) {
|
||||||
|
$mentionedUsers[] = $mention_username;
|
||||||
|
}
|
||||||
|
}, $postText);
|
||||||
|
|
||||||
|
return $mentionedUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = null;
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$Get_Post_Json = file_get_contents("php://input");
|
||||||
|
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||||
|
//トークン取得
|
||||||
|
if(!(empty($_GET['token']))){
|
||||||
|
$token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$post_json = json_decode($Get_Post_Json, true);
|
||||||
|
if(isset($post_json["token"])){
|
||||||
|
$token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($token == ""){
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['limit']))){
|
||||||
|
$limit = (int)$_GET['limit'];
|
||||||
|
}elseif(!(empty($post_json["limit"]))){
|
||||||
|
$limit = (int)$post_json["limit"];
|
||||||
|
}else{
|
||||||
|
$limit = 25;
|
||||||
|
}
|
||||||
|
if($limit > 100){
|
||||||
|
$limit = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['page']))){
|
||||||
|
$page = (int)$_GET['page'];
|
||||||
|
}elseif(!(empty($post_json["page"]))){
|
||||||
|
$page = (int)$post_json["page"];
|
||||||
|
}else{
|
||||||
|
$page = 1;
|
||||||
|
}
|
||||||
|
$offset = ($page - 1) * $limit;
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, role FROM account WHERE token = :token");
|
||||||
|
$userQuery->bindValue(':token', $token);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if(empty($userData["userid"])){
|
||||||
|
$err = "token_invalid";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}elseif($userData["role"] === "ice"){
|
||||||
|
$err = "this_account_has_been_frozen";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
$Userid = $userData["userid"];
|
||||||
|
|
||||||
|
$sql = "SELECT * FROM ueuse WHERE ueuse LIKE :keyword OR abi LIKE :keyword ORDER BY datetime DESC LIMIT :offset, :itemsPerPage";
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->bindValue(':offset', $offset, PDO::PARAM_INT);
|
||||||
|
$stmt->bindValue(':itemsPerPage', $limit, PDO::PARAM_INT);
|
||||||
|
$stmt->bindValue(':keyword', '%@' . $Userid . '%', PDO::PARAM_STR);
|
||||||
|
$stmt->execute();
|
||||||
|
$message_array = $stmt;
|
||||||
|
|
||||||
|
while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
|
||||||
|
$messages[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($messages)) {
|
||||||
|
$response = array(); // ループ外で $response を初期化
|
||||||
|
|
||||||
|
foreach ($messages as $ueusedata) {
|
||||||
|
if(!(empty($ueusedata["favorite"]))){
|
||||||
|
$favorite = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"])));
|
||||||
|
array_shift($favorite);
|
||||||
|
}else{
|
||||||
|
$favorite = array();
|
||||||
|
}
|
||||||
|
$favcnts = explode(',', $ueusedata["favorite"]);
|
||||||
|
$ueusedata["favorite_cnt"] = count($favcnts) - 1;
|
||||||
|
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, iconname, headname, role FROM account WHERE userid = :userid");
|
||||||
|
$userQuery->bindValue(':userid', $ueusedata["account"]);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if ($userData) {
|
||||||
|
$now_userdata = array(
|
||||||
|
"username" => decode_yajirushi(htmlspecialchars_decode($userData['username'])),
|
||||||
|
"userid" => decode_yajirushi(htmlspecialchars_decode($userData['userid'])),
|
||||||
|
"user_icon" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['iconname'])),
|
||||||
|
"user_head" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['headname'])),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($ueusedata["nsfw"] == "true"){
|
||||||
|
$nsfw = true;
|
||||||
|
}else{
|
||||||
|
$nsfw = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$item = [
|
||||||
|
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])),
|
||||||
|
'replyid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["rpuniqid"])),
|
||||||
|
'text' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])),
|
||||||
|
'account' => $now_userdata,
|
||||||
|
'photo1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo1"]))),
|
||||||
|
'photo2' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo2"]))),
|
||||||
|
'photo3' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo3"]))),
|
||||||
|
'photo4' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo4"]))),
|
||||||
|
'video1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["video1"]))),
|
||||||
|
'favorite' => $favorite,
|
||||||
|
'favorite_cnt' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite_cnt"])),
|
||||||
|
'datetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["datetime"])),
|
||||||
|
'abi' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abi"])),
|
||||||
|
'abidatetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abidate"])),
|
||||||
|
'nsfw' => $nsfw,
|
||||||
|
];
|
||||||
|
|
||||||
|
$response[] = $item; // ループ内で $response にデータを追加
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
$err = "ueuse_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,235 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
require('../../db.php');
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
header("charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
function decode_yajirushi($postText){
|
||||||
|
$postText = str_replace('←', '←', $postText);
|
||||||
|
$postText = str_replace('↓', '↓', $postText);
|
||||||
|
$postText = str_replace('↑', '↑', $postText);
|
||||||
|
$postText = str_replace('→', '→', $postText);
|
||||||
|
return $postText;
|
||||||
|
}
|
||||||
|
function get_mentions_userid($postText) {
|
||||||
|
// @useridを検出する
|
||||||
|
$usernamePattern = '/@(\w+)/';
|
||||||
|
$mentionedUsers = [];
|
||||||
|
|
||||||
|
preg_replace_callback($usernamePattern, function($matches) use (&$mentionedUsers) {
|
||||||
|
$mention_username = $matches[1];
|
||||||
|
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$mention_userQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
|
||||||
|
$mention_userQuery->bindValue(':userid', $mention_username);
|
||||||
|
$mention_userQuery->execute();
|
||||||
|
$mention_userData = $mention_userQuery->fetch();
|
||||||
|
|
||||||
|
if (!empty($mention_userData)) {
|
||||||
|
$mentionedUsers[] = $mention_username;
|
||||||
|
}
|
||||||
|
}, $postText);
|
||||||
|
|
||||||
|
return $mentionedUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = null;
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$Get_Post_Json = file_get_contents("php://input");
|
||||||
|
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||||
|
//トークン取得
|
||||||
|
if(!(empty($_GET['token']))){
|
||||||
|
$token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$post_json = json_decode($Get_Post_Json, true);
|
||||||
|
if(isset($post_json["token"])){
|
||||||
|
$token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($token == ""){
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['uniqid']))){
|
||||||
|
$ueuseid = $_GET['uniqid'];
|
||||||
|
}elseif(!(empty($post_json["uniqid"]))){
|
||||||
|
$ueuseid = $post_json["uniqid"];
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['limit']))){
|
||||||
|
$limit = (int)$_GET['limit'];
|
||||||
|
}elseif(!(empty($post_json["limit"]))){
|
||||||
|
$limit = (int)$post_json["limit"];
|
||||||
|
}else{
|
||||||
|
$limit = 25;
|
||||||
|
}
|
||||||
|
if($limit > 100){
|
||||||
|
$limit = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['page']))){
|
||||||
|
$page = (int)$_GET['page'];
|
||||||
|
}elseif(!(empty($post_json["page"]))){
|
||||||
|
$page = (int)$post_json["page"];
|
||||||
|
}else{
|
||||||
|
$page = 1;
|
||||||
|
}
|
||||||
|
$offset = ($page - 1) * $limit;
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, role FROM account WHERE token = :token");
|
||||||
|
$userQuery->bindValue(':token', $token);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if(empty($userData["userid"])){
|
||||||
|
$err = "token_invalid";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}elseif($userData["role"] === "ice"){
|
||||||
|
$err = "this_account_has_been_frozen";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
$sql = "SELECT * FROM ueuse WHERE uniqid = :ueuseid OR rpuniqid = :ueuseid ORDER BY datetime ASC LIMIT :offset, :itemsPerPage";
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->bindValue(':ueuseid', $ueuseid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindValue(':offset', $offset, PDO::PARAM_INT);
|
||||||
|
$stmt->bindValue(':itemsPerPage', $limit, PDO::PARAM_INT);
|
||||||
|
$stmt->execute();
|
||||||
|
$message_array = $stmt;
|
||||||
|
|
||||||
|
while ($row = $message_array->fetchA(PDO::FETCH_ASSOC)) {
|
||||||
|
|
||||||
|
$messages[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($messages)) {
|
||||||
|
$response = array(); // ループ外で $response を初期化
|
||||||
|
|
||||||
|
foreach ($messages as $ueusedata) {
|
||||||
|
if(!(empty($ueusedata["favorite"]))){
|
||||||
|
$favorite = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"])));
|
||||||
|
array_shift($favorite);
|
||||||
|
}else{
|
||||||
|
$favorite = array();
|
||||||
|
}
|
||||||
|
$favcnts = explode(',', $ueusedata["favorite"]);
|
||||||
|
$ueusedata["favorite_cnt"] = count($favcnts) - 1;
|
||||||
|
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, iconname, headname, role FROM account WHERE userid = :userid");
|
||||||
|
$userQuery->bindValue(':userid', $ueusedata["account"]);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if ($userData) {
|
||||||
|
$now_userdata = array(
|
||||||
|
"username" => decode_yajirushi(htmlspecialchars_decode($userData['username'])),
|
||||||
|
"userid" => decode_yajirushi(htmlspecialchars_decode($userData['userid'])),
|
||||||
|
"user_icon" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['iconname'])),
|
||||||
|
"user_head" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['headname'])),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($ueusedata["nsfw"] == "true"){
|
||||||
|
$nsfw = true;
|
||||||
|
}else{
|
||||||
|
$nsfw = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$item = [
|
||||||
|
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])),
|
||||||
|
'replyid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["rpuniqid"])),
|
||||||
|
'text' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])),
|
||||||
|
'account' => $now_userdata,
|
||||||
|
'photo1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo1"]))),
|
||||||
|
'photo2' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo2"]))),
|
||||||
|
'photo3' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo3"]))),
|
||||||
|
'photo4' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo4"]))),
|
||||||
|
'video1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["video1"]))),
|
||||||
|
'favorite' => $favorite,
|
||||||
|
'favorite_cnt' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite_cnt"])),
|
||||||
|
'datetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["datetime"])),
|
||||||
|
'abi' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abi"])),
|
||||||
|
'abidatetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abidate"])),
|
||||||
|
'nsfw' => $nsfw,
|
||||||
|
];
|
||||||
|
|
||||||
|
$response[] = $item; // ループ内で $response にデータを追加
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
$err = "ueuse_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,238 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
require('../../db.php');
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
header("charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
function decode_yajirushi($postText){
|
||||||
|
$postText = str_replace('←', '←', $postText);
|
||||||
|
$postText = str_replace('↓', '↓', $postText);
|
||||||
|
$postText = str_replace('↑', '↑', $postText);
|
||||||
|
$postText = str_replace('→', '→', $postText);
|
||||||
|
return $postText;
|
||||||
|
}
|
||||||
|
function get_mentions_userid($postText) {
|
||||||
|
// @useridを検出する
|
||||||
|
$usernamePattern = '/@(\w+)/';
|
||||||
|
$mentionedUsers = [];
|
||||||
|
|
||||||
|
preg_replace_callback($usernamePattern, function($matches) use (&$mentionedUsers) {
|
||||||
|
$mention_username = $matches[1];
|
||||||
|
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$mention_userQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
|
||||||
|
$mention_userQuery->bindValue(':userid', $mention_username);
|
||||||
|
$mention_userQuery->execute();
|
||||||
|
$mention_userData = $mention_userQuery->fetch();
|
||||||
|
|
||||||
|
if (!empty($mention_userData)) {
|
||||||
|
$mentionedUsers[] = $mention_username;
|
||||||
|
}
|
||||||
|
}, $postText);
|
||||||
|
|
||||||
|
return $mentionedUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = null;
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$Get_Post_Json = file_get_contents("php://input");
|
||||||
|
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||||
|
//トークン取得
|
||||||
|
if(!(empty($_GET['token']))){
|
||||||
|
$token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$post_json = json_decode($Get_Post_Json, true);
|
||||||
|
if(isset($post_json["token"])){
|
||||||
|
$token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($token == ""){
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['keyword']))){
|
||||||
|
$keyword = $_GET['keyword'];
|
||||||
|
}elseif(!(empty($post_json["keyword"]))){
|
||||||
|
$keyword = $post_json["keyword"];
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['limit']))){
|
||||||
|
$limit = (int)$_GET['limit'];
|
||||||
|
}elseif(!(empty($post_json["limit"]))){
|
||||||
|
$limit = (int)$post_json["limit"];
|
||||||
|
}else{
|
||||||
|
$limit = 25;
|
||||||
|
}
|
||||||
|
if($limit > 100){
|
||||||
|
$limit = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['page']))){
|
||||||
|
$page = (int)$_GET['page'];
|
||||||
|
}elseif(!(empty($post_json["page"]))){
|
||||||
|
$page = (int)$post_json["page"];
|
||||||
|
}else{
|
||||||
|
$page = 1;
|
||||||
|
}
|
||||||
|
$offset = ($page - 1) * $limit;
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, role FROM account WHERE token = :token");
|
||||||
|
$userQuery->bindValue(':token', $token);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if(empty($userData["userid"])){
|
||||||
|
$err = "token_invalid";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}elseif($userData["role"] === "ice"){
|
||||||
|
$err = "this_account_has_been_frozen";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
$Userid = $userData["userid"];
|
||||||
|
|
||||||
|
$sql = "SELECT * FROM ueuse WHERE ueuse LIKE :keyword OR abi LIKE :keyword ORDER BY datetime DESC LIMIT :offset, :itemsPerPage";
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->bindValue(':offset', $offset, PDO::PARAM_INT);
|
||||||
|
$stmt->bindValue(':itemsPerPage', $limit, PDO::PARAM_INT);
|
||||||
|
$stmt->bindValue(':keyword', '%' . $keyword . '%', PDO::PARAM_STR);
|
||||||
|
$stmt->execute();
|
||||||
|
$message_array = $stmt;
|
||||||
|
|
||||||
|
while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
|
||||||
|
$messages[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($messages)) {
|
||||||
|
$response = array(); // ループ外で $response を初期化
|
||||||
|
|
||||||
|
foreach ($messages as $ueusedata) {
|
||||||
|
if(!(empty($ueusedata["favorite"]))){
|
||||||
|
$favorite = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"])));
|
||||||
|
array_shift($favorite);
|
||||||
|
}else{
|
||||||
|
$favorite = array();
|
||||||
|
}
|
||||||
|
$favcnts = explode(',', $ueusedata["favorite"]);
|
||||||
|
$ueusedata["favorite_cnt"] = count($favcnts) - 1;
|
||||||
|
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, iconname, headname, role FROM account WHERE userid = :userid");
|
||||||
|
$userQuery->bindValue(':userid', $ueusedata["account"]);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if ($userData) {
|
||||||
|
$now_userdata = array(
|
||||||
|
"username" => decode_yajirushi(htmlspecialchars_decode($userData['username'])),
|
||||||
|
"userid" => decode_yajirushi(htmlspecialchars_decode($userData['userid'])),
|
||||||
|
"user_icon" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['iconname'])),
|
||||||
|
"user_head" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['headname'])),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($ueusedata["nsfw"] == "true"){
|
||||||
|
$nsfw = true;
|
||||||
|
}else{
|
||||||
|
$nsfw = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$item = [
|
||||||
|
'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])),
|
||||||
|
'replyid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["rpuniqid"])),
|
||||||
|
'text' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])),
|
||||||
|
'account' => $now_userdata,
|
||||||
|
'photo1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo1"]))),
|
||||||
|
'photo2' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo2"]))),
|
||||||
|
'photo3' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo3"]))),
|
||||||
|
'photo4' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo4"]))),
|
||||||
|
'video1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["video1"]))),
|
||||||
|
'favorite' => $favorite,
|
||||||
|
'favorite_cnt' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite_cnt"])),
|
||||||
|
'datetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["datetime"])),
|
||||||
|
'abi' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abi"])),
|
||||||
|
'abidatetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abidate"])),
|
||||||
|
'nsfw' => $nsfw,
|
||||||
|
];
|
||||||
|
|
||||||
|
$response[] = $item; // ループ内で $response にデータを追加
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
$err = "ueuse_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,250 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
require('../../db.php');
|
||||||
|
//関数呼び出し
|
||||||
|
//- Base64_mime
|
||||||
|
require('../../function/function.php');
|
||||||
|
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
||||||
|
$max_ueuse_rate_limit = 60;
|
||||||
|
|
||||||
|
$mojisizefile = "../../server/textsize.txt";
|
||||||
|
|
||||||
|
$banurldomainfile = "../../server/banurldomain.txt";
|
||||||
|
$banurl_info = file_get_contents($banurldomainfile);
|
||||||
|
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
header("charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
function decode_yajirushi($postText){
|
||||||
|
$postText = str_replace('←', '←', $postText);
|
||||||
|
$postText = str_replace('↓', '↓', $postText);
|
||||||
|
$postText = str_replace('↑', '↑', $postText);
|
||||||
|
$postText = str_replace('→', '→', $postText);
|
||||||
|
return $postText;
|
||||||
|
}
|
||||||
|
function get_mentions_userid($postText) {
|
||||||
|
// @useridを検出する
|
||||||
|
$usernamePattern = '/@(\w+)/';
|
||||||
|
$mentionedUsers = [];
|
||||||
|
|
||||||
|
preg_replace_callback($usernamePattern, function($matches) use (&$mentionedUsers) {
|
||||||
|
$mention_username = $matches[1];
|
||||||
|
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$mention_userQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
|
||||||
|
$mention_userQuery->bindValue(':userid', $mention_username);
|
||||||
|
$mention_userQuery->execute();
|
||||||
|
$mention_userData = $mention_userQuery->fetch();
|
||||||
|
|
||||||
|
if (!empty($mention_userData)) {
|
||||||
|
$mentionedUsers[] = $mention_username;
|
||||||
|
}
|
||||||
|
}, $postText);
|
||||||
|
|
||||||
|
return $mentionedUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = null;
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$Get_Post_Json = file_get_contents("php://input");
|
||||||
|
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||||
|
//トークン取得
|
||||||
|
if(!(empty($_GET['token']))){
|
||||||
|
$token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$post_json = json_decode($Get_Post_Json, true);
|
||||||
|
if(isset($post_json["token"])){
|
||||||
|
$token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($token == ""){
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, role, follow, follower FROM account WHERE token = :token");
|
||||||
|
$userQuery->bindValue(':token', $token);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if(empty($userData["userid"])){
|
||||||
|
$err = "token_invalid";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}elseif($userData["role"] === "ice"){
|
||||||
|
$err = "this_account_has_been_frozen";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
//本文取得
|
||||||
|
if(!(empty($_GET['userid']))){
|
||||||
|
$follow_userid = htmlentities($_GET['userid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}elseif(!(empty($post_json["userid"]))){
|
||||||
|
$follow_userid = htmlentities($post_json["userid"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($follow_userid))){
|
||||||
|
$DataQuery = $pdo->prepare("SELECT username,userid,follow,follower FROM account WHERE userid = :userid");
|
||||||
|
$DataQuery->bindValue(':userid', $follow_userid);
|
||||||
|
$DataQuery->execute();
|
||||||
|
$Follow_userdata = $DataQuery->fetch();
|
||||||
|
|
||||||
|
$userid = $userData["userid"];
|
||||||
|
|
||||||
|
if(!(empty($Follow_userdata))){
|
||||||
|
if(!($userid == $Follow_userdata['userid'])){
|
||||||
|
$followerList = explode(',', $Follow_userdata['follower']);
|
||||||
|
if (!(in_array($userid, $followerList))) {
|
||||||
|
// 自分が相手をフォローしていない場合、相手のfollowerカラムと自分のfollowカラムを更新
|
||||||
|
$followerList[] = $userid;
|
||||||
|
$newFollowerList = implode(',', $followerList);
|
||||||
|
|
||||||
|
// UPDATE文を実行してフォロー情報を更新
|
||||||
|
$updateQuery = $pdo->prepare("UPDATE account SET follower = :follower WHERE userid = :userid");
|
||||||
|
$updateQuery->bindValue(':follower', $newFollowerList, PDO::PARAM_STR);
|
||||||
|
$updateQuery->bindValue(':userid', $Follow_userdata['userid'], PDO::PARAM_STR);
|
||||||
|
$res = $updateQuery->execute();
|
||||||
|
|
||||||
|
// 自分のfollowカラムを更新
|
||||||
|
$updateQuery = $pdo->prepare("UPDATE account SET follow = CONCAT_WS(',', follow, :follow) WHERE userid = :userid");
|
||||||
|
$updateQuery->bindValue(':follow', $Follow_userdata["userid"], PDO::PARAM_STR);
|
||||||
|
$updateQuery->bindValue(':userid', $userid, PDO::PARAM_STR);
|
||||||
|
$res_follow = $updateQuery->execute();
|
||||||
|
|
||||||
|
$datetime = date("Y-m-d H:i:s");
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$fromuserid = htmlentities($userid, ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$touserid = htmlentities($Follow_userdata["userid"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$datetime = htmlentities(date("Y-m-d H:i:s"), ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$msg = htmlentities("".$userid."さんにフォローされました。", ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$title = htmlentities("🎉".$userid."さんにフォローされました!🎉", ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$url = htmlentities("/@" . $userid . "", ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$userchk = htmlentities('none', ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
|
// 通知用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', $fromuserid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':touserid', $touserid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':url', $url, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':userchk', $userchk, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':title', $title, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// SQLクエリの実行
|
||||||
|
$res = $stmt->execute();
|
||||||
|
|
||||||
|
// コミット
|
||||||
|
$res = $pdo->commit();
|
||||||
|
|
||||||
|
} catch(Exception $e) {
|
||||||
|
|
||||||
|
// エラーが発生した時はロールバック
|
||||||
|
$pdo->rollBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($res && $res_follow) {
|
||||||
|
//フォロー完了
|
||||||
|
$response = array(
|
||||||
|
'userid' => decode_yajirushi(htmlspecialchars_decode($Follow_userdata["userid"])),
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
$err = "db_error_".$e->getMessage();
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
$stmt = null;
|
||||||
|
}else{
|
||||||
|
$err = "already_been_completed";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "you_cant_it_to_yourself";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "critical_error_userdata_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,243 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
require('../../db.php');
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
header("charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
function decode_yajirushi($postText){
|
||||||
|
$postText = str_replace('←', '←', $postText);
|
||||||
|
$postText = str_replace('↓', '↓', $postText);
|
||||||
|
$postText = str_replace('↑', '↑', $postText);
|
||||||
|
$postText = str_replace('→', '→', $postText);
|
||||||
|
return $postText;
|
||||||
|
}
|
||||||
|
function get_mentions_userid($postText) {
|
||||||
|
// @useridを検出する
|
||||||
|
$usernamePattern = '/@(\w+)/';
|
||||||
|
$mentionedUsers = [];
|
||||||
|
|
||||||
|
preg_replace_callback($usernamePattern, function($matches) use (&$mentionedUsers) {
|
||||||
|
$mention_username = $matches[1];
|
||||||
|
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$mention_userQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
|
||||||
|
$mention_userQuery->bindValue(':userid', $mention_username);
|
||||||
|
$mention_userQuery->execute();
|
||||||
|
$mention_userData = $mention_userQuery->fetch();
|
||||||
|
|
||||||
|
if (!empty($mention_userData)) {
|
||||||
|
$mentionedUsers[] = $mention_username;
|
||||||
|
}
|
||||||
|
}, $postText);
|
||||||
|
|
||||||
|
return $mentionedUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = null;
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$Get_Post_Json = file_get_contents("php://input");
|
||||||
|
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||||
|
|
||||||
|
//トークン取得
|
||||||
|
if(!(empty($_GET['token']))){
|
||||||
|
$token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$post_json = json_decode($Get_Post_Json, true);
|
||||||
|
if(isset($post_json["token"])){
|
||||||
|
$token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($token == ""){
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($_GET['userid']))){
|
||||||
|
$userid = $_GET['userid'];
|
||||||
|
}elseif(!(empty($post_json["userid"]))){
|
||||||
|
$userid = $post_json["userid"];
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, role FROM account WHERE token = :token");
|
||||||
|
$userQuery->bindValue(':token', $token);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if(empty($userData["userid"])){
|
||||||
|
$err = "token_invalid";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}elseif($userData["role"] === "ice"){
|
||||||
|
$err = "this_account_has_been_frozen";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
$DataQuery = $pdo->prepare("SELECT username,userid,profile,datetime,follow,follower,iconname,headname,role,sacinfo,admin FROM account WHERE userid = :userid");
|
||||||
|
$DataQuery->bindValue(':userid', $userid);
|
||||||
|
$DataQuery->execute();
|
||||||
|
$userdata = $DataQuery->fetch();
|
||||||
|
|
||||||
|
if (empty($userdata)){
|
||||||
|
$response = array(
|
||||||
|
'error_code' => "critical_error_userdata_not_found",
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
$roles = explode(',', $userdata["role"]);
|
||||||
|
if(!(empty($roles))){
|
||||||
|
foreach ($roles as $roleId) {
|
||||||
|
$Getrole = $pdo->prepare("SELECT roleidname, rolename, roleauth, rolecolor, roleeffect FROM role WHERE roleidname = :role");
|
||||||
|
$Getrole->bindValue(':role', $roleId);
|
||||||
|
$Getrole->execute();
|
||||||
|
$roleData[$roleId] = $Getrole->fetch();
|
||||||
|
|
||||||
|
if($roleData[$roleId]['roleeffect'] == '' || $roleData[$roleId]['roleeffect'] == 'none'){
|
||||||
|
$role_view_effect = "none";
|
||||||
|
}elseif($roleData[$roleId]['roleeffect'] == 'shine'){
|
||||||
|
$role_view_effect = "shine";
|
||||||
|
}elseif($roleData[$roleId]['roleeffect'] == 'rainbow'){
|
||||||
|
$role_view_effect = "rainbow";
|
||||||
|
}else{
|
||||||
|
$role_view_effect = "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
$roleinfo = array(
|
||||||
|
"name" => decode_yajirushi(htmlspecialchars_decode($roleData[$roleId]['rolename'])),
|
||||||
|
"color" => decode_yajirushi(htmlspecialchars_decode($roleData[$roleId]['rolecolor'])),
|
||||||
|
"effect" => decode_yajirushi(htmlspecialchars_decode($role_view_effect)),
|
||||||
|
"id" => decode_yajirushi(htmlspecialchars_decode($roleData[$roleId]['roleidname'])),
|
||||||
|
);
|
||||||
|
|
||||||
|
$role[] = $roleinfo;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$role[] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($userdata["sacinfo"]))){
|
||||||
|
if($userdata["sacinfo"] == "bot"){
|
||||||
|
$isBot = true;
|
||||||
|
}else{
|
||||||
|
$isBot = false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$isBot = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($userdata["admin"]))){
|
||||||
|
if($userdata["admin"] == "yes"){
|
||||||
|
$isAdmin = true;
|
||||||
|
}else{
|
||||||
|
$isAdmin = false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$isAdmin = false;
|
||||||
|
}
|
||||||
|
if(!(empty($userdata["follow"]))){
|
||||||
|
$followee = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($userdata["follow"])));
|
||||||
|
array_shift($followee);
|
||||||
|
}else{
|
||||||
|
$followee = array();
|
||||||
|
}
|
||||||
|
if(!(empty($userdata["follower"]))){
|
||||||
|
$follower = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($userdata["follower"])));
|
||||||
|
array_shift($follower);
|
||||||
|
}else{
|
||||||
|
$follower = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$followcnts = explode(',', $userdata["follow"]);
|
||||||
|
$userdata["follow_cnt"] = (int)count($followcnts)-1;
|
||||||
|
|
||||||
|
$followercnts = explode(',', $userdata["follower"]);
|
||||||
|
$userdata["follower_cnt"] = (int)count($followercnts)-1;
|
||||||
|
|
||||||
|
$allueuse = $pdo->prepare("SELECT account FROM ueuse WHERE account = :userid");
|
||||||
|
$allueuse->bindValue(':userid', $userdata["userid"]);
|
||||||
|
$allueuse->execute();
|
||||||
|
$All_ueuse = $allueuse->rowCount();
|
||||||
|
|
||||||
|
$response = array(
|
||||||
|
'username' => decode_yajirushi(htmlspecialchars_decode($userdata["username"])),
|
||||||
|
'userid' => decode_yajirushi(htmlspecialchars_decode($userdata["userid"])),
|
||||||
|
'profile' => decode_yajirushi(htmlspecialchars_decode($userdata["profile"])),
|
||||||
|
'user_icon' => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userdata["iconname"])),
|
||||||
|
'user_header' => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userdata["headname"])),
|
||||||
|
'registered_date' => decode_yajirushi(htmlspecialchars_decode($userdata["datetime"])),
|
||||||
|
'followee' => $followee,
|
||||||
|
'followee_cnt' => $userdata["follow_cnt"],
|
||||||
|
'follower' => $follower,
|
||||||
|
'follower_cnt' => $userdata["follower_cnt"],
|
||||||
|
'ueuse_cnt' => $All_ueuse,
|
||||||
|
'isBot' => $isBot,
|
||||||
|
'isAdmin' => $isAdmin,
|
||||||
|
'role' => $role,
|
||||||
|
'language' => "ja-JP",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
require('../../db.php');
|
||||||
|
//関数呼び出し
|
||||||
|
//- Base64_mime
|
||||||
|
require('../../function/function.php');
|
||||||
|
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
||||||
|
$max_ueuse_rate_limit = 60;
|
||||||
|
|
||||||
|
$mojisizefile = "../../server/textsize.txt";
|
||||||
|
|
||||||
|
$banurldomainfile = "../../server/banurldomain.txt";
|
||||||
|
$banurl_info = file_get_contents($banurldomainfile);
|
||||||
|
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
header("charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
function decode_yajirushi($postText){
|
||||||
|
$postText = str_replace('←', '←', $postText);
|
||||||
|
$postText = str_replace('↓', '↓', $postText);
|
||||||
|
$postText = str_replace('↑', '↑', $postText);
|
||||||
|
$postText = str_replace('→', '→', $postText);
|
||||||
|
return $postText;
|
||||||
|
}
|
||||||
|
function get_mentions_userid($postText) {
|
||||||
|
// @useridを検出する
|
||||||
|
$usernamePattern = '/@(\w+)/';
|
||||||
|
$mentionedUsers = [];
|
||||||
|
|
||||||
|
preg_replace_callback($usernamePattern, function($matches) use (&$mentionedUsers) {
|
||||||
|
$mention_username = $matches[1];
|
||||||
|
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$mention_userQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
|
||||||
|
$mention_userQuery->bindValue(':userid', $mention_username);
|
||||||
|
$mention_userQuery->execute();
|
||||||
|
$mention_userData = $mention_userQuery->fetch();
|
||||||
|
|
||||||
|
if (!empty($mention_userData)) {
|
||||||
|
$mentionedUsers[] = $mention_username;
|
||||||
|
}
|
||||||
|
}, $postText);
|
||||||
|
|
||||||
|
return $mentionedUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = null;
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$Get_Post_Json = file_get_contents("php://input");
|
||||||
|
if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
||||||
|
//トークン取得
|
||||||
|
if(!(empty($_GET['token']))){
|
||||||
|
$token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$post_json = json_decode($Get_Post_Json, true);
|
||||||
|
if(isset($post_json["token"])){
|
||||||
|
$token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($token == ""){
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
$userQuery = $pdo->prepare("SELECT username, userid, role, follow, follower FROM account WHERE token = :token");
|
||||||
|
$userQuery->bindValue(':token', $token);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
if(empty($userData["userid"])){
|
||||||
|
$err = "token_invalid";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}elseif($userData["role"] === "ice"){
|
||||||
|
$err = "this_account_has_been_frozen";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
//本文取得
|
||||||
|
if(!(empty($_GET['userid']))){
|
||||||
|
$unfollow_userid = htmlentities($_GET['userid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}elseif(!(empty($post_json["userid"]))){
|
||||||
|
$unfollow_userid = htmlentities($post_json["userid"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($unfollow_userid))){
|
||||||
|
$DataQuery = $pdo->prepare("SELECT username,userid,follow,follower FROM account WHERE userid = :userid");
|
||||||
|
$DataQuery->bindValue(':userid', $unfollow_userid);
|
||||||
|
$DataQuery->execute();
|
||||||
|
$Follow_userdata = $DataQuery->fetch();
|
||||||
|
|
||||||
|
$userid = $userData["userid"];
|
||||||
|
$myfollowlist = $userData["follow"];
|
||||||
|
|
||||||
|
if(!(empty($Follow_userdata))){
|
||||||
|
if(!($userid == $Follow_userdata['userid'])){
|
||||||
|
$followerList = explode(',', $Follow_userdata['follower']);
|
||||||
|
if (in_array($userid, $followerList)) {
|
||||||
|
// 自分が相手をフォローしている場合、相手のfollowerカラムと自分のfollowカラムを更新
|
||||||
|
$followerList = array_diff($followerList, array($userid));
|
||||||
|
$newFollowerList = implode(',', $followerList);
|
||||||
|
|
||||||
|
// UPDATE文を実行してフォロー情報を更新
|
||||||
|
$updateQuery = $pdo->prepare("UPDATE account SET follower = :follower WHERE userid = :userid");
|
||||||
|
$updateQuery->bindValue(':follower', $newFollowerList, PDO::PARAM_STR);
|
||||||
|
$updateQuery->bindValue(':userid', $Follow_userdata['userid'], PDO::PARAM_STR);
|
||||||
|
$res = $updateQuery->execute();
|
||||||
|
|
||||||
|
$myflwlist = explode(',', $myfollowlist);
|
||||||
|
$delfollowList = array_diff($myflwlist, array($Follow_userdata['userid']));
|
||||||
|
$deluserid = implode(',', $delfollowList);
|
||||||
|
|
||||||
|
// 自分のfollowカラムから相手のユーザーIDを削除
|
||||||
|
$updateQuery = $pdo->prepare("UPDATE account SET follow = :follow WHERE userid = :userid");
|
||||||
|
$updateQuery->bindValue(':follow', $deluserid, PDO::PARAM_STR);
|
||||||
|
$updateQuery->bindValue(':userid', $userid, PDO::PARAM_STR);
|
||||||
|
$res_follow = $updateQuery->execute();
|
||||||
|
|
||||||
|
if ($res && $res_follow) {
|
||||||
|
$response = array(
|
||||||
|
'userid' => decode_yajirushi(htmlspecialchars_decode($Follow_userdata["userid"])),
|
||||||
|
'success' => true
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
$err = "db_error_".$e->getMessage();
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt = null;
|
||||||
|
}else{
|
||||||
|
$err = "already_been_completed";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "you_cant_it_to_yourself";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "critical_error_userdata_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$err = "input_not_found";
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
?>
|
||||||
+2
-2
@@ -146,11 +146,11 @@ $pdo = null;
|
|||||||
<div class="leftbox2">
|
<div class="leftbox2">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src="img/uwuzulogo.svg"></a>
|
<a href="index.php"><img src="img/uwuzulogo.svg"></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
|
||||||
|
|||||||
+51
-6
@@ -4,7 +4,9 @@ $serversettings_file = "server/serversettings.ini";
|
|||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
require('db.php');
|
require('db.php');
|
||||||
|
//関数呼び出し
|
||||||
|
//- ユーザーエージェントからdevice名とるやつ
|
||||||
|
require('function/function.php');
|
||||||
|
|
||||||
// 変数の初期化
|
// 変数の初期化
|
||||||
$current_date = null;
|
$current_date = null;
|
||||||
@@ -88,6 +90,9 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
|
$useragent = htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$device = UserAgent_to_Device($useragent);
|
||||||
|
|
||||||
$userbackupcode = $_POST['userbackupcode'];
|
$userbackupcode = $_POST['userbackupcode'];
|
||||||
|
|
||||||
$options = array(
|
$options = array(
|
||||||
@@ -118,7 +123,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
try {
|
try {
|
||||||
$touserid = $userid;
|
$touserid = $userid;
|
||||||
$datetime = date("Y-m-d H:i:s");
|
$datetime = date("Y-m-d H:i:s");
|
||||||
$msg = "バックアップコードを使用しログインされました!\nバックアップコード変更のために二段階認証を再設定することを強くおすすめします。\nまた、もしバックアップコードを利用してログインした覚えがない場合は「その他」より全てのセッションを終了し、設定画面よりパスワードを変更し、二段階認証を再設定してください!";
|
$msg = "バックアップコードを使用しログインされました!\nバックアップコード変更のために二段階認証を再設定することを強くおすすめします。\nまた、もしバックアップコードを利用してログインした覚えがない場合は「その他」よりセッショントークンを再生成し、設定画面よりパスワードを変更し、二段階認証を再設定してください!\n\nログインした端末 : ".$device;
|
||||||
$title = '🔴バックアップコード使用のお知らせ🔴';
|
$title = '🔴バックアップコード使用のお知らせ🔴';
|
||||||
$url = '/settings';
|
$url = '/settings';
|
||||||
$userchk = 'none';
|
$userchk = 'none';
|
||||||
@@ -146,6 +151,46 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$pdo->rollBack();
|
$pdo->rollBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearstatcache();
|
||||||
|
|
||||||
|
if (isset($_SERVER['HTTP_COOKIE'])) {
|
||||||
|
$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
|
||||||
|
foreach($cookies as $cookie) {
|
||||||
|
$parts = explode('=', $cookie);
|
||||||
|
$name = trim($parts[0]);
|
||||||
|
setcookie($name, '', time()-1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setcookie('userid', $userid,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('loginid', $row["loginid"],[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('username', $row["username"],[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('admin_login', true,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
$_SESSION['admin_login'] = true;
|
$_SESSION['admin_login'] = true;
|
||||||
$_SESSION['userid'] = $userid;
|
$_SESSION['userid'] = $userid;
|
||||||
$_SESSION['loginid'] = $row["loginid"];
|
$_SESSION['loginid'] = $row["loginid"];
|
||||||
@@ -186,7 +231,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
try {
|
try {
|
||||||
$touserid = $userid;
|
$touserid = $userid;
|
||||||
$datetime = date("Y-m-d H:i:s");
|
$datetime = date("Y-m-d H:i:s");
|
||||||
$msg = "アカウントにログインがありました。\nもしログインした覚えがない場合は「その他」よりセッションを終了し、パスワードを変更し、二段階認証を再設定してください。";
|
$msg = "アカウントにログインがありました。\nもしログインした覚えがない場合は「その他」よりセッショントークンを再生成し、パスワードを変更し、二段階認証を再設定してください。\n\nログインした端末 : ".$device;
|
||||||
$title = '🚪ログイン通知🚪';
|
$title = '🚪ログイン通知🚪';
|
||||||
$url = '/settings';
|
$url = '/settings';
|
||||||
$userchk = 'none';
|
$userchk = 'none';
|
||||||
@@ -303,11 +348,11 @@ $pdo = null;
|
|||||||
<div class="leftbox">
|
<div class="leftbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src="img/uwuzulogo.svg"></a>
|
<a href="index.php"><img src="img/uwuzulogo.svg"></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
|
||||||
@@ -332,7 +377,7 @@ $pdo = null;
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p>バックアップコード</p>
|
<p>バックアップコード</p>
|
||||||
<div class="p2">もし二段階認証が出来ない場合は8桁英数字のバックアップコードを入力してください。</div>
|
<div class="p2">もし二段階認証が出来ない場合は32桁英数字のバックアップコードを入力してください。</div>
|
||||||
<input id="profile" type="text" placeholder="通常は入力しなくて大丈夫です。" class="inbox" name="userbackupcode" value="">
|
<input id="profile" type="text" placeholder="通常は入力しなくて大丈夫です。" class="inbox" name="userbackupcode" value="">
|
||||||
</div>
|
</div>
|
||||||
<input type="submit" class = "irobutton" name="btn_submit" value="次へ">
|
<input type="submit" class = "irobutton" name="btn_submit" value="次へ">
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ $serversettings_file = "server/serversettings.ini";
|
|||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
require('db.php');
|
require('db.php');
|
||||||
|
//関数呼び出し
|
||||||
|
//- ユーザーエージェントからdevice名とるやつ
|
||||||
|
require('function/function.php');
|
||||||
|
|
||||||
// 変数の初期化
|
// 変数の初期化
|
||||||
$current_date = null;
|
$current_date = null;
|
||||||
@@ -137,12 +139,14 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
|
$useragent = htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$device = UserAgent_to_Device($useragent);
|
||||||
|
|
||||||
$pdo->beginTransaction();
|
$pdo->beginTransaction();
|
||||||
try {
|
try {
|
||||||
$touserid = $userid;
|
$touserid = $userid;
|
||||||
$datetime = date("Y-m-d H:i:s");
|
$datetime = date("Y-m-d H:i:s");
|
||||||
$msg = "アカウントにログインがありました。\nもしログインした覚えがない場合は「その他」よりセッションを終了し、パスワードを変更してください。";
|
$msg = "アカウントにログインがありました。\nもしログインした覚えがない場合は「その他」よりセッショントークンを再生成し、パスワードを変更してください。\n\nログインした端末 : ".$device;
|
||||||
$title = '🚪ログイン通知🚪';
|
$title = '🚪ログイン通知🚪';
|
||||||
$url = '/settings';
|
$url = '/settings';
|
||||||
$userchk = 'none';
|
$userchk = 'none';
|
||||||
@@ -239,34 +243,6 @@ if( !empty($_POST['btn_submit2']) ) {
|
|||||||
// すべての出力を終了
|
// すべての出力を終了
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// プロフィールの絵文字対応
|
|
||||||
function replaceProfileEmojiImages($postText) {
|
|
||||||
// プロフィール名で絵文字名(:emoji:)を検出して画像に置き換える
|
|
||||||
$emojiPattern = '/:(\w+):/';
|
|
||||||
$postTextWithImages = preg_replace_callback($emojiPattern, function($matches) {
|
|
||||||
$emojiName = $matches[1];
|
|
||||||
//絵文字path取得
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
));
|
|
||||||
$emoji_Query = $dbh->prepare("SELECT emojifile, emojiname FROM emoji WHERE emojiname = :emojiname");
|
|
||||||
$emoji_Query->bindValue(':emojiname', $emojiName);
|
|
||||||
$emoji_Query->execute();
|
|
||||||
$emoji_row = $emoji_Query->fetch();
|
|
||||||
if(empty($emoji_row["emojifile"])){
|
|
||||||
$emoji_path = "img/sysimage/errorimage/emoji_404.png";
|
|
||||||
}else{
|
|
||||||
$emoji_path = $emoji_row["emojifile"];
|
|
||||||
}
|
|
||||||
return "<img src='../".$emoji_path."' alt=':$emojiName:' title=':$emojiName:'>";
|
|
||||||
}, $postText);
|
|
||||||
return $postTextWithImages;
|
|
||||||
}
|
|
||||||
|
|
||||||
// データベースの接続を閉じる
|
// データベースの接続を閉じる
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
@@ -291,11 +267,11 @@ $pdo = null;
|
|||||||
<div class="leftbox">
|
<div class="leftbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src="img/uwuzulogo.svg"></a>
|
<a href="index.php"><img src="img/uwuzulogo.svg"></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
:root {
|
:root {
|
||||||
|
/*Maincolor*/
|
||||||
--main-color: #FFC832;
|
--main-color: #FFC832;
|
||||||
--sub-color: #FFFAE6;
|
--sub-color: #FFFAE6;
|
||||||
--background-color: #F5F5F5;
|
--background-color: #F5F5F5;
|
||||||
@@ -13,4 +14,10 @@
|
|||||||
--dark-background-color: #0c0c0c;
|
--dark-background-color: #0c0c0c;
|
||||||
--dark-subtext-color: #CCC;
|
--dark-subtext-color: #CCC;
|
||||||
--dark-text-color: #FFF;
|
--dark-text-color: #FFF;
|
||||||
|
/*HeadingFonts*/
|
||||||
|
--Head-fonts: "Zen Maru Gothic";
|
||||||
|
/*TextFonts*/
|
||||||
|
--Text-fonts: "BIZ UDPGothic";
|
||||||
|
/*MonospacedFonts*/
|
||||||
|
--Mono-fonts: "BIZ UDGothic";
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/*GoogleFontsから使用*/
|
||||||
|
@import url('https://fonts.googleapis.com/css2?family=BIZ+UDGothic:wght@400;700&family=BIZ+UDPGothic:wght@400;700&family=Zen+Maru+Gothic:wght@500&display=swap')
|
||||||
|
|
||||||
|
/*
|
||||||
|
ローカルから独自フォントを読み込む際はこれを使用
|
||||||
|
color.cssの方のフォント変数にも同じ名前を書いて~
|
||||||
|
@font-face {
|
||||||
|
font-family: 'HeadingFont';
|
||||||
|
src: url(/Fonts/HeadingFont.woff);
|
||||||
|
|
||||||
|
font-family: 'TextFont';
|
||||||
|
src: url(/Fonts/TextFont.woff);
|
||||||
|
|
||||||
|
font-family: 'MonospacedFont';
|
||||||
|
src: url(/Fonts/MOnospacedtFont.woff);
|
||||||
|
}
|
||||||
|
*/
|
||||||
+470
-254
File diff suppressed because it is too large
Load Diff
+78
-74
@@ -1,5 +1,8 @@
|
|||||||
@import url('https://fonts.googleapis.com/css2?family=BIZ+UDPGothic:wght@400;700&family=Josefin+Sans:ital,wght@1,700&family=Kosugi+Maru&family=Zen+Maru+Gothic:wght@500&display=swap');
|
@import url("font.css");
|
||||||
@import url("color.css");
|
@import url("color.css");
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
body{
|
body{
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -27,7 +30,8 @@ body{
|
|||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
background-color: var(--main-color);
|
background-color: var(--main-color);
|
||||||
width: 600px;
|
width: 600px;
|
||||||
height: 100%;
|
min-height: 100dvh;
|
||||||
|
height: fit-content;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
}
|
}
|
||||||
@@ -50,7 +54,7 @@ body{
|
|||||||
}
|
}
|
||||||
.leftbox .logo p{
|
.leftbox .logo p{
|
||||||
color:var(--background-color);
|
color:var(--background-color);
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
@@ -86,7 +90,7 @@ body{
|
|||||||
}
|
}
|
||||||
.leftbox2 .logo p{
|
.leftbox2 .logo p{
|
||||||
color:var(--background-color);
|
color:var(--background-color);
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
@@ -111,7 +115,7 @@ body{
|
|||||||
margin: 0px;
|
margin: 0px;
|
||||||
color: var(--main-color);
|
color: var(--main-color);
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +125,7 @@ body{
|
|||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
.textbox h3{
|
.textbox h3{
|
||||||
@@ -130,7 +134,7 @@ body{
|
|||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +143,7 @@ body{
|
|||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +154,7 @@ body{
|
|||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
color: var(--subtext-color);
|
color: var(--subtext-color);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +166,7 @@ body{
|
|||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
color: var(--subtext-color);
|
color: var(--subtext-color);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,7 +177,7 @@ body{
|
|||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,7 +187,7 @@ body{
|
|||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +216,7 @@ body{
|
|||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
color: var(--subtext-color);
|
color: var(--subtext-color);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +228,7 @@ body{
|
|||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +280,7 @@ body{
|
|||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.servericon .textzone .p2c{
|
.servericon .textzone .p2c{
|
||||||
@@ -287,7 +291,7 @@ body{
|
|||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
color: var(--subtext-color);
|
color: var(--subtext-color);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,51 +318,44 @@ label > input {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: none;
|
border: none;
|
||||||
display: block;
|
display: block;
|
||||||
width:40%;
|
width: fit-content;
|
||||||
margin: 32px;
|
margin: 32px;
|
||||||
padding: 8px 10%;
|
padding: 8px 20%;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
|
|
||||||
padding-top: 8px;
|
|
||||||
padding-bottom: 8px;
|
|
||||||
|
|
||||||
background-color: var(--main-color);
|
background-color: var(--main-color);
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
color:var(--background-color);
|
color:var(--background-color);
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
||||||
transition: box-shadow 250ms ease-in-out;
|
transition: all 250ms ease-in-out;
|
||||||
transition: width 250ms ease-out;
|
|
||||||
}
|
}
|
||||||
.irobutton:hover{
|
.irobutton:hover{
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
|
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
|
||||||
width:45%;
|
padding: 8px 22%;
|
||||||
}
|
}
|
||||||
.irobutton:active{
|
.irobutton:active{
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
|
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
|
||||||
width:35%;
|
padding: 8px 18%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sirobutton{
|
.sirobutton{
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: none;
|
border: none;
|
||||||
display: block;
|
display: block;
|
||||||
width:40%;
|
width: fit-content;
|
||||||
margin: 32px;
|
margin: 32px;
|
||||||
padding: 8px 10%;
|
padding: 8px 20%;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
|
|
||||||
padding-top: 8px;
|
|
||||||
padding-bottom: 8px;
|
|
||||||
|
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: var(--sub-color);
|
background-color: var(--sub-color);
|
||||||
@@ -366,20 +363,19 @@ label > input {
|
|||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
color:var(--main-color);
|
color:var(--main-color);
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
||||||
transition: box-shadow 250ms ease-in-out;
|
transition: all 250ms ease-in-out;
|
||||||
transition: width 250ms ease-out;
|
|
||||||
}
|
}
|
||||||
.sirobutton:hover{
|
.sirobutton:hover{
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
|
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
|
||||||
width:45%;
|
padding: 8px 22%;
|
||||||
}
|
}
|
||||||
.sirobutton:active{
|
.sirobutton:active{
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
|
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
|
||||||
width:45%;
|
padding: 8px 18%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formarea{
|
.formarea{
|
||||||
@@ -410,6 +406,7 @@ label > input {
|
|||||||
height:100px;
|
height:100px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
||||||
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formarea label{
|
.formarea label{
|
||||||
@@ -417,7 +414,7 @@ label > input {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color:var(--text-color);
|
color:var(--text-color);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -452,7 +449,7 @@ label > input {
|
|||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
color: var(--subtext-color);
|
color: var(--subtext-color);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
.ueuse2 a{
|
.ueuse2 a{
|
||||||
@@ -462,19 +459,19 @@ label > input {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color:var(--link-color);
|
color:var(--link-color);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inbox {
|
.inbox {
|
||||||
width: 96%;
|
width: calc(100% - 24px);
|
||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
background: var(--background-color);
|
background: var(--background-color);
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
font-size: 1em;
|
font-size: 16px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
box-shadow: 0px 0px 25px rgba(0,0,0,0.03);
|
box-shadow: 0px 0px 25px rgba(0,0,0,0.03);
|
||||||
@@ -499,6 +496,10 @@ label > input {
|
|||||||
border: 1px solid var(--main-color);
|
border: 1px solid var(--main-color);
|
||||||
border-bottom: 3px solid var(--main-color);
|
border-bottom: 3px solid var(--main-color);
|
||||||
}
|
}
|
||||||
|
textarea {
|
||||||
|
height: 100px;
|
||||||
|
resize: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.errmsg{
|
.errmsg{
|
||||||
@@ -514,7 +515,7 @@ label > input {
|
|||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
color:#ff4848;
|
color:#ff4848;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
border: 1px solid #FF4848;
|
border: 1px solid #FF4848;
|
||||||
@@ -541,7 +542,7 @@ label > input {
|
|||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
color:var(--background-color);
|
color:var(--background-color);
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
||||||
@@ -575,7 +576,7 @@ label > input {
|
|||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
color:var(--main-color);
|
color:var(--main-color);
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
||||||
@@ -612,7 +613,7 @@ label > input {
|
|||||||
.rolebox p {
|
.rolebox p {
|
||||||
margin: 2px 10px 2px 10px;
|
margin: 2px 10px 2px 10px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-family: "Zen Maru Gothic", sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -723,7 +724,7 @@ label > input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.userleftbox h1{
|
.userleftbox h1{
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
color:var(--background-color);
|
color:var(--background-color);
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
@@ -741,7 +742,7 @@ label > input {
|
|||||||
}
|
}
|
||||||
.userleftbox .logo p{
|
.userleftbox .logo p{
|
||||||
color:var(--background-color);
|
color:var(--background-color);
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
@@ -768,7 +769,7 @@ label > input {
|
|||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
color:var(--sub-color);
|
color:var(--sub-color);
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -801,7 +802,7 @@ main{
|
|||||||
main h1{
|
main h1{
|
||||||
color:var(--text-color);
|
color:var(--text-color);
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -834,7 +835,7 @@ main h1{
|
|||||||
color:var(--sub-color);
|
color:var(--sub-color);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -961,7 +962,7 @@ p img{
|
|||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
color: var(--subtext-color);
|
color: var(--subtext-color);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
.module_chk{
|
.module_chk{
|
||||||
@@ -992,6 +993,14 @@ p img{
|
|||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(10px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.formarea{
|
||||||
|
padding-top: 16px;
|
||||||
|
padding-bottom: 16px;
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
margin-top: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
.leftbox{
|
.leftbox{
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
@@ -1022,7 +1031,7 @@ p img{
|
|||||||
}
|
}
|
||||||
.leftbox .logo p{
|
.leftbox .logo p{
|
||||||
color:var(--background-color);
|
color:var(--background-color);
|
||||||
font-family: 'BIZ UDPGothic', sans-serif;
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
@@ -1050,7 +1059,7 @@ p img{
|
|||||||
margin: 0px;
|
margin: 0px;
|
||||||
color: var(--main-color);
|
color: var(--main-color);
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1070,27 +1079,22 @@ p img{
|
|||||||
}
|
}
|
||||||
|
|
||||||
.irobutton{
|
.irobutton{
|
||||||
width:60%;
|
padding: 8px 5%;
|
||||||
}
|
}
|
||||||
.irobutton:hover{
|
.irobutton:hover{
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
|
padding: 8px 6%;
|
||||||
width:65%;
|
|
||||||
}
|
}
|
||||||
.irobutton:active{
|
.irobutton:active{
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
|
padding: 8px 4%;
|
||||||
width:55%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.sirobutton{
|
.sirobutton{
|
||||||
width:60%;
|
padding: 8px 5%;
|
||||||
}
|
}
|
||||||
.sirobutton:hover{
|
.sirobutton:hover{
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
|
padding: 8px 6%;
|
||||||
width:65%;
|
|
||||||
}
|
}
|
||||||
.sirobutton:active{
|
.sirobutton:active{
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
|
padding: 8px 4%;
|
||||||
width:55%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1105,16 +1109,16 @@ p img{
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: none;
|
border: none;
|
||||||
display: block;
|
display: block;
|
||||||
width:50%;
|
width:100%;
|
||||||
padding: 8px auto;
|
padding: 8px auto;
|
||||||
|
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
margin-left: 12px;
|
margin-left: auto;
|
||||||
margin-right: 12px;
|
margin-right: auto;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
|
|
||||||
padding-top: 12px;
|
padding-top: 6px;
|
||||||
padding-bottom: 12px;
|
padding-bottom: 6px;
|
||||||
|
|
||||||
|
|
||||||
background-color: var(--main-color);
|
background-color: var(--main-color);
|
||||||
@@ -1123,7 +1127,7 @@ p img{
|
|||||||
color:var(--sub-color);
|
color:var(--sub-color);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: 'Zen Maru Gothic', sans-serif;
|
font-family: var(--Head-fonts), sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -1135,11 +1139,11 @@ p img{
|
|||||||
background-color: var(--main-color);
|
background-color: var(--main-color);
|
||||||
color: var(--sub-color);
|
color: var(--sub-color);
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
|
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
|
||||||
width:55%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.fbtn:active{
|
.fbtn:active{
|
||||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
|
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
|
||||||
width:45%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leftbox2{
|
.leftbox2{
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php // データベースの接続情報
|
<?php // データベースの接続情報
|
||||||
define( 'DB_HOST', 'localhost');
|
define( 'DB_HOST', '');
|
||||||
define( 'DB_USER', 'root');
|
define( 'DB_USER', '');
|
||||||
define( 'DB_PASS', 'root');
|
define( 'DB_PASS', '');
|
||||||
define( 'DB_NAME', 'uwuzu_db');
|
define( 'DB_NAME', '');
|
||||||
|
|
||||||
// タイムゾーン設定
|
// タイムゾーン設定
|
||||||
date_default_timezone_set('Asia/Tokyo');
|
date_default_timezone_set('Asia/Tokyo');
|
||||||
|
|||||||
+2
-2
@@ -31,11 +31,11 @@ $domain = $_SERVER['HTTP_HOST'];
|
|||||||
<div class="topbox">
|
<div class="topbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="/index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<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>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -31,11 +31,11 @@ $domain = $_SERVER['HTTP_HOST'];
|
|||||||
<div class="topbox">
|
<div class="topbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="/index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<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>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -31,11 +31,11 @@ $domain = $_SERVER['HTTP_HOST'];
|
|||||||
<div class="topbox">
|
<div class="topbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="/index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<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>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -33,11 +33,11 @@ $domain = $_SERVER['HTTP_HOST'];
|
|||||||
<div class="topbox">
|
<div class="topbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="/index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<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>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -30,11 +30,11 @@ $domain = $_SERVER['HTTP_HOST'];
|
|||||||
<div class="topbox">
|
<div class="topbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="/index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<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>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -36,11 +36,11 @@ $domain = $_SERVER['HTTP_HOST'];
|
|||||||
<div class="topbox">
|
<div class="topbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="/index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<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>
|
</div>
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ if(!empty(file_get_contents($serverstopfile))){
|
|||||||
<div class="topbox">
|
<div class="topbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="/index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<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>
|
</div>
|
||||||
|
|||||||
+200
-3
@@ -62,7 +62,8 @@ function delete_exif($extension, $path){
|
|||||||
//----------Check_Extension------
|
//----------Check_Extension------
|
||||||
//ファイル形式チェック(画像かどうか)
|
//ファイル形式チェック(画像かどうか)
|
||||||
function check_mime($tmp_name){
|
function check_mime($tmp_name){
|
||||||
$tmp_ext = mime_content_type($tmp_name);
|
$finfo = new finfo();
|
||||||
|
$tmp_ext = $finfo->file($tmp_name, FILEINFO_MIME_TYPE);
|
||||||
$safe_img_mime = array(
|
$safe_img_mime = array(
|
||||||
"image/gif",
|
"image/gif",
|
||||||
"image/jpeg",
|
"image/jpeg",
|
||||||
@@ -81,7 +82,8 @@ function check_mime($tmp_name){
|
|||||||
}
|
}
|
||||||
//ファイル形式チェック(画像かどうか)
|
//ファイル形式チェック(画像かどうか)
|
||||||
function check_mime_video($tmp_name){
|
function check_mime_video($tmp_name){
|
||||||
$tmp_ext = mime_content_type($tmp_name);
|
$finfo = new finfo();
|
||||||
|
$tmp_ext = $finfo->file($tmp_name, FILEINFO_MIME_TYPE);
|
||||||
$safe_vid_mime = array(
|
$safe_vid_mime = array(
|
||||||
"video/mpeg",
|
"video/mpeg",
|
||||||
"video/mp4",
|
"video/mp4",
|
||||||
@@ -94,6 +96,43 @@ function check_mime_video($tmp_name){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//ファイル形式チェック(Base64の場合)
|
||||||
|
function base64_mime($Base64,$userid){
|
||||||
|
$Base64 = base64_decode($Base64);
|
||||||
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
|
$mime_type = finfo_buffer($finfo, $Base64);
|
||||||
|
|
||||||
|
$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, $Base64);
|
||||||
|
|
||||||
|
delete_exif($extension, $temp_file);
|
||||||
|
|
||||||
|
$newFilename = uniqid() . '-' . $userid . '.' . $extension;
|
||||||
|
$uploadedPath = '../ueuseimages/' . $newFilename;
|
||||||
|
|
||||||
|
$result = copy($temp_file, "../".$uploadedPath);
|
||||||
|
if($result){
|
||||||
|
return $uploadedPath;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
//文字装飾・URL変換など
|
//文字装飾・URL変換など
|
||||||
function processMarkdownAndWrapEmptyLines($markdownText){
|
function processMarkdownAndWrapEmptyLines($markdownText){
|
||||||
|
|
||||||
@@ -112,7 +151,7 @@ function processMarkdownAndWrapEmptyLines($markdownText){
|
|||||||
|
|
||||||
//太字&斜体------------------------------------------------------------------------
|
//太字&斜体------------------------------------------------------------------------
|
||||||
$markdownText = preg_replace('/\*\*\*(.+)\*\*\*(?=\s)/', '<b><i>$1</i></b>', $markdownText);//太字&斜体の全部のせセット
|
$markdownText = preg_replace('/\*\*\*(.+)\*\*\*(?=\s)/', '<b><i>$1</i></b>', $markdownText);//太字&斜体の全部のせセット
|
||||||
$markdownText = preg_replace('/\b\*\*\*(.+)\*\*\*\b/', '<b><i>$1</i></b>', $markdownText);//太字&斜体の全部のせセット
|
$markdownText = preg_replace('/\*\*\*(.+)\*\*\*/', '<b><i>$1</i></b>', $markdownText);//太字&斜体の全部のせセット
|
||||||
|
|
||||||
$markdownText = preg_replace('/\_\_\_(.+)\_\_\_(?=\s)/', '<b><i>$1</i></b>', $markdownText);//太字&斜体の全部のせセット
|
$markdownText = preg_replace('/\_\_\_(.+)\_\_\_(?=\s)/', '<b><i>$1</i></b>', $markdownText);//太字&斜体の全部のせセット
|
||||||
$markdownText = preg_replace('/\b\_\_\_(.+)\_\_\_\b/', '<b><i>$1</i></b>', $markdownText);//太字&斜体の全部のせセット
|
$markdownText = preg_replace('/\b\_\_\_(.+)\_\_\_\b/', '<b><i>$1</i></b>', $markdownText);//太字&斜体の全部のせセット
|
||||||
@@ -318,4 +357,162 @@ function YouTube_and_nicovideo_Links($postText) {
|
|||||||
|
|
||||||
return $postText;
|
return $postText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function UserAgent_to_Device($useragent) {
|
||||||
|
if(preg_match('/Windows\sNT\s10.0/', $useragent)) {
|
||||||
|
$device = "Windows 10/11";
|
||||||
|
}elseif(preg_match('/Windows\sNT\s6.3/', $useragent)) {
|
||||||
|
$device = "Windows 8.1";
|
||||||
|
}elseif(preg_match('/Windows\sNT\s6.2/', $useragent)) {
|
||||||
|
$device = "Windows 8";
|
||||||
|
}elseif(preg_match('/Windows\sNT\s6.1/', $useragent)) {
|
||||||
|
$device = "Windows 7";
|
||||||
|
}elseif(preg_match('/Windows\sNT\s6.0/', $useragent)) {
|
||||||
|
$device = "Windows Vista";
|
||||||
|
}elseif(preg_match('/Windows\sNT\s5.2/', $useragent)) {
|
||||||
|
$device = "Windows XP";
|
||||||
|
}elseif(preg_match('/Windows\sNT\s5.1/', $useragent)) {
|
||||||
|
$device = "Windows XP";
|
||||||
|
}elseif(preg_match('/Windows\sPhone/', $useragent)) {
|
||||||
|
$device = "Windows Phone";
|
||||||
|
}elseif(preg_match('/iPhone/', $useragent)) {
|
||||||
|
$device = "iPhone";
|
||||||
|
}elseif(preg_match('/iPad/', $useragent)) {
|
||||||
|
$device = "iPad";
|
||||||
|
}elseif(preg_match('/iPod\stouch/', $useragent)) {
|
||||||
|
$device = "iPod touch";
|
||||||
|
}elseif(preg_match('/Mac\sOS\sX/', $useragent)) {
|
||||||
|
$device = "macOS";
|
||||||
|
}elseif(preg_match('/Android/', $useragent)) {
|
||||||
|
$device = "Android";
|
||||||
|
}elseif(preg_match('/BlackBerry/', $useragent)) {
|
||||||
|
$device = "BlackBerry";
|
||||||
|
}elseif(preg_match('/Linux/', $useragent)) {
|
||||||
|
$device = "Linux";
|
||||||
|
}elseif(preg_match('/Nintendo\sWiiU/', $useragent)) {
|
||||||
|
$device = "Nintendo WiiU";
|
||||||
|
}elseif(preg_match('/PlayStation\s4/', $useragent)) {
|
||||||
|
$device = "PlayStation 4";
|
||||||
|
}elseif(preg_match('/PlayStation\s5/', $useragent)) {
|
||||||
|
$device = "PlayStation 5";
|
||||||
|
}elseif(preg_match('/Nintendo\sSwitch/', $useragent)) {
|
||||||
|
$device = "Nintendo Switch";
|
||||||
|
}elseif(preg_match('/Nintendo\s3DS/', $useragent)) {
|
||||||
|
$device = "Nintendo 3DS";
|
||||||
|
}else{
|
||||||
|
$device = "Others";
|
||||||
|
}
|
||||||
|
return $device;
|
||||||
|
}
|
||||||
|
function File_MaxUploadSize(){
|
||||||
|
$memory_max = ini_get('memory_limit');
|
||||||
|
$post_max = ini_get('post_max_size');
|
||||||
|
$upload_max = ini_get('upload_max_filesize');
|
||||||
|
if(!($memory_max == "-1")){
|
||||||
|
$memory_max_s = ini_parse_quantity($memory_max);
|
||||||
|
}else{
|
||||||
|
$memory_max_s = PHP_INT_MAX;
|
||||||
|
}
|
||||||
|
if(!($post_max == "-1")){
|
||||||
|
$post_max_s = ini_parse_quantity($post_max);
|
||||||
|
}else{
|
||||||
|
$post_max_s = PHP_INT_MAX;
|
||||||
|
}
|
||||||
|
if(!($upload_max == "-1")){
|
||||||
|
$upload_max_s = ini_parse_quantity($upload_max);
|
||||||
|
}else{
|
||||||
|
$upload_max_s = PHP_INT_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($memory_max_s >= $post_max_s){
|
||||||
|
$maxsize = $post_max_s;
|
||||||
|
}else{
|
||||||
|
$maxsize = $memory_max_s;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($maxsize >= $upload_max_s){
|
||||||
|
$file_maxsize = $upload_max_s;
|
||||||
|
}else{
|
||||||
|
$file_maxsize = $maxsize;
|
||||||
|
}
|
||||||
|
return $file_maxsize;
|
||||||
|
}
|
||||||
|
function x1024($byte){
|
||||||
|
$n_mb = $byte / 1024;
|
||||||
|
return round($n_mb, 1);
|
||||||
|
}
|
||||||
|
function uwuzu_ver($select,$path){
|
||||||
|
$softwaredata = file_get_contents($path);
|
||||||
|
|
||||||
|
$softwaredata = explode( "\n", $softwaredata );
|
||||||
|
$cnt = count( $softwaredata );
|
||||||
|
for( $i=0;$i<$cnt;$i++ ){
|
||||||
|
$software_info[$i] = ($softwaredata[$i]);
|
||||||
|
}
|
||||||
|
if($select == "name"){
|
||||||
|
$ret = $software_info[0];
|
||||||
|
}elseif($select == "ver_"){
|
||||||
|
$ret = $software_info[1];
|
||||||
|
}elseif($select == "date"){
|
||||||
|
$ret = $software_info[2];
|
||||||
|
}elseif($select == "dev_"){
|
||||||
|
$ret = $software_info[3];
|
||||||
|
}else{
|
||||||
|
$ret = "no_data";
|
||||||
|
}
|
||||||
|
return htmlentities($ret, ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}
|
||||||
|
function send_notification($to,$from,$title,$message,$url){
|
||||||
|
// データベースに接続
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($pdo))){
|
||||||
|
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$fromuserid = htmlentities($from, ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$touserid = htmlentities($to, ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$datetime = date("Y-m-d H:i:s");
|
||||||
|
$msg = htmlentities($message, ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$title = htmlentities($title, ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$url = htmlentities($url, ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$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', $fromuserid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':touserid', $touserid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':url', $url, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':userchk', $userchk, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':title', $title, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$res = $stmt->execute();
|
||||||
|
|
||||||
|
$res = $pdo->commit();
|
||||||
|
|
||||||
|
if($res){
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch(Exception $e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
+127
-139
@@ -195,15 +195,6 @@ if(isset($_GET['text'])) {
|
|||||||
}elseif(isset($_COOKIE['ueuse'])) {
|
}elseif(isset($_COOKIE['ueuse'])) {
|
||||||
$ueuse = htmlentities($_COOKIE['ueuse'], ENT_QUOTES, 'UTF-8', false);
|
$ueuse = htmlentities($_COOKIE['ueuse'], ENT_QUOTES, 'UTF-8', false);
|
||||||
}
|
}
|
||||||
//-----------------絵文字の取得----------------
|
|
||||||
if (!empty($pdo)) {
|
|
||||||
$custom_emoji_Query = "SELECT emojifile,emojiname,emojiinfo,emojidate FROM emoji ORDER BY emojidate DESC";
|
|
||||||
$custom_emoji_array = $pdo->query($custom_emoji_Query);
|
|
||||||
|
|
||||||
while ($row = $custom_emoji_array->fetch(PDO::FETCH_ASSOC)) {
|
|
||||||
$custom_emoji[] = $row;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
function get_mentions_userid($postText) {
|
function get_mentions_userid($postText) {
|
||||||
@@ -529,43 +520,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$mentionedUsers = array_unique(get_mentions_userid($ueuse));
|
$mentionedUsers = array_unique(get_mentions_userid($ueuse));
|
||||||
|
|
||||||
foreach ($mentionedUsers as $mentionedUser) {
|
foreach ($mentionedUsers as $mentionedUser) {
|
||||||
|
send_notification($mentionedUser,$userid,"".$userid."さんにメンションされました!",$ueuse,"/!".$uniqid."");
|
||||||
$pdo->beginTransaction();
|
|
||||||
|
|
||||||
try {
|
|
||||||
$fromuserid = $userid;
|
|
||||||
$touserid = $mentionedUser;
|
|
||||||
$datetime = date("Y-m-d H:i:s");
|
|
||||||
$msg = "" . $ueuse . "";
|
|
||||||
$title = "" . $userid . "さんにメンションされました!";
|
|
||||||
$url = "/!" . $uniqid . "";
|
|
||||||
$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', htmlentities($fromuserid, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':touserid', htmlentities($touserid, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':msg', htmlentities($msg, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':url', htmlentities($url, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':userchk', htmlentities($userchk, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':title', htmlentities($title, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
|
|
||||||
$stmt->bindParam(':datetime', htmlentities($datetime, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
|
|
||||||
// SQLクエリの実行
|
|
||||||
$res = $stmt->execute();
|
|
||||||
|
|
||||||
// コミット
|
|
||||||
$res = $pdo->commit();
|
|
||||||
|
|
||||||
} catch(Exception $e) {
|
|
||||||
|
|
||||||
// エラーが発生した時はロールバック
|
|
||||||
$pdo->rollBack();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
@@ -645,8 +600,8 @@ if ("serviceWorker" in navigator) {
|
|||||||
<main class="outer">
|
<main class="outer">
|
||||||
|
|
||||||
<div class="tlchange">
|
<div class="tlchange">
|
||||||
<a href="index" class="off">LTL</a>
|
<a href="index" class="off">ローカル</a>
|
||||||
<a href="ftl" class="on">FTL</a>
|
<a href="ftl" class="on">フォロー</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if( !empty($error_message) ): ?>
|
<?php if( !empty($error_message) ): ?>
|
||||||
@@ -702,98 +657,12 @@ if ("serviceWorker" in navigator) {
|
|||||||
<div class="emoji_picker" id="emoji_picker" style="display:none;">
|
<div class="emoji_picker" id="emoji_picker" style="display:none;">
|
||||||
<p>カスタム絵文字</p>
|
<p>カスタム絵文字</p>
|
||||||
<div class="emoji_picker_flex">
|
<div class="emoji_picker_flex">
|
||||||
<?php
|
|
||||||
if(!empty($custom_emoji)){
|
|
||||||
foreach ($custom_emoji as $value) {
|
|
||||||
echo '<div class="one_emoji">';
|
|
||||||
echo '<img src="../' . htmlentities($value["emojifile"], ENT_QUOTES, 'UTF-8', false) . '" alt=":'.htmlentities($value["emojiname"], ENT_QUOTES, 'UTF-8', false).':" title=":'.htmlentities($value["emojiname"], ENT_QUOTES, 'UTF-8', false).':">';
|
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
echo '<div class="tokonone" id="noueuse"><p>カスタム絵文字がありません</p></div>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<script>
|
|
||||||
document.getElementById("upload_videos1").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#videos1').addClass('label_set');
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
document.getElementById("upload_images4").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#images4').addClass('label_set');
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("upload_images3").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#images3').addClass('label_set');
|
|
||||||
$("#images4").show();
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("upload_images2").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#images2').addClass('label_set');
|
|
||||||
$("#images3").show();
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
document.getElementById("upload_images").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#images').addClass('label_set');
|
|
||||||
$("#images2").show();
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#ueuse').on('input', function () {
|
|
||||||
var mojisize = '<?php echo $mojisize; ?>';
|
|
||||||
var mojicount = Number(mojisize) - $(this).val().length;
|
|
||||||
if(mojicount >= 0){
|
|
||||||
$('#moji_cnt').removeClass('red');
|
|
||||||
$('#moji_cnt').html(mojicount);
|
|
||||||
$('#ueusebtn').prop('disabled', false);
|
|
||||||
}else{
|
|
||||||
$('#moji_cnt').addClass('red');
|
|
||||||
$('#moji_cnt').html(mojicount);
|
|
||||||
$('#ueusebtn').prop('disabled', true);
|
|
||||||
}
|
|
||||||
document.cookie = "ueuse=" + encodeURIComponent($(this).val()) + "; Secure; SameSite=Lax; path=/home;";
|
|
||||||
})
|
|
||||||
$("#emoji_picker_btn").click(function () {
|
|
||||||
if ($("#emoji_picker_btn").prop("checked") == true) {
|
|
||||||
$("#emoji_picker").show();
|
|
||||||
} else {
|
|
||||||
$("#emoji_picker").hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$(".one_emoji").click(function (event) {
|
|
||||||
event.preventDefault();
|
|
||||||
var children = $(this).children("img");
|
|
||||||
var custom_emojiname = children.attr("title");
|
|
||||||
$("#ueuse").val($("#ueuse").val() + custom_emojiname);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<section class="inner">
|
<section class="inner">
|
||||||
<div id="postContainer">
|
<div id="postContainer">
|
||||||
@@ -816,8 +685,8 @@ if ("serviceWorker" in navigator) {
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<p>ユーズを削除しますか?</p>
|
<p>ユーズを削除しますか?</p>
|
||||||
<form class="btn_area" method="post" id="deleteForm">
|
<form class="btn_area" method="post" id="deleteForm">
|
||||||
<input type="button" id="deleteButton" class="fbtn" name="delete" value="削除">
|
<input type="button" id="deleteButton" class="fbtn_no" name="delete" value="削除">
|
||||||
<input type="button" id="cancelButton" class="fbtn_no" value="キャンセル">
|
<input type="button" id="cancelButton" class="fbtn" value="キャンセル">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -830,8 +699,8 @@ if ("serviceWorker" in navigator) {
|
|||||||
<form method="post" id="AbiForm">
|
<form method="post" id="AbiForm">
|
||||||
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlentities( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlentities( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
||||||
<div class="btn_area">
|
<div class="btn_area">
|
||||||
<input type="submit" id="AbiAddButton" class="fbtn" name="abi" value="追記">
|
<input type="submit" id="AbiAddButton" class="fbtn_no" name="abi" value="追記">
|
||||||
<input type="button" id="AbiCancelButton" class="fbtn_no" value="キャンセル">
|
<input type="button" id="AbiCancelButton" class="fbtn" value="キャンセル">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -1149,6 +1018,125 @@ $(document).on('click', '.addabi', function (event) {
|
|||||||
osho_gats.style.display = 'none';
|
osho_gats.style.display = 'none';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
//-------------------------------------------------------send_box-------------------------------------------------------
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
document.getElementById("upload_videos1").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#videos1').addClass('label_set');
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
document.getElementById("upload_images4").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#images4').addClass('label_set');
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("upload_images3").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#images3').addClass('label_set');
|
||||||
|
$("#images4").show();
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("upload_images2").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#images2').addClass('label_set');
|
||||||
|
$("#images3").show();
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
document.getElementById("upload_images").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#images').addClass('label_set');
|
||||||
|
$("#images2").show();
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#ueuse').on('input', function () {
|
||||||
|
var mojisize = '<?php echo $mojisize; ?>';
|
||||||
|
var mojicount = Number(mojisize) - $(this).val().length;
|
||||||
|
if(mojicount >= 0){
|
||||||
|
$('#moji_cnt').removeClass('red');
|
||||||
|
$('#moji_cnt').html(mojicount);
|
||||||
|
$('#ueusebtn').prop('disabled', false);
|
||||||
|
}else{
|
||||||
|
$('#moji_cnt').addClass('red');
|
||||||
|
$('#moji_cnt').html(mojicount);
|
||||||
|
$('#ueusebtn').prop('disabled', true);
|
||||||
|
}
|
||||||
|
document.cookie = "ueuse=" + encodeURIComponent($(this).val()) + "; Secure; SameSite=Lax; path=/home;";
|
||||||
|
});
|
||||||
|
loadEmojis();
|
||||||
|
$("#emoji_picker_btn").click(function () {
|
||||||
|
if ($("#emoji_picker_btn").prop("checked") == true) {
|
||||||
|
$("#emoji_picker").show();
|
||||||
|
} else {
|
||||||
|
$("#emoji_picker").hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('.emoji_picker').on('scroll', function() {
|
||||||
|
var innerHeight = $('.emoji_picker_flex').innerHeight(),
|
||||||
|
outerHeight = $('.emoji_picker').innerHeight(),
|
||||||
|
outerBottom = innerHeight - outerHeight;
|
||||||
|
if (outerBottom <= $('.emoji_picker').scrollTop()) {
|
||||||
|
if ($('#noemoji').length){
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
loadEmojis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var Emoji_pageNumber = 1;
|
||||||
|
var isLoading = false;
|
||||||
|
function loadEmojis() {
|
||||||
|
if (isLoading) return;
|
||||||
|
isLoading = true;
|
||||||
|
|
||||||
|
var userid = '<?php echo $userid; ?>';
|
||||||
|
var account_id = '<?php echo $loginid; ?>';
|
||||||
|
var search_query = '';
|
||||||
|
var viewmode = 'picker'
|
||||||
|
$.ajax({
|
||||||
|
url: '../nextpage/emojiview.php', // PHPファイルへのパス
|
||||||
|
method: 'GET',
|
||||||
|
data: { page: Emoji_pageNumber, userid: userid , account_id: account_id , search_query: search_query, view_mode: viewmode},
|
||||||
|
dataType: 'html',
|
||||||
|
timeout: 300000,
|
||||||
|
success: function(response) {
|
||||||
|
$('.emoji_picker_flex').append(response);
|
||||||
|
Emoji_pageNumber++;
|
||||||
|
isLoading = false;
|
||||||
|
EmojiClickEvent();
|
||||||
|
},
|
||||||
|
error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||||
|
isLoading = false;
|
||||||
|
EmojiClickEvent();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function EmojiClickEvent() {
|
||||||
|
$(".one_emoji").click(function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
var children = $(this).children("img");
|
||||||
|
var custom_emojiname = children.attr("title");
|
||||||
|
$("#ueuse").val($("#ueuse").val() + custom_emojiname);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+133
-139
@@ -194,15 +194,6 @@ if(isset($_GET['text'])) {
|
|||||||
}elseif(isset($_COOKIE['ueuse'])) {
|
}elseif(isset($_COOKIE['ueuse'])) {
|
||||||
$ueuse = htmlentities($_COOKIE['ueuse'], ENT_QUOTES, 'UTF-8', false);
|
$ueuse = htmlentities($_COOKIE['ueuse'], ENT_QUOTES, 'UTF-8', false);
|
||||||
}
|
}
|
||||||
//-----------------絵文字の取得----------------
|
|
||||||
if (!empty($pdo)) {
|
|
||||||
$custom_emoji_Query = "SELECT emojifile,emojiname,emojiinfo,emojidate FROM emoji ORDER BY emojidate DESC";
|
|
||||||
$custom_emoji_array = $pdo->query($custom_emoji_Query);
|
|
||||||
|
|
||||||
while ($row = $custom_emoji_array->fetch(PDO::FETCH_ASSOC)) {
|
|
||||||
$custom_emoji[] = $row;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
function get_mentions_userid($postText) {
|
function get_mentions_userid($postText) {
|
||||||
@@ -528,43 +519,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$mentionedUsers = array_unique(get_mentions_userid($ueuse));
|
$mentionedUsers = array_unique(get_mentions_userid($ueuse));
|
||||||
|
|
||||||
foreach ($mentionedUsers as $mentionedUser) {
|
foreach ($mentionedUsers as $mentionedUser) {
|
||||||
|
send_notification($mentionedUser,$userid,"".$userid."さんにメンションされました!",$ueuse,"/!".$uniqid."");
|
||||||
$pdo->beginTransaction();
|
|
||||||
|
|
||||||
try {
|
|
||||||
$fromuserid = $userid;
|
|
||||||
$touserid = $mentionedUser;
|
|
||||||
$datetime = date("Y-m-d H:i:s");
|
|
||||||
$msg = "" . $ueuse . "";
|
|
||||||
$title = "" . $userid . "さんにメンションされました!";
|
|
||||||
$url = "/!" . $uniqid . "";
|
|
||||||
$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', htmlentities($fromuserid, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':touserid', htmlentities($touserid, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':msg', htmlentities($msg, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':url', htmlentities($url, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':userchk', htmlentities($userchk, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':title', htmlentities($title, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
|
|
||||||
$stmt->bindParam(':datetime', htmlentities($datetime, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
|
||||||
|
|
||||||
// SQLクエリの実行
|
|
||||||
$res = $stmt->execute();
|
|
||||||
|
|
||||||
// コミット
|
|
||||||
$res = $pdo->commit();
|
|
||||||
|
|
||||||
} catch(Exception $e) {
|
|
||||||
|
|
||||||
// エラーが発生した時はロールバック
|
|
||||||
$pdo->rollBack();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
@@ -674,8 +629,8 @@ if ("serviceWorker" in navigator) {
|
|||||||
<?php }?>
|
<?php }?>
|
||||||
|
|
||||||
<div class="tlchange">
|
<div class="tlchange">
|
||||||
<a href="index" class="on">LTL</a>
|
<a href="index" class="on">ローカル</a>
|
||||||
<a href="ftl" class="off">FTL</a>
|
<a href="ftl" class="off">フォロー</a>
|
||||||
</div>
|
</div>
|
||||||
<?php if( !empty($error_message) ): ?>
|
<?php if( !empty($error_message) ): ?>
|
||||||
<ul class="errmsg">
|
<ul class="errmsg">
|
||||||
@@ -730,97 +685,12 @@ if ("serviceWorker" in navigator) {
|
|||||||
<div class="emoji_picker" id="emoji_picker" style="display:none;">
|
<div class="emoji_picker" id="emoji_picker" style="display:none;">
|
||||||
<p>カスタム絵文字</p>
|
<p>カスタム絵文字</p>
|
||||||
<div class="emoji_picker_flex">
|
<div class="emoji_picker_flex">
|
||||||
<?php
|
|
||||||
if(!empty($custom_emoji)){
|
|
||||||
foreach ($custom_emoji as $value) {
|
|
||||||
echo '<div class="one_emoji">';
|
|
||||||
echo '<img src="../' . htmlentities($value["emojifile"], ENT_QUOTES, 'UTF-8', false) . '" alt=":'.htmlentities($value["emojiname"], ENT_QUOTES, 'UTF-8', false).':" title=":'.htmlentities($value["emojiname"], ENT_QUOTES, 'UTF-8', false).':">';
|
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
echo '<div class="tokonone" id="noemoji"><p>カスタム絵文字がありません</p></div>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<script>
|
|
||||||
document.getElementById("upload_videos1").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#videos1').addClass('label_set');
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
document.getElementById("upload_images4").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#images4').addClass('label_set');
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("upload_images3").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#images3').addClass('label_set');
|
|
||||||
$("#images4").show();
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("upload_images2").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#images2').addClass('label_set');
|
|
||||||
$("#images3").show();
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
document.getElementById("upload_images").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#images').addClass('label_set');
|
|
||||||
$("#images2").show();
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#ueuse').on('input', function () {
|
|
||||||
var mojisize = '<?php echo $mojisize; ?>';
|
|
||||||
var mojicount = Number(mojisize) - $(this).val().length;
|
|
||||||
if(mojicount >= 0){
|
|
||||||
$('#moji_cnt').removeClass('red');
|
|
||||||
$('#moji_cnt').html(mojicount);
|
|
||||||
$('#ueusebtn').prop('disabled', false);
|
|
||||||
}else{
|
|
||||||
$('#moji_cnt').addClass('red');
|
|
||||||
$('#moji_cnt').html(mojicount);
|
|
||||||
$('#ueusebtn').prop('disabled', true);
|
|
||||||
}
|
|
||||||
document.cookie = "ueuse=" + encodeURIComponent($(this).val()) + "; Secure; SameSite=Lax; path=/home;";
|
|
||||||
})
|
|
||||||
$("#emoji_picker_btn").click(function () {
|
|
||||||
if ($("#emoji_picker_btn").prop("checked") == true) {
|
|
||||||
$("#emoji_picker").show();
|
|
||||||
} else {
|
|
||||||
$("#emoji_picker").hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$(".one_emoji").click(function (event) {
|
|
||||||
event.preventDefault();
|
|
||||||
var children = $(this).children("img");
|
|
||||||
var custom_emojiname = children.attr("title");
|
|
||||||
$("#ueuse").val($("#ueuse").val() + custom_emojiname);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<section class="inner">
|
<section class="inner">
|
||||||
<div id="postContainer">
|
<div id="postContainer">
|
||||||
@@ -843,8 +713,8 @@ if ("serviceWorker" in navigator) {
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<p>ユーズを削除しますか?</p>
|
<p>ユーズを削除しますか?</p>
|
||||||
<form class="btn_area" method="post" id="deleteForm">
|
<form class="btn_area" method="post" id="deleteForm">
|
||||||
<input type="button" id="deleteButton" class="fbtn" name="delete" value="削除">
|
<input type="button" id="deleteButton" class="fbtn_no" name="delete" value="削除">
|
||||||
<input type="button" id="cancelButton" class="fbtn_no" value="キャンセル">
|
<input type="button" id="cancelButton" class="fbtn" value="キャンセル">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -857,8 +727,8 @@ if ("serviceWorker" in navigator) {
|
|||||||
<form method="post" id="AbiForm">
|
<form method="post" id="AbiForm">
|
||||||
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlentities( $_SESSION['abi'], ENT_QUOTES, 'UTF-8', false); } ?></textarea>
|
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlentities( $_SESSION['abi'], ENT_QUOTES, 'UTF-8', false); } ?></textarea>
|
||||||
<div class="btn_area">
|
<div class="btn_area">
|
||||||
<input type="submit" id="AbiAddButton" class="fbtn" name="abi" value="追記">
|
<input type="submit" id="AbiAddButton" class="fbtn_no" name="abi" value="追記">
|
||||||
<input type="button" id="AbiCancelButton" class="fbtn_no" value="キャンセル">
|
<input type="button" id="AbiCancelButton" class="fbtn" value="キャンセル">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -1139,7 +1009,6 @@ $(document).ready(function() {
|
|||||||
$("#offline").show();
|
$("#offline").show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
$(document).on('click', '.share', function (event) {
|
$(document).on('click', '.share', function (event) {
|
||||||
|
|
||||||
@@ -1202,5 +1071,130 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
}, 60000);
|
}, 60000);
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
//-------------------------------------------------------send_box-------------------------------------------------------
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
document.getElementById("upload_videos1").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#videos1').addClass('label_set');
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
document.getElementById("upload_images4").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#images4').addClass('label_set');
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("upload_images3").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#images3').addClass('label_set');
|
||||||
|
$("#images4").show();
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("upload_images2").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#images2').addClass('label_set');
|
||||||
|
$("#images3").show();
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
document.getElementById("upload_images").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#images').addClass('label_set');
|
||||||
|
$("#images2").show();
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#ueuse').on('input', function () {
|
||||||
|
var mojisize = '<?php echo $mojisize; ?>';
|
||||||
|
var mojicount = Number(mojisize) - $(this).val().length;
|
||||||
|
if(mojicount >= 0){
|
||||||
|
$('#moji_cnt').removeClass('red');
|
||||||
|
$('#moji_cnt').html(mojicount);
|
||||||
|
$('#ueusebtn').prop('disabled', false);
|
||||||
|
}else{
|
||||||
|
$('#moji_cnt').addClass('red');
|
||||||
|
$('#moji_cnt').html(mojicount);
|
||||||
|
$('#ueusebtn').prop('disabled', true);
|
||||||
|
}
|
||||||
|
document.cookie = "ueuse=" + encodeURIComponent($(this).val()) + "; Secure; SameSite=Lax; path=/home;";
|
||||||
|
});
|
||||||
|
loadEmojis();
|
||||||
|
$("#emoji_picker_btn").click(function () {
|
||||||
|
if ($("#emoji_picker_btn").prop("checked") == true) {
|
||||||
|
$("#emoji_picker").show();
|
||||||
|
} else {
|
||||||
|
$("#emoji_picker").hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('.emoji_picker').on('scroll', function() {
|
||||||
|
var innerHeight = $('.emoji_picker_flex').innerHeight(),
|
||||||
|
outerHeight = $('.emoji_picker').innerHeight(),
|
||||||
|
outerBottom = innerHeight - outerHeight;
|
||||||
|
if (outerBottom <= $('.emoji_picker').scrollTop()) {
|
||||||
|
if ($('#noemoji').length){
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
loadEmojis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var Emoji_pageNumber = 1;
|
||||||
|
var isLoading = false;
|
||||||
|
function loadEmojis() {
|
||||||
|
if (isLoading) return;
|
||||||
|
isLoading = true;
|
||||||
|
|
||||||
|
var userid = '<?php echo $userid; ?>';
|
||||||
|
var account_id = '<?php echo $loginid; ?>';
|
||||||
|
var search_query = '';
|
||||||
|
var viewmode = 'picker'
|
||||||
|
$.ajax({
|
||||||
|
url: '../nextpage/emojiview.php', // PHPファイルへのパス
|
||||||
|
method: 'GET',
|
||||||
|
data: { page: Emoji_pageNumber, userid: userid , account_id: account_id , search_query: search_query, view_mode: viewmode},
|
||||||
|
dataType: 'html',
|
||||||
|
timeout: 300000,
|
||||||
|
success: function(response) {
|
||||||
|
$('.emoji_picker_flex').append(response);
|
||||||
|
Emoji_pageNumber++;
|
||||||
|
isLoading = false;
|
||||||
|
if($("#error").length){
|
||||||
|
$("#error").hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
EmojiClickEvent();
|
||||||
|
},
|
||||||
|
error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||||
|
isLoading = false;
|
||||||
|
$("#error").show();
|
||||||
|
EmojiClickEvent();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function EmojiClickEvent() {
|
||||||
|
$(".one_emoji").click(function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
var children = $(this).children("img");
|
||||||
|
var custom_emojiname = children.attr("title");
|
||||||
|
$("#ueuse").val($("#ueuse").val() + custom_emojiname);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 99 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 138 KiB |
@@ -149,11 +149,11 @@ if ("serviceWorker" in navigator) {
|
|||||||
<div class="leftbox">
|
<div class="leftbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src="img/uwuzulogo.svg"></a>
|
<a href="index.php"><img src="img/uwuzulogo.svg"></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
|
||||||
@@ -206,11 +206,6 @@ if ("serviceWorker" in navigator) {
|
|||||||
|
|
||||||
<?php if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){?>
|
<?php if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){?>
|
||||||
<p>このサーバーには招待コードがないと登録できません。<br>招待コードはお手元にありますか?</p>
|
<p>このサーバーには招待コードがないと登録できません。<br>招待コードはお手元にありますか?</p>
|
||||||
|
|
||||||
<div class="btnbox">
|
|
||||||
<a href="new.php" class="irobutton">アカウント登録</a>
|
|
||||||
<a href="login.php" class="sirobutton">ログイン</a>
|
|
||||||
</div>
|
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
|
|
||||||
<div class="cntzone">
|
<div class="cntzone">
|
||||||
@@ -223,11 +218,13 @@ if ("serviceWorker" in navigator) {
|
|||||||
<p><?php echo $count2."<br>"?></p>
|
<p><?php echo $count2."<br>"?></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php }?>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a href="new.php" class="irobutton">アカウント登録</a>
|
<a href="new_select.php" class="irobutton">アカウント登録</a>
|
||||||
<a href="login.php" class="sirobutton">ログイン</a>
|
<a href="login.php" class="sirobutton">ログイン</a>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
|
||||||
<div class="p2" style="margin-top:8px;margin-bottom:0px;"><?php echo $uwuzuinfo[0];?> Version <?php echo $uwuzuinfo[1];?></div>
|
<div class="p2" style="margin-top:8px;margin-bottom:0px;"><?php echo $uwuzuinfo[0];?> Version <?php echo $uwuzuinfo[1];?></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,10 +21,7 @@ console.log(
|
|||||||
"",
|
"",
|
||||||
);
|
);
|
||||||
console.log(
|
console.log(
|
||||||
"%cMessage by uwuzu%c\n%cこのメッセージはuwuzu開発者であるだいちまるによって書き込まれたものです。%c",
|
"%cMessage by uwuzu%c\nこのメッセージはuwuzu開発者であるだいちまるによって書き込まれたものです。\nuwuzuサーバー運営者及びuwuzu開発者がCookie情報等を要求することはありません。",
|
||||||
"color:white; background-color:#FFC832; padding:4px; border-radius:4px; font-size: 12pt",
|
"color:white; background-color:#FFC832; padding:4px; border-radius:4px; font-size: 12pt",
|
||||||
"",
|
"",
|
||||||
"color:#000;",
|
|
||||||
"",
|
|
||||||
"uwuzuサーバー運営者及びuwuzu開発者がCookie情報等を要求することはありません。",
|
|
||||||
);
|
);
|
||||||
@@ -267,11 +267,11 @@ $pdo = null;
|
|||||||
<div class="leftbox">
|
<div class="leftbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src="img/uwuzulogo.svg"></a>
|
<a href="index.php"><img src="img/uwuzulogo.svg"></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
|
||||||
@@ -290,11 +290,11 @@ $pdo = null;
|
|||||||
|
|
||||||
<form class="formarea" method="post">
|
<form class="formarea" method="post">
|
||||||
<div>
|
<div>
|
||||||
<label for="userid">ユーザーID</label>
|
<p>ユーザーID</p>
|
||||||
<input onInput="checkForm(this)" id="userid" class="inbox" type="text" name="userid" value="<?php if( !empty($_SESSION['userid']) ){ echo htmlentities( $_SESSION['userid'], ENT_QUOTES, 'UTF-8'); } ?>">
|
<input onInput="checkForm(this)" id="userid" class="inbox" type="text" name="userid" value="<?php if( !empty($_SESSION['userid']) ){ echo htmlentities( $_SESSION['userid'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="password">パスワード</label>
|
<p>パスワード</p>
|
||||||
<input id="password" class="inbox" type="password" name="password" maxlength="32" value="<?php if( !empty($_SESSION['password']) ){ echo htmlentities( $_SESSION['password'], ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="password" class="inbox" type="password" name="password" maxlength="32" value="<?php if( !empty($_SESSION['password']) ){ echo htmlentities( $_SESSION['password'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="switch_flexbox">
|
<div class="switch_flexbox">
|
||||||
|
|||||||
+8
-2
@@ -24,8 +24,11 @@ if (isset($_SERVER['HTTP_COOKIE'])) {
|
|||||||
setcookie('userid', '', time()-1000, '');
|
setcookie('userid', '', time()-1000, '');
|
||||||
setcookie('username', '', time()-1000, '');
|
setcookie('username', '', time()-1000, '');
|
||||||
}
|
}
|
||||||
|
header("Location: " . $_SERVER['PHP_SELF']);
|
||||||
}
|
}
|
||||||
$_SESSION = null;
|
session_start();
|
||||||
|
$_SESSION = array();
|
||||||
|
session_destroy();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
@@ -71,4 +74,7 @@ $_SESSION = null;
|
|||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
<script>
|
||||||
|
document.cookie.split(";").forEach(function(c) { document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); });
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,642 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$banuseridfile = "../server/banuserid.txt";
|
||||||
|
$banuserid_info = file_get_contents($banuseridfile);
|
||||||
|
$banuserid = preg_split("/\r\n|\n|\r/", $banuserid_info);
|
||||||
|
|
||||||
|
$badpassfile = "../server/badpass.txt";
|
||||||
|
$badpass_info = file_get_contents($badpassfile);
|
||||||
|
$badpass = preg_split("/\r\n|\n|\r/", $badpass_info);
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
|
||||||
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
|
require('../db.php');
|
||||||
|
//関数呼び出し
|
||||||
|
//- EXIF
|
||||||
|
require('../function/function.php');
|
||||||
|
//hCaptcha--------------------------------------------
|
||||||
|
require('../settings_admin/hCaptcha_settings/hCaptcha_settings.php');
|
||||||
|
//Cloudflare_Turnstile--------------------------------------------
|
||||||
|
require('../settings_admin/CloudflareTurnstile_settings/CloudflareTurnstile_settings.php');
|
||||||
|
//----------------------------------------------------
|
||||||
|
|
||||||
|
session_name('uwuzu_s_id');
|
||||||
|
session_set_cookie_params(0, '', '', true, true);
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
// 変数の初期化
|
||||||
|
$current_date = null;
|
||||||
|
$message_array = array();
|
||||||
|
$error_message = array();
|
||||||
|
$pdo = null;
|
||||||
|
$stmt = null;
|
||||||
|
$res = null;
|
||||||
|
$option = null;
|
||||||
|
|
||||||
|
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset($_COOKIE['loginid']) && isset($_SESSION['userid'])) {
|
||||||
|
$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);
|
||||||
|
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
||||||
|
$acck->bindValue(':userid', $_SESSION['userid']);
|
||||||
|
$acck->execute();
|
||||||
|
$acck_data = $acck->fetch();
|
||||||
|
if(!empty($acck_data)){
|
||||||
|
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_SESSION['userid'] === $acck_data["userid"] ){
|
||||||
|
header("Location: /home/index.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true && isset($_COOKIE['loginid']) && isset($_COOKIE['userid'])) {
|
||||||
|
$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);
|
||||||
|
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
||||||
|
$acck->bindValue(':userid', $_COOKIE['userid']);
|
||||||
|
$acck->execute();
|
||||||
|
$acck_data = $acck->fetch();
|
||||||
|
if(!empty($acck_data)){
|
||||||
|
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_COOKIE['userid'] === $acck_data["userid"] ){
|
||||||
|
header("Location: /home/index.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
|
if(htmlspecialchars($serversettings["serverinfo"]["server_account_migration"], ENT_QUOTES, 'UTF-8') === "true"){
|
||||||
|
$new_userid = htmlentities($_POST['new_userid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$password = htmlentities($_POST['password'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
|
if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){
|
||||||
|
$invitationcode = htmlentities($_POST['invitationcode'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
$domain = htmlentities($_POST['moto_server_domain'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$check_code = htmlentities($_POST['moto_server_account_check'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$key = htmlentities($_POST['moto_server_account_auth'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
|
if(empty($domain)) {
|
||||||
|
$error_message[] = '移行元のサーバードメインを入力してください。(INPUT_PLEASE)';
|
||||||
|
}else{
|
||||||
|
$domain_response = @file_get_contents("https://".$domain."/");
|
||||||
|
if (empty($domain_response)) {
|
||||||
|
$error_message[] = '入力されたドメインに接続できませんでした。(INPUT_PLEASE)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($check_code)) {
|
||||||
|
$error_message[] = '識別コードを入力してください。(INPUT_PLEASE)';
|
||||||
|
}
|
||||||
|
if(empty($key)) {
|
||||||
|
$error_message[] = '認証コードを入力してください。(INPUT_PLEASE)';
|
||||||
|
}
|
||||||
|
|
||||||
|
//招待コードチェック
|
||||||
|
if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){
|
||||||
|
$query = $pdo->prepare('SELECT * FROM invitation WHERE code = :code limit 1');
|
||||||
|
|
||||||
|
$query->execute(array(':code' => $invitationcode));
|
||||||
|
|
||||||
|
$result = $query->fetch();
|
||||||
|
|
||||||
|
// 招待コードの入力チェック
|
||||||
|
if( empty($invitationcode) ) {
|
||||||
|
$error_message[] = '招待コードを入力してください。(INVITATION_CODE_INPUT_PLEASE)';
|
||||||
|
} else {
|
||||||
|
if($result > 0){
|
||||||
|
if($result["used"] === "true"){
|
||||||
|
$error_message[] = 'この招待コード('.$invitationcode.')は既に使用されています。(INVITATION_CODE_SHIYOUZUMI)';
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = 'この招待コード('.$invitationcode.')は使えません。(INVITATION_CODE_DEAD)';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$key1_code = substr($key, 0, -16);//key1
|
||||||
|
$key2_code = substr($key, -16);//key2
|
||||||
|
|
||||||
|
if(!empty(H_CAPTCHA_ONOFF && H_CAPTCHA_ONOFF == "true")){
|
||||||
|
if(isset($_POST['h-captcha-response'])){
|
||||||
|
$hcaptcha_token = htmlentities($_POST['h-captcha-response']);
|
||||||
|
if($hcaptcha_token){
|
||||||
|
$captcha_data = [
|
||||||
|
'secret' => htmlentities(H_CAPTCHA_SEAC_KEY),
|
||||||
|
'response' => $hcaptcha_token,
|
||||||
|
'sitekey' => htmlentities(H_CAPTCHA_SITE_KEY)
|
||||||
|
];
|
||||||
|
$options = [
|
||||||
|
'http' => [
|
||||||
|
'method'=> 'POST',
|
||||||
|
'header'=> 'Content-Type: application/x-www-form-urlencoded',
|
||||||
|
'content' => http_build_query($captcha_data, '', '&')
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$hCaptcha_result = json_decode(file_get_contents('https://hcaptcha.com/siteverify', false, stream_context_create($options)),true);
|
||||||
|
if(!($hCaptcha_result["success"] == true)){
|
||||||
|
$error_message[] = "hCaptchaであなたが人間である確認ができませんでした。(ERROR)";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = "hCaptchaであなたが人間である確認ができませんでした。(ERROR)";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = "hCaptchaであなたが人間である確認ができませんでした。(ERROR)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!empty(CF_TURNSTILE_ONOFF && CF_TURNSTILE_ONOFF == "true")){
|
||||||
|
if(isset($_POST['cf-turnstile-response'])){
|
||||||
|
$CF_Turnstile_token = htmlentities($_POST['cf-turnstile-response']);
|
||||||
|
if($CF_Turnstile_token){
|
||||||
|
$CF_Turnstile_data = [
|
||||||
|
'secret' => htmlentities(CF_TURNSTILE_SEAC_KEY),
|
||||||
|
'response' => $CF_Turnstile_token
|
||||||
|
];
|
||||||
|
$CF_Turnstile_options = [
|
||||||
|
'http' => [
|
||||||
|
'method'=> 'POST',
|
||||||
|
'header'=> 'Content-Type: application/x-www-form-urlencoded',
|
||||||
|
'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);
|
||||||
|
if(!($CF_Turnstile_result["success"] == true)){
|
||||||
|
$error_message[] = "CloudflareTurnstileであなたが人間である確認ができませんでした。(ERROR)";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = "CloudflareTurnstileであなたが人間である確認ができませんでした。(ERROR)";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = "CloudflareTurnstileであなたが人間である確認ができませんでした。(ERROR)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($error_message)){
|
||||||
|
$data = array();
|
||||||
|
$options = [
|
||||||
|
'http' => [
|
||||||
|
'method'=> 'POST',
|
||||||
|
'content' => http_build_query($data, '', '&')
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$Check_result = json_decode(file_get_contents("https://".$domain."/api/serverinfo-api", false, stream_context_create($options)),true);
|
||||||
|
if($Check_result["software"]["name"] == "uwuzu"){
|
||||||
|
$version = str_pad(str_replace('.', '', $Check_result["software"]["version"]), 4, 0, STR_PAD_RIGHT);
|
||||||
|
|
||||||
|
if($version >= 1360){
|
||||||
|
$Check_Link = "https://".$domain."/api/migration-api?migration_code=".$check_code;
|
||||||
|
$data = array();
|
||||||
|
$options = [
|
||||||
|
'http' => [
|
||||||
|
'method'=> 'GET',
|
||||||
|
'content' => http_build_query($data, '', '&')
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$Get_result = json_decode(file_get_contents($Check_Link, false, stream_context_create($options)),true);
|
||||||
|
|
||||||
|
if(isset($Get_result["data"])){
|
||||||
|
$account_data = openssl_decrypt($Get_result["data"], "AES-256-CBC", $key1_code, 0, $key2_code);
|
||||||
|
if($account_data == false){
|
||||||
|
$error_message[] = "認証コードもしくは確認コードが間違っているようです。(MIGRATION_BAD_AUTH_CODE)";
|
||||||
|
}else{
|
||||||
|
$json_account_data = json_decode($account_data,true);
|
||||||
|
if($json_account_data == false){
|
||||||
|
$error_message[] = "アカウントの移行を最初からやり直してください。(MIGRATION_SORRY)";
|
||||||
|
}else{
|
||||||
|
|
||||||
|
//アイコン&ヘッダー
|
||||||
|
$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);
|
||||||
|
|
||||||
|
// 新しいファイル名を生成(uniqid + 拡張子)
|
||||||
|
$newFilename = uniqid() . '-'.$new_userid.'.png';
|
||||||
|
|
||||||
|
// 保存先のパスを生成
|
||||||
|
$uploadedPath = 'usericons/' . $newFilename;
|
||||||
|
|
||||||
|
// ファイルを移動
|
||||||
|
$result = copy($temp_file, "../".$uploadedPath);
|
||||||
|
|
||||||
|
if ($result) {
|
||||||
|
$iconName = $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[] = 'アップロード失敗!(1)エラーコード:' .$uploadedFile['error'].'';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//------------------
|
||||||
|
$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);
|
||||||
|
|
||||||
|
// 新しいファイル名を生成(uniqid + 拡張子)
|
||||||
|
$newFilename = uniqid() . '-'.$new_userid.'.png';
|
||||||
|
|
||||||
|
// 保存先のパスを生成
|
||||||
|
$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'].'';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $pdo->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
||||||
|
$query->execute(array(':userid' => $new_userid));
|
||||||
|
$result = $query->fetch();
|
||||||
|
|
||||||
|
// ユーザーネームの入力チェック
|
||||||
|
if( empty($json_account_data["userdata"]["user_name"]) ) {
|
||||||
|
$error_message[] = '表示名を入力してください。(USERNAME_INPUT_PLEASE)';
|
||||||
|
} else {
|
||||||
|
// 文字数を確認
|
||||||
|
if( 50 < mb_strlen($json_account_data["userdata"]["user_name"], 'UTF-8') ) {
|
||||||
|
$error_message[] = 'ユーザーネームは50文字以内で入力してください。(USERNAME_OVER_MAX_COUNT)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// IDの入力チェック
|
||||||
|
if( empty($new_userid) ) {
|
||||||
|
$error_message[] = 'ユーザーIDを入力してください。(USERID_INPUT_PLEASE)';
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// 文字数を確認
|
||||||
|
if( 20 < mb_strlen($new_userid, 'UTF-8') ) {
|
||||||
|
$error_message[] = 'IDは20文字以内で入力してください。(USERID_OVER_MAX_COUNT)';
|
||||||
|
}
|
||||||
|
|
||||||
|
if(in_array($new_userid, $banuserid) === true ){
|
||||||
|
$error_message[] = 'そのIDは登録禁止になっています。(USERID_CONTAINS_PROHIBITED)';
|
||||||
|
}
|
||||||
|
|
||||||
|
if($result > 0){
|
||||||
|
$error_message[] = 'このID('.$new_userid.')は既に使用されています。他のIDを作成してください。(USERID_SHIYOUZUMI)';
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(preg_match("/^[a-zA-Z0-9_]+$/", $new_userid))){
|
||||||
|
$error_message[] = "IDは半角英数字で入力してください。(「_」は使用可能です。)(USERID_DONT_USE_WORD)";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// パスワードの入力チェック
|
||||||
|
if( empty($password) ) {
|
||||||
|
$error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if(in_array($password, $badpass) === true ){
|
||||||
|
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
|
||||||
|
}
|
||||||
|
|
||||||
|
if( 4 > mb_strlen($password, 'UTF-8') ) {
|
||||||
|
$error_message[] = 'パスワードは4文字以上である必要があります。(PASSWORD_TODOITENAI_MIN_COUNT)';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 文字数を確認
|
||||||
|
if( 256 < mb_strlen($password, 'UTF-8') ) {
|
||||||
|
$error_message[] = 'パスワードは256文字以内で入力してください。(PASSWORD_OVER_MAX_COUNT)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( empty($error_message) ) {
|
||||||
|
// トランザクション開始
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
$datetime = date("Y-m-d H:i:s");
|
||||||
|
$username = htmlentities($json_account_data["userdata"]["user_name"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$mailadds = htmlentities($json_account_data["userdata"]["mail_adds"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$profile = htmlentities($json_account_data["userdata"]["user_profile"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
$role = "user";
|
||||||
|
$admin = "none";
|
||||||
|
$hashpassword = password_hash($password, PASSWORD_DEFAULT);
|
||||||
|
$loginid = sha1(uniqid(mt_rand(), true));
|
||||||
|
|
||||||
|
// SQL作成
|
||||||
|
$stmt = $pdo->prepare("INSERT INTO account (username, userid, password, loginid, mailadds, profile, iconname, headname, role, datetime, admin) VALUES (:username, :userid, :password, :loginid, :mailadds, :profile, :iconname, :headname, :role, :datetime, :admin )");
|
||||||
|
|
||||||
|
// アイコン画像
|
||||||
|
$stmt->bindValue(':iconname', $iconName, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// ヘッダー画像
|
||||||
|
$stmt->bindValue(':headname', $headName, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// 他の値をセット
|
||||||
|
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':userid', $new_userid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':password', $hashpassword, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':loginid', $loginid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':mailadds', $mailadds, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':profile', $profile, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':role', $role, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$stmt->bindParam(':admin', $admin, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// SQLクエリの実行
|
||||||
|
$res = $stmt->execute();
|
||||||
|
|
||||||
|
// コミット
|
||||||
|
$res = $pdo->commit();
|
||||||
|
|
||||||
|
if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare("UPDATE invitation SET used = :used, datetime = :datetime WHERE code = :code;");
|
||||||
|
|
||||||
|
$true = "true";
|
||||||
|
$stmt->bindParam(':used', $true, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$stmt->bindValue(':code', $invitationcode, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// SQLクエリの実行
|
||||||
|
$res = $stmt->execute();
|
||||||
|
|
||||||
|
// コミット
|
||||||
|
$res = $pdo->commit();
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
|
||||||
|
// エラーが発生した時はロールバック
|
||||||
|
$pdo->rollBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($res) {
|
||||||
|
//ここのながい文字列はアカウント移行が完了したことを認証するためのもの!かえないでください!
|
||||||
|
$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);
|
||||||
|
$data = array();
|
||||||
|
$options = [
|
||||||
|
'http' => [
|
||||||
|
'method'=> 'GET',
|
||||||
|
'content' => http_build_query($data, '', '&')
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$Done_result = json_decode(file_get_contents($Done_Check_Link, false, stream_context_create($options)),true);
|
||||||
|
|
||||||
|
if(isset($Done_result["data"])){
|
||||||
|
$done_chk = openssl_decrypt($Done_result["data"], "AES-256-CBC", $key1_code, 0, $key2_code);
|
||||||
|
$done_data = json_decode($done_chk,true);
|
||||||
|
if($done_data["done"] == "success"){
|
||||||
|
$_SESSION['userid'] = $new_userid;
|
||||||
|
$_SESSION['done'] = true;
|
||||||
|
}else{
|
||||||
|
$_SESSION['userid'] = $new_userid;
|
||||||
|
$_SESSION['done'] = false;
|
||||||
|
}
|
||||||
|
$url = '../success';
|
||||||
|
header('Location: ' . $url, true, 303);
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
$_SESSION['userid'] = $new_userid;
|
||||||
|
$_SESSION['done'] = false;
|
||||||
|
$url = '../success';
|
||||||
|
header('Location: ' . $url, true, 303);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$error_message[] = '登録に失敗しました。(REGISTERED_DAME)';
|
||||||
|
}
|
||||||
|
|
||||||
|
// プリペアドステートメントを削除
|
||||||
|
$stmt = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = "識別コードが間違っているようです。(MIGRATION_BAD_CHECK_CODE)";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = "移行元のサーバーのuwuzuバージョンが1.3.6未満のためアカウントの移行はできません。(MIGRATION_FROM_SERVER_BAD_UWUZU_VERSION)";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = "移行元のサーバーのソフトウェアがuwuzuではありません。(MIGRATION_FROM_SERVER_NOT_UWUZU)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = "このサーバーではアカウントの移行登録を受け入れていません。(MIGRATION_SORRY)";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// データベースの接続を閉じる
|
||||||
|
$pdo = null;
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ja">
|
||||||
|
<head prefix="og:http://ogp.me/ns#">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="stylesheet" href="/css/style.css">
|
||||||
|
<script src="/js/jquery-min.js"></script>
|
||||||
|
<script src="/js/unsupported.js"></script>
|
||||||
|
<?php if(!empty(H_CAPTCHA_ONOFF && H_CAPTCHA_ONOFF == "true")){?>
|
||||||
|
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
|
||||||
|
<?php }?>
|
||||||
|
<?php if(!empty(CF_TURNSTILE_ONOFF && CF_TURNSTILE_ONOFF == "true")){?>
|
||||||
|
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
|
||||||
|
<?php }?>
|
||||||
|
<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">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<title>アカウントの移行登録 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
||||||
|
</head>
|
||||||
|
<script src="/js/back.js"></script>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="leftbox">
|
||||||
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
|
<div class="logo">
|
||||||
|
<a href="/index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
|
</div>
|
||||||
|
<?php }else{?>
|
||||||
|
<div class="logo">
|
||||||
|
<a href="/index.php"><img src="/img/uwuzulogo.svg"></a>
|
||||||
|
</div>
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
|
<div class="textbox">
|
||||||
|
<h1>アカウントの移行登録</h1>
|
||||||
|
<p>ここからアカウントの移行登録が可能です!</p>
|
||||||
|
<?php if( !empty($error_message) ): ?>
|
||||||
|
<ul class="errmsg">
|
||||||
|
<?php foreach( $error_message as $value ): ?>
|
||||||
|
<p>・ <?php echo $value; ?></p>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if(htmlspecialchars($serversettings["serverinfo"]["server_account_migration"], ENT_QUOTES, 'UTF-8') === "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="">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>新しいパスワード</p>
|
||||||
|
<div class="p2">このサーバーで使用するパスワードを入力してください。</div>
|
||||||
|
<input id="password" type="text" placeholder="" class="inbox" name="password" value="">
|
||||||
|
</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="">
|
||||||
|
</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="">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>認証コード</p>
|
||||||
|
<div class="p2">アカウント移行元のサーバーで発行された認証コードを入力してください。</div>
|
||||||
|
<input id="moto_server_account_auth" type="text" placeholder="" class="inbox" name="moto_server_account_auth" value="">
|
||||||
|
</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 htmlentities(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 htmlentities(CF_TURNSTILE_SITE_KEY);?>" data-callback="javascriptCallback" data-language="ja"></div>
|
||||||
|
</div>
|
||||||
|
<?php }?>
|
||||||
|
<?php if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){?>
|
||||||
|
<div>
|
||||||
|
<p>招待コード</p>
|
||||||
|
<div class="p2">招待コードがないとこのサーバーには登録できません。</div>
|
||||||
|
<input id="invitationcode" type="text" placeholder="" class="inbox" name="invitationcode" value="<?php if( !empty($_SESSION['invitationcode']) ){ echo htmlspecialchars( $_SESSION['invitationcode'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||||
|
</div>
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function checkForm(inputElement) {
|
||||||
|
var str = inputElement.value;
|
||||||
|
while (str.match(/[^A-Za-z\d_]/)) {
|
||||||
|
str = str.replace(/[^A-Za-z\d_]/, "");
|
||||||
|
}
|
||||||
|
inputElement.value = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
window.addEventListener('DOMContentLoaded', function(){
|
||||||
|
$('#file_upload').change(function(e) {
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#img_select').show();
|
||||||
|
$('#iconimg').attr('src', file_reader.result);
|
||||||
|
});
|
||||||
|
file_reader.readAsDataURL(e.target.files[0]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -2,9 +2,12 @@
|
|||||||
|
|
||||||
$banuseridfile = "server/banuserid.txt";
|
$banuseridfile = "server/banuserid.txt";
|
||||||
$banuserid_info = file_get_contents($banuseridfile);
|
$banuserid_info = file_get_contents($banuseridfile);
|
||||||
|
|
||||||
$banuserid = preg_split("/\r\n|\n|\r/", $banuserid_info);
|
$banuserid = preg_split("/\r\n|\n|\r/", $banuserid_info);
|
||||||
|
|
||||||
|
$badpassfile = "server/badpass.txt";
|
||||||
|
$badpass_info = file_get_contents($badpassfile);
|
||||||
|
$badpass = preg_split("/\r\n|\n|\r/", $badpass_info);
|
||||||
|
|
||||||
function createUniqId(){
|
function createUniqId(){
|
||||||
list($msec, $sec) = explode(" ", microtime());
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
$hashCreateTime = $sec.floor($msec*1000000);
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
@@ -102,9 +105,6 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset
|
|||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
|
|
||||||
|
|
||||||
//$row['userid'] = "daichimarukn";
|
|
||||||
|
|
||||||
// 空白除去
|
// 空白除去
|
||||||
$username = htmlentities($_POST['username']);
|
$username = htmlentities($_POST['username']);
|
||||||
$userid = htmlentities($_POST['userid']);
|
$userid = htmlentities($_POST['userid']);
|
||||||
@@ -116,7 +116,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$profile = htmlentities($_POST['profile']);
|
$profile = htmlentities($_POST['profile']);
|
||||||
|
|
||||||
if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){
|
if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){
|
||||||
$invitationcode = $_POST['invitationcode'];
|
$invitationcode = htmlentities($_POST['invitationcode'], ENT_QUOTES, 'UTF-8', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty(H_CAPTCHA_ONOFF && H_CAPTCHA_ONOFF == "true")){
|
if(!empty(H_CAPTCHA_ONOFF && H_CAPTCHA_ONOFF == "true")){
|
||||||
@@ -348,74 +348,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
|
$error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$weakPasswords = array(
|
if(in_array($password, $badpass) === true ){
|
||||||
"password",
|
|
||||||
"123456",
|
|
||||||
"123456789",
|
|
||||||
"12345",
|
|
||||||
"12345678",
|
|
||||||
"123123",
|
|
||||||
"1234567890",
|
|
||||||
"1234567",
|
|
||||||
"1q2w3e",
|
|
||||||
"qwerty123",
|
|
||||||
"aa12345678",
|
|
||||||
"password1",
|
|
||||||
"1234",
|
|
||||||
"qwertyuiop",
|
|
||||||
"123321",
|
|
||||||
"12321",
|
|
||||||
"qwertyui",
|
|
||||||
"abcd1234",
|
|
||||||
"zaq12wsx",
|
|
||||||
"1q2w3e4r",
|
|
||||||
"qwer1234",
|
|
||||||
"sakura",
|
|
||||||
"asdf1234",
|
|
||||||
"asdfghjkl",
|
|
||||||
"asdfghjk",
|
|
||||||
"member",
|
|
||||||
"1qaz2wsx",
|
|
||||||
"doraemon",
|
|
||||||
"makoto",
|
|
||||||
"takeshi",
|
|
||||||
"machi1",
|
|
||||||
"machida",
|
|
||||||
"machida1",
|
|
||||||
"tokyo",
|
|
||||||
"arashi",
|
|
||||||
"dropbox",
|
|
||||||
"twitter",
|
|
||||||
"elonmusk",
|
|
||||||
"xcorp",
|
|
||||||
"1234qwer",
|
|
||||||
"japan",
|
|
||||||
"nippon",
|
|
||||||
"tukareta",
|
|
||||||
"tweet",
|
|
||||||
"discord",
|
|
||||||
"misskey",
|
|
||||||
"qwerty",
|
|
||||||
"123456789",
|
|
||||||
"abc123",
|
|
||||||
"password123",
|
|
||||||
"admin",
|
|
||||||
"letmein",
|
|
||||||
"iloveyou",
|
|
||||||
"111111",
|
|
||||||
"12345678910",
|
|
||||||
"user",
|
|
||||||
"root",
|
|
||||||
"system",
|
|
||||||
// 他にも弱いパスワードを追加できます
|
|
||||||
);
|
|
||||||
|
|
||||||
function isWeakPassword($passwords) {
|
|
||||||
global $weakPasswords;
|
|
||||||
return in_array($passwords, $weakPasswords);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isWeakPassword($password)) {
|
|
||||||
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
|
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -556,11 +489,11 @@ $pdo = null;
|
|||||||
<div class="leftbox">
|
<div class="leftbox">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src="img/uwuzulogo.svg"></a>
|
<a href="index.php"><img src="img/uwuzulogo.svg"></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
|
||||||
@@ -582,11 +515,12 @@ $pdo = null;
|
|||||||
|
|
||||||
<div id="wrap">
|
<div id="wrap">
|
||||||
<div class="iconimg">
|
<div class="iconimg">
|
||||||
<img src="img/deficon/icon.png">
|
<img id="iconimg" src="img/deficon/icon.png">
|
||||||
</div>
|
</div>
|
||||||
<label class="irobutton" for="file_upload">ファイル選択
|
<label class="irobutton" for="file_upload">ファイル選択
|
||||||
<input type="file" id="file_upload" name="image" accept="image/*">
|
<input type="file" id="file_upload" name="image" accept="image/*">
|
||||||
</label>
|
</label>
|
||||||
|
<p id="img_select" style="display:none;">画像を選択しました</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -623,7 +557,7 @@ $pdo = null;
|
|||||||
<div>
|
<div>
|
||||||
<p>プロフィール</p>
|
<p>プロフィール</p>
|
||||||
<div class="p2">プロフィールページに掲載され公開されます。<br>※サービス管理者が確認できます。</div>
|
<div class="p2">プロフィールページに掲載され公開されます。<br>※サービス管理者が確認できます。</div>
|
||||||
<input id="profile" type="text" placeholder="" class="inbox" name="profile" value="<?php if( !empty($_SESSION['profile']) ){ echo htmlspecialchars( $_SESSION['profile'], ENT_QUOTES, 'UTF-8'); } ?>">
|
<textarea id="profile" type="text" placeholder="" class="inbox" name="profile"><?php if( !empty($_SESSION['profile']) ){ echo htmlspecialchars( $_SESSION['profile'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn_area">
|
<div class="btn_area">
|
||||||
@@ -676,22 +610,14 @@ function checkForm(inputElement) {
|
|||||||
|
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', function(){
|
window.addEventListener('DOMContentLoaded', function(){
|
||||||
|
$('#file_upload').change(function(e) {
|
||||||
// ファイルが選択されたら実行
|
var file_reader = new FileReader();
|
||||||
document.getElementById("file_upload").addEventListener('change', function(e){
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#img_select').show();
|
||||||
var file_reader = new FileReader();
|
$('#iconimg').attr('src', file_reader.result);
|
||||||
|
});
|
||||||
// ファイルの読み込みを行ったら実行
|
file_reader.readAsDataURL(e.target.files[0]);
|
||||||
file_reader.addEventListener('load', function(e) {
|
});
|
||||||
console.log(e.target.result);
|
|
||||||
const element = document.querySelector('#wrap');
|
|
||||||
const createElement = '<p>画像を選択しました。</p>';
|
|
||||||
element.insertAdjacentHTML('afterend', createElement);
|
|
||||||
});
|
|
||||||
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
+167
@@ -0,0 +1,167 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
require('db.php');
|
||||||
|
|
||||||
|
session_name('uwuzu_s_id');
|
||||||
|
session_set_cookie_params(0, '', '', true, true);
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
|
||||||
|
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset($_COOKIE['loginid']) && isset($_SESSION['userid'])) {
|
||||||
|
$option = 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);
|
||||||
|
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
||||||
|
$acck->bindValue(':userid', $_SESSION['userid']);
|
||||||
|
$acck->execute();
|
||||||
|
$acck_data = $acck->fetch();
|
||||||
|
if(!empty($acck_data)){
|
||||||
|
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_SESSION['userid'] === $acck_data["userid"] ){
|
||||||
|
header("Location: home/index.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true && isset($_COOKIE['loginid']) && isset($_COOKIE['userid'])) {
|
||||||
|
$option = 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);
|
||||||
|
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
||||||
|
$acck->bindValue(':userid', $_COOKIE['userid']);
|
||||||
|
$acck->execute();
|
||||||
|
$acck_data = $acck->fetch();
|
||||||
|
if(!empty($acck_data)){
|
||||||
|
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_COOKIE['userid'] === $acck_data["userid"] ){
|
||||||
|
header("Location: home/index.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$serversettings_file = "server/serversettings.ini";
|
||||||
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
|
//-------------------------
|
||||||
|
$softwarefile = "server/uwuzuinfo.txt";
|
||||||
|
$softwaredata = file_get_contents($softwarefile);
|
||||||
|
|
||||||
|
$softwaredata = explode( "\n", $softwaredata );
|
||||||
|
$cnt = count( $softwaredata );
|
||||||
|
for( $i=0;$i<$cnt;$i++ ){
|
||||||
|
$uwuzuinfo[$i] = ($softwaredata[$i]);
|
||||||
|
}
|
||||||
|
//-------------------------
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
|
||||||
|
//------------------------
|
||||||
|
|
||||||
|
// データベースに接続
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname=' . DB_NAME . ';host=' . DB_HOST, DB_USER, DB_PASS, $option);
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<html lang="ja">
|
||||||
|
<head prefix="og:http://ogp.me/ns#">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<!--OGPはじまり-->
|
||||||
|
<meta property="og:title" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>">
|
||||||
|
<meta property="og:description" content="<?php echo htmlentities($serverinfo);?>">
|
||||||
|
<meta property="og:url" content="https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8'); ?>/">
|
||||||
|
<meta property="og:image" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8');?>">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:site_name" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>">
|
||||||
|
|
||||||
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
|
<meta name="twitter:title" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>"/>
|
||||||
|
<meta name="twitter:description" content="<?php echo htmlentities($serverinfo);?>"/>
|
||||||
|
<!--OGPここまで-->
|
||||||
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
<script src="js/jquery-min.js"></script>
|
||||||
|
<script src="js/unsupported.js"></script>
|
||||||
|
<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="manifest" href="manifest/manifest.json" />
|
||||||
|
<script>
|
||||||
|
if ("serviceWorker" in navigator) {
|
||||||
|
navigator.serviceWorker.register("sw.js").then(reg => {
|
||||||
|
console.log("ServiceWorker OK", reg);
|
||||||
|
}).catch(err => {
|
||||||
|
console.log("ServiceWorker BAD", err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<title>アカウント登録<?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
|
||||||
|
<script src="js/back.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="leftbox">
|
||||||
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
|
<div class="logo">
|
||||||
|
<a href="index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
|
</div>
|
||||||
|
<?php }else{?>
|
||||||
|
<div class="logo">
|
||||||
|
<a href="index.php"><img src="img/uwuzulogo.svg"></a>
|
||||||
|
</div>
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
|
<div class="textbox">
|
||||||
|
|
||||||
|
<?php if( !empty($error_message) ): ?>
|
||||||
|
<ul class="errmsg">
|
||||||
|
<?php foreach( $error_message as $value ): ?>
|
||||||
|
<p>・ <?php echo $value; ?></p>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
<h1>アカウントの登録方法</h1>
|
||||||
|
<p>アカウントの登録方法を選択してください!</p>
|
||||||
|
<div class="p2">通常のアカウント登録では新規アカウント登録です!<br>他のuwuzuサーバーからアカウントを移行して登録する場合はアカウントの移行登録を選択してください。</div>
|
||||||
|
<div class="formarea">
|
||||||
|
<a href="new.php" class="irobutton">新規アカウント登録</a>
|
||||||
|
<?php if(htmlspecialchars($serversettings["serverinfo"]["server_account_migration"], ENT_QUOTES, 'UTF-8') === "true"){?>
|
||||||
|
<a href="migration/" class="sirobutton">アカウントの移行登録</a>
|
||||||
|
<?php }?>
|
||||||
|
</div>
|
||||||
|
<div class="btnbox">
|
||||||
|
<a href="index.php" class="sirobutton">戻る</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="p2" style="margin-top:8px;margin-bottom:0px;"><?php echo $uwuzuinfo[0];?> Version <?php echo $uwuzuinfo[1];?></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -73,7 +73,7 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
|
|||||||
$followQuery->bindValue(':userid', $userid);
|
$followQuery->bindValue(':userid', $userid);
|
||||||
$followQuery->execute();
|
$followQuery->execute();
|
||||||
$followData = $followQuery->fetch();
|
$followData = $followQuery->fetch();
|
||||||
$follow = $followData['follow'];
|
$follow = $followData['follow']/*.",".$userid*/;
|
||||||
$followList = explode(',', $follow);
|
$followList = explode(',', $follow);
|
||||||
|
|
||||||
// フォローしているユーザーの投稿を取得し、日時順に並び替える
|
// フォローしているユーザーの投稿を取得し、日時順に並び替える
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
|
|||||||
|
|
||||||
if(!empty($messages)){
|
if(!empty($messages)){
|
||||||
foreach ($messages as $value) {
|
foreach ($messages as $value) {
|
||||||
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) {
|
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8', false))) {
|
||||||
if(!($value["role"] === "ice")){
|
if(!($value["role"] === "ice")){
|
||||||
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
|
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,13 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
|
|||||||
|
|
||||||
if(!(empty($result2["loginid"]))){
|
if(!(empty($result2["loginid"]))){
|
||||||
if($result2["loginid"] === $loginid){
|
if($result2["loginid"] === $loginid){
|
||||||
|
|
||||||
|
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist,bookmark FROM account WHERE userid = :userid");
|
||||||
|
$aduserinfoQuery->bindValue(':userid', htmlentities($userid));
|
||||||
|
$aduserinfoQuery->execute();
|
||||||
|
$res = $aduserinfoQuery->fetch();
|
||||||
|
$myblocklist = htmlentities($res["blocklist"]);
|
||||||
|
|
||||||
$userid = htmlentities($_GET['userid']);
|
$userid = htmlentities($_GET['userid']);
|
||||||
|
|
||||||
$itemsPerPage = 15; // 1ページあたりの投稿数
|
$itemsPerPage = 15; // 1ページあたりの投稿数
|
||||||
|
|||||||
+1
-1
@@ -74,7 +74,7 @@ class MessageDisplay {
|
|||||||
echo ' <div class="nsfw_main" data-uniqid="' . htmlentities($this->value['uniqid'], ENT_QUOTES, 'UTF-8', false) . '">';
|
echo ' <div class="nsfw_main" data-uniqid="' . htmlentities($this->value['uniqid'], ENT_QUOTES, 'UTF-8', false) . '">';
|
||||||
echo ' <div class="block">';
|
echo ' <div class="block">';
|
||||||
}
|
}
|
||||||
echo ' <p>' . processMarkdownAndWrapEmptyLines(replaceEmojisWithImages(replaceURLsWithLinks(nl2br(htmlentities($this->value['ueuse'], ENT_QUOTES, 'UTF-8', false))))) . '</h1></h2></h3></font></center></p>';
|
echo ' <p>' . replaceEmojisWithImages(processMarkdownAndWrapEmptyLines(replaceURLsWithLinks(nl2br(htmlentities($this->value['ueuse'], ENT_QUOTES, 'UTF-8', false))))) . '</h1></h2></h3></font></center></p>';
|
||||||
|
|
||||||
if (!empty($this->value['photo4']) && $this->value['photo4'] !== 'none') {
|
if (!empty($this->value['photo4']) && $this->value['photo4'] !== 'none') {
|
||||||
echo ' <div class="photo4">';
|
echo ' <div class="photo4">';
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ $pdo = null;
|
|||||||
<summary><?php echo htmlentities($value["title"]);?></summary>
|
<summary><?php echo htmlentities($value["title"]);?></summary>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="p2">本文</div>
|
<div class="p2">本文</div>
|
||||||
<p><?php echo htmlentities($value["note"]);?></p>
|
<p><?php echo nl2br(htmlentities($value["note"]));?></p>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="p2">配信日時</div>
|
<div class="p2">配信日時</div>
|
||||||
<p><?php echo date("Y年m月d日 H:i", strtotime(htmlentities($value["datetime"])));?></p>
|
<p><?php echo date("Y年m月d日 H:i", strtotime(htmlentities($value["datetime"])));?></p>
|
||||||
|
|||||||
@@ -0,0 +1,415 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
function random_token($length = 64)
|
||||||
|
{
|
||||||
|
return substr(str_shuffle('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, $length);
|
||||||
|
}
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
function random($length){
|
||||||
|
return substr(str_shuffle('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'), 0, $length);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
require('../db.php');
|
||||||
|
|
||||||
|
// 変数の初期化
|
||||||
|
$datetime = array();
|
||||||
|
$user_name = null;
|
||||||
|
$message = array();
|
||||||
|
$message_data = null;
|
||||||
|
$error_message = array();
|
||||||
|
$pdo = null;
|
||||||
|
$stmt = null;
|
||||||
|
$res = null;
|
||||||
|
$option = null;
|
||||||
|
|
||||||
|
session_name('uwuzu_s_id');
|
||||||
|
session_set_cookie_params(0, '', '', true, true);
|
||||||
|
session_start();
|
||||||
|
session_regenerate_id(true);
|
||||||
|
|
||||||
|
// データベースに接続
|
||||||
|
try {
|
||||||
|
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
||||||
|
|
||||||
|
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
||||||
|
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
|
||||||
|
$passQuery->execute();
|
||||||
|
$res = $passQuery->fetch();
|
||||||
|
if(empty($res["userid"])){
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
||||||
|
// セッションに値をセット
|
||||||
|
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
|
||||||
|
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
|
||||||
|
$loginid = htmlentities($res["loginid"]);
|
||||||
|
$role = htmlentities($res["role"]);
|
||||||
|
$sacinfo = htmlentities($res["sacinfo"]);
|
||||||
|
$myblocklist = htmlentities($res["blocklist"]);
|
||||||
|
$myfollowlist = htmlentities($res["follow"]);
|
||||||
|
$_SESSION['admin_login'] = true;
|
||||||
|
$_SESSION['userid'] = $userid;
|
||||||
|
$_SESSION['username'] = $username;
|
||||||
|
$_SESSION['loginid'] = $res["loginid"];
|
||||||
|
setcookie('userid', $userid, [
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('username', $username,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('loginid', $res["loginid"],[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('admin_login', true,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
}else{
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
|
||||||
|
|
||||||
|
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
||||||
|
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
|
||||||
|
$passQuery->execute();
|
||||||
|
$res = $passQuery->fetch();
|
||||||
|
if(empty($res["userid"])){
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
|
||||||
|
// セッションに値をセット
|
||||||
|
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット
|
||||||
|
$username = htmlentities($res['username']); // クッキーから取得した値をセット
|
||||||
|
$loginid = htmlentities($res["loginid"]);
|
||||||
|
$role = htmlentities($res["role"]);
|
||||||
|
$sacinfo = htmlentities($res["sacinfo"]);
|
||||||
|
$myblocklist = htmlentities($res["blocklist"]);
|
||||||
|
$myfollowlist = htmlentities($res["follow"]);
|
||||||
|
$_SESSION['admin_login'] = true;
|
||||||
|
$_SESSION['userid'] = $userid;
|
||||||
|
$_SESSION['username'] = $username;
|
||||||
|
$_SESSION['loginid'] = $res["loginid"];
|
||||||
|
setcookie('userid', $userid,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('username', $username,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('loginid', $res["loginid"],[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('admin_login', true,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
}else{
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// ログインが許可されていない場合、ログインページにリダイレクト
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if(empty($userid)){
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if(empty($username)){
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
|
$notiQuery->execute();
|
||||||
|
$notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
$notificationcount = $notiData['notification_count'];
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
|
||||||
|
// データベース接続の設定
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$userQuery = $dbh->prepare("SELECT userid,role,datetime FROM account WHERE userid = :userid");
|
||||||
|
$userQuery->bindValue(':userid', $userid);
|
||||||
|
$userQuery->execute();
|
||||||
|
$userData = $userQuery->fetch();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !empty($_POST['migration_submit']) ) {
|
||||||
|
|
||||||
|
$server_domain = htmlentities($_POST['server_domain']);
|
||||||
|
|
||||||
|
if( empty($server_domain) ) {
|
||||||
|
$error_message[] = '移行先のサーバードメインを入力してください。(INPUT_PLEASE)';
|
||||||
|
}else{
|
||||||
|
$domain_response = @file_get_contents("https://".$server_domain."/");
|
||||||
|
if (empty($domain_response)) {
|
||||||
|
$error_message[] = '入力されたドメインに接続できませんでした。(INPUT_PLEASE)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($server_domain == $domain){
|
||||||
|
$error_message[] = 'このサーバーに移行することはできません。(MIGRATION_ONAJI_SERVER_DAME)';
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($error_message)){
|
||||||
|
$data = array();
|
||||||
|
$options = [
|
||||||
|
'http' => [
|
||||||
|
'method'=> 'POST',
|
||||||
|
'content' => http_build_query($data, '', '&')
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$Check_result = json_decode(file_get_contents("http://".$server_domain."/api/serverinfo-api", false, stream_context_create($options)),true);
|
||||||
|
if($Check_result["software"]["name"] == "uwuzu"){
|
||||||
|
$version = str_pad(str_replace('.', '', $Check_result["software"]["version"]), 4, 0, STR_PAD_RIGHT);
|
||||||
|
|
||||||
|
if($version >= 1360){
|
||||||
|
if($Check_result["server_info"]["account_migration"] == "true"){
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
try {
|
||||||
|
$account = $userid;
|
||||||
|
$migration_code = createUniqId();
|
||||||
|
$encryption_key = random(32);
|
||||||
|
$encryption_ivkey = random(16);
|
||||||
|
$datetime = date("Y-m-d H:i:s");
|
||||||
|
$domain = $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->bindParam(':account', htmlentities($account, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':domain', htmlentities($domain, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':migration_code', htmlentities($migration_code, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':encryption_key', htmlentities($encryption_key, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':encryption_ivkey', htmlentities($encryption_ivkey, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':datetime', htmlentities($datetime, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$res = $stmt->execute();
|
||||||
|
|
||||||
|
$res = $pdo->commit();
|
||||||
|
|
||||||
|
} catch(Exception $e) {
|
||||||
|
$pdo->rollBack();
|
||||||
|
}
|
||||||
|
if($res) {
|
||||||
|
$_SESSION["migration_code"] = htmlentities($migration_code, ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$_SESSION["encryption_key"] = htmlentities($encryption_key, ENT_QUOTES, 'UTF-8', false);
|
||||||
|
$_SESSION["encryption_ivkey"] = htmlentities($encryption_ivkey, ENT_QUOTES, 'UTF-8', false);
|
||||||
|
header("Location: account_migration_done.php");
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = "移行先のサーバーがアカウントの移行登録を拒否しているためアカウントの移行はできません。(MIGRATION_TO_SERVER_IYADA)";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = "移行先のサーバーのuwuzuバージョンが1.3.6未満のためアカウントの移行はできません。(MIGRATION_TO_SERVER_BAD_UWUZU_VERSION)";
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = "移行先のサーバーのソフトウェアがuwuzuではありません。(MIGRATION_TO_SERVER_NOT_UWUZU)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !empty($_POST['migration_cancel_submit']) ) {
|
||||||
|
$account = $userid;
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
try {
|
||||||
|
$deleteQuery = $pdo->prepare("DELETE FROM migration WHERE account = :account");
|
||||||
|
$deleteQuery->bindValue(':account', htmlentities($account, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR);
|
||||||
|
$res = $deleteQuery->execute();
|
||||||
|
$res = $pdo->commit();
|
||||||
|
} catch(Exception $e) {
|
||||||
|
$pdo->rollBack();
|
||||||
|
}
|
||||||
|
if($res) {
|
||||||
|
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||||
|
header("Location: ".$url."");
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($pdo))){
|
||||||
|
$CheckQuery = $pdo->prepare("SELECT COUNT(*) as count FROM migration WHERE account = :account");
|
||||||
|
$CheckQuery->bindValue(':account', $userid);
|
||||||
|
$CheckQuery->execute();
|
||||||
|
$CheckData = $CheckQuery->fetch(PDO::FETCH_ASSOC);
|
||||||
|
$CheckCount = $CheckData['count'];
|
||||||
|
if(!(empty($CheckCount))){
|
||||||
|
if((int)$CheckCount > 0){
|
||||||
|
$migration_start = true;
|
||||||
|
}else{
|
||||||
|
$migration_start = false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$migration_start = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$today = strtotime(date("Y-m-d"));
|
||||||
|
$accountDate = new DateTime($userData["datetime"]);
|
||||||
|
$day = strtotime($accountDate->format('Y-m-d'));
|
||||||
|
$account_date = ($today - $day) / (60 * 60 * 24);
|
||||||
|
if($account_date > 30){
|
||||||
|
$migration = true;
|
||||||
|
}else{
|
||||||
|
$migration = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
require('../logout/logout.php');
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ja">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="stylesheet" href="../css/home.css">
|
||||||
|
<script src="../js/unsupported.js"></script>
|
||||||
|
<script src="../js/console_notice.js"></script>
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<script src="../js/jquery-min.js"></script>
|
||||||
|
<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">
|
||||||
|
<title>アカウントの移行 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<?php require('../require/leftbox.php');?>
|
||||||
|
<main>
|
||||||
|
|
||||||
|
<?php if( !empty($error_message) ): ?>
|
||||||
|
<ul class="errmsg">
|
||||||
|
<?php foreach( $error_message as $value ): ?>
|
||||||
|
<p>・ <?php echo $value; ?></p>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||||
|
<h1>アカウントの移行</h1>
|
||||||
|
<p>アカウントの移行をすると以下のデータが引き継がれます。<br>フォロー・フォロワー、いいねなどの情報は引き継がれません。<br>ユーザーID、パスワードや二段階認証の設定は移行先サーバーで再度行う必要があります。<br>移行後30日は別のサーバーに移行することはできません。<p>
|
||||||
|
<p>- アカウント名<br>
|
||||||
|
- プロフィール<br>
|
||||||
|
- アイコン<br>
|
||||||
|
- ヘッダー<br>
|
||||||
|
- メールアドレス</p>
|
||||||
|
<?php
|
||||||
|
if($migration == true){?>
|
||||||
|
<?php if($userData['role']==='ice'){ ?>
|
||||||
|
<p>このアカウントは凍結されているため移行できません。</p>
|
||||||
|
<?php }else{ ?>
|
||||||
|
<?php if($migration_start == true){?>
|
||||||
|
<div class="errmsg">
|
||||||
|
<p>既に移行作業は開始されているようです。<br>もし以降に必要な情報をなくしてしまった場合はもう一度最初から作業をやり直す必要があります!</p>
|
||||||
|
</div>
|
||||||
|
<input type="submit" class = "irobutton" name="migration_cancel_submit" value="アカウントの移行を取り消す">
|
||||||
|
<?php }else{?>
|
||||||
|
<div>
|
||||||
|
<p>移行先サーバーのドメイン</p>
|
||||||
|
<div class="p2">uwuzu v1.3.6以上が使用されているサーバーに対応します。</div>
|
||||||
|
<input id="server_domain" type="text" placeholder="uwuzu.example.com" class="inbox" name="server_domain" value="">
|
||||||
|
</div>
|
||||||
|
<input type="submit" class = "irobutton" name="migration_submit" value="アカウントの移行を開始">
|
||||||
|
<?php }?>
|
||||||
|
<?php }?>
|
||||||
|
<?php }else{?>
|
||||||
|
<p>アカウントを作成してから30日以上経過していないとアカウントの移行はできません。</p>
|
||||||
|
<?php }?>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="btnbox">
|
||||||
|
<a href="javascript:history.back();" class="sirobutton">戻る</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<?php require('../require/rightbox.php');?>
|
||||||
|
<?php require('../require/botbox.php');?>
|
||||||
|
<?php require('../require/noscript_modal.php');?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$(function(){
|
||||||
|
$("input"). keydown(function(e) {
|
||||||
|
if ((e.which && e.which === 13) || (e.keyCode && e.keyCode === 13)) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,242 @@
|
|||||||
|
<?php
|
||||||
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
|
|
||||||
|
require('../db.php');
|
||||||
|
|
||||||
|
session_name('uwuzu_s_id');
|
||||||
|
session_set_cookie_params(0, '', '', true, true);
|
||||||
|
session_start();
|
||||||
|
session_regenerate_id(true);
|
||||||
|
|
||||||
|
// 変数の初期化
|
||||||
|
$current_date = null;
|
||||||
|
$message_array = array();
|
||||||
|
$error_message = array();
|
||||||
|
$authcode = array();
|
||||||
|
$pdo = null;
|
||||||
|
$stmt = null;
|
||||||
|
$res = null;
|
||||||
|
$option = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
||||||
|
|
||||||
|
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
||||||
|
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
|
||||||
|
$passQuery->execute();
|
||||||
|
$res = $passQuery->fetch();
|
||||||
|
if(empty($res["userid"])){
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
||||||
|
// セッションに値をセット
|
||||||
|
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
|
||||||
|
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
|
||||||
|
$loginid = htmlentities($res["loginid"]);
|
||||||
|
$role = htmlentities($res["role"]);
|
||||||
|
$sacinfo = htmlentities($res["sacinfo"]);
|
||||||
|
$myblocklist = htmlentities($res["blocklist"]);
|
||||||
|
$myfollowlist = htmlentities($res["follow"]);
|
||||||
|
$_SESSION['admin_login'] = true;
|
||||||
|
$_SESSION['userid'] = $userid;
|
||||||
|
$_SESSION['username'] = $username;
|
||||||
|
$_SESSION['loginid'] = $res["loginid"];
|
||||||
|
setcookie('userid', $userid, [
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('username', $username,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('loginid', $res["loginid"],[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('admin_login', true,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
}else{
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
|
||||||
|
|
||||||
|
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
||||||
|
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
|
||||||
|
$passQuery->execute();
|
||||||
|
$res = $passQuery->fetch();
|
||||||
|
if(empty($res["userid"])){
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
|
||||||
|
// セッションに値をセット
|
||||||
|
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット
|
||||||
|
$username = htmlentities($res['username']); // クッキーから取得した値をセット
|
||||||
|
$loginid = htmlentities($res["loginid"]);
|
||||||
|
$role = htmlentities($res["role"]);
|
||||||
|
$sacinfo = htmlentities($res["sacinfo"]);
|
||||||
|
$myblocklist = htmlentities($res["blocklist"]);
|
||||||
|
$myfollowlist = htmlentities($res["follow"]);
|
||||||
|
$_SESSION['admin_login'] = true;
|
||||||
|
$_SESSION['userid'] = $userid;
|
||||||
|
$_SESSION['username'] = $username;
|
||||||
|
$_SESSION['loginid'] = $res["loginid"];
|
||||||
|
setcookie('userid', $userid,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('username', $username,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('loginid', $res["loginid"],[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
setcookie('admin_login', true,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 14,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
}else{
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// ログインが許可されていない場合、ログインページにリダイレクト
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if(empty($userid)){
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if(empty($username)){
|
||||||
|
header("Location: ../login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
|
$notiQuery->execute();
|
||||||
|
$notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
$notificationcount = $notiData['notification_count'];
|
||||||
|
|
||||||
|
require('../logout/logout.php');
|
||||||
|
|
||||||
|
if(isset($_SESSION["migration_code"]) && isset($_SESSION["encryption_key"]) && isset($_SESSION["encryption_ivkey"])){
|
||||||
|
if(!(empty($_SESSION["migration_code"]) && empty($_SESSION["encryption_key"]) && empty($_SESSION["encryption_ivkey"]))){
|
||||||
|
$migration_code = $_SESSION["migration_code"];
|
||||||
|
$key1 = $_SESSION["encryption_key"];
|
||||||
|
$key2 = $_SESSION["encryption_ivkey"];
|
||||||
|
$key = $key1.$key2;
|
||||||
|
}else{
|
||||||
|
$migration_code = "再表示はできません。";
|
||||||
|
$key = "再表示はできません。";
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION["migration_code"] = array();
|
||||||
|
$_SESSION["encryption_key"] = array();
|
||||||
|
$_SESSION["encryption_ivkey"] = array();
|
||||||
|
}else{
|
||||||
|
$migration_code = "再表示はできません。";
|
||||||
|
$key = "再表示はできません。";
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ja">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="stylesheet" href="../css/home.css">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<script src="../js/jquery-min.js"></script>
|
||||||
|
<script src="../js/unsupported.js"></script>
|
||||||
|
<script src="../js/console_notice.js"></script>
|
||||||
|
<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">
|
||||||
|
<title>アカウント移行準備完了 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8',false);?></title>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<?php require('../require/leftbox.php');?>
|
||||||
|
<main>
|
||||||
|
|
||||||
|
<?php if( !empty($error_message) ): ?>
|
||||||
|
<ul class="errmsg">
|
||||||
|
<?php foreach( $error_message as $value ): ?>
|
||||||
|
<p>・ <?php echo $value; ?></p>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div class="emojibox">
|
||||||
|
<h1>アカウントの移行準備完了</h1>
|
||||||
|
<div class="formarea">
|
||||||
|
<p>アカウントの移行準備が完了しました!</p>
|
||||||
|
<p>以降に必要な情報は以下のものです。ここから先は移行先のサーバーで作業を行ってください。</p>
|
||||||
|
<ul class="errmsg">
|
||||||
|
<p>以下の情報はご自身以外の方に絶対に公開しないでください!<br>このページを離れるとこの情報を再度表示することはできません。</p>
|
||||||
|
</ul>
|
||||||
|
<p>識別コード : <?php echo htmlentities($migration_code, ENT_QUOTES, 'UTF-8',false);?><br>
|
||||||
|
認証コード : <?php echo htmlentities($key, ENT_QUOTES, 'UTF-8',false);?><br>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a href="index" class="irobutton">戻る</a>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<?php require('../require/rightbox.php');?>
|
||||||
|
<?php require('../require/botbox.php');?>
|
||||||
|
<?php require('../require/noscript_modal.php');?>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
function createUniqId(){
|
||||||
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
$hashCreateTime = $sec.floor($msec*1000000);
|
||||||
|
|
||||||
|
$hashCreateTime = strrev($hashCreateTime);
|
||||||
|
|
||||||
|
return base_convert($hashCreateTime,10,36);
|
||||||
|
}
|
||||||
|
|
||||||
|
require("../function/function.php");
|
||||||
|
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
|
||||||
|
header( 'Cache-Control: post-check=0, pre-check=0', FALSE );
|
||||||
|
header( 'Pragma: no-cache' );
|
||||||
|
if(isset($_SERVER['HTTP_REFERER'])){
|
||||||
|
$back = htmlentities($_SERVER['HTTP_REFERER']);
|
||||||
|
}else{
|
||||||
|
$back = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . "/index.php";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<script src="../js/jquery-min.js?v=<?php echo createUniqId();?>"></script>
|
||||||
|
<script src="../js/unsupported.js?v=<?php echo createUniqId();?>"></script>
|
||||||
|
<script src="../js/console_notice.js?v=<?php echo createUniqId();?>"></script>
|
||||||
|
<script src="../js/nsfw_event.js?v=<?php echo createUniqId();?>"></script>
|
||||||
|
<link rel="manifest" href="../manifest/manifest.json?v=<?php echo createUniqId();?>" />
|
||||||
|
<link rel="stylesheet" href="../css/home.css?v=<?php echo createUniqId();?>">
|
||||||
|
<title>キャッシュクリア中</title>
|
||||||
|
</head>
|
||||||
|
<script>
|
||||||
|
window.addEventListener('load', function(){
|
||||||
|
window.location.href = "<?php echo $back?>";
|
||||||
|
});
|
||||||
|
</script>
|
||||||
+34
-29
@@ -190,7 +190,7 @@ if( !empty($pdo) ) {
|
|||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
));
|
));
|
||||||
|
|
||||||
$userQuery = $dbh->prepare("SELECT userid,token FROM account WHERE userid = :userid");
|
$userQuery = $dbh->prepare("SELECT userid,token,role FROM account WHERE userid = :userid");
|
||||||
$userQuery->bindValue(':userid', $userid);
|
$userQuery->bindValue(':userid', $userid);
|
||||||
$userQuery->execute();
|
$userQuery->execute();
|
||||||
$userData = $userQuery->fetch();
|
$userData = $userQuery->fetch();
|
||||||
@@ -478,6 +478,10 @@ if( !empty($_POST['token_off_submit']) ) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !empty($_POST['cache_submit']) ) {
|
||||||
|
header("Location: cache_clear.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
require('../logout/logout.php');
|
require('../logout/logout.php');
|
||||||
|
|
||||||
@@ -515,6 +519,28 @@ require('../logout/logout.php');
|
|||||||
<p>下のセッショントークン再生成ボタンを押すと全てのログイン中のデバイスからログアウトされます。<br>再度uwuzu使用するにはログインが必須になります。</p>
|
<p>下のセッショントークン再生成ボタンを押すと全てのログイン中のデバイスからログアウトされます。<br>再度uwuzu使用するにはログインが必須になります。</p>
|
||||||
<input type="submit" class = "irobutton" name="session_submit" value="セッショントークン再生成">
|
<input type="submit" class = "irobutton" name="session_submit" value="セッショントークン再生成">
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h1>キャッシュクリア</h1>
|
||||||
|
<p>下のボタンを押すことでキャッシュクリアが可能です。</p>
|
||||||
|
<div class="p2">この機能は試験的なものであり、正常に動作しない可能性があります。</div>
|
||||||
|
<input type="submit" class = "irobutton" name="cache_submit" value="キャッシュクリア">
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h1>チュートリアル</h1>
|
||||||
|
<p>uwuzuの基礎的なチュートリアルを行うことができます!</p>
|
||||||
|
<input type="button" class = "irobutton" id="tutorial" value="チュートリアル">
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<h1>他のサーバーへアカウント移行</h1>
|
||||||
|
<p>uwuzuサーバー同士でのアカウント移行が可能になりました!</p>
|
||||||
|
<?php if($userData['token']==='ice'){ ?>
|
||||||
|
<p>このアカウントは凍結されているため移行できません。</p>
|
||||||
|
<?php }else{ ?>
|
||||||
|
<a href="account_migration" class="irobutton">アカウント移行</a>
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<h1>アカウント削除</h1>
|
<h1>アカウント削除</h1>
|
||||||
<p>アカウント誤削除を防ぐため下の入力ボックスにご自身のユーザーIDを入力する必要があります。</p>
|
<p>アカウント誤削除を防ぐため下の入力ボックスにご自身のユーザーIDを入力する必要があります。</p>
|
||||||
@@ -529,39 +555,14 @@ require('../logout/logout.php');
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<h1>API</h1>
|
<h1>API</h1>
|
||||||
<p>APIの簡単な使用法です。</p>
|
<p>APIの使用方法はuwuzu.comよりAPIドキュメントをご確認ください。</p>
|
||||||
<hr>
|
|
||||||
<li>サーバー情報取得API</li>
|
|
||||||
<div class="p2">https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8');?>/api/serverinfo-api</div>
|
|
||||||
<p>これによりサーバーの各種情報を取得できます。</p>
|
|
||||||
<hr>
|
|
||||||
<li>ユーザー情報取得API</li>
|
|
||||||
<div class="p2">https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8');?>/api/bot-api?token=[アクセストークン]&type=getuser_from_userid&userid=[ユーザーID]</div>
|
|
||||||
<p>これによりユーザーのユーザーネーム(user_name)、プロフィール(profile)、登録日時(registered_date)、フォローしている人一覧(follow)、フォロワー一覧(follower)、フォロー・フォロワー数(follow_cnt,follower_cnt)が取得できます。</p>
|
|
||||||
<hr>
|
|
||||||
<li>単独投稿取得API</li>
|
|
||||||
<div class="p2">https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8');?>/api/bot-api?token=[アクセストークン]&type=getueuse&ueuseid=[投稿の詳細ページのリンクより投稿のID(!より後、~より手前の文字列)]</div>
|
|
||||||
<p>これにより投稿内容(ueuse)と、ユーザーネーム(user_name)、ユーザーID(userid)、投稿ID(uniqid)、写真・動画URL(photo1,photo2,video1)、いいねした人一覧(favorite)、いいね数(favorite_cnt)、投稿日時(datetime)、追記内容(abi)、追記日時(abidatetime)が取得できます。</p>
|
|
||||||
<hr>
|
|
||||||
<li>ローカルタイムライン投稿取得API</li>
|
|
||||||
<div class="p2">https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8');?>/api/bot-api?token=[アクセストークン]&type=getltl&limit=[取得件数]&page=[ページ切り替え]</div>
|
|
||||||
<p>これにより投稿内容(ueuse)と、ユーザーネーム(user_name)、ユーザーID(userid)、投稿ID(uniqid)、写真・動画URL(photo1,photo2,video1)、いいねした人一覧(favorite)、いいね数(favorite_cnt)、投稿日時(datetime)、追記内容(abi)、追記日時(abidatetime)が取得できます。<br>page=は指定しなくても動作します。(https://[ドメイン名(uwuzu.netなど)]/api/ltl-api?limit=[取得件数])</p>
|
|
||||||
<hr>
|
|
||||||
<li>投稿API</li>
|
|
||||||
<div class="p2">https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8');?>/api/bot-api?token=[アクセストークン]&type=post&ueuse=[投稿の内容]</div>
|
|
||||||
<hr>
|
|
||||||
<li>アクセストークンからユーザー情報取得API</li>
|
|
||||||
<div class="p2">https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8');?>/api/bot-api?token=[アクセストークン]&type=getuser</div>
|
|
||||||
<hr>
|
|
||||||
<li>返信API</li>
|
|
||||||
<div class="p2">https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8');?>/api/bot-api?token=[アクセストークン]&type=reply&uniqid=[返信先のuniqid]&ueuse=[返信の内容]</div>
|
|
||||||
<hr>
|
|
||||||
<?php
|
<?php
|
||||||
if(empty($userData['token'])){
|
if(empty($userData['token'])){
|
||||||
?>
|
?>
|
||||||
<p>以下のボタンよりアクセストークンを取得すると使用できます。<br>アクセストークンは一度発行すると作り直すまで再度確認はできません。また、絶対に他人に知られないように保護してください。<p>
|
<p>以下のボタンよりアクセストークンを取得すると使用できます。<br>アクセストークンは一度発行すると作り直すまで再度確認はできません。また、絶対に他人に知られないように保護してください。<p>
|
||||||
<input type="submit" class = "irobutton" name="token_submit" value="アクセストークン発行">
|
<input type="submit" class = "irobutton" name="token_submit" value="アクセストークン発行">
|
||||||
<?php }elseif($userData['token']==='ice'){ ?>
|
<?php }elseif($userData['role']==='ice'){ ?>
|
||||||
<p>アクセストークンはアカウントが凍結されているため発行できません。</p>
|
<p>アクセストークンはアカウントが凍結されているため発行できません。</p>
|
||||||
<?php }else{ ?>
|
<?php }else{ ?>
|
||||||
<p>以下のボタンよりアクセストークンを削除できます。ボタンを押すとすぐに削除されますのでご注意ください。</p>
|
<p>以下のボタンよりアクセストークンを削除できます。ボタンを押すとすぐに削除されますのでご注意ください。</p>
|
||||||
@@ -592,11 +593,15 @@ require('../logout/logout.php');
|
|||||||
<?php require('../require/rightbox.php');?>
|
<?php require('../require/rightbox.php');?>
|
||||||
<?php require('../require/botbox.php');?>
|
<?php require('../require/botbox.php');?>
|
||||||
<?php require('../require/noscript_modal.php');?>
|
<?php require('../require/noscript_modal.php');?>
|
||||||
|
<?php require('../require/tutorial.php');?>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
$('#tutorial').on('click', function() {
|
||||||
|
$(".tutorial_background").show();
|
||||||
|
});
|
||||||
|
|
||||||
var modal = document.getElementById('help_me_Modal');
|
var modal = document.getElementById('help_me_Modal');
|
||||||
var cancelButton = document.getElementById('cancelButton');
|
var cancelButton = document.getElementById('cancelButton');
|
||||||
|
|||||||
+2
-2
@@ -213,11 +213,11 @@ require('../logout/logout.php');
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<div class="formarea">
|
<div class="formarea">
|
||||||
<p>発行完了!以下のアクセストークンでこのアカウント(<?php echo $userid?>)に投稿を行えます!</p>
|
<p>発行完了!以下のアクセストークンでこのアカウント(<?php echo $userid?>)に投稿を行えます!</p>
|
||||||
<p>アクセストークンは以下のものです!<br>
|
<p>アクセストークンは以下のものです!</p>
|
||||||
<ul class="errmsg">
|
<ul class="errmsg">
|
||||||
<p>以下のアクセストークンは絶対に他人に知られないように大切に保管してください!</p>
|
<p>以下のアクセストークンは絶対に他人に知られないように大切に保管してください!</p>
|
||||||
</ul>
|
</ul>
|
||||||
<p><?php echo $token;?>
|
<p><?php echo htmlentities($token, ENT_QUOTES, 'UTF-8',false);?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a href="index" class="irobutton">戻る</a>
|
<a href="index" class="irobutton">戻る</a>
|
||||||
|
|||||||
@@ -18,11 +18,9 @@ $serversettings = parse_ini_file($serversettings_file, true);
|
|||||||
<title>残念なお知らせ - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>残念なお知らせ - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<script src="../back.js"></script>
|
<script src="../js/back.js"></script>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="leftbox2">
|
<div class="leftbox2">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ $serversettings = parse_ini_file($serversettings_file, true);
|
|||||||
<title>パスワード変更完了 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>パスワード変更完了 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<script src="../back.js"></script>
|
<script src="../js/back.js"></script>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ $pdo = null;
|
|||||||
<title>パスワードの復元 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>パスワードの復元 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<script src="../back.js"></script>
|
<script src="../js/back.js"></script>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="leftbox">
|
<div class="leftbox">
|
||||||
|
|||||||
@@ -3,9 +3,12 @@
|
|||||||
$serversettings_file = "../server/serversettings.ini";
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
|
$badpassfile = "../server/badpass.txt";
|
||||||
|
$badpass_info = file_get_contents($badpassfile);
|
||||||
|
$badpass = preg_split("/\r\n|\n|\r/", $badpass_info);
|
||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
|
require('../function/function.php');
|
||||||
|
|
||||||
// 変数の初期化
|
// 変数の初期化
|
||||||
$current_date = null;
|
$current_date = null;
|
||||||
@@ -89,80 +92,9 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
if( empty($password) ) {
|
if( empty($password) ) {
|
||||||
$error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
|
$error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$weakPasswords = array(
|
|
||||||
"password",
|
|
||||||
"123456",
|
|
||||||
"123456789",
|
|
||||||
"12345",
|
|
||||||
"12345678",
|
|
||||||
"123123",
|
|
||||||
"1234567890",
|
|
||||||
"1234567",
|
|
||||||
"1q2w3e",
|
|
||||||
"qwerty123",
|
|
||||||
"aa12345678",
|
|
||||||
"password1",
|
|
||||||
"1234",
|
|
||||||
"qwertyuiop",
|
|
||||||
"123321",
|
|
||||||
"12321",
|
|
||||||
"qwertyui",
|
|
||||||
"abcd1234",
|
|
||||||
"zaq12wsx",
|
|
||||||
"1q2w3e4r",
|
|
||||||
"qwer1234",
|
|
||||||
"sakura",
|
|
||||||
"asdf1234",
|
|
||||||
"asdfghjkl",
|
|
||||||
"asdfghjk",
|
|
||||||
"member",
|
|
||||||
"1qaz2wsx",
|
|
||||||
"doraemon",
|
|
||||||
"makoto",
|
|
||||||
"takeshi",
|
|
||||||
"machi1",
|
|
||||||
"machida",
|
|
||||||
"machida1",
|
|
||||||
"tokyo",
|
|
||||||
"arashi",
|
|
||||||
"dropbox",
|
|
||||||
"twitter",
|
|
||||||
"elonmusk",
|
|
||||||
"xcorp",
|
|
||||||
"1234qwer",
|
|
||||||
"japan",
|
|
||||||
"nippon",
|
|
||||||
"tukareta",
|
|
||||||
"tweet",
|
|
||||||
"discord",
|
|
||||||
"misskey",
|
|
||||||
"qwerty",
|
|
||||||
"123456789",
|
|
||||||
"abc123",
|
|
||||||
"password123",
|
|
||||||
"admin",
|
|
||||||
"letmein",
|
|
||||||
"iloveyou",
|
|
||||||
"111111",
|
|
||||||
"12345678910",
|
|
||||||
"user",
|
|
||||||
"root",
|
|
||||||
"system",
|
|
||||||
// 他にも弱いパスワードを追加できます
|
|
||||||
);
|
|
||||||
|
|
||||||
function isWeakPassword($passwords) {
|
if(in_array($password, $badpass) === true ){
|
||||||
global $weakPasswords;
|
|
||||||
return in_array($passwords, $weakPasswords);
|
|
||||||
}
|
|
||||||
|
|
||||||
// テスト用のパスワード(実際にはユーザー入力などから取得することになります。
|
|
||||||
|
|
||||||
if (isWeakPassword($password)) {
|
|
||||||
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
|
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( 4 > mb_strlen($password, 'UTF-8') ) {
|
if( 4 > mb_strlen($password, 'UTF-8') ) {
|
||||||
@@ -204,6 +136,9 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($res) {
|
if ($res) {
|
||||||
|
$msg = "お使いのアカウントのパスワードがパスワードの復元により変更されました。\n変更した覚えがない場合はパスワードを変更し、セッショントークンを再生成してください。";
|
||||||
|
send_notification($userid,"uwuzu-fromsys","🔴アカウントのパスワードが復元により変更されました。🔴",$msg,"/others");
|
||||||
|
|
||||||
$_SESSION['userid'] = "";
|
$_SESSION['userid'] = "";
|
||||||
$url = 'donerecovery.php';
|
$url = 'donerecovery.php';
|
||||||
header('Location: ' . $url, true, 303);
|
header('Location: ' . $url, true, 303);
|
||||||
@@ -239,10 +174,10 @@ $pdo = null;
|
|||||||
<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 htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>パスワードの復元 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<script src="../back.js"></script>
|
<script src="../js/back.js"></script>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="leftbox">
|
<div class="leftbox">
|
||||||
|
|||||||
@@ -63,6 +63,9 @@
|
|||||||
<h3><?php echo $uwuzuinfo[0]?></h3>
|
<h3><?php echo $uwuzuinfo[0]?></h3>
|
||||||
<p>Version : <?php echo $uwuzuinfo[1]?></p>
|
<p>Version : <?php echo $uwuzuinfo[1]?></p>
|
||||||
<p>Developer : <?php echo $uwuzuinfo[3]?></p>
|
<p>Developer : <?php echo $uwuzuinfo[3]?></p>
|
||||||
|
<?php if (date("md") == "0816") {?>
|
||||||
|
<p class="special"><span class="clap_anim">🎉</span>今日はuwuzuの誕生日です!</p>
|
||||||
|
<?php }?>
|
||||||
<a href="/rule/uwuzuabout">もっと詳しく!</a><a href="/rule/releasenotes">リリースノート</a>
|
<a href="/rule/uwuzuabout">もっと詳しく!</a><a href="/rule/releasenotes">リリースノート</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
<div class="tutorial_background" style="display:none;">
|
||||||
|
<div class="tutorial_modal">
|
||||||
|
<div class="tutorial">
|
||||||
|
<div class="page" id="page1">
|
||||||
|
<h1>チュートリアルへようこそ!</h1>
|
||||||
|
<p style="text-align: center;">ここでは、uwuzuのチュートリアルを行うことができます!<br>
|
||||||
|
チュートリアルでは、uwuzuについてや、基本的な使用方法を学ぶことができます!</p>
|
||||||
|
<div class="btm_area">
|
||||||
|
<div class="iro_btn" id="next">次へ</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page" id="page2" style="display:none;">
|
||||||
|
<h2>そもそも、uwuzuって?</h2>
|
||||||
|
<p>簡潔に言えば、ミニブログSNSです!<br>
|
||||||
|
アカウント登録をしたユーザーが「ユーズ」という投稿を行うことができ、他のユーザーがいいねをしたり、フォローなどをして交流することができます。<br>
|
||||||
|
<br>
|
||||||
|
基本的な使用方法はこれまでのミニブログSNSと似ているものです。<br>
|
||||||
|
<br>
|
||||||
|
ここで一つ知っていただきたいことがあります!<br>
|
||||||
|
uwuzuは、SNSという場所を作るためのソフトウェアの名前です。<br>
|
||||||
|
つまりどういうことかというと、あなたが使っているこのサービス自体は"uwuzu"ではなく"uwuzuを使って作られているコミュニティ"ということになります!<br>
|
||||||
|
<br>
|
||||||
|
uwuzuはどなたでもサーバーを構築できるという特徴があり、誰でも簡単にuwuzuを使用したサーバーを立ててコミュニティを作ることができます!<br>
|
||||||
|
<br>
|
||||||
|
そして、今あなたがチュートリアルを見ているこのサーバーもuwuzuを使用して構築されたコミュニティの一つです。
|
||||||
|
</p>
|
||||||
|
<div class="btm_area">
|
||||||
|
<div class="iro_btn backcolor" id="back">戻る</div>
|
||||||
|
<div class="iro_btn" id="next">次へ</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page" id="page3" style="display:none;">
|
||||||
|
<h2>ユーズって何?</h2>
|
||||||
|
<p>uwuzu上では、投稿のことを「ユーズ」と呼んでいます。<br>
|
||||||
|
このユーズは、他のSNSで言う「ノート」や、「ツイート」と同じような意味を持つ言葉です。<br>
|
||||||
|
<br>
|
||||||
|
ユーズをするには、タイムラインの一番上にある「いまどうしてる?」という入力欄に投稿したい内容を入力して、「ユーズする」ボタンを押すことでユーズができます!<br>
|
||||||
|
<br>
|
||||||
|
投稿されたユーズはタイムラインに時系列順にならんで他のユーザーに表示されます!
|
||||||
|
</p>
|
||||||
|
<img src="../img/tutorial_image/image1.png">
|
||||||
|
<div class="btm_area">
|
||||||
|
<div class="iro_btn backcolor" id="back">戻る</div>
|
||||||
|
<div class="iro_btn" id="next">次へ</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page" id="page4" style="display:none;">
|
||||||
|
<h2>追記について</h2>
|
||||||
|
<p>「追記」はユーズに付け足したいことを書き加えることができる機能です!<br>
|
||||||
|
追記を使うことで間違えてしまったことの訂正、後日談や新たな情報を書き加えることが可能です。<br>
|
||||||
|
<br>
|
||||||
|
もちろん、それ以外の用途で使用してもOKですよ!
|
||||||
|
</p>
|
||||||
|
<img src="../img/tutorial_image/image2.png">
|
||||||
|
<div class="btm_area">
|
||||||
|
<div class="iro_btn backcolor" id="back">戻る</div>
|
||||||
|
<div class="iro_btn" id="next">次へ</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page" id="page5" style="display:none;">
|
||||||
|
<h2>タイムラインの仕組み</h2>
|
||||||
|
<p>uwuzuには主に2つのタイムラインがあります!<br>
|
||||||
|
uwuzuの「ホーム」を開いてデフォルトで開かれるタイムラインは「ローカル」と書かれています。<br>
|
||||||
|
そして、タイムライン上部のメニューから「フォロー」というタイムラインも見ることが可能です。<br>
|
||||||
|
それぞれの機能はこんな感じ!<br>
|
||||||
|
<br>
|
||||||
|
- ローカル … ローカルタイムラインの略称で、同じサーバーにいる全員のユーズが表示されます。(uwuzu v1.3.5以前はLTL)<br>
|
||||||
|
- フォロー … フォロータイムラインの略称で、自分のフォローしているユーザーのユーズが表示されます。(uwuzu v1.3.5以前はFTL)<br>
|
||||||
|
</p>
|
||||||
|
<div class="btm_area">
|
||||||
|
<div class="iro_btn backcolor" id="back">戻る</div>
|
||||||
|
<div class="iro_btn" id="next">次へ</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page" id="page6" style="display:none;">
|
||||||
|
<h2>NSFWとは</h2>
|
||||||
|
<p>もし、このサーバーのルールに、センシティブな内容を投稿する際にはNSFWを設定する必要があるというものがあれば、あなたはセンシティブな内容のユーズをするさいにNSFWを設定する必要があります。<br>
|
||||||
|
<br>
|
||||||
|
NSFWは、Not Safe For Workの略であり、解釈としては「仕事中や学校などで見るべきではないぞっ!」って感じのことになります。<br>
|
||||||
|
<br>
|
||||||
|
センシティブな内容の投稿をする際はサーバーのルールを守って投稿画面より「目に斜線」ボタンを押してNSFWを設定してくださいね
|
||||||
|
</p>
|
||||||
|
<img src="../img/tutorial_image/image3.png">
|
||||||
|
<div class="btm_area">
|
||||||
|
<div class="iro_btn backcolor" id="back">戻る</div>
|
||||||
|
<div class="iro_btn" id="next">次へ</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page" id="page7" style="display:none;">
|
||||||
|
<h2>このサーバーで少し過ごして居づらかったら...</h2>
|
||||||
|
<p>安心してください、uwuzuにはいろんなサーバーがあり、自分にあったサーバーをさがし、登録することができます!<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
えっ?自分の好みにあったサーバーがないって...?<br>
|
||||||
|
<br>
|
||||||
|
大丈夫、uwuzuは無料で配布されているソフトウェアです。<br>
|
||||||
|
少しのWebサーバーの知識とインターネットの使い方がわかっていれば大丈夫!<br>
|
||||||
|
あなたが自分だけのサーバーを立てることができちゃいます!<br>
|
||||||
|
<br>
|
||||||
|
また、uwuzu v1.3.6以上を導入しているサーバーであれば、サーバー間でのアカウントの移行が可能です!
|
||||||
|
</p>
|
||||||
|
<div class="btm_area">
|
||||||
|
<div class="iro_btn backcolor" id="back">戻る</div>
|
||||||
|
<div class="iro_btn" id="next">次へ</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page" id="page8" style="display:none;">
|
||||||
|
<h1>お疲れ様でした!</h1>
|
||||||
|
<p style="text-align: center;">チュートリアルは終了です!<br>
|
||||||
|
まだ、このチュートリアルで紹介できていなuwuzuの機能や使い方も多くあるので、もっとuwuzuについて知りたい方はぜひuwuzu.comをご覧ください。</p>
|
||||||
|
<div class="btm_area">
|
||||||
|
<div class="iro_btn backcolor" id="back">戻る</div>
|
||||||
|
<div class="iro_btn" id="end">閉じる</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$(".tutorial_background").on('click', function(e) {
|
||||||
|
if(e.target !== e.currentTarget) return;
|
||||||
|
$(".tutorial_background").hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
var page = 1;
|
||||||
|
$(document).on("click", "#next", function () {
|
||||||
|
$("#page"+page+"").hide();
|
||||||
|
page++
|
||||||
|
$("#page"+page+"").show();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("click", "#back", function () {
|
||||||
|
$("#page"+page+"").hide();
|
||||||
|
page = page-1
|
||||||
|
$("#page"+page+"").show();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("click", "#end", function () {
|
||||||
|
$(".tutorial_background").hide();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
+10
-1
@@ -3,10 +3,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
|
//関数呼び出し
|
||||||
|
//- php.iniのファイル最大サイズ
|
||||||
|
require('../function/function.php');
|
||||||
|
|
||||||
session_name('uwuzu_s_id');
|
session_name('uwuzu_s_id');
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
$mojisizefile = "../server/textsize.txt";
|
||||||
|
$mojisize = htmlentities(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8');
|
||||||
|
|
||||||
$serversettings_file = "../server/serversettings.ini";
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
@@ -124,6 +129,10 @@ $count4 = $result4->num_rows;
|
|||||||
echo $info.'<br>';
|
echo $info.'<br>';
|
||||||
}?></p>
|
}?></p>
|
||||||
<hr>
|
<hr>
|
||||||
|
<h4>制限</h4>
|
||||||
|
<p>ファイルサイズの上限 : <?php echo x1024(x1024(File_MaxUploadSize()));?>MB</p>
|
||||||
|
<p>ユーズの文字数の上限 : <?php echo $mojisize;?>文字</p>
|
||||||
|
<hr>
|
||||||
|
|
||||||
<h4>管理者情報</h4>
|
<h4>管理者情報</h4>
|
||||||
<p>管理者名 : <?php echo htmlspecialchars($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8');?></p>
|
<p>管理者名 : <?php echo htmlspecialchars($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8');?></p>
|
||||||
@@ -160,7 +169,7 @@ $count4 = $result4->num_rows;
|
|||||||
<?php }?>
|
<?php }?>
|
||||||
<hr>
|
<hr>
|
||||||
<h4>サーバーソフトウェア</h4>
|
<h4>サーバーソフトウェア</h4>
|
||||||
<div class="p3"><?php echo $uwuzuinfo[0];?></div>
|
<div class="p3" translate="no"><?php echo $uwuzuinfo[0];?></div>
|
||||||
<div class="p2c">Version : <?php echo $uwuzuinfo[1];?><br>Developer : <?php echo $uwuzuinfo[3];?><br>Last Update : <?php echo $uwuzuinfo[2];?></div>
|
<div class="p2c">Version : <?php echo $uwuzuinfo[1];?><br>Developer : <?php echo $uwuzuinfo[3];?><br>Last Update : <?php echo $uwuzuinfo[2];?></div>
|
||||||
|
|
||||||
<a href = "javascript:history.back();" class="irobutton">戻る</a>
|
<a href = "javascript:history.back();" class="irobutton">戻る</a>
|
||||||
|
|||||||
+3
-1
@@ -91,7 +91,9 @@ foreach ($sterms as $terms) {
|
|||||||
<div class="p2c"><?php echo $domain;?></div>
|
<div class="p2c"><?php echo $domain;?></div>
|
||||||
<div class="p3"><?php echo $uwuzuinfo[0];?></div>
|
<div class="p3"><?php echo $uwuzuinfo[0];?></div>
|
||||||
<div class="p2c">Version : <?php echo $uwuzuinfo[1];?><br>Developer : <?php echo $uwuzuinfo[3];?><br>Last Update : <?php echo $uwuzuinfo[2];?></div>
|
<div class="p2c">Version : <?php echo $uwuzuinfo[1];?><br>Developer : <?php echo $uwuzuinfo[3];?><br>Last Update : <?php echo $uwuzuinfo[2];?></div>
|
||||||
|
<?php if (date("md") == "0816") {?>
|
||||||
|
<div class="p2c">🎉今日はuwuzuの誕生日です!</div>
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
<p><?php echo $htmltext;?></p>
|
<p><?php echo $htmltext;?></p>
|
||||||
|
|
||||||
|
|||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
$key_pair = openssl_pkey_new(array(
|
||||||
|
'private_key_bits' => 2048, // 秘密鍵のビット数
|
||||||
|
'private_key_type' => OPENSSL_KEYTYPE_RSA // RSA秘密鍵を生成
|
||||||
|
));
|
||||||
|
|
||||||
|
// 秘密鍵を取得する
|
||||||
|
openssl_pkey_export($key_pair, $private_key);
|
||||||
|
|
||||||
|
echo $private_key;
|
||||||
|
?>
|
||||||
@@ -207,6 +207,7 @@ $pdo = null;
|
|||||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||||
<link rel="stylesheet" href="../css/home.css">
|
<link rel="stylesheet" href="../css/home.css">
|
||||||
|
<link rel="search" href="<?php echo htmlentities((empty($_SERVER['HTTPS']) ? 'http://' : 'https://').$_SERVER['HTTP_HOST']."/search/opensearch.php")?>" title="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>" type="application/opensearchdescription+xml">
|
||||||
<title>検索 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>検索 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
|
header("Content-Type: application/xml");
|
||||||
|
header("charset=UTF-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
|
||||||
|
if(!(empty($serversettings["serverinfo"]["server_icon"]))){
|
||||||
|
$servericon = htmlentities($this->value["servericon"], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
}else{
|
||||||
|
$servericon = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://').$domain."/img/uwuzuicon.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
|
||||||
|
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
|
||||||
|
<ShortName><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?></ShortName>
|
||||||
|
<Description><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?>で検索</Description>
|
||||||
|
<InputEncoding>UTF-8</InputEncoding>
|
||||||
|
<Image width="16" height="16"><?php echo htmlentities($servericon, ENT_QUOTES, 'UTF-8', false);?></Image>
|
||||||
|
<Url type="text/html" template="<?php echo htmlentities((empty($_SERVER['HTTPS']) ? 'http://' : 'https://').$domain."/search/?q={searchTerms}");?>"/>
|
||||||
|
</OpenSearchDescription>
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
password
|
||||||
|
123456
|
||||||
|
123456789
|
||||||
|
12345
|
||||||
|
12345678
|
||||||
|
123123
|
||||||
|
1234567890
|
||||||
|
1234567
|
||||||
|
1q2w3e
|
||||||
|
qwerty123
|
||||||
|
aa12345678
|
||||||
|
password1
|
||||||
|
1234
|
||||||
|
qwertyuiop
|
||||||
|
123321
|
||||||
|
12321
|
||||||
|
qwertyui
|
||||||
|
abcd1234
|
||||||
|
zaq12wsx
|
||||||
|
1q2w3e4r
|
||||||
|
qwer1234
|
||||||
|
sakura
|
||||||
|
asdf1234
|
||||||
|
asdfghjkl
|
||||||
|
asdfghjk
|
||||||
|
member
|
||||||
|
1qaz2wsx
|
||||||
|
tokyo
|
||||||
|
arashi
|
||||||
|
dropbox
|
||||||
|
twitter
|
||||||
|
elonmusk
|
||||||
|
xcorp
|
||||||
|
1234qwer
|
||||||
|
japan
|
||||||
|
nippon
|
||||||
|
tukareta
|
||||||
|
tweet
|
||||||
|
qwerty
|
||||||
|
123456789
|
||||||
|
abc123
|
||||||
|
password123
|
||||||
|
admin
|
||||||
|
letmein
|
||||||
|
iloveyou
|
||||||
|
111111
|
||||||
|
12345678910
|
||||||
|
user
|
||||||
|
root
|
||||||
|
system
|
||||||
|
777777
|
||||||
|
098765
|
||||||
|
654321
|
||||||
|
4321
|
||||||
|
0987
|
||||||
@@ -15,4 +15,5 @@
|
|||||||
server_invitation = "false"
|
server_invitation = "false"
|
||||||
;ActivityPubのオンオフ
|
;ActivityPubのオンオフ
|
||||||
server_activitypub = "false"
|
server_activitypub = "false"
|
||||||
|
;アカウントの移行登録を許可するか
|
||||||
|
server_account_migration = "true"
|
||||||
+15
-5
@@ -86,6 +86,15 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
|
|||||||
- used(varchar(25)) 使用済みかそうでないか
|
- used(varchar(25)) 使用済みかそうでないか
|
||||||
- datetime(datetime) 招待コード仕様日時更新用
|
- datetime(datetime) 招待コード仕様日時更新用
|
||||||
|
|
||||||
|
### migration
|
||||||
|
- sysid(INT)(AUTO_INCREMENT) 追加されるとカウントされるシステム用ID
|
||||||
|
- account(varchar(512)) ユーザーID保存用
|
||||||
|
- domain(varchar(1024)) 移行先サーバーのドメイン保存用
|
||||||
|
- migration_code(varchar(256)) 識別コード
|
||||||
|
- encryption_ivkey(varchar(256)) 暗号化用
|
||||||
|
- encryption_key(varchar(256)) 暗号化用
|
||||||
|
- datetime(datetime) 招待コード仕様日時更新用
|
||||||
|
|
||||||
### notice
|
### notice
|
||||||
- sysid(INT)(AUTO_INCREMENT) うんえいからのおしらせが追加されるとカウントされるシステム用ID
|
- sysid(INT)(AUTO_INCREMENT) うんえいからのおしらせが追加されるとカウントされるシステム用ID
|
||||||
- uniqid(varchar(256)) ID保存用
|
- uniqid(varchar(256)) ID保存用
|
||||||
@@ -154,16 +163,16 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
|
|||||||
- 503imagepath.txt : 503ページに表示する画像パス保存用
|
- 503imagepath.txt : 503ページに表示する画像パス保存用
|
||||||
- banurldomain.txt : 投稿禁止URLドメイン
|
- banurldomain.txt : 投稿禁止URLドメイン
|
||||||
- banuserid.txt : 登録禁止ユーザーid
|
- banuserid.txt : 登録禁止ユーザーid
|
||||||
|
- badpass.txt : 登録禁止パスワードリスト
|
||||||
- info.txt : サーバー登録時に表示されるメッセージ(好きな内容)
|
- info.txt : サーバー登録時に表示されるメッセージ(好きな内容)
|
||||||
- privacypolicy.txt : プライバシーポリシー(サーバーのプライバシーポリシーを記載)
|
- privacypolicy.txt : プライバシーポリシー(サーバーのプライバシーポリシーを記載)
|
||||||
- serverstop.txt : サーバー停止ページで表示するメッセージ
|
- serverstop.txt : サーバー停止ページで表示するメッセージ
|
||||||
- terms.txt : 利用規約(サーバーの利用規約を記載)
|
- terms.txt : 利用規約(サーバーの利用規約を記載)
|
||||||
- textsize.txt : 最大文字数
|
- textsize.txt : 最大文字数
|
||||||
- serversettings.ini : サーバー情報保存ファイル
|
- serversettings.ini : サーバー情報保存ファイル
|
||||||
- uwuzuabout.txt : このファイル(uwuzuを改造した場合は書き換え)
|
- uwuzuabout.txt : このファイル
|
||||||
- uwuzuinfo.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え)
|
- uwuzuinfo.txt : uwuzuのバージョン等記載
|
||||||
- uwuzurelease.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え)
|
- uwuzurelease.txt : uwuzuのバージョン等記載
|
||||||
- onlyuser.txt : 招待コード機能をオンにするかどうか、「true」でオン、「false」でオフ。招待コードはDBに直接追加。
|
|
||||||
|
|
||||||
### これでサーバーは完成!!!
|
### これでサーバーは完成!!!
|
||||||
もう一度サーバーを起動してみんなに公開しよう!!!(まだ脆弱性は残っていると思われます。公開する際は気をつけてください。私だいちまる及びPutonfpsは一切責任を負いません。)
|
もう一度サーバーを起動してみんなに公開しよう!!!(まだ脆弱性は残っていると思われます。公開する際は気をつけてください。私だいちまる及びPutonfpsは一切責任を負いません。)
|
||||||
@@ -173,9 +182,10 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
|
|||||||
誰かが作ってくれたらありがたいな~()
|
誰かが作ってくれたらありがたいな~()
|
||||||
|
|
||||||
## 7. 開発したいです!!!
|
## 7. 開発したいです!!!
|
||||||
uwuzuを自分の思うように改造して使いたい場合はAGPLライセンスのもと改造後ソースコードを公開するということで改造してください!
|
uwuzuを自分の思うように改造して使いたい場合はUPULライセンスのもと改造後ソースコードを公開するということで改造してください!
|
||||||
場合によってはdaichimarukanaの作る本家(?)uwuzuにも改造で追加された機能が実装されるかも...()
|
場合によってはdaichimarukanaの作る本家(?)uwuzuにも改造で追加された機能が実装されるかも...()
|
||||||
daichimarukanaと一緒に開発したいよ~って人は私のHPからメールとか某Xとかから連絡してくださいな~
|
daichimarukanaと一緒に開発したいよ~って人は私のHPからメールとか某Xとかから連絡してくださいな~
|
||||||
|
(uwuzuはv1.3.0よりAGPLからUPULに変更されました。)
|
||||||
|
|
||||||
## 8. ロゴは誰が作ったのですか?
|
## 8. ロゴは誰が作ったのですか?
|
||||||
ロゴはまだない。
|
ロゴはまだない。
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
uwuzu
|
uwuzu
|
||||||
1.3.5
|
1.3.6
|
||||||
2024/03/27
|
2024/04/24
|
||||||
daichimarukana,putonfps
|
daichimarukana,putonfps
|
||||||
@@ -1,6 +1,55 @@
|
|||||||
## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
|
## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
|
||||||
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
|
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
|
||||||
|
|
||||||
|
## Version 1.3.6 (new_Planet)
|
||||||
|
リリース日:2024/04/24
|
||||||
|
fix: バックアップコードを使用してのログインができない問題を修正しました。
|
||||||
|
fix: お知らせ配信ページにて過去のお知らせの本文が改行されない問題を修正しました。
|
||||||
|
fix: 脆弱性を修正しました。
|
||||||
|
fix: serverinfo-apiにてお知らせが1件も配信されていない際にエラーがでてしまう問題を修正しました。
|
||||||
|
fix: サーバーの設定次第で画像のアップロード時にエラーが発生する可能性がある問題を修正しました。
|
||||||
|
fix: 管理者ページより概要ページでのエラーを修正しました。
|
||||||
|
chg: 一部UIを変更しました!
|
||||||
|
chg: カスタム絵文字のファイルサイズ上限を256KBにしました!
|
||||||
|
これはカスタム絵文字によってuwuzuが重たくならないようにするための変更です。
|
||||||
|
chg: アカウントのアイコンやヘッダーを設定する際に画像を選択した後にプレビュー表示をするようにしました。
|
||||||
|
chg: 絵文字ピッカーを軽量化しました!
|
||||||
|
chg: LTL、FTLの表記をローカル、フォローに変更しました!
|
||||||
|
機能は従来と同じく、
|
||||||
|
- ローカル : サーバー内の全ユーザーのユーズがあるタイムライン
|
||||||
|
- フォロー : 自分のフォローしているユーザーのユーズがあるタイムライン
|
||||||
|
です。
|
||||||
|
new: db.php自動設定機能を実装しました!
|
||||||
|
new: データベース自動設定機能を実装しました!
|
||||||
|
これによりuwuzuの導入がものすごく楽になりました!
|
||||||
|
phpとMySQLが動作するWebサーバーと空のデータベースが用意してあればuwuzuを適切なフォルダに配置するだけでセットアップが可能です。
|
||||||
|
localhost/admin/からセットアップが可能です。
|
||||||
|
new: ログイン通知にログインした端末を記載するようにしました!
|
||||||
|
new: サーバー内で使用するフォントを自由に指定できるようにしました!
|
||||||
|
new: 「その他」よりキャッシュクリア機能を実装しました。
|
||||||
|
この機能はまだ動作が保証できないため試験的なものとなります。
|
||||||
|
new: OpenSearchに対応しました!
|
||||||
|
この機能はブラウザのアドレスバーに検索したい文字列を入力した時に直でuwuzuに検索をかけられる的な機能です!
|
||||||
|
ブラウザによって使用できるかは不明ですが、[domain]/search/へアクセスすることでブラウザ側がOpenSearchを認識して設定が可能になるはずです。
|
||||||
|
new: サーバー間でのアカウント移行機能を実装しました!
|
||||||
|
その他のページからアカウントの移行、移行先のサーバーのドメインを入力することで移行用エイリアスの作成が可能です。
|
||||||
|
移行先のサーバーでアカウント登録、アカウントの移行登録とすすみ、新しいユーザーID、パスワード、移行元のサーバーで作成した認証コードと移行元のサーバーのドメインを入力することでアカウントの移行が可能です。
|
||||||
|
移行できるデータは以下のものです。
|
||||||
|
- ユーザー名
|
||||||
|
- プロフィール
|
||||||
|
- ユーザーアイコン
|
||||||
|
- ユーザーヘッダー
|
||||||
|
- メールアドレス
|
||||||
|
これによりデータベース上にmigrationテーブルを作成する必要があります。
|
||||||
|
中身はsysid(int,AUTO_INCREMENT),account(varchar(512)),domain(varchar(1024)),migration_code(varchar(256)),encryption_key(varchar(256)),encryption_ivkey(varchar(256)),datetime(datetime)です。
|
||||||
|
new: APIを大幅強化しました!
|
||||||
|
使用方法など詳細はuwuzu.comをご確認ください!
|
||||||
|
また、uwuzu v1.3.4で変更された従来のAPIも引き続き使用可能です。
|
||||||
|
new: チュートリアル機能を実装しました!
|
||||||
|
チュートリアルは「その他」より行うことができます!
|
||||||
|
new: パスワード復元機能によりパスワードが変更された際に通知を送信するようにしました!
|
||||||
|
uwuzu_database.sqlは更新済みです。
|
||||||
|
|
||||||
## Version 1.3.5 (new_Planet)
|
## Version 1.3.5 (new_Planet)
|
||||||
リリース日:2024/03/27
|
リリース日:2024/03/27
|
||||||
fix: ロールの新規作成ができなくなってしまう問題を修正しました。
|
fix: ロールの新規作成ができなくなってしまう問題を修正しました。
|
||||||
|
|||||||
@@ -277,14 +277,6 @@ $pdo = null;
|
|||||||
<?php require('../require/leftbox.php');?>
|
<?php require('../require/leftbox.php');?>
|
||||||
<main>
|
<main>
|
||||||
|
|
||||||
<?php if( !empty($error_message) ): ?>
|
|
||||||
<ul class="errmsg">
|
|
||||||
<?php foreach( $error_message as $value ): ?>
|
|
||||||
<p>・ <?php echo $value; ?></p>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</ul>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<div class="emojibox">
|
<div class="emojibox">
|
||||||
<h1>二段階認証の登録</h1>
|
<h1>二段階認証の登録</h1>
|
||||||
<?php if( !empty($error_message) ): ?>
|
<?php if( !empty($error_message) ): ?>
|
||||||
|
|||||||
+93
-70
@@ -800,80 +800,84 @@ $pdo = null;
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||||
<div class="hed">
|
<div>
|
||||||
<img src="<?php echo htmlentities('../'.$userdata['headname']); ?>">
|
<h1>プロフィール</h1>
|
||||||
</div>
|
<div class="hed">
|
||||||
|
<img src="<?php echo htmlentities('../'.$userdata['headname']); ?>">
|
||||||
<div class="iconimg">
|
|
||||||
<img src="<?php echo htmlentities('../'.$userdata['iconname']); ?>">
|
|
||||||
</div>
|
|
||||||
<?php if($role === "ice"){?>
|
|
||||||
<p>お使いのアカウントは凍結されているため設定を変更できません</p>
|
|
||||||
<?php }else{?>
|
|
||||||
|
|
||||||
<label class="imgbtn" for="file_upload">アイコン選択
|
|
||||||
<input type="file" id="file_upload" name="image" accept="image/*">
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label class="imgbtn2" for="file_upload2">ヘッダー選択
|
|
||||||
<input type="file" id="file_upload2" name="image2s" accept="image/*">
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<div class="sub">
|
|
||||||
<input type="submit" class = "imgbtn" name="img1btn_submit" value="ヘッダー画像更新">
|
|
||||||
<input type="submit" class = "imgbtn" name="img2btn_submit" value="アイコン画像更新">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--ユーザーネーム関係-->
|
<div class="iconimg">
|
||||||
<div>
|
<img src="<?php echo htmlentities('../'.$userdata['iconname']); ?>">
|
||||||
<p>ユーザーネーム</p>
|
|
||||||
<input id="username" placeholder="" class="inbox" type="text" name="username" value="<?php if( !empty($userdata['username']) ){ echo htmlentities( $userdata['username'], ENT_QUOTES, 'UTF-8'); } ?>">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>メールアドレス</p>
|
|
||||||
<input id="mailadds" type="text" placeholder="" class="inbox" name="mailadds" value="<?php if( !empty($userdata['mailadds']) ){ echo htmlentities( $userdata['mailadds'], ENT_QUOTES, 'UTF-8'); } ?>">
|
|
||||||
</div>
|
|
||||||
<!--プロフィール関連-->
|
|
||||||
<div>
|
|
||||||
<p>プロフィール</p>
|
|
||||||
<textarea id="profile" type="text" placeholder="" class="inbox" name="profile" value=""><?php if( !empty($userdata['profile']) ){ echo htmlentities( $userdata['profile'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
|
||||||
</div>
|
</div>
|
||||||
|
<?php if($role === "ice"){?>
|
||||||
|
<p>お使いのアカウントは凍結されているため設定を変更できません</p>
|
||||||
|
<?php }else{?>
|
||||||
|
|
||||||
<?php if(!empty($userData['token'])){?>
|
<label class="imgbtn" for="file_upload">アイコン選択
|
||||||
|
<input type="file" id="file_upload" name="image" accept="image/*">
|
||||||
|
</label>
|
||||||
|
|
||||||
<p>このアカウントがBotであることを公開する</p>
|
<label class="imgbtn2" for="file_upload2">ヘッダー選択
|
||||||
<div class="switch_button">
|
<input type="file" id="file_upload2" name="image2s" accept="image/*">
|
||||||
<?php if($sacinfo === "bot"){?>
|
</label>
|
||||||
<input id="im_bot" class="switch_input" type='checkbox' name="im_bot" value="true" checked/>
|
|
||||||
<label for="im_bot" class="switch_label"></label>
|
<div class="sub">
|
||||||
<?php }else{?>
|
<input type="submit" class = "imgbtn" name="img1btn_submit" value="ヘッダー画像更新">
|
||||||
<input id="im_bot" class="switch_input" type='checkbox' name="im_bot" value="true" />
|
<input type="submit" class = "imgbtn" name="img2btn_submit" value="アイコン画像更新">
|
||||||
<label for="im_bot" class="switch_label"></label>
|
|
||||||
<?php }?>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php }elseif($userData['token']==='ice'){ ?>
|
<!--ユーザーネーム関係-->
|
||||||
<p>アカウントが凍結されているためBotであることの設定変更はできません。</p>
|
<div>
|
||||||
<?php }?>
|
<p>ユーザーネーム</p>
|
||||||
|
<input id="username" placeholder="" class="inbox" type="text" name="username" value="<?php if( !empty($userdata['username']) ){ echo htmlentities( $userdata['username'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||||
<?php if(!empty(MAIL_CHKS && MAIL_CHKS == "true")){?>
|
</div>
|
||||||
<p>重要なお知らせをメールで受信する</p>
|
<div>
|
||||||
<div class="p2">あなたのアカウントが凍結された際やBANされた際にメールにてお知らせする機能です。<br>利用可能なメールアドレスを事前に設定しておく必要があります。</div>
|
<p>メールアドレス</p>
|
||||||
<div class="switch_button">
|
<input id="mailadds" type="text" placeholder="" class="inbox" name="mailadds" value="<?php if( !empty($userdata['mailadds']) ){ echo htmlentities( $userdata['mailadds'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||||
<?php if(false !== strpos($mail_settings, 'important')) {?>
|
</div>
|
||||||
<input id="mail_important" class="switch_input" type='checkbox' name="mail_important" value="true" checked/>
|
<!--プロフィール関連-->
|
||||||
<label for="mail_important" class="switch_label"></label>
|
<div>
|
||||||
<?php }else{?>
|
<p>プロフィール</p>
|
||||||
<input id="mail_important" class="switch_input" type='checkbox' name="mail_important" value="true" />
|
<textarea id="profile" type="text" placeholder="" class="inbox" name="profile" value=""><?php if( !empty($userdata['profile']) ){ echo htmlentities( $userdata['profile'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
||||||
<label for="mail_important" class="switch_label"></label>
|
|
||||||
<?php }?>
|
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
|
||||||
|
|
||||||
<input type="submit" class = "irobutton" name="btn_submit" value="情報更新">
|
|
||||||
|
|
||||||
<?php }?>
|
<?php if(!empty($userData['token'])){?>
|
||||||
|
|
||||||
|
<p>このアカウントがBotであることを公開する</p>
|
||||||
|
<div class="switch_button">
|
||||||
|
<?php if($sacinfo === "bot"){?>
|
||||||
|
<input id="im_bot" class="switch_input" type='checkbox' name="im_bot" value="true" checked/>
|
||||||
|
<label for="im_bot" class="switch_label"></label>
|
||||||
|
<?php }else{?>
|
||||||
|
<input id="im_bot" class="switch_input" type='checkbox' name="im_bot" value="true" />
|
||||||
|
<label for="im_bot" class="switch_label"></label>
|
||||||
|
<?php }?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php }elseif($userData['token']==='ice'){ ?>
|
||||||
|
<p>アカウントが凍結されているためBotであることの設定変更はできません。</p>
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
|
<?php if(!empty(MAIL_CHKS && MAIL_CHKS == "true")){?>
|
||||||
|
<p>重要なお知らせをメールで受信する</p>
|
||||||
|
<div class="p2">あなたのアカウントが凍結された際やBANされた際にメールにてお知らせする機能です。<br>利用可能なメールアドレスを事前に設定しておく必要があります。</div>
|
||||||
|
<div class="switch_button">
|
||||||
|
<?php if(false !== strpos($mail_settings, 'important')) {?>
|
||||||
|
<input id="mail_important" class="switch_input" type='checkbox' name="mail_important" value="true" checked/>
|
||||||
|
<label for="mail_important" class="switch_label"></label>
|
||||||
|
<?php }else{?>
|
||||||
|
<input id="mail_important" class="switch_input" type='checkbox' name="mail_important" value="true" />
|
||||||
|
<label for="mail_important" class="switch_label"></label>
|
||||||
|
<?php }?>
|
||||||
|
</div>
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
|
<input type="submit" class = "irobutton" name="btn_submit" value="情報更新">
|
||||||
|
|
||||||
|
<?php }?>
|
||||||
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
<h1>パスワード</h1>
|
||||||
<div>
|
<div>
|
||||||
<p>ユーザーid</p>
|
<p>ユーザーid</p>
|
||||||
<input id="passchk_userid" type="text" class="inbox" name="passchk_userid" oncopy="return false" onpaste="return false" oncontextmenu="return false" value="">
|
<input id="passchk_userid" type="text" class="inbox" name="passchk_userid" oncopy="return false" onpaste="return false" oncontextmenu="return false" value="">
|
||||||
@@ -892,6 +896,7 @@ $pdo = null;
|
|||||||
<input type="submit" class = "irobutton" name="pass_submit" value="パスワード更新">
|
<input type="submit" class = "irobutton" name="pass_submit" value="パスワード更新">
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
<h1>二段階認証</h1>
|
||||||
<?php
|
<?php
|
||||||
if(empty($userdata['authcode'])){
|
if(empty($userdata['authcode'])){
|
||||||
?>
|
?>
|
||||||
@@ -911,11 +916,29 @@ $pdo = null;
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
<script>
|
<script>
|
||||||
$("#passview").click(function () {
|
window.addEventListener('DOMContentLoaded', function(){
|
||||||
if ($("#passview").prop("checked") == true) {
|
$("#passview").click(function () {
|
||||||
$('#password').get(0).type = 'text';
|
if ($("#passview").prop("checked") == true) {
|
||||||
} else {
|
$('#password').get(0).type = 'text';
|
||||||
$('#password').get(0).type = 'password';
|
} else {
|
||||||
}
|
$('#password').get(0).type = 'password';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#file_upload').change(function(e) {
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('.iconimg').children('img').attr('src', file_reader.result);
|
||||||
|
});
|
||||||
|
file_reader.readAsDataURL(e.target.files[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#file_upload2').change(function(e) {
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('.hed').children('img').attr('src', file_reader.result);
|
||||||
|
});
|
||||||
|
file_reader.readAsDataURL(e.target.files[0]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -185,11 +185,11 @@ $notificationcount = $notiData['notification_count'];
|
|||||||
|
|
||||||
if( !empty($_POST['ads_btn_submit']) ) {
|
if( !empty($_POST['ads_btn_submit']) ) {
|
||||||
|
|
||||||
$ads_url = htmlentities($_POST['ads_url']);
|
$ads_url = htmlentities($_POST['ads_url'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$ads_img_url = htmlentities($_POST['ads_img_url']);
|
$ads_img_url = htmlentities($_POST['ads_img_url'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$ads_start_date = htmlentities(date($_POST['ads_start_date']));
|
$ads_start_date = htmlentities(date($_POST['ads_start_date']), ENT_QUOTES, 'UTF-8', false);
|
||||||
$ads_limit_date = htmlentities(date($_POST['ads_limit_date']));
|
$ads_limit_date = htmlentities(date($_POST['ads_limit_date']), ENT_QUOTES, 'UTF-8', false);
|
||||||
$ads_memo = htmlentities($_POST['ads_memo']);
|
$ads_memo = htmlentities($_POST['ads_memo'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
if(empty($ads_url)){
|
if(empty($ads_url)){
|
||||||
$error_message[] = "URLが入力されていません。(INPUT_PLEASE)";
|
$error_message[] = "URLが入力されていません。(INPUT_PLEASE)";
|
||||||
@@ -312,7 +312,7 @@ if (!empty($pdo)) {
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||||
<title>広告 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>広告 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?></title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -214,41 +214,47 @@ if( !empty($pdo) ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
$emojiname = $_POST['emojiname'];
|
$emojiname = htmlentities($_POST['emojiname'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$emojiinfo = $_POST['emojiinfo'];
|
$emojiinfo = htmlentities($_POST['emojiinfo'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
if (!empty($_FILES['image']['name'])) {
|
if (!empty($_FILES['image']['name'])) {
|
||||||
// アップロードされたファイル情報
|
// アップロードされたファイル情報
|
||||||
$uploadedFile = $_FILES['image'];
|
$uploadedFile = $_FILES['image'];
|
||||||
|
|
||||||
|
if(filesize($uploadedFile['tmp_name']) > 256000){
|
||||||
|
$error_message[] = "絵文字のファイルサイズは256KB以下に押さえてください。(EMOJI_OVER_256KB)";
|
||||||
|
}
|
||||||
|
|
||||||
if(check_mime($uploadedFile['tmp_name'])){
|
if(check_mime($uploadedFile['tmp_name'])){
|
||||||
// アップロードされたファイルの拡張子を取得
|
if(empty($error_message)){
|
||||||
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
|
// アップロードされたファイルの拡張子を取得
|
||||||
|
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
|
||||||
// 新しいファイル名を生成(uniqid + 拡張子)
|
|
||||||
$newFilename = uniqid() . '.' . $extension;
|
// 新しいファイル名を生成(uniqid + 拡張子)
|
||||||
|
$newFilename = uniqid() . '.' . $extension;
|
||||||
// 保存先のパスを生成
|
|
||||||
$uploadedPath = 'emojiimage/' . $newFilename;
|
// 保存先のパスを生成
|
||||||
|
$uploadedPath = 'emojiimage/' . $newFilename;
|
||||||
|
|
||||||
// EXIF削除
|
// EXIF削除
|
||||||
delete_exif($extension2, $uploadedFile['tmp_name']);
|
delete_exif($extension, $uploadedFile['tmp_name']);
|
||||||
|
|
||||||
// ファイルを移動
|
// ファイルを移動
|
||||||
$result = move_uploaded_file($uploadedFile['tmp_name'], '../'.$uploadedPath);
|
$result = move_uploaded_file($uploadedFile['tmp_name'], '../'.$uploadedPath);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$emoji_path = $uploadedPath; // 保存されたファイルのパスを使用
|
$emoji_path = $uploadedPath; // 保存されたファイルのパスを使用
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$errnum = $uploadedFile['error'];
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
||||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
|
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
||||||
@@ -363,7 +369,7 @@ $pdo = null;
|
|||||||
<script src="../js/jquery-min.js"></script>
|
<script src="../js/jquery-min.js"></script>
|
||||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||||
<title>絵文字登録 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>絵文字登録 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?></title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -375,13 +381,13 @@ $pdo = null;
|
|||||||
|
|
||||||
<div class="admin_right">
|
<div class="admin_right">
|
||||||
|
|
||||||
<?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; ?>
|
||||||
|
|
||||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||||
|
|
||||||
@@ -391,7 +397,8 @@ $pdo = null;
|
|||||||
<div class="p2">
|
<div class="p2">
|
||||||
注意 : uwuzuで表示されるカスタム絵文字の最大の大きさは縦64pxです。<br>
|
注意 : uwuzuで表示されるカスタム絵文字の最大の大きさは縦64pxです。<br>
|
||||||
縦64px以上のカスタム絵文字を登録しても縮小されて表示されます。<br>
|
縦64px以上のカスタム絵文字を登録しても縮小されて表示されます。<br>
|
||||||
また、縦64px以上の画像をアップロードすると、uwuzuの動作が遅くなる恐れがあるため、絵文字の画像サイズは縦64pxを推奨します。</div>
|
最大ファイルサイズは256KBです。<br>
|
||||||
|
これはカスタム絵文字によってuwuzuが重たくならないようにするための仕様です。</div>
|
||||||
|
|
||||||
<div id="wrap">
|
<div id="wrap">
|
||||||
|
|
||||||
@@ -403,12 +410,12 @@ $pdo = null;
|
|||||||
<!--ユーザーネーム関係-->
|
<!--ユーザーネーム関係-->
|
||||||
<div>
|
<div>
|
||||||
<p>EmojiID</p>
|
<p>EmojiID</p>
|
||||||
<input id="username" onInput="checkForm(this)" placeholder="kusa" class="inbox" type="text" name="emojiname" value="<?php if( !empty($_SESSION['emojiname']) ){ echo htmlentities( $_SESSION['emojiname'], ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="username" onInput="checkForm(this)" placeholder="kusa" class="inbox" type="text" name="emojiname" value="<?php if( !empty($_SESSION['emojiname']) ){ echo htmlentities( $_SESSION['emojiname'], ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p>この絵文字について</p>
|
<p>この絵文字について</p>
|
||||||
<input id="username" placeholder="くさデス" class="inbox" type="text" name="emojiinfo" value="<?php if( !empty($_SESSION['emojiinfo']) ){ echo htmlentities( $_SESSION['emojiinfo'], ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="username" placeholder="くさデス" class="inbox" type="text" name="emojiinfo" value="<?php if( !empty($_SESSION['emojiinfo']) ){ echo htmlentities( $_SESSION['emojiinfo'], ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -438,21 +445,21 @@ function checkForm(inputElement) {
|
|||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', function(){
|
window.addEventListener('DOMContentLoaded', function(){
|
||||||
|
|
||||||
// ファイルが選択されたら実行
|
// ファイルが選択されたら実行
|
||||||
document.getElementById("file_upload").addEventListener('change', function(e){
|
document.getElementById("file_upload").addEventListener('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) {
|
||||||
console.log(e.target.result);
|
|
||||||
const element = document.querySelector('#wrap');
|
const element = document.querySelector('#wrap');
|
||||||
const createElement = '<p>画像を選択しました。</p>';
|
const createElement = '<p>画像を選択しました。</p>';
|
||||||
element.insertAdjacentHTML('afterend', createElement);
|
element.insertAdjacentHTML('afterend', createElement);
|
||||||
});
|
});
|
||||||
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
file_reader.readAsText(e.target.files[0]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
require('../db.php');
|
require('../db.php');
|
||||||
|
|
||||||
if (htmlentities(isset($_POST['code'])) && htmlentities(isset($_POST['userid'])) && htmlentities(isset($_POST['account_id']))){
|
if (htmlentities(isset($_POST['code'])) && htmlentities(isset($_POST['userid'])) && htmlentities(isset($_POST['account_id']))){
|
||||||
$postUserid = htmlentities($_POST['userid']);
|
$postUserid = htmlentities($_POST['userid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$postCode= htmlentities($_POST['code']);
|
$postCode= htmlentities($_POST['code'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$loginid = htmlentities($_POST['account_id']);
|
$loginid = htmlentities($_POST['account_id'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ if (!empty($pdo)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !empty($_POST['code_btn_submit']) ) {
|
if( !empty($_POST['code_btn_submit']) ) {
|
||||||
$make_code = $_POST['make_code'];
|
$make_code = htmlentities($_POST['make_code'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$code_num = 0;
|
$code_num = 0;
|
||||||
while ($code_num < (int)$make_code) {
|
while ($code_num < (int)$make_code) {
|
||||||
$code_num++;
|
$code_num++;
|
||||||
@@ -281,7 +281,7 @@ require('../logout/logout.php');
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||||
<title>招待コード発行所 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>招待コード発行所 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?></title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -302,14 +302,16 @@ require('../logout/logout.php');
|
|||||||
<div class="admin_right">
|
<div class="admin_right">
|
||||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||||
<h1>招待コード発行所</h1>
|
<h1>招待コード発行所</h1>
|
||||||
<?php if(htmlentities($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){?>
|
<?php if(htmlentities($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8', false) === "true"){?>
|
||||||
<p>下の発行ボタンで新しくコードを発行できます!<br>なお、コードは一回限り有効です。</p>
|
<p>下の発行ボタンで新しくコードを発行できます!<br>なお、コードは一回限り有効です。</p>
|
||||||
<div>
|
<div>
|
||||||
<p>発行数</p>
|
<p>発行数</p>
|
||||||
<input id="make_code" placeholder="1" class="inbox" type="number" name="make_code" value="1" min="1" max="10000">
|
<input id="make_code" placeholder="1" class="inbox" type="number" name="make_code" value="1" min="1" max="10000">
|
||||||
</div>
|
</div>
|
||||||
<input type="submit" class = "irobutton" name="code_btn_submit" value="発行!">
|
<input type="submit" class = "irobutton" name="code_btn_submit" value="発行!">
|
||||||
<?php foreach ($codes as $value) {?>
|
<?php
|
||||||
|
if(!(empty($codes))){
|
||||||
|
foreach ($codes as $value) {?>
|
||||||
<div class="server_code">
|
<div class="server_code">
|
||||||
<details>
|
<details>
|
||||||
<summary>コード:<?php if( !empty($value["code"]) ){ echo htmlentities($value["code"]); }?><?php if( !empty($value["used"]) ){if($value["used"] === "true"){echo " ✅";}}?> </summary>
|
<summary>コード:<?php if( !empty($value["code"]) ){ echo htmlentities($value["code"]); }?><?php if( !empty($value["used"]) ){if($value["used"] === "true"){echo " ✅";}}?> </summary>
|
||||||
@@ -318,14 +320,16 @@ require('../logout/logout.php');
|
|||||||
echo "未使用<br>発行日時:".$value["datetime"]."";
|
echo "未使用<br>発行日時:".$value["datetime"]."";
|
||||||
}elseif($value["used"] === "true"){
|
}elseif($value["used"] === "true"){
|
||||||
echo "使用済み<br>使用日時:".$value["datetime"]."";
|
echo "使用済み<br>使用日時:".$value["datetime"]."";
|
||||||
}?></p>
|
}}?></p>
|
||||||
<div class="delbox">
|
<div class="delbox">
|
||||||
<p>削除ボタンを押すとこのコードは使用できなくなります。</p>
|
<p>削除ボタンを押すとこのコードは使用できなくなります。</p>
|
||||||
<button type="button" id="code_delete" class="delbtn" del-code="<?php echo htmlentities($value["code"]);?>">削除</button>
|
<button type="button" id="code_delete" class="delbtn" del-code="<?php echo htmlentities($value["code"]);?>">削除</button>
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
<?php }else{?>
|
||||||
|
<p>招待コードは発行されていません。</p>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<p>サーバーは招待制にされていないため招待コードは利用できません。</p>
|
<p>サーバーは招待制にされていないため招待コードは利用できません。</p>
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ $serversettings = parse_ini_file($serversettings_file, true);
|
|||||||
$colorfile = "../css/color.css";
|
$colorfile = "../css/color.css";
|
||||||
$color_info = file_get_contents($colorfile);
|
$color_info = file_get_contents($colorfile);
|
||||||
|
|
||||||
|
$fontfile = "../css/font.css";
|
||||||
|
$font_info = file_get_contents($fontfile);
|
||||||
|
|
||||||
$manifestfile = "../manifest/manifest.json";
|
$manifestfile = "../manifest/manifest.json";
|
||||||
$manifest_info = file_get_contents($manifestfile);
|
$manifest_info = file_get_contents($manifestfile);
|
||||||
|
|
||||||
@@ -235,16 +238,23 @@ if (!empty($pdo)) {
|
|||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
|
|
||||||
// 空白除去
|
//htmlentitiesで変換すると死ぬので注意
|
||||||
$colordata = $_POST['colordata'];
|
$colordata = $_POST['colordata'];
|
||||||
|
$fontdata = $_POST['fontdata'];
|
||||||
$manifestdata = $_POST['manifestdata'];
|
$manifestdata = $_POST['manifestdata'];
|
||||||
|
|
||||||
//鯖名
|
//色等変数
|
||||||
$file = fopen($colorfile, 'w');
|
$file = fopen($colorfile, 'w');
|
||||||
$data = $colordata;
|
$data = $colordata;
|
||||||
fputs($file, $data);
|
fputs($file, $data);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
|
//フォント呼び出し
|
||||||
|
$file = fopen($fontfile, 'w');
|
||||||
|
$data = $fontdata;
|
||||||
|
fputs($file, $data);
|
||||||
|
fclose($file);
|
||||||
|
|
||||||
//manifest
|
//manifest
|
||||||
$file = fopen($manifestfile, 'w');
|
$file = fopen($manifestfile, 'w');
|
||||||
$data = $manifestdata;
|
$data = $manifestdata;
|
||||||
@@ -268,7 +278,7 @@ require('../logout/logout.php');
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||||
<title>サーバーカスタマイズ - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>サーバーカスタマイズ - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?></title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -291,11 +301,17 @@ require('../logout/logout.php');
|
|||||||
<h1>サーバーカスタマイズ</h1>
|
<h1>サーバーカスタマイズ</h1>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p>CSS</p>
|
<p>Color & Fontname CSS</p>
|
||||||
<div class="p2">ここで指定されている色が適用されます。<br>もし適用されなかった場合はキャッシュを削除し再読み込みしてください。<br>表示がおかしくなってしまった場合はカラーコードを再度確認してください。</div>
|
<div class="p2">ここで指定されている色が適用されます。<br>もし適用されなかった場合はキャッシュを削除し再読み込みしてください。<br>表示がおかしくなってしまった場合はカラーコードを再度確認してください。</div>
|
||||||
<textarea id="colordata" placeholder="CSS" class="inbox" type="text" name="colordata"><?php $sinfo = explode("\r", $color_info); foreach ($sinfo as $info) { echo $info; }?></textarea>
|
<textarea id="colordata" placeholder="CSS" class="inbox" type="text" name="colordata"><?php $sinfo = explode("\r", $color_info); foreach ($sinfo as $info) { echo $info; }?></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>FontRequire CSS</p>
|
||||||
|
<div class="p2">ここで指定されている色が適用されます。<br>もし適用されなかった場合はキャッシュを削除し再読み込みしてください。<br>表示がおかしくなってしまった場合はカラーコードを再度確認してください。</div>
|
||||||
|
<textarea id="fontdata" placeholder="FontRequireCSS" class="inbox" type="text" name="fontdata"><?php $sinfo = explode("\r", $font_info); foreach ($sinfo as $info) { echo $info; }?></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p>PWA(manifest)</p>
|
<p>PWA(manifest)</p>
|
||||||
<div class="p2">ここでPWAの設定を変更できます。<br>"short_name"、"name"が表示されるアプリ名、"theme_color"、"background_color"がテーマカラーとPWA起動時のスプラッシュ画面の背景色です。<br>いま記載したもの以外の設定は変更しないことをお勧めします。</div>
|
<div class="p2">ここでPWAの設定を変更できます。<br>"short_name"、"name"が表示されるアプリ名、"theme_color"、"background_color"がテーマカラーとPWA起動時のスプラッシュ画面の背景色です。<br>いま記載したもの以外の設定は変更しないことをお勧めします。</div>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ $serverstopfile = "../server/serverstop.txt";
|
|||||||
$htaccessfile = "../.htaccess";
|
$htaccessfile = "../.htaccess";
|
||||||
|
|
||||||
if(!empty(file_get_contents($serverstopfile))){
|
if(!empty(file_get_contents($serverstopfile))){
|
||||||
$serverstop = htmlentities(file_get_contents($serverstopfile), ENT_QUOTES, 'UTF-8');
|
$serverstop = htmlentities(file_get_contents($serverstopfile), ENT_QUOTES, 'UTF-8', false);
|
||||||
}else{
|
}else{
|
||||||
$serverstop = "";
|
$serverstop = "";
|
||||||
}
|
}
|
||||||
@@ -236,7 +236,7 @@ if (!empty($pdo)) {
|
|||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
|
|
||||||
// 空白除去
|
// 空白除去
|
||||||
$serverstop = $_POST['serverstop'];
|
$serverstop = htmlentities($_POST['serverstop'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
//鯖停止
|
//鯖停止
|
||||||
$file = fopen($serverstopfile, 'w');
|
$file = fopen($serverstopfile, 'w');
|
||||||
@@ -290,7 +290,7 @@ require('../logout/logout.php');
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||||
<title>メンテナンス - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>メンテナンス - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?></title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ require('../logout/logout.php');
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||||
<title>モデレーション - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>モデレーション - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?></title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -368,7 +368,7 @@ require('../logout/logout.php');
|
|||||||
<div>
|
<div>
|
||||||
<p>投稿の最大文字数</p>
|
<p>投稿の最大文字数</p>
|
||||||
<div class="p2">ここで設定した文字数までの投稿が可能です。<br>なお、データベースより最大文字数を設定している場合そちらが優先されて使用されます。<br>1文字から16777216文字の間で設定が可能です。<br>※uwuzu version 1.3.0以前にuwuzuを導入された方はuwuzuのDB内のtext型を全てmediumtext型にしてください。</div>
|
<div class="p2">ここで設定した文字数までの投稿が可能です。<br>なお、データベースより最大文字数を設定している場合そちらが優先されて使用されます。<br>1文字から16777216文字の間で設定が可能です。<br>※uwuzu version 1.3.0以前にuwuzuを導入された方はuwuzuのDB内のtext型を全てmediumtext型にしてください。</div>
|
||||||
<input id="max_textsize" placeholder="1024" class="inbox" type="number" min="1" max="16777216" name="max_textsize" value="<?php if( !empty(file_get_contents($mojisizefile)) ){ echo htmlentities(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="max_textsize" placeholder="1024" class="inbox" type="number" min="1" max="16777216" name="max_textsize" value="<?php if( !empty(file_get_contents($mojisizefile)) ){ echo htmlentities(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div>
|
<div>
|
||||||
@@ -387,9 +387,9 @@ require('../logout/logout.php');
|
|||||||
<div id="hcaptcha">
|
<div id="hcaptcha">
|
||||||
<p>hCaptcha - 認証情報設定</p>
|
<p>hCaptcha - 認証情報設定</p>
|
||||||
<div class="p2">サイトキー</div>
|
<div class="p2">サイトキー</div>
|
||||||
<input id="hcaptcha" placeholder="" class="inbox" type="text" name="hCaptcha_sitekey" value="<?php if( !empty(H_CAPTCHA_SITE_KEY) ){ echo htmlentities(H_CAPTCHA_SITE_KEY, ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="hcaptcha" placeholder="" class="inbox" type="text" name="hCaptcha_sitekey" value="<?php if( !empty(H_CAPTCHA_SITE_KEY) ){ echo htmlentities(H_CAPTCHA_SITE_KEY, ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
<div class="p2">シークレットキー</div>
|
<div class="p2">シークレットキー</div>
|
||||||
<input id="hcaptcha" placeholder="" class="inbox" type="text" name="hCaptcha_seackey" value="<?php if( !empty(H_CAPTCHA_SEAC_KEY) ){ echo htmlentities(H_CAPTCHA_SEAC_KEY, ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="hcaptcha" placeholder="" class="inbox" type="text" name="hCaptcha_seackey" value="<?php if( !empty(H_CAPTCHA_SEAC_KEY) ){ echo htmlentities(H_CAPTCHA_SEAC_KEY, ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
<p>デモ</p>
|
<p>デモ</p>
|
||||||
<div class="h-captcha" data-sitekey="10000000-ffff-ffff-ffff-000000000001"></div>
|
<div class="h-captcha" data-sitekey="10000000-ffff-ffff-ffff-000000000001"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -411,9 +411,9 @@ require('../logout/logout.php');
|
|||||||
<div id="CF_Turnstile">
|
<div id="CF_Turnstile">
|
||||||
<p>CloudflareTurnstile - 認証情報設定</p>
|
<p>CloudflareTurnstile - 認証情報設定</p>
|
||||||
<div class="p2">サイトキー</div>
|
<div class="p2">サイトキー</div>
|
||||||
<input id="CF_Turnstile" placeholder="" class="inbox" type="text" name="CF_Turnstile_sitekey" value="<?php if( !empty(CF_TURNSTILE_SITE_KEY) ){ echo htmlentities(CF_TURNSTILE_SITE_KEY, ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="CF_Turnstile" placeholder="" class="inbox" type="text" name="CF_Turnstile_sitekey" value="<?php if( !empty(CF_TURNSTILE_SITE_KEY) ){ echo htmlentities(CF_TURNSTILE_SITE_KEY, ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
<div class="p2">シークレットキー</div>
|
<div class="p2">シークレットキー</div>
|
||||||
<input id="CF_Turnstile" placeholder="" class="inbox" type="text" name="CF_Turnstile_seackey" value="<?php if( !empty(CF_TURNSTILE_SEAC_KEY) ){ echo htmlentities(CF_TURNSTILE_SEAC_KEY, ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="CF_Turnstile" placeholder="" class="inbox" type="text" name="CF_Turnstile_seackey" value="<?php if( !empty(CF_TURNSTILE_SEAC_KEY) ){ echo htmlentities(CF_TURNSTILE_SEAC_KEY, ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
<p>デモ<p>
|
<p>デモ<p>
|
||||||
<div class="cf-turnstile" data-sitekey="1x00000000000000000000AA" data-callback="javascriptCallback" data-language="ja"></div>
|
<div class="cf-turnstile" data-sitekey="1x00000000000000000000AA" data-callback="javascriptCallback" data-language="ja"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -213,28 +213,46 @@ $count3 = $result3->num_rows;
|
|||||||
$result4 = $mysqli->query("SELECT userid FROM account WHERE sacinfo = 'bot'");
|
$result4 = $mysqli->query("SELECT userid FROM account WHERE sacinfo = 'bot'");
|
||||||
$count4 = $result4->num_rows;
|
$count4 = $result4->num_rows;
|
||||||
|
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
if(function_exists("disk_free_space")){
|
||||||
$diskFree = (int) disk_free_space('C:') / 1024 / 1024;
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||||
$diskTotal = (int) disk_total_space('C:') / 1024 / 1024;
|
$disk = true;
|
||||||
$diskUmari = $diskTotal - $diskFree;
|
$diskFree = (int) disk_free_space('C:') / 1024 / 1024;
|
||||||
if ($diskFree / $diskTotal < 0.1) {
|
$diskTotal = (int) disk_total_space('C:') / 1024 / 1024;
|
||||||
$disk_over90p = true;
|
$diskUmari = $diskTotal - $diskFree;
|
||||||
}else{
|
if ($diskFree / $diskTotal < 0.1) {
|
||||||
$disk_over90p = false;
|
$disk_over90p = true;
|
||||||
|
}else{
|
||||||
|
$disk_over90p = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$loadAve = null;
|
||||||
|
} else {
|
||||||
|
$disk = true;
|
||||||
|
$diskFree = (int) disk_free_space('/') / 1024 / 1024;
|
||||||
|
$diskTotal = (int) disk_total_space('/') / 1024 / 1024;
|
||||||
|
$diskUmari = $diskTotal - $diskFree;
|
||||||
|
if ($diskFree / $diskTotal < 0.1) {
|
||||||
|
$disk_over90p = true;
|
||||||
|
}else{
|
||||||
|
$disk_over90p = false;
|
||||||
|
}
|
||||||
|
if(function_exists("sys_getloadavg")){
|
||||||
|
$loadAve = sys_getloadavg()[0];
|
||||||
|
}else{
|
||||||
|
$loadAve = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
$loadAve = null;
|
$disk = false;
|
||||||
} else {
|
$diskFree = 5000;
|
||||||
$diskFree = (int) disk_free_space('/') / 1024 / 1024;
|
$diskUmari = 5000;
|
||||||
$diskTotal = (int) disk_total_space('/') / 1024 / 1024;
|
$diskTotal = 10000;
|
||||||
$diskUmari = $diskTotal - $diskFree;
|
$disk_over90p = false;
|
||||||
if ($diskFree / $diskTotal < 0.1) {
|
if(function_exists("sys_getloadavg")){
|
||||||
$disk_over90p = true;
|
$loadAve = sys_getloadavg()[0];
|
||||||
}else{
|
}else{
|
||||||
$disk_over90p = false;
|
$loadAve = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$loadAve = sys_getloadavg()[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
require('../logout/logout.php');
|
require('../logout/logout.php');
|
||||||
@@ -250,7 +268,7 @@ require('../logout/logout.php');
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||||
<title>サーバー概要 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>サーバー概要 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?></title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -274,32 +292,32 @@ require('../logout/logout.php');
|
|||||||
<!--(サーバーアイコン)-->
|
<!--(サーバーアイコン)-->
|
||||||
<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
|
<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
|
||||||
<div class="serverhead">
|
<div class="serverhead">
|
||||||
<img src="<?php echo htmlentities($serversettings["serverinfo"]["server_head"], ENT_QUOTES, 'UTF-8'); ?>">
|
<img src="<?php echo htmlentities($serversettings["serverinfo"]["server_head"], ENT_QUOTES, 'UTF-8', false); ?>">
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<?php if( !empty($serversettings["serverinfo"]["server_icon"]) ){ ?>
|
<?php if( !empty($serversettings["serverinfo"]["server_icon"]) ){ ?>
|
||||||
<div class="servericon">
|
<div class="servericon">
|
||||||
<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
|
<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
|
||||||
<div class="up">
|
<div class="up">
|
||||||
<img src="<?php echo htmlentities($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
|
<img src="<?php echo htmlentities($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8', false); ?>">
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<img src="<?php echo htmlentities($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
|
<img src="<?php echo htmlentities($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8', false); ?>">
|
||||||
<?php }?>
|
<?php }?>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<!--(サーバーアイコンここまで)-->
|
<!--(サーバーアイコンここまで)-->
|
||||||
<p>サーバー名</p>
|
<p>サーバー名</p>
|
||||||
<p><?php if( !empty(htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8')) ){ echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8'); } ?></p>
|
<p><?php if( !empty(htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false)) ){ echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false); } ?></p>
|
||||||
<hr>
|
<hr>
|
||||||
<p>サーバー紹介メッセージ</p>
|
<p>サーバー紹介メッセージ</p>
|
||||||
<p><?php $sinfo = explode("\n", $serverinfo); foreach ($sinfo as $info) { echo nl2br(htmlentities($info)); }?></p>
|
<p><?php $sinfo = explode("\n", $serverinfo); foreach ($sinfo as $info) { echo nl2br(htmlentities($info)); }?></p>
|
||||||
<hr>
|
<hr>
|
||||||
<p>サーバー管理者の名前</p>
|
<p>サーバー管理者の名前</p>
|
||||||
<p><?php if( !empty(htmlentities($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8')) ){ echo htmlentities($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8'); } ?></p>
|
<p><?php if( !empty(htmlentities($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8', false)) ){ echo htmlentities($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8', false); } ?></p>
|
||||||
<hr>
|
<hr>
|
||||||
<p>サーバーへのお問い合わせ用メールアドレス</p>
|
<p>サーバーへのお問い合わせ用メールアドレス</p>
|
||||||
<p><?php if( !empty(htmlentities($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8')) ){ echo htmlentities($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8'); } ?></p>
|
<p><?php if( !empty(htmlentities($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8', false)) ){ echo htmlentities($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8', false); } ?></p>
|
||||||
<hr>
|
<hr>
|
||||||
<p>統計情報</p>
|
<p>統計情報</p>
|
||||||
<div class="overview">
|
<div class="overview">
|
||||||
@@ -324,17 +342,21 @@ require('../logout/logout.php');
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<p>ディスク空き容量</p>
|
<p>ディスク空き容量</p>
|
||||||
<?php if($disk_over90p == true){?>
|
<?php if($disk == true){?>
|
||||||
<p class="errmsg">90%以上が使用済みです。<br>早急に容量拡張などの対応を考えてください!</p>
|
<?php if($disk_over90p == true){?>
|
||||||
<?php }else{?>
|
<p class="errmsg">90%以上が使用済みです。<br>早急に容量拡張などの対応を考えてください!</p>
|
||||||
<p>ディスク空き容量には余裕があります。</p>
|
<?php }else{?>
|
||||||
<?php };?>
|
<p>ディスク空き容量には余裕があります。</p>
|
||||||
<div class="graph">
|
<?php };?>
|
||||||
<div class="per" style="width:calc(<?php echo round((int)mb_to_gb($diskUmari) / (int)mb_to_gb($diskTotal) * 100, 1);?>% - 8px);">
|
<div class="graph">
|
||||||
|
<div class="per" style="width:calc(<?php echo round((int)mb_to_gb($diskUmari) / (int)mb_to_gb($diskTotal) * 100, 1);?>% - 8px);">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<p>使用済み : <?php echo mb_to_gb($diskUmari)."GB/".mb_to_gb($diskTotal);?>GB<br>
|
||||||
<p>使用済み : <?php echo mb_to_gb($diskUmari)."GB/".mb_to_gb($diskTotal);?>GB<br>
|
空き容量 : <?php echo mb_to_gb($diskFree);?>GB</p>
|
||||||
空き容量 : <?php echo mb_to_gb($diskFree);?>GB</p>
|
<?php }else{?>
|
||||||
|
<p>空き容量の取得ができませんでした。</p>
|
||||||
|
<?php };?>
|
||||||
<hr>
|
<hr>
|
||||||
<p>ロードアベレージ</p>
|
<p>ロードアベレージ</p>
|
||||||
<div class="p2">ロードアベレージはCPUのコア数と照らし合わせて活用してください。<br>
|
<div class="p2">ロードアベレージはCPUのコア数と照らし合わせて活用してください。<br>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ $serverstopfile = "../server/serverstop.txt";
|
|||||||
$domain = $_SERVER['HTTP_HOST'];
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
|
||||||
if(!empty(file_get_contents($serverstopfile))){
|
if(!empty(file_get_contents($serverstopfile))){
|
||||||
$serverstop = htmlentities(file_get_contents($serverstopfile), ENT_QUOTES, 'UTF-8');
|
$serverstop = htmlentities(file_get_contents($serverstopfile), ENT_QUOTES, 'UTF-8', false);
|
||||||
}else{
|
}else{
|
||||||
$serverstop = "";
|
$serverstop = "";
|
||||||
}
|
}
|
||||||
@@ -197,26 +197,26 @@ $notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
|
|||||||
$notificationcount = $notiData['notification_count'];
|
$notificationcount = $notiData['notification_count'];
|
||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
$N_MAIL_ONOFF = $_POST['mailchks_onoff'];
|
$N_MAIL_ONOFF = htmlentities($_POST['mailchks_onoff'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$N_MAIL_ADDS = $_POST['N_MAIL_ADDS'];
|
$N_MAIL_ADDS = htmlentities($_POST['N_MAIL_ADDS'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$N_MAIL_HOST = $_POST['N_MAIL_HOST'];
|
$N_MAIL_HOST = htmlentities($_POST['N_MAIL_HOST'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$N_MAIL_PORT = $_POST['N_MAIL_PORT'];
|
$N_MAIL_PORT = htmlentities($_POST['N_MAIL_PORT'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$N_MAIL_USER = $_POST['N_MAIL_USER'];
|
$N_MAIL_USER = htmlentities($_POST['N_MAIL_USER'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$N_MAIL_PASS = $_POST['N_MAIL_PASS'];
|
$N_MAIL_PASS = htmlentities($_POST['N_MAIL_PASS'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$N_MAIL_SSL_ = $_POST['ssl_tls_none'];
|
$N_MAIL_SSL_ = htmlentities($_POST['ssl_tls_none'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$New_Mail_Settings = "
|
$New_Mail_Settings = "
|
||||||
<?php // メールサーバーの情報
|
<?php // メールサーバーの情報
|
||||||
define( 'MAIL_CHKS', '".htmlentities($N_MAIL_ONOFF)."');// trueならPHPMailerが有効
|
define( 'MAIL_CHKS', '".$N_MAIL_ONOFF."');// trueならPHPMailerが有効
|
||||||
|
|
||||||
define( 'MAIL_ADDS', '".htmlentities($N_MAIL_ADDS)."');
|
define( 'MAIL_ADDS', '".$N_MAIL_ADDS."');
|
||||||
define( 'MAIL_HOST', '".htmlentities($N_MAIL_HOST)."');
|
define( 'MAIL_HOST', '".$N_MAIL_HOST."');
|
||||||
define( 'MAIL_PORT', '".htmlentities($N_MAIL_PORT)."');
|
define( 'MAIL_PORT', '".$N_MAIL_PORT."');
|
||||||
define( 'MAIL_USER', '".htmlentities($N_MAIL_USER)."');
|
define( 'MAIL_USER', '".$N_MAIL_USER."');
|
||||||
define( 'MAIL_PASS', '".htmlentities($N_MAIL_PASS)."');
|
define( 'MAIL_PASS', '".$N_MAIL_PASS."');
|
||||||
define( 'MAIL_SSL_', '".htmlentities($N_MAIL_SSL_)."');
|
define( 'MAIL_SSL_', '".$N_MAIL_SSL_."');
|
||||||
?>
|
?>
|
||||||
";
|
";
|
||||||
|
|
||||||
@@ -232,7 +232,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !empty($_POST['testmail_send_btn_submit']) ) {
|
if( !empty($_POST['testmail_send_btn_submit']) ) {
|
||||||
$test_mail_adds = $_POST['test_sender_adds'];
|
$test_mail_adds = htmlentities($_POST['test_sender_adds'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$mail_title = "Test email";
|
$mail_title = "Test email";
|
||||||
$mail_text = "これはuwuzuのテストメールです。 問題なく受信できていますか?";
|
$mail_text = "これはuwuzuのテストメールです。 問題なく受信できていますか?";
|
||||||
@@ -252,7 +252,7 @@ require('../logout/logout.php');
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||||
<title>プラグイン - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>プラグイン - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?></title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -291,15 +291,15 @@ require('../logout/logout.php');
|
|||||||
<div id="mail_plugin">
|
<div id="mail_plugin">
|
||||||
<p>PHPMailer - メールサーバー設定</p>
|
<p>PHPMailer - メールサーバー設定</p>
|
||||||
<div class="p2">メールアドレス</div>
|
<div class="p2">メールアドレス</div>
|
||||||
<input id="mail_plugin" placeholder="user@localhost" class="inbox" type="text" name="N_MAIL_ADDS" value="<?php if( !empty(MAIL_ADDS) ){ echo htmlentities(MAIL_ADDS, ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="mail_plugin" placeholder="user@localhost" class="inbox" type="text" name="N_MAIL_ADDS" value="<?php if( !empty(MAIL_ADDS) ){ echo htmlentities(MAIL_ADDS, ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
<div class="p2">ホスト名</div>
|
<div class="p2">ホスト名</div>
|
||||||
<input id="mail_plugin" placeholder="smtp.mailserver.com" class="inbox" type="text" name="N_MAIL_HOST" value="<?php if( !empty(MAIL_HOST) ){ echo htmlentities(MAIL_HOST, ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="mail_plugin" placeholder="smtp.mailserver.com" class="inbox" type="text" name="N_MAIL_HOST" value="<?php if( !empty(MAIL_HOST) ){ echo htmlentities(MAIL_HOST, ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
<div class="p2">ポート番号</div>
|
<div class="p2">ポート番号</div>
|
||||||
<input id="mail_plugin" placeholder="465" class="inbox" type="text" name="N_MAIL_PORT" value="<?php if( !empty(MAIL_PORT) ){ echo htmlentities(MAIL_PORT, ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="mail_plugin" placeholder="465" class="inbox" type="text" name="N_MAIL_PORT" value="<?php if( !empty(MAIL_PORT) ){ echo htmlentities(MAIL_PORT, ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
<div class="p2">ユーザー名</div>
|
<div class="p2">ユーザー名</div>
|
||||||
<input id="mail_plugin" placeholder="from@localhost" class="inbox" type="text" name="N_MAIL_USER" value="<?php if( !empty(MAIL_USER) ){ echo htmlentities(MAIL_USER, ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="mail_plugin" placeholder="from@localhost" class="inbox" type="text" name="N_MAIL_USER" value="<?php if( !empty(MAIL_USER) ){ echo htmlentities(MAIL_USER, ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
<div class="p2">パスワード</div>
|
<div class="p2">パスワード</div>
|
||||||
<input id="mail_plugin" placeholder="password" class="inbox" type="text" name="N_MAIL_PASS" style="-webkit-text-security:disc;" value="<?php if( !empty(MAIL_PASS) ){ echo htmlentities(MAIL_PASS, ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="mail_plugin" placeholder="password" class="inbox" type="text" name="N_MAIL_PASS" style="-webkit-text-security:disc;" value="<?php if( !empty(MAIL_PASS) ){ echo htmlentities(MAIL_PASS, ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
|
|
||||||
<div class="p2">暗号化設定</div>
|
<div class="p2">暗号化設定</div>
|
||||||
<div class="radio_btn_zone">
|
<div class="radio_btn_zone">
|
||||||
|
|||||||
@@ -185,10 +185,10 @@ $notificationcount = $notiData['notification_count'];
|
|||||||
|
|
||||||
if( !empty($_POST['role_btn_submit']) ) {
|
if( !empty($_POST['role_btn_submit']) ) {
|
||||||
|
|
||||||
$rolename = htmlentities($_POST['rolename']);
|
$rolename = htmlentities($_POST['rolename'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$roleid = htmlentities($_POST['roleid']);
|
$roleid = htmlentities($_POST['roleid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$rolecolor = htmlentities($_POST['rolecolor']);
|
$rolecolor = htmlentities($_POST['rolecolor'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$roleeffect = htmlentities($_POST['roleeffect']);
|
$roleeffect = htmlentities($_POST['roleeffect'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
$query = $dbh->prepare('SELECT * FROM role WHERE roleidname = :roleid limit 1');
|
$query = $dbh->prepare('SELECT * FROM role WHERE roleidname = :roleid limit 1');
|
||||||
@@ -269,7 +269,7 @@ if( !empty($_POST['role_btn_submit']) ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !empty($_POST['role_del']) ) {
|
if( !empty($_POST['role_del']) ) {
|
||||||
$role_id = htmlentities($_POST['role_id']);
|
$role_id = htmlentities($_POST['role_id'], ENT_QUOTES, 'UTF-8', false);
|
||||||
try{
|
try{
|
||||||
// 通知削除クエリを実行
|
// 通知削除クエリを実行
|
||||||
$deleteQuery = $pdo->prepare("DELETE FROM role WHERE roleidname = :roleid");
|
$deleteQuery = $pdo->prepare("DELETE FROM role WHERE roleidname = :roleid");
|
||||||
@@ -319,8 +319,8 @@ if( !empty($_POST['role_del']) ) {
|
|||||||
|
|
||||||
|
|
||||||
if( !empty($_POST['send_add_role_submit']) ) {
|
if( !empty($_POST['send_add_role_submit']) ) {
|
||||||
$add_userid = htmlentities($_POST['add_userid']);
|
$add_userid = htmlentities($_POST['add_userid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$add_roleid = htmlentities($_POST['add_roleid']);
|
$add_roleid = htmlentities($_POST['add_roleid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
$query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
$query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
||||||
@@ -371,8 +371,8 @@ if( !empty($_POST['send_add_role_submit']) ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !empty($_POST['send_del_role_submit']) ) {
|
if( !empty($_POST['send_del_role_submit']) ) {
|
||||||
$del_userid = htmlentities($_POST['del_userid']);
|
$del_userid = htmlentities($_POST['del_userid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$del_roleid = htmlentities($_POST['del_roleid']);
|
$del_roleid = htmlentities($_POST['del_roleid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
$query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
$query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
||||||
|
|||||||
@@ -237,42 +237,49 @@ if (!empty($pdo)) {
|
|||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
|
|
||||||
$servericon = $_POST['servericon'];
|
$servericon = htmlentities($_POST['servericon'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$serverhead = $_POST['serverhead'];
|
$serverhead = htmlentities($_POST['serverhead'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$serverlogo_onoff = $_POST['serverlogo_onoff'];
|
$serverlogo_onoff = htmlentities($_POST['serverlogo_onoff'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$serverlogo_light = $_POST['serverlogo_light'];
|
$serverlogo_light = htmlentities($_POST['serverlogo_light'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$serverlogo_dark = $_POST['serverlogo_dark'];
|
$serverlogo_dark = htmlentities($_POST['serverlogo_dark'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
if(!($serverlogo_onoff === "true")){
|
if(!($serverlogo_onoff === "true")){
|
||||||
$serverlogo_light = "";
|
$serverlogo_light = "";
|
||||||
$serverlogo_dark = "";
|
$serverlogo_dark = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$servername = $_POST['servername'];
|
$servername = htmlentities($_POST['servername'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$serverinfo = $_POST['serverinfo'];
|
$serverinfo = htmlentities($_POST['serverinfo'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$serveradminname = $_POST['serveradminname'];
|
$serveradminname = htmlentities($_POST['serveradminname'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$servermailadds = $_POST['servermailadds'];
|
$servermailadds = htmlentities($_POST['servermailadds'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$onlyuser = $_POST['onlyuser'];
|
$onlyuser = htmlentities($_POST['onlyuser'], ENT_QUOTES, 'UTF-8', false);
|
||||||
if($onlyuser === "true"){
|
if($onlyuser === "true"){
|
||||||
$saveonlyuser = "true";
|
$saveonlyuser = "true";
|
||||||
}else{
|
}else{
|
||||||
$saveonlyuser = "false";
|
$saveonlyuser = "false";
|
||||||
}
|
}
|
||||||
$activitypub = $_POST['activitypub'];
|
$activitypub = htmlentities($_POST['activitypub'], ENT_QUOTES, 'UTF-8', false);
|
||||||
if($activitypub === "true"){
|
if($activitypub === "true"){
|
||||||
$saveactivitypub = "true";
|
$saveactivitypub = "true";
|
||||||
}else{
|
}else{
|
||||||
$saveactivitypub = "false";
|
$saveactivitypub = "false";
|
||||||
}
|
}
|
||||||
|
|
||||||
$postrobots = $_POST['robots'];
|
$migration = htmlentities($_POST['migration'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
if($migration === "true"){
|
||||||
|
$savemigration = "true";
|
||||||
|
}else{
|
||||||
|
$savemigration = "false";
|
||||||
|
}
|
||||||
|
|
||||||
|
$postrobots = htmlentities($_POST['robots'], ENT_QUOTES, 'UTF-8', false);
|
||||||
if($postrobots === "true"){
|
if($postrobots === "true"){
|
||||||
//GPTBotによるクロールを拒否
|
//GPTBotによるクロールを拒否
|
||||||
$file = fopen($robots, 'w');
|
$file = fopen($robots, 'w');
|
||||||
@@ -287,9 +294,9 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
fclose($file);
|
fclose($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
$serverterms = $_POST['serverterms'];
|
$serverterms = htmlentities($_POST['serverterms'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$serverprv = $_POST['serverprv'];
|
$serverprv = htmlentities($_POST['serverprv'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
$server_new_settings = '
|
$server_new_settings = '
|
||||||
;サーバーの基本情報
|
;サーバーの基本情報
|
||||||
@@ -309,6 +316,8 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
;招待のオンオフ
|
;招待のオンオフ
|
||||||
server_invitation = "'.$saveonlyuser.'"
|
server_invitation = "'.$saveonlyuser.'"
|
||||||
server_activitypub = "'.$saveactivitypub.'"
|
server_activitypub = "'.$saveactivitypub.'"
|
||||||
|
;アカウントの移行登録を許可するか
|
||||||
|
server_account_migration = "'.$savemigration.'"
|
||||||
';
|
';
|
||||||
|
|
||||||
//サーバー設定上書き
|
//サーバー設定上書き
|
||||||
@@ -353,7 +362,7 @@ require('../logout/logout.php');
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||||
<title>サーバー設定 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>サーバー設定 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?></title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -377,17 +386,17 @@ require('../logout/logout.php');
|
|||||||
<!--(サーバーアイコン)-->
|
<!--(サーバーアイコン)-->
|
||||||
<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
|
<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
|
||||||
<div class="serverhead_set">
|
<div class="serverhead_set">
|
||||||
<img src="<?php echo htmlentities($serversettings["serverinfo"]["server_head"], ENT_QUOTES, 'UTF-8'); ?>">
|
<img src="<?php echo htmlentities($serversettings["serverinfo"]["server_head"], ENT_QUOTES, 'UTF-8', false); ?>">
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<?php if( !empty($serversettings["serverinfo"]["server_icon"]) ){ ?>
|
<?php if( !empty($serversettings["serverinfo"]["server_icon"]) ){ ?>
|
||||||
<div class="servericon">
|
<div class="servericon">
|
||||||
<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
|
<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
|
||||||
<div class="up">
|
<div class="up">
|
||||||
<img src="<?php echo htmlentities($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
|
<img src="<?php echo htmlentities($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8', false); ?>">
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<img src="<?php echo htmlentities($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
|
<img src="<?php echo htmlentities($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8', false); ?>">
|
||||||
<?php }?>
|
<?php }?>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
@@ -395,12 +404,12 @@ require('../logout/logout.php');
|
|||||||
<div>
|
<div>
|
||||||
<p>サーバーアイコン</p>
|
<p>サーバーアイコン</p>
|
||||||
<div class="p2">サーバー登録画面などに表示されます。<br>自動的に角が丸くなります。<br>URLより設定してください。(設定しなくても大丈夫です。)</div>
|
<div class="p2">サーバー登録画面などに表示されます。<br>自動的に角が丸くなります。<br>URLより設定してください。(設定しなくても大丈夫です。)</div>
|
||||||
<input id="servericon" placeholder="https://~" class="inbox" type="text" name="servericon" value="<?php if( !empty($serversettings["serverinfo"]["server_icon"]) ){ echo htmlentities($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="servericon" placeholder="https://~" class="inbox" type="text" name="servericon" value="<?php if( !empty($serversettings["serverinfo"]["server_icon"]) ){ echo htmlentities($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p>サーバーヘッダー</p>
|
<p>サーバーヘッダー</p>
|
||||||
<div class="p2">サーバー登録画面などに表示されます。<br>自動的に角が丸くなります。<br>URLより設定してください。(設定しなくても大丈夫です。)</div>
|
<div class="p2">サーバー登録画面などに表示されます。<br>自動的に角が丸くなります。<br>URLより設定してください。(設定しなくても大丈夫です。)</div>
|
||||||
<input id="serverhead" placeholder="https://~" class="inbox" type="text" name="serverhead" value="<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ echo htmlentities($serversettings["serverinfo"]["server_head"], ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="serverhead" placeholder="https://~" class="inbox" type="text" name="serverhead" value="<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ echo htmlentities($serversettings["serverinfo"]["server_head"], ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -419,9 +428,9 @@ require('../logout/logout.php');
|
|||||||
<p>サーバーロゴ</p>
|
<p>サーバーロゴ</p>
|
||||||
<div class="p2">サーバーの左上に表示されているuwuzuのロゴを独自のロゴに置き換えるときに使用します。<br>自動的に角が丸くなります。<br>URLより設定してください。<br>背景透過画像を推奨します。</div>
|
<div class="p2">サーバーの左上に表示されているuwuzuのロゴを独自のロゴに置き換えるときに使用します。<br>自動的に角が丸くなります。<br>URLより設定してください。<br>背景透過画像を推奨します。</div>
|
||||||
<div class="p2">ログイン後のロゴ</div>
|
<div class="p2">ログイン後のロゴ</div>
|
||||||
<input id="serverlogo" placeholder="https://~" class="inbox" type="text" name="serverlogo_light" value="<?php if( !empty($serversettings["serverinfo"]["server_logo_home"]) ){ echo htmlentities($serversettings["serverinfo"]["server_logo_home"], ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="serverlogo" placeholder="https://~" class="inbox" type="text" name="serverlogo_light" value="<?php if( !empty($serversettings["serverinfo"]["server_logo_home"]) ){ echo htmlentities($serversettings["serverinfo"]["server_logo_home"], ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
<div class="p2">ログイン画面と利用規約などドキュメントページのロゴ</div>
|
<div class="p2">ログイン画面と利用規約などドキュメントページのロゴ</div>
|
||||||
<input id="serverlogo" placeholder="https://~" class="inbox" type="text" name="serverlogo_dark" value="<?php if( !empty($serversettings["serverinfo"]["server_logo_login"]) ){ echo htmlentities($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="serverlogo" placeholder="https://~" class="inbox" type="text" name="serverlogo_dark" value="<?php if( !empty($serversettings["serverinfo"]["server_logo_login"]) ){ echo htmlentities($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
if ($("#serverlogo_onoff").prop("checked")) {
|
if ($("#serverlogo_onoff").prop("checked")) {
|
||||||
@@ -437,7 +446,7 @@ require('../logout/logout.php');
|
|||||||
<div>
|
<div>
|
||||||
<p>サーバー名</p>
|
<p>サーバー名</p>
|
||||||
<div class="p2">サーバー名です。</div>
|
<div class="p2">サーバー名です。</div>
|
||||||
<input id="servername" placeholder="uwuzuさ~ば~" class="inbox" type="text" name="servername" value="<?php if( !empty($serversettings["serverinfo"]["server_name"]) ){ echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="servername" placeholder="uwuzuさ~ば~" class="inbox" type="text" name="servername" value="<?php if( !empty($serversettings["serverinfo"]["server_name"]) ){ echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -449,13 +458,13 @@ require('../logout/logout.php');
|
|||||||
<div>
|
<div>
|
||||||
<p>サーバー管理者の名前</p>
|
<p>サーバー管理者の名前</p>
|
||||||
<div class="p2">サーバー管理者名です。</div>
|
<div class="p2">サーバー管理者名です。</div>
|
||||||
<input id="serveradminname" placeholder="わたし" class="inbox" type="text" name="serveradminname" value="<?php if( !empty($serversettings["serverinfo"]["server_admin"]) ){ echo htmlentities($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="serveradminname" placeholder="わたし" class="inbox" type="text" name="serveradminname" value="<?php if( !empty($serversettings["serverinfo"]["server_admin"]) ){ echo htmlentities($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p>サーバーへのお問い合わせ用メールアドレス</p>
|
<p>サーバーへのお問い合わせ用メールアドレス</p>
|
||||||
<div class="p2">ユーザーからのお問い合わせメアドです。</div>
|
<div class="p2">ユーザーからのお問い合わせメアドです。</div>
|
||||||
<input id="servermailadds" placeholder="" class="inbox" type="text" name="servermailadds" value="<?php if( !empty($serversettings["serverinfo"]["server_admin_mailadds"]) ){ echo htmlentities($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="servermailadds" placeholder="" class="inbox" type="text" name="servermailadds" value="<?php if( !empty($serversettings["serverinfo"]["server_admin_mailadds"]) ){ echo htmlentities($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -471,6 +480,20 @@ require('../logout/logout.php');
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>アカウントの移行登録を許可するか</p>
|
||||||
|
<div class="p2">他のuwuzuサーバーからのアカウント移行を許可するかです。<br>このサーバーが招待制の場合移行登録にも招待コードが必要となります。</div>
|
||||||
|
<div class="switch_button">
|
||||||
|
<?php if($serversettings["serverinfo"]["server_account_migration"] === "true"){?>
|
||||||
|
<input id="migration" class="switch_input" type='checkbox' name="migration" value="true" checked/>
|
||||||
|
<label for="migration" class="switch_label"></label>
|
||||||
|
<?php }else{?>
|
||||||
|
<input id="migration" class="switch_input" type='checkbox' name="migration" value="true" />
|
||||||
|
<label for="migration" class="switch_label"></label>
|
||||||
|
<?php }?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p>OpenAIによるクロールを拒否するかどうか<br>※robots.txtによりOpenAIからのクロールを拒否するものであり、他のAI企業によるクロールを完全拒否するものではございません。</p>
|
<p>OpenAIによるクロールを拒否するかどうか<br>※robots.txtによりOpenAIからのクロールを拒否するものであり、他のAI企業によるクロールを完全拒否するものではございません。</p>
|
||||||
<div class="switch_button">
|
<div class="switch_button">
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ $notificationcount = $notiData['notification_count'];
|
|||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
|
|
||||||
// 空白除去
|
// 空白除去
|
||||||
$target_userid = htmlentities(str_replace('@', '', $_POST['target_userid']));
|
$target_userid = htmlentities(str_replace('@', '', $_POST['target_userid']), ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
if (!empty($pdo)) {
|
if (!empty($pdo)) {
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
@@ -222,7 +222,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
|
|
||||||
if( !empty($_POST['report_done']) ) {
|
if( !empty($_POST['report_done']) ) {
|
||||||
|
|
||||||
$report_id = $_POST['report_id'];
|
$report_id = htmlentities($_POST['report_id'], ENT_QUOTES, 'UTF-8', false);
|
||||||
|
|
||||||
if (!empty($pdo)) {
|
if (!empty($pdo)) {
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
@@ -268,7 +268,7 @@ if( !empty($_POST['report_done']) ) {
|
|||||||
require('../logout/logout.php');
|
require('../logout/logout.php');
|
||||||
|
|
||||||
if(isset($_GET['q'])){
|
if(isset($_GET['q'])){
|
||||||
$keyword = htmlentities($_GET['q']);
|
$keyword = htmlentities($_GET['q'], ENT_QUOTES, 'UTF-8', false);
|
||||||
}else{
|
}else{
|
||||||
$keyword = "";
|
$keyword = "";
|
||||||
}
|
}
|
||||||
@@ -296,7 +296,7 @@ if (!empty($pdo)) {
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||||
<title>ユーザー管理 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>ユーザー管理 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?></title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -319,7 +319,7 @@ if (!empty($pdo)) {
|
|||||||
<h1>ユーザー管理</h1>
|
<h1>ユーザー管理</h1>
|
||||||
<div>
|
<div>
|
||||||
<p>ユーザーID</p>
|
<p>ユーザーID</p>
|
||||||
<input id="target_userid" placeholder="admin" class="inbox" type="text" name="target_userid" value="<?php if( !empty($keyword) ){ echo htmlentities($keyword, ENT_QUOTES, 'UTF-8'); } ?>">
|
<input id="target_userid" placeholder="admin" class="inbox" type="text" name="target_userid" value="<?php if( !empty($keyword) ){ echo htmlentities($keyword, ENT_QUOTES, 'UTF-8', false); } ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="submit" class = "irobutton" name="btn_submit" value="検索">
|
<input type="submit" class = "irobutton" name="btn_submit" value="検索">
|
||||||
|
|||||||
+22
-22
@@ -231,12 +231,12 @@ if( !empty($_POST['send_ice_submit']) ) {
|
|||||||
|
|
||||||
$newrole = "ice";
|
$newrole = "ice";
|
||||||
$newtoken = "ice";
|
$newtoken = "ice";
|
||||||
$newadmin = "user";
|
$newadmin = "none";
|
||||||
// トランザクション開始
|
// トランザクション開始
|
||||||
$pdo->beginTransaction();
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$touserid = htmlentities($userdata['userid'], ENT_QUOTES, 'UTF-8');
|
$touserid = htmlentities($userdata['userid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
// SQL作成
|
// SQL作成
|
||||||
$stmt = $pdo->prepare("UPDATE account SET role = :role,token = :newtoken,admin = :newadmin WHERE userid = :userid");
|
$stmt = $pdo->prepare("UPDATE account SET role = :role,token = :newtoken,admin = :newadmin WHERE userid = :userid");
|
||||||
|
|
||||||
@@ -264,8 +264,8 @@ if( !empty($_POST['send_ice_submit']) ) {
|
|||||||
if(!empty(MAIL_CHKS && MAIL_CHKS == "true")){
|
if(!empty(MAIL_CHKS && MAIL_CHKS == "true")){
|
||||||
if( !empty($userdata["mailadds"]) ){
|
if( !empty($userdata["mailadds"]) ){
|
||||||
if(filter_var($userdata["mailadds"], FILTER_VALIDATE_EMAIL)){
|
if(filter_var($userdata["mailadds"], FILTER_VALIDATE_EMAIL)){
|
||||||
$mail_title = "お使いの".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8')."アカウントは凍結されました";
|
$mail_title = "お使いの".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false)."アカウントは凍結されました";
|
||||||
$mail_text = "".$userdata["username"]."(".$userdata["userid"].")さん いつもuwuzuをご利用いただきありがとうございます。 ご利用のアカウント(".$userdata["userid"].")が".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8')."管理者により凍結されたためお知らせいたします。 サービス管理者からのメッセージは以下のものです。 ". $notice_msg ." 異議申し立てする場合は[".htmlentities($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8')."]まで異議申し立てをする旨を記載し送信をしてください。";
|
$mail_text = "".$userdata["username"]."(".$userdata["userid"].")さん いつもuwuzuをご利用いただきありがとうございます。 ご利用のアカウント(".$userdata["userid"].")が".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false)."管理者により凍結されたためお知らせいたします。 サービス管理者からのメッセージは以下のものです。 ". $notice_msg ." 異議申し立てする場合は[".htmlentities($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8', false)."]まで異議申し立てをする旨を記載し送信をしてください。";
|
||||||
|
|
||||||
send_html_mail($userdata["mailadds"],$mail_title,$mail_text,"../");
|
send_html_mail($userdata["mailadds"],$mail_title,$mail_text,"../");
|
||||||
}
|
}
|
||||||
@@ -277,7 +277,7 @@ if( !empty($_POST['send_ice_submit']) ) {
|
|||||||
$pdo->beginTransaction();
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$touserid = htmlentities($userdata['userid'], ENT_QUOTES, 'UTF-8');
|
$touserid = htmlentities($userdata['userid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$datetime = date("Y-m-d H:i:s");
|
$datetime = date("Y-m-d H:i:s");
|
||||||
$msg = "サービス管理者からのメッセージは以下のものです。\n" . $notice_msg . "\n異議申し立てする場合は連絡用メールに異議申し立てをする旨を記載し送信をしてください。";
|
$msg = "サービス管理者からのメッセージは以下のものです。\n" . $notice_msg . "\n異議申し立てする場合は連絡用メールに異議申し立てをする旨を記載し送信をしてください。";
|
||||||
$title = "🧊お使いのアカウントは凍結されました。🧊";
|
$title = "🧊お使いのアカウントは凍結されました。🧊";
|
||||||
@@ -324,7 +324,7 @@ if( !empty($_POST['send_water_submit']) ) {
|
|||||||
$pdo->beginTransaction();
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$touserid = htmlentities($userdata['userid'], ENT_QUOTES, 'UTF-8');
|
$touserid = htmlentities($userdata['userid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
// SQL作成
|
// SQL作成
|
||||||
$stmt = $pdo->prepare("UPDATE account SET role = :role,token = :newtoken,admin = :newadmin WHERE userid = :userid");
|
$stmt = $pdo->prepare("UPDATE account SET role = :role,token = :newtoken,admin = :newadmin WHERE userid = :userid");
|
||||||
|
|
||||||
@@ -352,7 +352,7 @@ if( !empty($_POST['send_water_submit']) ) {
|
|||||||
if(!empty(MAIL_CHKS && MAIL_CHKS == "true")){
|
if(!empty(MAIL_CHKS && MAIL_CHKS == "true")){
|
||||||
if( !empty($userdata["mailadds"]) ){
|
if( !empty($userdata["mailadds"]) ){
|
||||||
if(filter_var($userdata["mailadds"], FILTER_VALIDATE_EMAIL)){
|
if(filter_var($userdata["mailadds"], FILTER_VALIDATE_EMAIL)){
|
||||||
$mail_title = "お使いの".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8')."アカウントは解凍されました!";
|
$mail_title = "お使いの".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false)."アカウントは解凍されました!";
|
||||||
$mail_text = "".$userdata["username"]."(".$userdata["userid"].")さん いつもuwuzuをご利用いただきありがとうございます。 ご利用のアカウント(".$userdata["userid"].")が解凍されたためお知らせいたします。 今後、ご利用のuwuzuアカウントは今まで通りご利用いただけます。 また、APIを使用している方はAPIのトークンがリセットされているため再度トークンを発行してご利用ください。";
|
$mail_text = "".$userdata["username"]."(".$userdata["userid"].")さん いつもuwuzuをご利用いただきありがとうございます。 ご利用のアカウント(".$userdata["userid"].")が解凍されたためお知らせいたします。 今後、ご利用のuwuzuアカウントは今まで通りご利用いただけます。 また、APIを使用している方はAPIのトークンがリセットされているため再度トークンを発行してご利用ください。";
|
||||||
|
|
||||||
send_html_mail($userdata["mailadds"],$mail_title,$mail_text,"../");
|
send_html_mail($userdata["mailadds"],$mail_title,$mail_text,"../");
|
||||||
@@ -365,7 +365,7 @@ if( !empty($_POST['send_water_submit']) ) {
|
|||||||
$pdo->beginTransaction();
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$touserid = htmlentities($userdata['userid'], ENT_QUOTES, 'UTF-8');
|
$touserid = htmlentities($userdata['userid'], ENT_QUOTES, 'UTF-8', false);
|
||||||
$datetime = date("Y-m-d H:i:s");
|
$datetime = date("Y-m-d H:i:s");
|
||||||
$msg = "サービス管理者によりお使いのアカウントは解凍されました!\n今まで通りご利用いただけます。\nまた、APIを使用している方はAPIのトークンがリセットされているため再度トークンを発行してご利用ください。";
|
$msg = "サービス管理者によりお使いのアカウントは解凍されました!\n今まで通りご利用いただけます。\nまた、APIを使用している方はAPIのトークンがリセットされているため再度トークンを発行してご利用ください。";
|
||||||
$title = "🫗お使いのアカウントが解凍されました!🫗";
|
$title = "🫗お使いのアカウントが解凍されました!🫗";
|
||||||
@@ -535,8 +535,8 @@ if( !empty($_POST['send_ban_submit']) ) {
|
|||||||
if(!empty(MAIL_CHKS && MAIL_CHKS == "true")){
|
if(!empty(MAIL_CHKS && MAIL_CHKS == "true")){
|
||||||
if( !empty($userdata["mailadds"]) ){
|
if( !empty($userdata["mailadds"]) ){
|
||||||
if(filter_var($userdata["mailadds"], FILTER_VALIDATE_EMAIL)){
|
if(filter_var($userdata["mailadds"], FILTER_VALIDATE_EMAIL)){
|
||||||
$mail_title = "お使いの".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8')."アカウントはBANされました";
|
$mail_title = "お使いの".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false)."アカウントはBANされました";
|
||||||
$mail_text = "".$userdata["username"]."(".$userdata["userid"].")さん いつもuwuzuをご利用いただきありがとうございます。 この度、ご利用のアカウント(".$userdata["userid"].")が".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8')."管理者によりBAN(削除)されたためお知らせいたします。 今後は今までご利用いただいた".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8')."アカウントは利用できません。 ".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8')."サーバー上から今までご利用いただいていたアカウントの情報は削除されたためログインなどもできません。 ご理解とご協力のほどよろしくお願いします。";
|
$mail_text = "".$userdata["username"]."(".$userdata["userid"].")さん いつもuwuzuをご利用いただきありがとうございます。 この度、ご利用のアカウント(".$userdata["userid"].")が".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false)."管理者によりBAN(削除)されたためお知らせいたします。 今後は今までご利用いただいた".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false)."アカウントは利用できません。 ".htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false)."サーバー上から今までご利用いただいていたアカウントの情報は削除されたためログインなどもできません。 ご理解とご協力のほどよろしくお願いします。";
|
||||||
|
|
||||||
send_html_mail($userdata["mailadds"],$mail_title,$mail_text,"../");
|
send_html_mail($userdata["mailadds"],$mail_title,$mail_text,"../");
|
||||||
}
|
}
|
||||||
@@ -576,7 +576,7 @@ require('../logout/logout.php');
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||||
<title>ユーザー管理 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
|
<title>ユーザー管理 - <?php echo htmlentities($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8', false);?></title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -599,8 +599,8 @@ require('../logout/logout.php');
|
|||||||
<div class="icon">
|
<div class="icon">
|
||||||
<img src="<?php echo htmlentities('../'.$userdata['iconname']); ?>">
|
<img src="<?php echo htmlentities('../'.$userdata['iconname']); ?>">
|
||||||
<div class="tatext">
|
<div class="tatext">
|
||||||
<h2><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?></h2>
|
<h2><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?></h2>
|
||||||
<p>@<?php echo htmlentities($userdata['userid'], ENT_QUOTES, 'UTF-8'); ?></p>
|
<p>@<?php echo htmlentities($userdata['userid'], ENT_QUOTES, 'UTF-8', false); ?></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -629,12 +629,12 @@ require('../logout/logout.php');
|
|||||||
|
|
||||||
<div class="profile">
|
<div class="profile">
|
||||||
<div class="p2">プロフィール</div>
|
<div class="p2">プロフィール</div>
|
||||||
<p><?php echo nl2br(htmlentities($userdata["profile"], ENT_QUOTES, 'UTF-8')); ?></p>
|
<p><?php echo nl2br(htmlentities($userdata["profile"], ENT_QUOTES, 'UTF-8', false)); ?></p>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="about">
|
<div class="about">
|
||||||
<div class="p2">メールアドレス</div>
|
<div class="p2">メールアドレス</div>
|
||||||
<p><?php if( !empty($userdata["mailadds"]) ){ echo htmlentities($userdata["mailadds"], ENT_QUOTES, 'UTF-8'); }else{echo "未設定";} ?></p>
|
<p><?php if( !empty($userdata["mailadds"]) ){ echo htmlentities($userdata["mailadds"], ENT_QUOTES, 'UTF-8', false); }else{echo "未設定";} ?></p>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="p2">二段階認証</div>
|
<div class="p2">二段階認証</div>
|
||||||
<p><?php if( !empty($userdata["authcode"]) ){ echo "設定済み";}else{echo "未設定";} ?></p>
|
<p><?php if( !empty($userdata["authcode"]) ){ echo "設定済み";}else{echo "未設定";} ?></p>
|
||||||
@@ -643,15 +643,15 @@ require('../logout/logout.php');
|
|||||||
<p><?php if( !empty($userdata["admin"] === "yes") ){ echo "あり";}else{echo "なし";} ?></p>
|
<p><?php if( !empty($userdata["admin"] === "yes") ){ echo "あり";}else{echo "なし";} ?></p>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="p2">フォロー数</div>
|
<div class="p2">フォロー数</div>
|
||||||
<p><?php if( $followCount > 0 ){ echo htmlentities($followCount, ENT_QUOTES, 'UTF-8');}else{echo "なし";} ?></p>
|
<p><?php if( $followCount > 0 ){ echo htmlentities($followCount, ENT_QUOTES, 'UTF-8', false);}else{echo "なし";} ?></p>
|
||||||
<div class="p2">フォロワー数</div>
|
<div class="p2">フォロワー数</div>
|
||||||
<p><?php if( $followerCount > 0 ){ echo htmlentities($followerCount, ENT_QUOTES, 'UTF-8');}else{echo "なし";} ?></p>
|
<p><?php if( $followerCount > 0 ){ echo htmlentities($followerCount, ENT_QUOTES, 'UTF-8', false);}else{echo "なし";} ?></p>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="p2">投稿数</div>
|
<div class="p2">投稿数</div>
|
||||||
<p><?php if( $upload_cnt1 > 0 ){ echo $upload_cnt1;}else{echo "なし";} ?></p>
|
<p><?php if( $upload_cnt1 > 0 ){ echo $upload_cnt1;}else{echo "なし";} ?></p>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="p2">アカウント登録日時</div>
|
<div class="p2">アカウント登録日時</div>
|
||||||
<p><?php echo htmlentities($userdata["datetime"], ENT_QUOTES, 'UTF-8'); ?></p>
|
<p><?php echo htmlentities($userdata["datetime"], ENT_QUOTES, 'UTF-8', false); ?></p>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="p2">アカウント操作</div>
|
<div class="p2">アカウント操作</div>
|
||||||
<div class="banzone">
|
<div class="banzone">
|
||||||
@@ -670,9 +670,9 @@ require('../logout/logout.php');
|
|||||||
<div id="account_IceModal" class="modal">
|
<div id="account_IceModal" class="modal">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<h1>このアカウントを凍結しますか?</h1>
|
<h1>このアカウントを凍結しますか?</h1>
|
||||||
<p><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんのアカウントを凍結しますか?<br>凍結すると<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんは以下のことができなくなります。<br>・投稿<br>・追記<br>・フォロー<br>・返信<br>・管理者権限の利用(管理者権限を持っていた場合)<br>・APIの使用(トークンがリセットされます)<br>また、以下の欄に入力した内容が個別メッセージとして通知欄に表示されます。<br><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんは異議申し立てが可能です。</p>
|
<p><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんのアカウントを凍結しますか?<br>凍結すると<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんは以下のことができなくなります。<br>・投稿<br>・追記<br>・フォロー<br>・返信<br>・管理者権限の利用(管理者権限を持っていた場合)<br>・APIの使用(トークンがリセットされます)<br>また、以下の欄に入力した内容が個別メッセージとして通知欄に表示されます。<br><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんは異議申し立てが可能です。</p>
|
||||||
<form method="post" id="deleteForm">
|
<form method="post" id="deleteForm">
|
||||||
<textarea id="notice_msg" placeholder="<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんへのメッセージ" name="notice_msg"></textarea>
|
<textarea id="notice_msg" placeholder="<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんへのメッセージ" name="notice_msg"></textarea>
|
||||||
<div class="btn_area">
|
<div class="btn_area">
|
||||||
<input type="submit" id="deleteButton" class="fbtn_no" name="send_ice_submit" value="凍結">
|
<input type="submit" id="deleteButton" class="fbtn_no" name="send_ice_submit" value="凍結">
|
||||||
<input type="button" id="cancelButton" class="fbtn" value="キャンセル">
|
<input type="button" id="cancelButton" class="fbtn" value="キャンセル">
|
||||||
@@ -684,7 +684,7 @@ require('../logout/logout.php');
|
|||||||
<div id="account_BanModal" class="modal">
|
<div id="account_BanModal" class="modal">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<h1>このアカウントをBANしますか?</h1>
|
<h1>このアカウントをBANしますか?</h1>
|
||||||
<p><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんのアカウントをBANしますか?<br>BANすると<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんのアカウントとは削除されます。<br>また、以下のデータも削除されます。<br>・アカウントに紐づいている画像や写真データ<br>・投稿<br>・フォロー情報やいいね情報<br>・APIトークン<br>・アカウントのメールアドレス<br>・その他アカウントに関連している情報<br>また、すぐに削除されるため本人に削除通知を送ることは出来ません。<br><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんのアカウントを削除する場合は「BAN」を押してください。<br>アカウントの復旧は出来ません。</p>
|
<p><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんのアカウントをBANしますか?<br>BANすると<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんのアカウントとは削除されます。<br>また、以下のデータも削除されます。<br>・アカウントに紐づいている画像や写真データ<br>・投稿<br>・フォロー情報やいいね情報<br>・APIトークン<br>・アカウントのメールアドレス<br>・その他アカウントに関連している情報<br>また、すぐに削除されるため本人に削除通知を送ることは出来ません。<br><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんのアカウントを削除する場合は「BAN」を押してください。<br>アカウントの復旧は出来ません。</p>
|
||||||
<form class="btn_area" method="post" id="deleteForm">
|
<form class="btn_area" method="post" id="deleteForm">
|
||||||
<input type="submit" id="deleteButton2" class="fbtn_no" name="send_ban_submit" value="BAN">
|
<input type="submit" id="deleteButton2" class="fbtn_no" name="send_ban_submit" value="BAN">
|
||||||
<input type="button" id="cancelButton2" class="fbtn" value="キャンセル">
|
<input type="button" id="cancelButton2" class="fbtn" value="キャンセル">
|
||||||
@@ -695,7 +695,7 @@ require('../logout/logout.php');
|
|||||||
<div id="account_WaterModal" class="modal">
|
<div id="account_WaterModal" class="modal">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<h1>このアカウントを解凍しますか?</h1>
|
<h1>このアカウントを解凍しますか?</h1>
|
||||||
<p><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんのアカウントを解凍しますか?<br>凍結すると<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8'); ?>さんは今まで通りアカウントを使用できます。</p>
|
<p><?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんのアカウントを解凍しますか?<br>凍結すると<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんは今まで通りアカウントを使用できます。</p>
|
||||||
<form method="post" id="deleteForm">
|
<form method="post" id="deleteForm">
|
||||||
<div class="btn_area">
|
<div class="btn_area">
|
||||||
<input type="submit" id="deleteButton3" class="fbtn_no" name="send_water_submit" value="解凍">
|
<input type="submit" id="deleteButton3" class="fbtn_no" name="send_water_submit" value="解凍">
|
||||||
|
|||||||
+15
-4
@@ -8,6 +8,11 @@ if(!(empty($_SESSION['backupcode']))){
|
|||||||
}else{
|
}else{
|
||||||
$backupcode = null;
|
$backupcode = null;
|
||||||
}
|
}
|
||||||
|
if(!(empty($_SESSION['done']))){
|
||||||
|
if($_SESSION['done'] == false){
|
||||||
|
$error_message[] = "アカウント移行の終了処理が完了できていません。\n前使用していたサーバーでアカウントの移行を取り消してください。";
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
@@ -32,18 +37,24 @@ if(!(empty($_SESSION['backupcode']))){
|
|||||||
<div class="leftbox2">
|
<div class="leftbox2">
|
||||||
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
<a href="index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<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">
|
||||||
|
<?php if( !empty($error_message) ): ?>
|
||||||
|
<ul class="errmsg">
|
||||||
|
<?php foreach( $error_message as $value ): ?>
|
||||||
|
<p>・ <?php echo $value; ?></p>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
<h1>アカウント作成完了!</h1>
|
<h1>アカウント作成完了!</h1>
|
||||||
<p><br>いぇ~い!</p>
|
<p>いぇ~い!</p>
|
||||||
<p>88888888888</p>
|
|
||||||
<p>アカウント登録が完了しました!</p>
|
<p>アカウント登録が完了しました!</p>
|
||||||
<?php
|
<?php
|
||||||
if(!(empty($backupcode))){?>
|
if(!(empty($backupcode))){?>
|
||||||
|
|||||||
+124
-99
@@ -219,15 +219,6 @@ if(isset($_GET['text'])) {
|
|||||||
}elseif(isset($_COOKIE['ueuse'])) {
|
}elseif(isset($_COOKIE['ueuse'])) {
|
||||||
$ueuse = htmlentities($_COOKIE['ueuse'], ENT_QUOTES, 'UTF-8', false);
|
$ueuse = htmlentities($_COOKIE['ueuse'], ENT_QUOTES, 'UTF-8', false);
|
||||||
}
|
}
|
||||||
//-----------------絵文字の取得----------------
|
|
||||||
if (!empty($pdo)) {
|
|
||||||
$custom_emoji_Query = "SELECT emojifile,emojiname,emojiinfo,emojidate FROM emoji ORDER BY emojidate DESC";
|
|
||||||
$custom_emoji_array = $pdo->query($custom_emoji_Query);
|
|
||||||
|
|
||||||
while ($row = $custom_emoji_array->fetch(PDO::FETCH_ASSOC)) {
|
|
||||||
$custom_emoji[] = $row;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
function get_mentions_userid($postText) {
|
function get_mentions_userid($postText) {
|
||||||
@@ -752,97 +743,12 @@ $pdo = null;
|
|||||||
<div class="emoji_picker" id="emoji_picker" style="display:none;">
|
<div class="emoji_picker" id="emoji_picker" style="display:none;">
|
||||||
<p>カスタム絵文字</p>
|
<p>カスタム絵文字</p>
|
||||||
<div class="emoji_picker_flex">
|
<div class="emoji_picker_flex">
|
||||||
<?php
|
|
||||||
if(!empty($custom_emoji)){
|
|
||||||
foreach ($custom_emoji as $value) {
|
|
||||||
echo '<div class="one_emoji">';
|
|
||||||
echo '<img src="../' . htmlentities($value["emojifile"], ENT_QUOTES, 'UTF-8', false) . '" alt=":'.htmlentities($value["emojiname"], ENT_QUOTES, 'UTF-8', false).':" title=":'.htmlentities($value["emojiname"], ENT_QUOTES, 'UTF-8', false).':">';
|
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
echo '<div class="tokonone" id="noueuse"><p>カスタム絵文字がありません</p></div>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<script>
|
|
||||||
document.getElementById("upload_videos1").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#videos1').addClass('label_set');
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
document.getElementById("upload_images4").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#images4').addClass('label_set');
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("upload_images3").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#images3').addClass('label_set');
|
|
||||||
$("#images4").show();
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("upload_images2").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#images2').addClass('label_set');
|
|
||||||
$("#images3").show();
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
document.getElementById("upload_images").addEventListener('change', function(e){
|
|
||||||
var file_reader = new FileReader();
|
|
||||||
// ファイルの読み込みを行ったら実行
|
|
||||||
file_reader.addEventListener('load', function(e) {
|
|
||||||
$('#images').addClass('label_set');
|
|
||||||
$("#images2").show();
|
|
||||||
});
|
|
||||||
file_reader.readAsText(e.target.files[0]);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#ueuse').on('input', function () {
|
|
||||||
var mojisize = '<?php echo $mojisize; ?>';
|
|
||||||
var mojicount = Number(mojisize) - $(this).val().length;
|
|
||||||
if(mojicount >= 0){
|
|
||||||
$('#moji_cnt').removeClass('red');
|
|
||||||
$('#moji_cnt').html(mojicount);
|
|
||||||
$('#ueusebtn').prop('disabled', false);
|
|
||||||
}else{
|
|
||||||
$('#moji_cnt').addClass('red');
|
|
||||||
$('#moji_cnt').html(mojicount);
|
|
||||||
$('#ueusebtn').prop('disabled', true);
|
|
||||||
}
|
|
||||||
document.cookie = "ueuse=" + encodeURIComponent($(this).val()) + "; Secure; SameSite=Lax; path=/!<?php echo $ueuseid; ?>;";
|
|
||||||
})
|
|
||||||
$("#emoji_picker_btn").click(function () {
|
|
||||||
if ($("#emoji_picker_btn").prop("checked") == true) {
|
|
||||||
$("#emoji_picker").show();
|
|
||||||
} else {
|
|
||||||
$("#emoji_picker").hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$(".one_emoji").click(function (event) {
|
|
||||||
event.preventDefault();
|
|
||||||
var children = $(this).children("img");
|
|
||||||
var custom_emojiname = children.attr("title");
|
|
||||||
$("#ueuse").val($("#ueuse").val() + custom_emojiname);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
<h1>ユーズ</h1>
|
<h1>ユーズ</h1>
|
||||||
</div>
|
</div>
|
||||||
@@ -868,8 +774,8 @@ $pdo = null;
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<p>ユーズを削除しますか?</p>
|
<p>ユーズを削除しますか?</p>
|
||||||
<form class="btn_area" method="post" id="deleteForm">
|
<form class="btn_area" method="post" id="deleteForm">
|
||||||
<input type="button" id="deleteButton" class="fbtn" name="delete" value="削除">
|
<input type="button" id="deleteButton" class="fbtn_no" name="delete" value="削除">
|
||||||
<input type="button" id="cancelButton" class="fbtn_no" value="キャンセル">
|
<input type="button" id="cancelButton" class="fbtn" value="キャンセル">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -881,8 +787,8 @@ $pdo = null;
|
|||||||
<form method="post" id="AbiForm">
|
<form method="post" id="AbiForm">
|
||||||
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlentities( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlentities( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
||||||
<div class="btn_area">
|
<div class="btn_area">
|
||||||
<input type="submit" id="AbiAddButton" class="fbtn" name="abi" value="追記">
|
<input type="submit" id="AbiAddButton" class="fbtn_no" name="abi" value="追記">
|
||||||
<input type="button" id="AbiCancelButton" class="fbtn_no" value="キャンセル">
|
<input type="button" id="AbiCancelButton" class="fbtn" value="キャンセル">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -1174,6 +1080,125 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
//-------------------------------------------------------send_box-------------------------------------------------------
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
document.getElementById("upload_videos1").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#videos1').addClass('label_set');
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
document.getElementById("upload_images4").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#images4').addClass('label_set');
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("upload_images3").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#images3').addClass('label_set');
|
||||||
|
$("#images4").show();
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("upload_images2").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#images2').addClass('label_set');
|
||||||
|
$("#images3").show();
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
document.getElementById("upload_images").addEventListener('change', function(e){
|
||||||
|
var file_reader = new FileReader();
|
||||||
|
// ファイルの読み込みを行ったら実行
|
||||||
|
file_reader.addEventListener('load', function(e) {
|
||||||
|
$('#images').addClass('label_set');
|
||||||
|
$("#images2").show();
|
||||||
|
});
|
||||||
|
file_reader.readAsText(e.target.files[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#ueuse').on('input', function () {
|
||||||
|
var mojisize = '<?php echo $mojisize; ?>';
|
||||||
|
var mojicount = Number(mojisize) - $(this).val().length;
|
||||||
|
if(mojicount >= 0){
|
||||||
|
$('#moji_cnt').removeClass('red');
|
||||||
|
$('#moji_cnt').html(mojicount);
|
||||||
|
$('#ueusebtn').prop('disabled', false);
|
||||||
|
}else{
|
||||||
|
$('#moji_cnt').addClass('red');
|
||||||
|
$('#moji_cnt').html(mojicount);
|
||||||
|
$('#ueusebtn').prop('disabled', true);
|
||||||
|
}
|
||||||
|
document.cookie = "ueuse=" + encodeURIComponent($(this).val()) + "; Secure; SameSite=Lax; path=/home;";
|
||||||
|
});
|
||||||
|
loadEmojis();
|
||||||
|
$("#emoji_picker_btn").click(function () {
|
||||||
|
if ($("#emoji_picker_btn").prop("checked") == true) {
|
||||||
|
$("#emoji_picker").show();
|
||||||
|
} else {
|
||||||
|
$("#emoji_picker").hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('.emoji_picker').on('scroll', function() {
|
||||||
|
var innerHeight = $('.emoji_picker_flex').innerHeight(),
|
||||||
|
outerHeight = $('.emoji_picker').innerHeight(),
|
||||||
|
outerBottom = innerHeight - outerHeight;
|
||||||
|
if (outerBottom <= $('.emoji_picker').scrollTop()) {
|
||||||
|
if ($('#noemoji').length){
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
loadEmojis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var Emoji_pageNumber = 1;
|
||||||
|
var isLoading = false;
|
||||||
|
function loadEmojis() {
|
||||||
|
if (isLoading) return;
|
||||||
|
isLoading = true;
|
||||||
|
|
||||||
|
var userid = '<?php echo $userid; ?>';
|
||||||
|
var account_id = '<?php echo $loginid; ?>';
|
||||||
|
var search_query = '';
|
||||||
|
var viewmode = 'picker'
|
||||||
|
$.ajax({
|
||||||
|
url: '../nextpage/emojiview.php', // PHPファイルへのパス
|
||||||
|
method: 'GET',
|
||||||
|
data: { page: Emoji_pageNumber, userid: userid , account_id: account_id , search_query: search_query, view_mode: viewmode},
|
||||||
|
dataType: 'html',
|
||||||
|
timeout: 300000,
|
||||||
|
success: function(response) {
|
||||||
|
$('.emoji_picker_flex').append(response);
|
||||||
|
Emoji_pageNumber++;
|
||||||
|
isLoading = false;
|
||||||
|
EmojiClickEvent();
|
||||||
|
},
|
||||||
|
error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||||
|
isLoading = false;
|
||||||
|
EmojiClickEvent();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function EmojiClickEvent() {
|
||||||
|
$(".one_emoji").click(function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
var children = $(this).children("img");
|
||||||
|
var custom_emojiname = children.attr("title");
|
||||||
|
$("#ueuse").val($("#ueuse").val() + custom_emojiname);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+8
-8
@@ -730,8 +730,8 @@ $pdo = null;
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<p>ユーズを削除しますか?</p>
|
<p>ユーズを削除しますか?</p>
|
||||||
<form class="btn_area" method="post" id="deleteForm">
|
<form class="btn_area" method="post" id="deleteForm">
|
||||||
<input type="button" id="deleteButton" class="fbtn" name="delete" value="削除">
|
<input type="button" id="deleteButton" class="fbtn_no" name="delete" value="削除">
|
||||||
<input type="button" id="cancelButton" class="fbtn_no" value="キャンセル">
|
<input type="button" id="cancelButton" class="fbtn" value="キャンセル">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -743,8 +743,8 @@ $pdo = null;
|
|||||||
<form method="post" id="AbiForm">
|
<form method="post" id="AbiForm">
|
||||||
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlentities( $_SESSION['abi'], ENT_QUOTES, 'UTF-8', false); } ?></textarea>
|
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlentities( $_SESSION['abi'], ENT_QUOTES, 'UTF-8', false); } ?></textarea>
|
||||||
<div class="btn_area">
|
<div class="btn_area">
|
||||||
<input type="submit" id="AbiAddButton" class="fbtn" name="abi" value="追記">
|
<input type="submit" id="AbiAddButton" class="fbtn_no" name="abi" value="追記">
|
||||||
<input type="button" id="AbiCancelButton" class="fbtn_no" value="キャンセル">
|
<input type="button" id="AbiCancelButton" class="fbtn" value="キャンセル">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -761,8 +761,8 @@ $pdo = null;
|
|||||||
<h1><?php echo replaceProfileEmojiImages(htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false)); ?>さんをブロックしますか?</h1>
|
<h1><?php echo replaceProfileEmojiImages(htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false)); ?>さんをブロックしますか?</h1>
|
||||||
<p><?php echo replaceProfileEmojiImages(htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false)); ?>さんのアカウントをブロックしますか?<br>ブロックするとフォローが解除され、検索以外のLTL、FTL等で<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんの投稿が表示されなくなります。<br>また、相手からこのアカウントを閲覧することもできなくなります。<br>※ブロックしたことは相手には通知されません。<br><br>ブロックを解除するときはこのアカウントのユーザーページ(このページ)から解除を行ってください。</p>
|
<p><?php echo replaceProfileEmojiImages(htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false)); ?>さんのアカウントをブロックしますか?<br>ブロックするとフォローが解除され、検索以外のLTL、FTL等で<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんの投稿が表示されなくなります。<br>また、相手からこのアカウントを閲覧することもできなくなります。<br>※ブロックしたことは相手には通知されません。<br><br>ブロックを解除するときはこのアカウントのユーザーページ(このページ)から解除を行ってください。</p>
|
||||||
<form class="btn_area" method="post">
|
<form class="btn_area" method="post">
|
||||||
<input type="submit" id="deleteButton2" class="fbtn" name="send_block_submit" value="ブロック">
|
<input type="submit" id="deleteButton2" class="fbtn_no" name="send_block_submit" value="ブロック">
|
||||||
<input type="button" id="cancelButton2" class="fbtn_no" value="キャンセル">
|
<input type="button" id="cancelButton2" class="fbtn" value="キャンセル">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -772,8 +772,8 @@ $pdo = null;
|
|||||||
<h1><?php echo replaceProfileEmojiImages(htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false)); ?>さんのブロックを解除しますか?</h1>
|
<h1><?php echo replaceProfileEmojiImages(htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false)); ?>さんのブロックを解除しますか?</h1>
|
||||||
<p><?php echo replaceProfileEmojiImages(htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false)); ?>さんのアカウントをブロック解除しますか?<br>ブロック解除すると<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんの投稿の閲覧が可能になりフォローすることもできるようになります。</p>
|
<p><?php echo replaceProfileEmojiImages(htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false)); ?>さんのアカウントをブロック解除しますか?<br>ブロック解除すると<?php echo htmlentities($userdata['username'], ENT_QUOTES, 'UTF-8', false); ?>さんの投稿の閲覧が可能になりフォローすることもできるようになります。</p>
|
||||||
<form class="btn_area" method="post">
|
<form class="btn_area" method="post">
|
||||||
<input type="submit" id="deleteButton3" class="fbtn" name="send_un_block_submit" value="ブロック解除">
|
<input type="submit" id="deleteButton3" class="fbtn_no" name="send_un_block_submit" value="ブロック解除">
|
||||||
<input type="button" id="cancelButton3" class="fbtn_no" value="キャンセル">
|
<input type="button" id="cancelButton3" class="fbtn" value="キャンセル">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+31
-3
@@ -2,8 +2,8 @@
|
|||||||
-- version 5.2.1
|
-- version 5.2.1
|
||||||
-- https://www.phpmyadmin.net/
|
-- https://www.phpmyadmin.net/
|
||||||
--
|
--
|
||||||
-- ホスト: ひ.み.つ
|
-- ホスト: ヒミツ
|
||||||
-- 生成日時: 2024-03-26 14:43:05
|
-- 生成日時: 2024-04-23 17:09:16
|
||||||
-- サーバのバージョン: 10.4.32-MariaDB
|
-- サーバのバージョン: 10.4.32-MariaDB
|
||||||
-- PHP のバージョン: 8.2.12
|
-- PHP のバージョン: 8.2.12
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ SET time_zone = "+00:00";
|
|||||||
/*!40101 SET NAMES utf8mb4 */;
|
/*!40101 SET NAMES utf8mb4 */;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- データベース: `account`
|
-- データベース: `uwuzu_db`
|
||||||
--
|
--
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
@@ -97,6 +97,22 @@ CREATE TABLE `invitation` (
|
|||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- テーブルの構造 `migration`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `migration` (
|
||||||
|
`sysid` int(11) NOT NULL,
|
||||||
|
`account` varchar(512) NOT NULL,
|
||||||
|
`domain` varchar(1024) NOT NULL,
|
||||||
|
`migration_code` varchar(256) NOT NULL,
|
||||||
|
`encryption_key` varchar(256) NOT NULL,
|
||||||
|
`encryption_ivkey` varchar(256) NOT NULL,
|
||||||
|
`datetime` datetime NOT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
--
|
--
|
||||||
-- テーブルの構造 `notice`
|
-- テーブルの構造 `notice`
|
||||||
--
|
--
|
||||||
@@ -211,6 +227,12 @@ ALTER TABLE `emoji`
|
|||||||
ALTER TABLE `invitation`
|
ALTER TABLE `invitation`
|
||||||
ADD PRIMARY KEY (`sysid`);
|
ADD PRIMARY KEY (`sysid`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- テーブルのインデックス `migration`
|
||||||
|
--
|
||||||
|
ALTER TABLE `migration`
|
||||||
|
ADD PRIMARY KEY (`sysid`);
|
||||||
|
|
||||||
--
|
--
|
||||||
-- テーブルのインデックス `notice`
|
-- テーブルのインデックス `notice`
|
||||||
--
|
--
|
||||||
@@ -269,6 +291,12 @@ ALTER TABLE `emoji`
|
|||||||
ALTER TABLE `invitation`
|
ALTER TABLE `invitation`
|
||||||
MODIFY `sysid` int(11) NOT NULL AUTO_INCREMENT;
|
MODIFY `sysid` int(11) NOT NULL AUTO_INCREMENT;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- テーブルの AUTO_INCREMENT `migration`
|
||||||
|
--
|
||||||
|
ALTER TABLE `migration`
|
||||||
|
MODIFY `sysid` int(11) NOT NULL AUTO_INCREMENT;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- テーブルの AUTO_INCREMENT `notice`
|
-- テーブルの AUTO_INCREMENT `notice`
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ ueuseid_not_found - ユーズが存在しない時に表示されます。
|
|||||||
critical_error_userdata_not_found - ユーザーデータがない時に表示されます。
|
critical_error_userdata_not_found - ユーザーデータがない時に表示されます。
|
||||||
userid_not_found - ユーザーデータがない時に表示されます。
|
userid_not_found - ユーザーデータがない時に表示されます。
|
||||||
API_has_been_deleted - APIが削除または統合、変更された場合に表示されます。
|
API_has_been_deleted - APIが削除または統合、変更された場合に表示されます。
|
||||||
|
no_reply_destination - リプライ先のユーズが存在しない際に表示されます。
|
||||||
|
migration_bad_success - アカウントの移行後に移行の完了処理が正常に完了できなかった際に表示されます。
|
||||||
|
already_been_completed - 処理が既に完了している場合に表示されます。
|
||||||
|
you_cant_it_to_yourself - 自分に対して行えない処理を行おうとした際に表示されます。
|
||||||
|
|
||||||
----------(UWUZU ERR CODE)----------
|
----------(UWUZU ERR CODE)----------
|
||||||
FILE_DEKASUGUI_PHP_INI_KAKUNIN - php.iniで設定されているファイルサイズ上限を上回っている時に表示されます。
|
FILE_DEKASUGUI_PHP_INI_KAKUNIN - php.iniで設定されているファイルサイズ上限を上回っている時に表示されます。
|
||||||
@@ -62,6 +66,7 @@ REGISTERED_DAME - データの登録・更新に失敗した場合に表示さ
|
|||||||
EMOJI_ID_INPUT_PLEASE - 絵文字IDが入力されていない時に表示されます。
|
EMOJI_ID_INPUT_PLEASE - 絵文字IDが入力されていない時に表示されます。
|
||||||
EMOJI_ID_OVER_MAX_COUNT - 絵文字IDの文字数が最大文字数を超過している時に表示されます。
|
EMOJI_ID_OVER_MAX_COUNT - 絵文字IDの文字数が最大文字数を超過している時に表示されます。
|
||||||
EMOJI_ID_SHIYOUZUMI - ユーザーIDがすでに使用されている時に表示されます。
|
EMOJI_ID_SHIYOUZUMI - ユーザーIDがすでに使用されている時に表示されます。
|
||||||
|
EMOJI_OVER_256KB - 絵文字のファイルサイズが256KBを超えている際に表示されます。
|
||||||
|
|
||||||
INPUT_PLEASE - 入力すべき場所に内容が無い場合に表示されます。
|
INPUT_PLEASE - 入力すべき場所に内容が無い場合に表示されます。
|
||||||
INPUT_OVER_MAX_COUNT - 入力すべき場所に入力された内容が設定されている最大文字数を超過している際に表示されます。
|
INPUT_OVER_MAX_COUNT - 入力すべき場所に入力された内容が設定されている最大文字数を超過している際に表示されます。
|
||||||
@@ -118,6 +123,17 @@ JS_BLOCKED_ERROR - JavaScriptがブラウザにより無効化されている場
|
|||||||
|
|
||||||
NOTICE_DELETE_DAME - サーバーからのお知らせの削除に失敗した場合に表示されます。
|
NOTICE_DELETE_DAME - サーバーからのお知らせの削除に失敗した場合に表示されます。
|
||||||
|
|
||||||
|
MIGRATION_TO_SERVER_NOT_UWUZU - アカウントの移行操作時に移行先のサーバーがuwuzuを使用していないと表示されるエラーです。
|
||||||
|
MIGRATION_TO_SERVER_BAD_UWUZU_VERSION - アカウントの移行操作時に移行先のサーバーがuwuzu v1.3.6未満の場合に表示されるエラーです。
|
||||||
|
MIGRATION_TO_SERVER_IYADA - アカウントの移行操作時に移行先のサーバーがアカウントの移行登録を拒否しているために表示されるエラーです。
|
||||||
|
MIGRATION_BAD_DOMAIN - 移行元or移行先サーバーのドメインにアクセスできなかった場合に表示されます。
|
||||||
|
MIGRATION_BAD_CHECK_CODE - アカウントの移行登録時に識別コードが間違っていると表示されるエラーです。
|
||||||
|
MIGRATION_BAD_AUTH_CODE - アカウントの移行登録時に認証コードもしくは確認コードが間違っていると表示されるエラーです。
|
||||||
|
MIGRATION_FROM_SERVER_NOT_UWUZU - アカウントの移行操作時に移行元のサーバーがuwuzuを使用していないときに表示されるエラーです。
|
||||||
|
MIGRATION_FROM_SERVER_BAD_UWUZU_VERSION - アカウントの移行操作時に移行元のサーバーがuwuzu v1.3.6未満の場合に表示されるエラーです。
|
||||||
|
MIGRATION_SORRY - なんらかの原因により正常にアカウントの移行ができないと判断された場合に表示されます。
|
||||||
|
MIGRATION_ONAJI_SERVER_DAME - 同じサーバーにアカウント移行しようとした際に表示されます。
|
||||||
|
|
||||||
ERROR - 想定されていないエラーが発生した際に表示されます。
|
ERROR - 想定されていないエラーが発生した際に表示されます。
|
||||||
|
|
||||||
----------(OTHERS ERR CODE)----------
|
----------(OTHERS ERR CODE)----------
|
||||||
|
|||||||
Reference in New Issue
Block a user