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

uwuzu v1.3.0 new_planet

This commit is contained in:
Daichimarukana
2024-02-24 19:17:08 +09:00
parent 29c46fcc4e
commit 1597041471
115 changed files with 5655 additions and 2252 deletions
+4 -2
View File
@@ -1,10 +1,12 @@
<?php <?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);
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/xml; charset=UTF-8"); header("Content-Type: application/xml");
header("charset=UTF-8");
header("Access-Control-Allow-Origin: *");
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
+4 -2
View File
@@ -1,8 +1,10 @@
<?php <?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);
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/json; charset=utf-8"); header("Content-Type: application/json");
header("charset=utf-8");
header("Access-Control-Allow-Origin: *");
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
+6 -3
View File
@@ -1,8 +1,10 @@
<?php <?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);
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/json; charset=utf-8"); header("Content-Type: application/json");
header("charset=utf-8");
header("Access-Control-Allow-Origin: *");
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
@@ -19,7 +21,7 @@ if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUO
// 接続エラーのときエラー内容を取得する // 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage(); $error_message[] = $e->getMessage();
} }
if(isset($_GET['resource'])){
$user = htmlentities($_GET['resource']); $user = htmlentities($_GET['resource']);
$userid = str_replace('acct:','', str_replace('@'.$domain.'', '', $user)); $userid = str_replace('acct:','', str_replace('@'.$domain.'', '', $user));
@@ -36,6 +38,7 @@ if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUO
); );
echo json_encode($item, JSON_UNESCAPED_UNICODE); echo json_encode($item, JSON_UNESCAPED_UNICODE);
}
}else{ }else{
header("HTTP/1.1 410 Gone"); header("HTTP/1.1 410 Gone");
} }
-142
View File
@@ -1,142 +0,0 @@
# 注意:結構脆弱です。導入後はローカルな環境で使うことをおすすめします。
# uwuzu
あたらしいSNSです!!!
右側のReleaseからDLして導入していただけます!
AGPLライセンスです!!!
導入方法は以下のとおりです!
## 5. サーバーの建て方
まず、Apache2とPHP 8とmysql Ver 15が導入されているサーバーを準備します!
PHP 8では事前にGDを有効化しておいてください!(QRコードの生成に必要です。)
次にSQLを設定します。(InnoDB)
まず、お好きな名前でDBを作成し、その中に、account,emoji,notice,role,ueuse,notification,ads,reportとテーブルを作成します。
テーブルの中身は以下のとおりです。
照合順序は全て標準でutf8mb4_general_ciです。
## 簡単に構築できるようSQLの構造ファイルがリリースに添付されています!そちらをインポートしていただけますと大幅に簡単に導入できます!
(userロールとofficialロールとiceロールの設定は別途必要です。お手数ですがそこの設定だけよろしくお願いいたします。)
### account
- sysid(INT)(AUTO_INCREMENT ) アカウントが追加されるとカウントされるシステム用ID
- username(varchar(500)) ユーザーネーム保存用
- userid(varchar(500)) ユーザーID保存用
- password(varchar(1024)) パスワード保存用(ハッシュ化されます)
- loginid(varchar(256)) 自動ログイン時に本人アカウントか確認
- mailadds(varchar(500)) メールアドレス保存用
- profile(TEXT) プロフィールテキスト保存用
- iconname(varchar(256)) アイコン画像リンク保存用
- headname(varchar(256)) ヘッダー画像リンク保存用
- role(varchar(1024)) 「user」のようなロール保存用
- datetime(datetime) アカウント作成日時保存用
- follow(text) アカウントがフォローしている人保存用
- follower(text) アカウントがフォローされている人保存用
- blocklist(text) ブロックしている人保存用
- admin(varchar(25)) 管理者アカウントなら「yes」、それ以外なら「none」と入力。
- authcode(varchar(256)) 二段階認証用キー保存用
- backupcode(varchar(256)) 二段階認証のバックアップコード保存用
- sacinfo(varchar(256)) 特殊アカウント識別用
### emoji
- sysid(INT)(AUTO_INCREMENT) アカウントが追加されるとカウントされるシステム用ID
- emojifile(varchar(512)) 絵文字ファイルパス保存用
- emojiname(varchar(512)) 「:emoji:」のような絵文字名保存用
- emojiinfo(text) 絵文字についての説明保存用
- emojidate(datetime) 絵文字登録日時保存用
### notice
- sysid(INT)(AUTO_INCREMENT) うんえいからのおしらせが追加されるとカウントされるシステム用ID
- title(varchar(1024)) お知らせのタイトル保存用
- note(text) お知らせの内容保存用
- account(varchar(500)) 編集者ID保存用
- emojidate(datetime) お知らせ登録日時保存用
### role
- sysid(INT)(AUTO_INCREMENT) ロールが追加されるとカウントされるシステム用ID
- rolename(varchar(512)) ロール表示名保存用
- roleauth(varchar(256)) ロールの権限保存用
- rolecolor(varchar(25)) ロールの色保存用
- roleidname(varchar(512)) 「user」のようなロール指定用
### ueuse
- sysid(INT)(AUTO_INCREMENT) 投稿されるとカウントされるシステム用ID
- account(varchar(256)) 投稿者ID保存用
- uniqid(varchar(256)) 投稿ID保存用
- rpuniqid(varchar(256)) リプライ先ID保存用
- ueuse(text) 投稿内容保存用
- photo1(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
- photo2(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
- photo3(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
- photo4(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
- video1(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
- datetime(datetime) 投稿日時保存用
- favorite(text) いいね保存用
- abi(text) 投稿者の追記保存用
- abidate(datetime) 追記日時保存用
- nsfw(varchar(25)) NSFW指定有無保存用
### notification
- sysid(INT)(AUTO_INCREMENT) 通知されるとカウントされるシステム用ID
- touserid(varchar(512)) 通知先ID保存用
- title(varchar(1024)) 通知のタイトル
- msg(text) 通知の内容
- datetime(datetime) 通知日時
- userchk(varchar(25)) 通知の既読確認
### invitation
- sysid(INT)(AUTO_INCREMENT) 追加されるとカウントされるシステム用ID
- code(varchar(512)) 招待コード
- used(varchar(25)) 使用済みかそうでないか
- datetime(datetime) 招待コード仕様日時更新用
### report
- sysid(INT)(AUTO_INCREMENT) 追加されるとカウントされるシステム用ID
- uniqid(varchar(256)) 通報ID保存用
- userid(varchar(500)) 通報先ユーザーID保存用
- report_userid(varchar(500)) 通報元ユーザーID保存用
- msg(text) サービス管理者宛メッセージ保存用
- datetime(datetime) 通報日時保存用
- admin_chk(varchar(25)) 解決済みかどうか確認用
### ads
- sysid(INT)(AUTO_INCREMENT) 追加されるとカウントされるシステム用ID
- uniqid(varchar(512)) 広告ID保存用
- url(varchar(512)) 広告のクリック先URL保存用
- image_url(varchar(512)) 広告に表示する画像URL保存用
- memo(text) 広告にマウスオーバーしたときに表示されるメッセージ保存用
- start_date(datetime) 広告配信開始日時保存用
- limit_date(datetime) 広告配信終了日時保存用
- datetime(datetime) 広告追加日時保存用
すべて作成完了したらGithubよりuwuzuのファイルをDLし、解凍し、それをサーバーの動作ディレクトリに置き、Apacheのhttpd.confからその動作ディレクトリを指定し、動作ディレクトリ内のdb.phpにDBのログイン情報を書き込んであとはApacheとphpとMy SQLを起動するだけ!
起動したらまずDBのroleにphpmyadminから「user」ロールと「official」ロールと「ice」ロールを追加、権限は「user」と「official」と「ice」でOK。ロール名はとりあえず「一般ユーザー」とか適当でOK、ロールの色はHEXコード(#を除く)で000000のように指定。(この3つのロールがないとエラーが発生します。)
そしたら普通にuwuzuにアクセスして自分のアカウントを登録。
## 管理者アカウント登録機能が追加されました。【[domain]/admin/】より設定できるのでそちらをご利用ください。
なお、管理者アカウントを導入後に登録した場合サーバーを止めてuwuzu動作ディレクトリ内のserverフォルダ内のファイルを設定する必要はございません。
管理者アカウント作成後にログインし、サーバー設定より以下の項目が簡単に設定できます。
- 404imagepath.txt : 404ページに表示する画像パス保存用
- 503imagepath.txt : 503ページに表示する画像パス保存用
- banurldomain.txt : 投稿禁止URLドメイン
- banuserid.txt : 登録禁止ユーザーid
- info.txt : サーバー登録時に表示されるメッセージ(好きな内容)
- privacypolicy.txt : プライバシーポリシー(サーバーのプライバシーポリシーを記載)
- serverstop.txt : サーバー停止ページで表示するメッセージ
- terms.txt : 利用規約(サーバーの利用規約を記載)
- textsize.txt : 最大文字数
- serversettings.ini : サーバー情報保存ファイル
- uwuzuabout.txt : このファイル(uwuzuを改造した場合は書き換え)
- uwuzuinfo.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え)
- uwuzurelease.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え)
- onlyuser.txt : 招待コード機能をオンにするかどうか、「true」でオン、「false」でオフ。招待コードはDBに直接追加。
### これでサーバーは完成!!!
脆弱だから自己責任で楽しんでね~()
### uwuzuを改変する人へ
基本的にReleaseより最新のコードをDLして改変してください。
Githubのmain内のコードは信頼しないほうがいいです。なぜなら私だいちまるがGithubの使い方をいまいち理解していないからです()
ご迷惑をおかけしますがどうぞよろしくお願いいたします。
+55
View File
@@ -0,0 +1,55 @@
---------<uwuzu公衆利用ライセンス(UPUL)>---------
ライセンス名 : uwuzu公衆利用ライセンス(英: uwuzu Public Use License)
バージョン : 1.0.0
ライセンス著作権 : uwuzu
本ライセンス使用著作者帰属先 : daichimarukana,putonfps
本ライセンス使用著作者連絡先 : support@uwuzu.com,daichimarukana@gmail.com
この文書を完全にコピーして利用、2-15以降に追記することは許可されていますが、この文書の2-14以前の改変、保存・利用することは許可されていません。
0. まえがき
uwuzu公衆利用ライセンスは本ライセンスを使用する全ての著作物の利用条件を明確にするためのライセンスです。
主にコンピューターで実行されるソフトウェアに対して使用しやすいように作成されています。
本ライセンスでは、ソフトウェアの作成者、利用者、改変者、それぞれが負担なく利用できるように考えられています。
1. 定義
ここにある定義はこの文書全体に適用されます。
「本ライセンス」とはuwuzu公衆利用ライセンス バージョン1.0.0を指します。
「著作権」とはベルヌ条約で示されている著作権及び各国の法律により示されている著作権を指します。
「著作物」とは上記の著作権に基づく作成された物を指します。
「著作者」とは本ライセンスの適用されている著作物を作成した人物を指します。
2. 利用条件
2-1. 本ライセンスが適用されている著作物は完全無料で閲覧・利用・改変が可能なものとします。
2-1-1. 改変し、公開する場合、本ライセンスが適用されている著作物のライセンスを変更することはできないものとします。
2-1-2. 改変する場合、著作物の原型を残す必要があります。
2-1-3. 改変する場合、「本ライセンス使用著作者帰属先」「本ライセンス使用著作者連絡先」を含め、本文書を引き継いで適用し、著作者の情報を削除しない必要があります。
2-1-3-1. 改変者の情報を追記することが可能ですが、著作者の権利を侵害しない範囲に限ります。
2-2. 本ライセンスが適用されている著作物を改変した場合、改変者は著作者による内容の開示を請求された場合に開示する必要があります。
2-2-1. 改変者は、改変した著作物を自身で公開する場合、著作者の同意を得る必要はありません。
2-3. 本ライセンスが適用されている著作物を改変して自身で利用する場合は、改変内容を開示する必要はありません。ただし、著作者から開示要求があった場合は、これに応じる必要があります。
2-3-1. 改変してから改変者が著作者以外の他人に譲渡・共有・配布する際は改変した著作物を誰でも使用できるものとします。
2-3-2. もし改変者が改変済の著作物を他人に譲渡・共有・配布せずに改変者自身で利用してサービスを提供する場合はサービス利用者に改変した著作物を公開する必要はありません。
2-4. 本ライセンスが適用されている著作物を二次配布したり改変したものを配布することは可能とします。
2-5. 本ライセンスはいかなる著作物にも著作者が適用することが可能です。
2-6. 著作物に本ライセンスを適用した著作者はいつでもこのライセンスの適用を取り消し、別のライセンスに変更することが可能なものとします。
2-6-1. 本ライセンスを適用した著作物のライセンスを変更した場合著作者はライセンスを変更したことを著作物内に明記する必要があります。
2-7. 本ライセンスが適用されている場合でも著作権は著作者に帰属します。
2-7-1. 著作者が本ライセンスが適用されている著作物の著作権の放棄を明記しない限り著作権は保護されます。
2-8. 著作者は本文書の「本ライセンス使用著作者帰属先」欄に著作者を判別できる文字列を記入する必要があります。
2-8-1. 可能であれば著作者は本文書の「本ライセンス使用著作者連絡先」に連絡先を記入する必要があります。
2-9. 本ライセンスが適用されている著作物の取り扱いは本ライセンス及び法律に則って扱う必要があります。
2-10. 本ライセンスが適用されている著作物を著作者が公開を停止し、著作者が利用者・改変者などに削除を求める旨の文章を公開していて、利用者・改変者などの関係者がそれに気づくことができた場合は削除する必要があるものとします。
2-11. 本ライセンスが適用されている著作物を使用し、何らかの損害が発生した場合に著作者は責任を負う必要はありません。
2-11-1. 本ライセンスが適用されている著作物を使用する際の責任は全て使用者にあるものとします。
2-12. 本ライセンスが適用されている著作物から本ライセンスを無効化するには著作者の許可、もしくは著作者によるライセンス変更が必要となります。
2-13. 本ライセンスが適用されている著作物は、営利目的を含む、いかなる利用目的であっても利用が可能です。
2-14. 本ライセンスはどなたでも自由にご利用いただけます。
2-15. 著作者は本ライセンスに追記して独自の規約を作成することが可能なものとし、利用者・改変者はその規約に従う必要があるものとします。
/----------(以下追記欄)----------/
独自の規約はありません。
上記の利用条件に従って利用してください。
-------------------<以上>-------------------
+9 -1
View File
@@ -2,7 +2,9 @@
$serversettings_file = "../server/serversettings.ini"; $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true); $serversettings = parse_ini_file($serversettings_file, true);
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/json; charset=utf-8"); header("Content-Type: application/json");
header("charset=utf-8");
header("Access-Control-Allow-Origin: *");
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
@@ -70,6 +72,12 @@ if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUO
"mediaType" => "image/".$icon_kakucho_ci."", "mediaType" => "image/".$icon_kakucho_ci."",
"url" => "https://".$domain."/".$userData["headname"]."", "url" => "https://".$domain."/".$userData["headname"]."",
), ),
/*"publicKey" => array(
"id" => "https://".$domain."/actor/?actor=@".$userid."#main-key",
"owner" => "https://".$domain."/actor/?actor=@".$userid."",
"publicKeyPem" => "ここにHTTP-Signature",
),*/
); );
echo json_encode($item, JSON_UNESCAPED_UNICODE); echo json_encode($item, JSON_UNESCAPED_UNICODE);
}else{ }else{
+5 -5
View File
@@ -163,14 +163,14 @@ if( !empty($_POST['btn_submit']) ) {
header('Location: ' . $url, true, 303); header('Location: ' . $url, true, 303);
exit; exit;
} else { } else {
$error_message[] = '更新に失敗しました。'; $error_message[] = '更新に失敗しました。(REGISTERED_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
$stmt = null; $stmt = null;
} }
} else { } else {
$error_message[] = "二段階認証が出来ませんでした。再度お試しください。"; $error_message[] = "二段階認証が出来ませんでした。再度お試しください。(AUTHCODE_CHECK_DAME)";
} }
} }
@@ -184,8 +184,8 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="css/style.css">
<script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="js/unsupported.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">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
@@ -204,7 +204,7 @@ $pdo = null;
</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 }?>
+25 -34
View File
@@ -10,6 +10,9 @@ function createUniqId(){
} }
require('../db.php'); require('../db.php');
//関数呼び出し
//- EXIF
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);
@@ -88,15 +91,6 @@ if( !empty($_POST['btn_submit']) ) {
$invitationcode = $_POST['invitationcode']; $invitationcode = $_POST['invitationcode'];
} }
//cookieに保存
setcookie("username",$username,time()+60*60*24*14);
setcookie("userid",$userid,time()+60*60*24*14);
setcookie("password",$password,time()+60*60*24*14);
setcookie("mailadds",$mailadds,time()+60*60*24*14);
setcookie("profile",$profile,time()+60*60*24*14);
//----------------[icon image]------------------------------- //----------------[icon image]-------------------------------
if (empty($_FILES['image']['name'])) { if (empty($_FILES['image']['name'])) {
$localFilePathhead = '../img/deficon/icon.png'; $localFilePathhead = '../img/deficon/icon.png';
@@ -138,7 +132,10 @@ if( !empty($_POST['btn_submit']) ) {
$uploadedPath = 'usericons/' . $newFilename; $uploadedPath = 'usericons/' . $newFilename;
// ファイルを移動 // ファイルを移動
$result = move_uploaded_file($uploadedFile['tmp_name'], '../'.$uploadedPath); $result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath);
// EXIF削除
delete_exif($extension, $uploadedPath);
if ($result) { if ($result) {
$iconName = $uploadedPath; // 保存されたファイルのパスを使用 $iconName = $uploadedPath; // 保存されたファイルのパスを使用
@@ -204,14 +201,14 @@ if( !empty($_POST['btn_submit']) ) {
// 招待コードの入力チェック // 招待コードの入力チェック
if( empty($invitationcode) ) { if( empty($invitationcode) ) {
$error_message[] = '招待コードを入力してください。'; $error_message[] = '招待コードを入力してください。(INVITATION_CODE_INPUT_PLEASE)';
} else { } else {
if($result > 0){ if($result > 0){
if($result["used"] === "true"){ if($result["used"] === "true"){
$error_message[] = 'この招待コード('.$invitationcode.')は既に使用されています。'; $error_message[] = 'この招待コード('.$invitationcode.')は既に使用されています。(INVITATION_CODE_SHIYOUZUMI)';
} }
}else{ }else{
$error_message[] = 'この招待コード('.$invitationcode.')は使えません。'; $error_message[] = 'この招待コード('.$invitationcode.')は使えません。(INVITATION_CODE_DEAD)';
} }
} }
@@ -227,33 +224,33 @@ if( !empty($_POST['btn_submit']) ) {
// ユーザーネームの入力チェック // ユーザーネームの入力チェック
if( empty($username) ) { if( empty($username) ) {
$error_message[] = '表示名を入力してください。'; $error_message[] = '表示名を入力してください。(USERNAME_INPUT_PLEASE)';
} else { } else {
// 文字数を確認 // 文字数を確認
if( 25 < mb_strlen($username, 'UTF-8') ) { if( 25 < mb_strlen($username, 'UTF-8') ) {
$error_message[] = 'ユーザーネームは25文字以内で入力してください。'; $error_message[] = 'ユーザーネームは50文字以内で入力してください。(USERNAME_OVER_MAX_COUNT)';
} }
} }
// IDの入力チェック // IDの入力チェック
if( empty($userid) ) { if( empty($userid) ) {
$error_message[] = 'ユーザーIDを入力してください。'; $error_message[] = 'ユーザーIDを入力してください。(USERID_INPUT_PLEASE)';
} else { } else {
// 文字数を確認 // 文字数を確認
if( 20 < mb_strlen($userid, 'UTF-8') ) { if( 20 < mb_strlen($userid, 'UTF-8') ) {
$error_message[] = 'IDは20文字以内で入力してください。'; $error_message[] = 'IDは20文字以内で入力してください。(USERID_OVER_MAX_COUNT)';
} }
if($result > 0){ if($result > 0){
$error_message[] = 'このID('.$userid.')は既に使用されています。他のIDを作成してください。'; //このE-mailは既に使用されています。 $error_message[] = 'このID('.$userid.')は既に使用されています。他のIDを作成してください。(USERID_SHIYOUZUMI)';
} }
} }
// パスワードの入力チェック // パスワードの入力チェック
if( empty($password) ) { if( empty($password) ) {
$error_message[] = 'パスワードを入力してください。'; $error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
} else { } else {
$weakPasswords = array( $weakPasswords = array(
@@ -323,27 +320,21 @@ if( !empty($_POST['btn_submit']) ) {
return in_array($passwords, $weakPasswords); return in_array($passwords, $weakPasswords);
} }
// テスト用のパスワード(実際にはユーザー入力などから取得することになります。
if (isWeakPassword($password)) { if (isWeakPassword($password)) {
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。"; $error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
} else {
} }
if ($chkpass == $password ){ if (!($chkpass == $password)){
$error_message[] = '確認用パスワードが違います。(PASSWORD_CHIGAUYANKE)';
}else{
$error_message[] = '確認用パスワードが違います。';
} }
if( 4 > mb_strlen($password, 'UTF-8') ) { if( 4 > mb_strlen($password, 'UTF-8') ) {
$error_message[] = 'パスワードは4文字以上である必要があります。'; $error_message[] = 'パスワードは4文字以上である必要があります。(PASSWORD_TODOITENAI_MIN_COUNT)';
} }
// 文字数を確認 // 文字数を確認
if( 100 < mb_strlen($password, 'UTF-8') ) { if( 100 < mb_strlen($password, 'UTF-8') ) {
$error_message[] = 'パスワードは100文字以内で入力してください。'; $error_message[] = 'パスワードは100文字以内で入力してください。(PASSWORD_OVER_MAX_COUNT)';
} }
} }
@@ -386,7 +377,7 @@ if( !empty($_POST['btn_submit']) ) {
// コミット // コミット
$res = $pdo->commit(); $res = $pdo->commit();
if($onlyuser === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){
$pdo->beginTransaction(); $pdo->beginTransaction();
$stmt = $pdo->prepare("UPDATE invitation SET used = :used, datetime = :datetime WHERE code = :code;"); $stmt = $pdo->prepare("UPDATE invitation SET used = :used, datetime = :datetime WHERE code = :code;");
@@ -419,7 +410,7 @@ if( !empty($_POST['btn_submit']) ) {
// すべての出力を終了 // すべての出力を終了
exit; exit;
} else { } else {
$error_message[] = '登録に失敗しました。'; $error_message[] = '登録に失敗しました。(REGISTERED_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
@@ -435,8 +426,8 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/style.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.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">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
+3 -3
View File
@@ -83,9 +83,9 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/style.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></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="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">
+3 -3
View File
@@ -78,9 +78,9 @@ if(!(empty($_SESSION['backupcode']))){
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/style.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></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="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">
+32 -20
View File
@@ -11,7 +11,9 @@ $banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
//投稿及び返信レート制限↓(分):デフォで60件/分まで //投稿及び返信レート制限↓(分):デフォで60件/分まで
$max_ueuse_rate_limit = 60; $max_ueuse_rate_limit = 60;
header("Content-Type: application/json; charset=utf-8; Access-Control-Allow-Origin: *;"); header("Content-Type: application/json");
header("charset=utf-8");
header("Access-Control-Allow-Origin: *");
function createUniqId(){ function createUniqId(){
list($msec, $sec) = explode(" ", microtime()); list($msec, $sec) = explode(" ", microtime());
@@ -21,7 +23,13 @@ function createUniqId(){
return base_convert($hashCreateTime,10,36); return base_convert($hashCreateTime,10,36);
} }
function decode_yajirushi($postText){
$postText = str_replace('&larr;', '←', $postText);
$postText = str_replace('&darr;', '↓', $postText);
$postText = str_replace('&uarr;', '↑', $postText);
$postText = str_replace('&rarr;', '→', $postText);
return $postText;
}
function get_mentions_userid($postText) { function get_mentions_userid($postText) {
// @useridを検出する // @useridを検出する
$usernamePattern = '/@(\w+)/'; $usernamePattern = '/@(\w+)/';
@@ -77,6 +85,7 @@ if(isset($_GET['token'])&&isset($_GET['type'])) {
} }
// 禁止url確認 // 禁止url確認
for($i = 0; $i < count($banurl); $i++) { for($i = 0; $i < count($banurl); $i++) {
if(!($banurl[$i] == "")){
if (false !== strpos($ueuse, 'https://'.$banurl[$i])) { if (false !== strpos($ueuse, 'https://'.$banurl[$i])) {
$err = "contains_prohibited_url"; $err = "contains_prohibited_url";
$response = array( $response = array(
@@ -88,6 +97,7 @@ if(isset($_GET['token'])&&isset($_GET['type'])) {
} }
} }
} }
}
if($token === 'ice'){ if($token === 'ice'){
$err = "this_account_has_been_frozen"; $err = "this_account_has_been_frozen";
@@ -201,7 +211,7 @@ if(isset($_GET['token'])&&isset($_GET['type'])) {
// コミット // コミット
$res = $pdo->commit(); $res = $pdo->commit();
$mentionedUsers = get_mentions_userid($ueuse); $mentionedUsers = array_unique(get_mentions_userid($ueuse));
foreach ($mentionedUsers as $mentionedUser) { foreach ($mentionedUsers as $mentionedUser) {
@@ -309,6 +319,7 @@ if(isset($_GET['token'])&&isset($_GET['type'])) {
} }
// 禁止url確認 // 禁止url確認
for($i = 0; $i < count($banurl); $i++) { for($i = 0; $i < count($banurl); $i++) {
if(!($banurl[$i] == "")){
if (false !== strpos($ueuse, 'https://'.$banurl[$i])) { if (false !== strpos($ueuse, 'https://'.$banurl[$i])) {
$err = "contains_prohibited_url"; $err = "contains_prohibited_url";
$response = array( $response = array(
@@ -320,6 +331,7 @@ if(isset($_GET['token'])&&isset($_GET['type'])) {
} }
} }
} }
}
if($token === 'ice'){ if($token === 'ice'){
$err = "this_account_has_been_frozen"; $err = "this_account_has_been_frozen";
@@ -472,7 +484,7 @@ if(isset($_GET['token'])&&isset($_GET['type'])) {
// コミット // コミット
$res = $pdo->commit(); $res = $pdo->commit();
$mentionedUsers = get_mentions_userid($ueuse); $mentionedUsers = array_unique(get_mentions_userid($ueuse));
foreach ($mentionedUsers as $mentionedUser) { foreach ($mentionedUsers as $mentionedUser) {
@@ -490,13 +502,13 @@ if(isset($_GET['token'])&&isset($_GET['type'])) {
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)"); $stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
$stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR); $stmt->bindParam(':touserid', decode_yajirushi(htmlspecialchars_decode($touserid), PDO::PARAM_STR));
$stmt->bindParam(':msg', htmlentities($msg), PDO::PARAM_STR); $stmt->bindParam(':msg', decode_yajirushi(htmlspecialchars_decode($msg), PDO::PARAM_STR));
$stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR); $stmt->bindParam(':url', decode_yajirushi(htmlspecialchars_decode($url), PDO::PARAM_STR));
$stmt->bindParam(':userchk', htmlentities($userchk), PDO::PARAM_STR); $stmt->bindParam(':userchk', decode_yajirushi(htmlspecialchars_decode($userchk), PDO::PARAM_STR));
$stmt->bindParam(':title', htmlentities($title), PDO::PARAM_STR); $stmt->bindParam(':title', decode_yajirushi(htmlspecialchars_decode($title), PDO::PARAM_STR));
$stmt->bindParam(':datetime', htmlentities($datetime), PDO::PARAM_STR); $stmt->bindParam(':datetime', decode_yajirushi(htmlspecialchars_decode($datetime), PDO::PARAM_STR));
// SQLクエリの実行 // SQLクエリの実行
$res = $stmt->execute(); $res = $stmt->execute();
@@ -647,16 +659,16 @@ if(isset($_GET['token'])&&isset($_GET['type'])) {
$userdata["follower_cnt"] = count($followercnts)-1; $userdata["follower_cnt"] = count($followercnts)-1;
$response = array( $response = array(
'user_name' => htmlentities($userdata["username"]), 'user_name' => decode_yajirushi(htmlspecialchars_decode($userdata["username"])),
'user_id' => htmlentities($userdata["userid"]), 'user_id' => decode_yajirushi(htmlspecialchars_decode($userdata["userid"])),
'profile' => htmlentities($userdata["profile"]), 'profile' => decode_yajirushi(htmlspecialchars_decode($userdata["profile"])),
'user_icon' => htmlentities("https://".$domain."/".$userdata["iconname"]), 'user_icon' => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userdata["iconname"])),
'user_header' => htmlentities("https://".$domain."/".$userdata["headname"]), 'user_header' => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userdata["headname"])),
'registered_date' => htmlentities($userdata["datetime"]), 'registered_date' => decode_yajirushi(htmlspecialchars_decode($userdata["datetime"])),
'follow' => htmlentities($userdata["follow"]), 'follow' => decode_yajirushi(htmlspecialchars_decode($userdata["follow"])),
'follow_cnt' => htmlentities($userdata["follow_cnt"]), 'follow_cnt' => decode_yajirushi(htmlspecialchars_decode($userdata["follow_cnt"])),
'follower' => htmlentities($userdata["follower"]), 'follower' => decode_yajirushi(htmlspecialchars_decode($userdata["follower"])),
'follower_cnt' => htmlentities($userdata["follower_cnt"]), 'follower_cnt' => decode_yajirushi(htmlspecialchars_decode($userdata["follower_cnt"])),
); );
} }
echo json_encode($response, JSON_UNESCAPED_UNICODE);; echo json_encode($response, JSON_UNESCAPED_UNICODE);;
+25 -17
View File
@@ -1,11 +1,19 @@
<?php <?php
header("Content-Type: application/json; charset=utf-8; Access-Control-Allow-Origin: *;"); header("Content-Type: application/json");
header("charset=utf-8");
header("Access-Control-Allow-Origin: *");
function decode_yajirushi($postText){
$postText = str_replace('&larr;', '←', $postText);
$postText = str_replace('&darr;', '↓', $postText);
$postText = str_replace('&uarr;', '↑', $postText);
$postText = str_replace('&rarr;', '→', $postText);
return $postText;
}
if(isset($_GET['limit'])) { if(isset($_GET['limit'])) {
$itemsPerPage = (int)$_GET['limit']; // 1ページあたりの投稿数 $itemsPerPage = htmlentities((int)$_GET['limit']); // 1ページあたりの投稿数
if(isset($_GET['page'])) { if(isset($_GET['page'])) {
$pageNumber = (int)$_GET['page']; $pageNumber = htmlentities((int)$_GET['page']);
}else{ }else{
$pageNumber = 1; $pageNumber = 1;
} }
@@ -65,19 +73,19 @@ if(isset($_GET['limit'])) {
$ueusedata["favorite_cnt"] = count($favcnts) - 1; $ueusedata["favorite_cnt"] = count($favcnts) - 1;
$item = [ $item = [
'account' => htmlentities($ueusedata["account"]), 'account' => decode_yajirushi(htmlspecialchars_decode($ueusedata["account"])),
'username' => htmlentities($ueusedata["username"]), 'username' => decode_yajirushi(htmlspecialchars_decode($ueusedata["username"])),
'uniqid' => htmlentities($ueusedata["uniqid"]), 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])),
'ueuse' => htmlentities($ueusedata["ueuse"]), 'ueuse' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])),
'photo1' => htmlentities(str_replace('../', '' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo1"])), 'photo1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', '' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo1"]))),
'photo2' => htmlentities(str_replace('../', '' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo2"])), 'photo2' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', '' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo2"]))),
'video1' => htmlentities(str_replace('../', '' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["video1"])), 'video1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', '' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["video1"]))),
'favorite' => htmlentities($ueusedata["favorite"]), 'favorite' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"])),
'favorite_cnt' => htmlentities($ueusedata["favorite_cnt"]), 'favorite_cnt' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite_cnt"])),
'datetime' => htmlentities($ueusedata["datetime"]), 'datetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["datetime"])),
'abi' => htmlentities($ueusedata["abi"]), 'abi' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abi"])),
'abidatetime' => htmlentities($ueusedata["abidate"]), 'abidatetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abidate"])),
'nsfw' => htmlentities($ueusedata["nsfw"]), 'nsfw' => decode_yajirushi(htmlspecialchars_decode($ueusedata["nsfw"])),
]; ];
$response[$ueusedata["uniqid"]] = $item; // ループ内で $response にデータを追加 $response[$ueusedata["uniqid"]] = $item; // ループ内で $response にデータを追加
+15 -14
View File
@@ -1,5 +1,7 @@
<?php <?php
header("Content-Type: application/json; charset=utf-8; Access-Control-Allow-Origin: *;"); header("Content-Type: application/json");
header("charset=utf-8");
header("Access-Control-Allow-Origin: *");
$mojisizefile = "../server/textsize.txt"; $mojisizefile = "../server/textsize.txt";
@@ -20,6 +22,13 @@ for( $i=0;$i<$cnt;$i++ ){
$uwuzuinfo[$i] = ($softwaredata[$i]); $uwuzuinfo[$i] = ($softwaredata[$i]);
} }
function decode_yajirushi($postText){
$postText = str_replace('&larr;', '←', $postText);
$postText = str_replace('&darr;', '↓', $postText);
$postText = str_replace('&uarr;', '↑', $postText);
$postText = str_replace('&rarr;', '→', $postText);
return $postText;
}
require('../db.php'); require('../db.php');
$datetime = array(); $datetime = array();
@@ -61,15 +70,7 @@ for( $i=0;$i<$cnt;$i++ ){
$notices[] = $row; $notices[] = $row;
} }
if(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8') === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){
$openregit = false;
}elseif(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8') === "false"){
$openregit = true;
}else{
$openregit = false;
}
if(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8') === "true"){
$invitation_code = true; $invitation_code = true;
}else{ }else{
$invitation_code = false; $invitation_code = false;
@@ -77,10 +78,10 @@ for( $i=0;$i<$cnt;$i++ ){
foreach ($notices as $value) { foreach ($notices as $value) {
$notices = array( $notices = array(
"title" => htmlentities($value['title']), "title" => decode_yajirushi(htmlspecialchars_decode($value['title'])),
"note" => htmlentities($value['note']), "note" => decode_yajirushi(htmlspecialchars_decode($value['note'])),
"editor" => htmlentities($value['account']), "editor" => decode_yajirushi(htmlspecialchars_decode($value['account'])),
"datetime" => htmlentities($value['datetime']), "datetime" => decode_yajirushi(htmlspecialchars_decode($value['datetime'])),
); );
$notice[] = $notices; $notice[] = $notices;
+22 -14
View File
@@ -1,6 +1,14 @@
<?php <?php
header("Content-Type: application/json; charset=utf-8; Access-Control-Allow-Origin: *;"); header("Content-Type: application/json");
header("charset=utf-8");
header("Access-Control-Allow-Origin: *");
function decode_yajirushi($postText){
$postText = str_replace('&larr;', '←', $postText);
$postText = str_replace('&darr;', '↓', $postText);
$postText = str_replace('&uarr;', '↑', $postText);
$postText = str_replace('&rarr;', '→', $postText);
return $postText;
}
if(isset($_GET['ueuseid'])) { if(isset($_GET['ueuseid'])) {
$ueuseid = htmlentities($_GET['ueuseid']); $ueuseid = htmlentities($_GET['ueuseid']);
@@ -61,18 +69,18 @@ if (empty($ueusedata)){
$ueusedata["favorite_cnt"] = count($favcnts)-1; $ueusedata["favorite_cnt"] = count($favcnts)-1;
$response = array( $response = array(
'userid' => htmlentities($ueusedata["account"]), 'userid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["account"])),
'user_name' => htmlentities($ueusedata["username"]), 'user_name' => decode_yajirushi(htmlspecialchars_decode($ueusedata["username"])),
'uniqid' => htmlentities($ueusedata["uniqid"]), 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])),
'ueuse' => htmlentities($ueusedata["ueuse"]), 'ueuse' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])),
'photo1' => htmlentities(str_replace('../', ''.$_SERVER['HTTP_HOST'].'/', $ueusedata["photo1"])), 'photo1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', ''.$_SERVER['HTTP_HOST'].'/', $ueusedata["photo1"]))),
'photo2' => htmlentities(str_replace('../', ''.$_SERVER['HTTP_HOST'].'/', $ueusedata["photo2"])), 'photo2' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', ''.$_SERVER['HTTP_HOST'].'/', $ueusedata["photo2"]))),
'video1' => htmlentities(str_replace('../', ''.$_SERVER['HTTP_HOST'].'/', $ueusedata["video1"])), 'video1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', ''.$_SERVER['HTTP_HOST'].'/', $ueusedata["video1"]))),
'favorite' => htmlentities($ueusedata["favorite"]), 'favorite' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"])),
'favorite_cnt' => htmlentities($ueusedata["favorite_cnt"]), 'favorite_cnt' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite_cnt"])),
'datetime' => htmlentities($ueusedata["datetime"]), 'datetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["datetime"])),
'abi' => htmlentities($ueusedata["abi"]), 'abi' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abi"])),
'abidatetime' => htmlentities($ueusedata["abidate"]), 'abidatetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abidate"])),
); );
} }
echo json_encode($response, JSON_UNESCAPED_UNICODE);; echo json_encode($response, JSON_UNESCAPED_UNICODE);;
+20 -12
View File
@@ -1,6 +1,14 @@
<?php <?php
header("Content-Type: application/json; charset=utf-8; Access-Control-Allow-Origin: *;"); header("Content-Type: application/json");
header("charset=utf-8");
header("Access-Control-Allow-Origin: *");
function decode_yajirushi($postText){
$postText = str_replace('&larr;', '←', $postText);
$postText = str_replace('&darr;', '↓', $postText);
$postText = str_replace('&uarr;', '↑', $postText);
$postText = str_replace('&rarr;', '→', $postText);
return $postText;
}
if(isset($_GET['userid'])) { if(isset($_GET['userid'])) {
$search = htmlentities($_GET['userid']); $search = htmlentities($_GET['userid']);
@@ -54,16 +62,16 @@ if (empty($userdata)){
$userdata["follower_cnt"] = count($followercnts)-1; $userdata["follower_cnt"] = count($followercnts)-1;
$response = array( $response = array(
'user_name' => htmlentities($userdata["username"]), 'user_name' => decode_yajirushi(htmlspecialchars_decode($userdata["username"])),
'user_id' => htmlentities($userdata["userid"]), 'user_id' => decode_yajirushi(htmlspecialchars_decode($userdata["userid"])),
'profile' => htmlentities($userdata["profile"]), 'profile' => decode_yajirushi(htmlspecialchars_decode($userdata["profile"])),
'user_icon' => htmlentities("https://".$domain."/".$userdata["iconname"]), 'user_icon' => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userdata["iconname"])),
'user_header' => htmlentities("https://".$domain."/".$userdata["headname"]), 'user_header' => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userdata["headname"])),
'registered_date' => htmlentities($userdata["datetime"]), 'registered_date' => decode_yajirushi(htmlspecialchars_decode($userdata["datetime"])),
'follow' => htmlentities($userdata["follow"]), 'follow' => decode_yajirushi(htmlspecialchars_decode($userdata["follow"])),
'follow_cnt' => htmlentities($userdata["follow_cnt"]), 'follow_cnt' => decode_yajirushi(htmlspecialchars_decode($userdata["follow_cnt"])),
'follower' => htmlentities($userdata["follower"]), 'follower' => decode_yajirushi(htmlspecialchars_decode($userdata["follower"])),
'follower_cnt' => htmlentities($userdata["follower_cnt"]), 'follower_cnt' => decode_yajirushi(htmlspecialchars_decode($userdata["follower_cnt"])),
); );
} }
echo json_encode($response, JSON_UNESCAPED_UNICODE); echo json_encode($response, JSON_UNESCAPED_UNICODE);
+5
View File
@@ -0,0 +1,5 @@
<?php
$url = "instance";
header("Location:".$url."");
exit;
?>
+63
View File
@@ -0,0 +1,63 @@
<?php
$serversettings_file = "../../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
function decode_yajirushi($postText){
$postText = str_replace('&larr;', '←', $postText);
$postText = str_replace('&darr;', '↓', $postText);
$postText = str_replace('&uarr;', '↑', $postText);
$postText = str_replace('&rarr;', '→', $postText);
return $postText;
}
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/json");
header("charset=utf-8");
header("Access-Control-Allow-Origin: *");
$mojisizefile = "../../server/textsize.txt";
$adminfile = htmlentities($serversettings["serverinfo"]["server_admin"]);
$servernamefile = htmlentities($serversettings["serverinfo"]["server_name"]);
$serverinfofile = '../../server/info.txt';
$serverinfo = htmlentities(file_get_contents($serverinfofile));
$contactfile = htmlentities($serversettings["serverinfo"]["server_admin_mailadds"]);
$domain = $_SERVER['HTTP_HOST'];
$softwarefile = "../../server/uwuzuinfo.txt";
$softwaredata = htmlentities(file_get_contents($softwarefile));
$onlyuser = htmlentities($serversettings["serverinfo"]["server_invitation"]);
$server_head = htmlentities($serversettings["serverinfo"]["server_head"]);
$softwaredata = explode( "\n", $softwaredata );
$cnt = count( $softwaredata );
for( $i=0;$i<$cnt;$i++ ){
$uwuzuinfo[$i] = ($softwaredata[$i]);
}
if($onlyuser === "true"){
$openregit = false;
}elseif($onlyuser === "false"){
$openregit = true;
}else{
$openregit = false;
}
$item = array(
"uri" => $domain,
"email" => $contactfile,
"title" => "uwuzu",
"version" =>str_replace("\r", '', $uwuzuinfo[1]),
"thumbnail" => $server_head,
"description" => $serverinfo,
);
echo json_encode($item, JSON_UNESCAPED_UNICODE);
}else{
header("HTTP/1.1 410 Gone");
}
?>
+3 -3
View File
@@ -129,8 +129,8 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="css/style.css">
<script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="js/unsupported.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">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
@@ -149,7 +149,7 @@ $pdo = null;
</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 }?>
+11 -9
View File
@@ -123,8 +123,9 @@ if( !empty($_POST['btn_submit']) ) {
$url = '/settings'; $url = '/settings';
$userchk = 'none'; $userchk = 'none';
// 通知用SQL作成 // 通知用SQL作成
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)"); $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("uwuzu-fromsys"), PDO::PARAM_STR);
$stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR); $stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR);
$stmt->bindParam(':msg', htmlentities($msg), PDO::PARAM_STR); $stmt->bindParam(':msg', htmlentities($msg), PDO::PARAM_STR);
$stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR); $stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR);
@@ -159,7 +160,7 @@ if( !empty($_POST['btn_submit']) ) {
// すべての出力を終了 // すべての出力を終了
exit; exit;
}else{ }else{
$error_message[] = "そのバックアップコードは使用できません。"; $error_message[] = "そのバックアップコードは使用できません。(BACKUPCODE_DAME)";
} }
}else{ }else{
@@ -173,7 +174,7 @@ if( !empty($_POST['btn_submit']) ) {
$userauthcode = $_POST['usercode']; $userauthcode = $_POST['usercode'];
if(empty($userauthcode)){ if(empty($userauthcode)){
$error_message[] = "コードを入力してください。"; $error_message[] = "コードを入力してください。(AUTHCODE_INPUT_PLEASE)";
}else{ }else{
$discrepancy = 2; $discrepancy = 2;
@@ -190,8 +191,9 @@ if( !empty($_POST['btn_submit']) ) {
$url = '/settings'; $url = '/settings';
$userchk = 'none'; $userchk = 'none';
// 通知用SQL作成 // 通知用SQL作成
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)"); $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("uwuzu-fromsys"), PDO::PARAM_STR);
$stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR); $stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR);
$stmt->bindParam(':msg', htmlentities($msg), PDO::PARAM_STR); $stmt->bindParam(':msg', htmlentities($msg), PDO::PARAM_STR);
$stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR); $stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR);
@@ -268,11 +270,11 @@ if( !empty($_POST['btn_submit']) ) {
exit; exit;
}else { }else {
$error_message[] = '二段階認証が出来ませんでした。再度お試しください。'; $error_message[] = '二段階認証が出来ませんでした。再度お試しください。(AUTHCODE_CHECK_DAME)';
} }
} }
}else{ }else{
$error_message[] = 'データの取得が出来ませんでした。再度お試しください。'; $error_message[] = 'データの取得が出来ませんでした。再度お試しください。(AUTHCODE_GET_ACCOUNT_NOT_FOUND)';
} }
} }
@@ -286,8 +288,8 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="css/style.css">
<script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="js/unsupported.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">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
@@ -304,7 +306,7 @@ $pdo = null;
</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 }?>
+85
View File
@@ -0,0 +1,85 @@
<?php
require('../db.php');
if (htmlentities(isset($_POST['uniqid'])) && htmlentities(isset($_POST['userid'])) && htmlentities(isset($_POST['account_id']))) {
$postUniqid = htmlentities($_POST['uniqid']);
$userId = htmlentities($_POST['userid']);
$loginid = htmlentities($_POST['account_id']);
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();
}
// データベース接続の設定
$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,
));
$query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
$query->execute(array(':userid' => $userId));
$result2 = $query->fetch();
if($result2["loginid"] === $loginid){
try {
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS);
// Bookmark情報を取得
$stmt = $pdo->prepare("SELECT bookmark FROM account WHERE userid = :userid");
$stmt->bindValue(':userid', $userId, PDO::PARAM_STR);
$stmt->execute();
$post = $stmt->fetch(PDO::FETCH_ASSOC);
if ($post) {
$bookmarkList = explode(',', $post['bookmark']);
$index = array_search($postUniqid, $bookmarkList);
if ($index === false) {
// ユーザーIDを追加
$bookmarkList[] = $postUniqid;
} else {
// ユーザーIDを削除
array_splice($bookmarkList, $index, 1);
}
// 新しいいいね情報を更新
$newbookmark = implode(',', $bookmarkList);
$updateQuery = $pdo->prepare("UPDATE account SET bookmark = :bookmark WHERE userid = :userid");
$updateQuery->bindValue(':bookmark', $newbookmark, PDO::PARAM_STR);
$updateQuery->bindValue(':userid', $userId, PDO::PARAM_STR);
$res = $updateQuery->execute();
if ($res) {
echo json_encode(['success' => true, 'newbookmark' => 'success']);
exit;
} else {
echo json_encode(['success' => false, 'error' => 'いいねの更新に失敗しました。']);
exit;
}
} else {
echo json_encode(['success' => false, 'error' => 'アカウントが見つかりません。']);
exit;
}
} catch(PDOException $e) {
echo json_encode(['success' => false, 'error' => 'データベースエラー:' . $e->getMessage()]);
exit;
}
}
} else {
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
exit;
}
?>
+617
View File
@@ -0,0 +1,617 @@
<?php
$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);
}
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=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
} catch(PDOException $e) {
// 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
$myblocklist = htmlentities($res["blocklist"]);
$myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, [
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
$myblocklist = htmlentities($res["blocklist"]);
$myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
$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( !empty($_POST['delete_all_bookmark']) ) {
$updateQuery = $pdo->prepare("UPDATE account SET bookmark = :bookmark WHERE userid = :userid");
$updateQuery->bindValue(':bookmark', '', PDO::PARAM_STR);
$updateQuery->bindValue(':userid', $userid, PDO::PARAM_STR);
$res = $updateQuery->execute();
if ($res) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];;
header("Location:".$url."");
exit;
} else {
$error_message[] = "BOOKMARK_NOT_DELETED";
}
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js"></script>
<link rel="stylesheet" href="../css/home.css">
<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="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>ブックマーク - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head>
<body>
<?php require('../require/leftbox.php');?>
<main class="outer">
<?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_flex">
<h1>ブックマーク</h1>
<div class="right_box">
<button name="del_bookmark" id="del_bookmark" class="emojibox_button" title="ブックマークの一括削除"><svg><use xlink:href="../img/sysimage/delete_1.svg#delete"></use></svg></a>
</div>
</div>
<section class="inner">
<div id="postContainer">
</div>
</section>
<div id="loading" class="loading" style="display: none;">
🤔
</div>
<div id="error" class="error" style="display: none;">
<h1>エラー</h1>
<p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。<br>(NETWORK_HUKANZEN_STOP)</p>
</div>
<!--ブックマーク全削除-->
<div id="Del_all_bookmark" class="modal">
<div class="modal-content">
<h1>ブックマークを全て削除しますか?</h1>
<p>削除後の復元はできません。</p>
<form class="btn_area" method="post" id="Del_bookmark_Form">
<input type="submit" id="Del_bookmark_Button" class="fbtn_no" name="delete_all_bookmark" value="削除">
<input type="button" id="Del_bookmark_Cancel" class="fbtn" value="キャンセル">
</form>
</div>
</div>
<!--ブックマーク全削除-->
<div id="myDelModal" class="modal">
<div class="modal-content">
<p>ユーズを削除しますか?</p>
<form class="btn_area" method="post" id="deleteForm">
<input type="button" id="deleteButton" class="fbtn_no" name="delete" value="削除">
<input type="button" id="cancelButton" class="fbtn" value="キャンセル">
</form>
</div>
</div>
<div id="myAbiModal" class="modal">
<div class="modal-content">
<h1>ユーズに追記しますか?</h1>
<p>※追記は削除出来ません。</p>
<form method="post" id="AbiForm">
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlspecialchars( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
<div class="btn_area">
<input type="submit" id="AbiAddButton" class="fbtn_no" name="abi" value="追記">
<input type="button" id="AbiCancelButton" class="fbtn" value="キャンセル">
</div>
</form>
</div>
</div>
</main>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
<script>
$(document).ready(function () {
loadPosts();
var pageNumber = 1;
var isLoading = false;
function loadPosts() {
if (isLoading) return;
isLoading = true;
$("#loading").show();
var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
$.ajax({
url: '../nextpage/bookmark.php', // PHPファイルへのパス
method: 'GET',
data: { page: pageNumber, userid: userid, account_id: account_id },
dataType: 'html',
success: function (response) {
$('#postContainer').append(response);
pageNumber++;
isLoading = false;
$("#loading").hide();
}
});
}
$('.outer').on('scroll', function () {
var innerHeight = $('.inner').innerHeight(), //内側の要素の高さ
outerHeight = $('.outer').innerHeight(), //外側の要素の高さ
outerBottom = innerHeight - outerHeight; //内側の要素の高さ - 外側の要素の高さ
if (outerBottom <= $('.outer').scrollTop()) {
var elem = document.getElementById("noueuse");
if (elem === null) {
// 存在しない場合の処理
loadPosts();
} else {
// 存在する場合の処理
return;
}
}
});
$(document).on('click', '.favbtn, .favbtn_after', function (event) {
event.preventDefault();
var postUniqid = $(this).data('uniqid');
var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
var likeCountElement = $(this).find('.like-count'); // いいね数を表示する要素
var isLiked = $(this).hasClass('favbtn_after'); // 現在のいいねの状態を判定
var $this = $(this); // ボタン要素を変数に格納
$.ajax({
url: '../favorite/favorite.php',
method: 'POST',
data: { uniqid: postUniqid, userid: userid, account_id: account_id }, // ここに自分のユーザーIDを指定
dataType: 'json',
success: function (response) {
if (response.success) {
// いいね成功時の処理
if (isLiked) {
$this.removeClass('favbtn_after'); // クラスを削除していいねを取り消す
$this.find('use').attr('xlink:href', '../img/sysimage/favorite_1.svg#favorite'); // 画像を元の画像に戻す
} else {
$this.addClass('favbtn_after'); // クラスを追加していいねを追加する
$this.find('use').attr('xlink:href', '../img/sysimage/favorite_2.svg#favorite'); // 画像を新しい画像に置き換える
}
var newFavoriteList = response.newFavorite.split(',');
var likeCount = newFavoriteList.length - 1;
likeCountElement.text(likeCount); // いいね数を更新
} else {
// いいね失敗時の処理
}
}.bind(this), // コールバック内でthisが適切な要素を指すようにbindする
error: function () {
// エラー時の処理
}
});
});
$(document).on('click', '.bookmark, .bookmark_after', function (event) {
event.preventDefault();
var postUniqid = $(this).data('uniqid');
var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
var likeCountElement = $(this).find('.like-count'); // いいね数を表示する要素
var isLiked = $(this).hasClass('bookmark_after'); // 現在のいいねの状態を判定
var $this = $(this); // ボタン要素を変数に格納
$.ajax({
url: '../bookmark/bookmark.php',
method: 'POST',
data: { uniqid: postUniqid, userid: userid, account_id: account_id }, // ここに自分のユーザーIDを指定
dataType: 'json',
success: function (response) {
if (response.success) {
// いいね成功時の処理
if (isLiked) {
$this.removeClass('bookmark_after'); // クラスを削除していいねを取り消す
} else {
$this.addClass('bookmark_after'); // クラスを追加していいねを追加する
}
} else {
// いいね失敗時の処理
}
}.bind(this), // コールバック内でthisが適切な要素を指すようにbindする
error: function () {
// エラー時の処理
}
});
});
var modal = document.getElementById('myDelModal');
var deleteButton = document.getElementById('deleteButton');
var cancelButton = document.getElementById('cancelButton'); // 追加
var modalMain = $('.modal-content');
$(document).on('click', '.delbtn', function (event) {
modal.style.display = 'block';
modalMain.addClass("slideUp");
modalMain.removeClass("slideDown");
var uniqid2 = $(this).attr('data-uniqid2');
var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
var postElement = $(this).closest('.ueuse');
deleteButton.addEventListener('click', () => {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function () {
modal.style.display = 'none';
}, 150);
$.ajax({
url: '../delete/delete.php',
method: 'POST',
data: { uniqid: uniqid2, userid: userid, account_id: account_id },
dataType: 'json',
success: function (response) {
if (response.success) {
postElement.remove();
} else {
// 削除失敗時の処理
}
},
error: function () {
// エラー時の処理
}
});
});
cancelButton.addEventListener('click', () => { // 追加
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function () {
modal.style.display = 'none';
}, 150);
});
});
var abimodal = document.getElementById('myAbiModal');
var AbiAddButton = document.getElementById('AbiAddButton');
var AbiCancelButton = document.getElementById('AbiCancelButton');
var modalMain = $('.modal-content');
$(document).on('click', '.addabi', function (event) {
abimodal.style.display = 'block';
modalMain.addClass("slideUp");
modalMain.removeClass("slideDown");
var uniqid2 = $(this).attr('data-uniqid2');
var postAbiElement = $(this).closest('.addabi');
AbiCancelButton.addEventListener('click', () => {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function () {
abimodal.style.display = 'none';
}, 150);
});
$('#AbiForm').off('submit').on('submit', function (event) {
event.preventDefault();
var abitext = document.getElementById("abitexts").value;
var usernames = '<?php echo $username; ?>';
var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
if (abitext == "") {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function () {
abimodal.style.display = 'none';
}, 150);
} else {
$.ajax({
url: '../abi/addabi.php',
method: 'POST',
data: { uniqid: uniqid2, abitext: abitext, username: usernames, userid: userid, account_id: account_id },
dataType: 'json',
success: function (response) {
console.log(response); // レスポンス内容をコンソールに表示
if (response.success) {
abimodal.style.display = 'none';
postAbiElement.remove();
console.log(response);
} else {
abimodal.style.display = 'none';
postAbiElement.remove();
}
},
error: function (xhr, status, error) {
console.log(error);
abimodal.style.display = 'none';
postAbiElement.remove();
}
});
}
});
});
var bookmark_modal = document.getElementById('Del_all_bookmark');
var bookmark_deleteButton = document.getElementById('Del_bookmark_Button');
var bookmark_cancelButton = document.getElementById('Del_bookmark_Cancel'); // 追加
var modalMain = $('.modal-content');
$(document).on('click', '.emojibox_button', function (event) {
bookmark_modal.style.display = 'block';
modalMain.addClass("slideUp");
modalMain.removeClass("slideDown");
bookmark_deleteButton.addEventListener('click', () => {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
bookmark_modal.style.display = 'none';
}, 150);
});
bookmark_cancelButton.addEventListener('click', () => { // 追加
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
bookmark_modal.style.display = 'none';
}, 150);
});
});
window.addEventListener('online', function () {
checkOnline();
});
window.addEventListener('offline', function () {
checkOnline();
});
function checkOnline() {
if (navigator.onLine) {
$("#online").show();
$("#offline").hide();
} else {
$("#online").hide();
$("#offline").show();
}
}
$(document).on('click', '.share', function (event) {
var domain = "<?php echo $domain;?>";
var share_uniqid = $(this).attr('data-uniqid');
var share_userid = $(this).attr('data-userid');
if (typeof navigator.share === 'undefined') {
navigator.clipboard.writeText("https://" + domain + "/!" + share_uniqid + "")
$("#clipboard").show();
window.setTimeout(function () {
$("#clipboard").hide();
}, 5000);
return;
}
var shareData = {
title: '' + share_userid + 'さんのID ' + share_uniqid + ' のユーズ - uwuzu',
text: '',
url: "https://" + domain + "/!" + share_uniqid + "",
};
navigator.share(shareData)
.then(function () {
// シェア完了後の処理
})
.catch(function (error) {
// シェア失敗時の処理
});
});
var osho_gats = document.getElementById('osho_gats');
$('#os_exit_btn').on('click', function () {
document.cookie = "event=done; max-age=86400";
osho_gats.style.display = 'none';
});
});
</script>
</html>
+33 -7
View File
@@ -147,8 +147,9 @@ if( !empty($_POST['btn_submit']) ) {
$url = '/settings'; $url = '/settings';
$userchk = 'none'; $userchk = 'none';
// 通知用SQL作成 // 通知用SQL作成
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)"); $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("uwuzu-fromsys"), PDO::PARAM_STR);
$stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR); $stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR);
$stmt->bindParam(':msg', htmlentities($msg), PDO::PARAM_STR); $stmt->bindParam(':msg', htmlentities($msg), PDO::PARAM_STR);
$stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR); $stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR);
@@ -241,6 +242,31 @@ if( !empty($_POST['btn_submit2']) ) {
// プロフィールの絵文字対応
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;
@@ -250,8 +276,8 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="css/style.css">
<script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="js/unsupported.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="favicon/icon-192x192.png">
@@ -268,14 +294,14 @@ $pdo = null;
</div> </div>
<?php }else{?> <?php }else{?>
<div class="logo"> <div class="logo">
<a href="../index.php"><img src="../img/uwuzulogo.svg"></a> <a href="../index.php"><img src="img/uwuzulogo.svg"></a>
</div> </div>
<?php }?> <?php }?>
<div class="textbox"> <div class="textbox">
<h1>確認</h1> <h1>確認</h1>
<p>あなたは <?php if( !empty($row["username"]) ){ echo htmlentities( $row["username"], ENT_QUOTES, 'UTF-8'); } ?> ですか?</p> <p>あなたは <?php if( !empty($row["username"]) ){ echo replaceProfileEmojiImages(htmlentities( $row["username"], ENT_QUOTES, 'UTF-8')); } ?> ですか?</p>
<?php if( !empty($error_message) ): ?> <?php if( !empty($error_message) ): ?>
<ul class="errmsg"> <ul class="errmsg">
@@ -287,8 +313,8 @@ $pdo = null;
<div class="myarea"> <div class="myarea">
<img src="<?php echo htmlentities($userData['iconname']); ?>"> <img src="<?php echo htmlentities($userData['iconname']); ?>">
<p>名</p> <p>ユーザー名</p>
<h2><?php if( !empty($row["username"]) ){ echo htmlentities( $row["username"], ENT_QUOTES, 'UTF-8'); } ?></h2> <h2><?php if( !empty($row["username"]) ){ echo replaceProfileEmojiImages(htmlentities( $row["username"], ENT_QUOTES, 'UTF-8')); } ?></h2>
<div class="roleboxes"> <div class="roleboxes">
<?php foreach ($roles as $roleId): ?> <?php foreach ($roles as $roleId): ?>
<?php $roleData = $roleDataArray[$roleId]; ?> <?php $roleData = $roleDataArray[$roleId]; ?>
+696 -350
View File
File diff suppressed because it is too large Load Diff
+44 -1
View File
@@ -229,6 +229,22 @@ body{
font-weight: bold; font-weight: bold;
} }
.serverhead{
width: 100%;
margin-left: auto;
margin-right: auto;
display: flex;
text-align: center;
}
.serverhead img{
object-fit: cover;
width: 100%;
height: 180px;
border-radius: 10px;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
margin: 0px;
}
.servericon{ .servericon{
width: fit-content; width: fit-content;
margin-left: auto; margin-left: auto;
@@ -236,12 +252,17 @@ body{
display: flex; display: flex;
text-align: center; text-align: center;
} }
.servericon .up{
margin-top: -74px;
border-radius: 18px;
}
.servericon img{ .servericon img{
object-fit: cover; object-fit: cover;
width: 100px; width: 100px;
height: 100px; height: 100px;
border-radius: 15px; border-radius: 15px;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05); box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
margin: 0px;
} }
.servericon .textzone{ .servericon .textzone{
margin-top: auto; margin-top: auto;
@@ -759,6 +780,26 @@ main h1{
.textbox .authzone img{ .textbox .authzone img{
width: 30%; width: 30%;
} }
p img{
margin-top: auto;
margin-bottom: auto;
margin-left: 4px;
margin-right: 4px;
height: 24px;
width: 24px;
vertical-align: middle;
border-radius: 5px;
}
.myarea h2 img{
margin-top: auto;
margin-bottom: auto;
margin-left: 4px;
margin-right: 4px;
height: 32px;
width: 32px;
vertical-align: middle;
border-radius: 5px;
}
/*------------------------------------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------スマホ向け--------------------------------------------------*/ /*--------------------------------------------------スマホ向け--------------------------------------------------*/
@@ -809,7 +850,9 @@ main h1{
margin-bottom: -4px; margin-bottom: -4px;
} }
.serverhead img{
height: 110px;
}
.textbox{ .textbox{
padding: 32px; padding: 32px;
width: auto; width: auto;
+3 -3
View File
@@ -200,12 +200,12 @@ $pdo = null;
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<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>
+3 -3
View File
@@ -16,10 +16,10 @@ $domain = $_SERVER['HTTP_HOST'];
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="/css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+3 -3
View File
@@ -16,10 +16,10 @@ $domain = $_SERVER['HTTP_HOST'];
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="/css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+3 -3
View File
@@ -16,10 +16,10 @@ $domain = $_SERVER['HTTP_HOST'];
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="/css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+3 -3
View File
@@ -18,10 +18,10 @@ $domain = $_SERVER['HTTP_HOST'];
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="/css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+3 -3
View File
@@ -15,10 +15,10 @@ $domain = $_SERVER['HTTP_HOST'];
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="/css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+3 -3
View File
@@ -21,10 +21,10 @@ $domain = $_SERVER['HTTP_HOST'];
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="/css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+4 -4
View File
@@ -18,10 +18,10 @@ if(!empty(file_get_contents($serverstopfile))){
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="/css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="/js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="/js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
@@ -49,7 +49,7 @@ if(!empty(file_get_contents($serverstopfile))){
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<div class="err404"> <div class="err404">
<h1>サーバー停止中</h1> <h1>サーバー停止中</h1>
<p>現在サーバーが管理者によって停止されています...<br>停止の理由は以下の通りです。</p> <p>現在サーバーが管理者によって停止されています...<br>停止の理由は以下の通りです。<br>(ADMIN_SERVER_STOP)</p>
<hr> <hr>
<p><?php <p><?php
+64
View File
@@ -0,0 +1,64 @@
<?php
//----------EXIF_Delete----------
//EXIFを削除するやつです。
function rotate($image, $exif){
$orientation = $exif['Orientation'] ?? 1;
switch ($orientation) {
case 1: //no rotate
break;
case 2: //FLIP_HORIZONTAL
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 3: //ROTATE 180
$image = imagerotate($image, 180, 0);
break;
case 4: //FLIP_VERTICAL
imageflip($image, IMG_FLIP_VERTICAL);
break;
case 5: //ROTATE 270 FLIP_HORIZONTAL
$image = imagerotate($image, 270, 0);
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 6: //ROTATE 90
$image = imagerotate($image, 270, 0);
break;
case 7: //ROTATE 90 FLIP_HORIZONTAL
$image = imagerotate($image, 90, 0);
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 8: //ROTATE 270
$image = imagerotate($image, 90, 0);
break;
}
return $image;
}
function delete_exif($extension, $path){
$exifimgext = array(
"jpg",
"jpeg",
"jfif",
"pjpeg",
"pjp",
"hdp",
"wdp",
"jxr",
"tiff",
"tif",
"png"
);
if(in_array($extension,$exifimgext)){
$gd = imagecreatefromjpeg($path);
$w = imagesx($gd);
$h = imagesy($gd);
$gd_out = imagecreatetruecolor($w,$h);
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
$exif = exif_read_data($path);
$gd_out = rotate($gd_out, $exif);
imagejpeg($gd_out, $path);
imagedestroy($gd_out);
}
}
//----------EXIF_Delete----------
?>
+102 -111
View File
@@ -3,6 +3,9 @@ $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true); $serversettings = parse_ini_file($serversettings_file, true);
$mojisizefile = "../server/textsize.txt"; $mojisizefile = "../server/textsize.txt";
$mojisize = (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8');
//投稿及び返信レート制限↓(分):デフォで60件/分まで
$max_ueuse_rate_limit = 60;
$banurldomainfile = "../server/banurldomain.txt"; $banurldomainfile = "../server/banurldomain.txt";
$banurl_info = file_get_contents($banurldomainfile); $banurl_info = file_get_contents($banurldomainfile);
@@ -18,6 +21,10 @@ function createUniqId(){
} }
require('../db.php'); require('../db.php');
//関数呼び出し
//- EXIF
require('../function/function.php');
// 変数の初期化 // 変数の初期化
$datetime = array(); $datetime = array();
$user_name = null; $user_name = null;
@@ -214,39 +221,7 @@ function get_mentions_userid($postText) {
return $mentionedUsers; return $mentionedUsers;
} }
function rotate($image, $exif)
{
$orientation = $exif['Orientation'] ?? 1;
switch ($orientation) {
case 1: //no rotate
break;
case 2: //FLIP_HORIZONTAL
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 3: //ROTATE 180
$image = imagerotate($image, 180, 0);
break;
case 4: //FLIP_VERTICAL
imageflip($image, IMG_FLIP_VERTICAL);
break;
case 5: //ROTATE 270 FLIP_HORIZONTAL
$image = imagerotate($image, 270, 0);
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 6: //ROTATE 90
$image = imagerotate($image, 270, 0);
break;
case 7: //ROTATE 90 FLIP_HORIZONTAL
$image = imagerotate($image, 90, 0);
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 8: //ROTATE 270
$image = imagerotate($image, 90, 0);
break;
}
return $image;
}
if( !empty($_POST['btn_submit']) ) { if( !empty($_POST['btn_submit']) ) {
@@ -266,22 +241,32 @@ if( !empty($_POST['btn_submit']) ) {
// メッセージの入力チェック // メッセージの入力チェック
if( empty($ueuse) ) { if( empty($ueuse) ) {
$error_message[] = '内容を入力してください。'; $error_message[] = '内容を入力してください。(INPUT_PLEASE)';
} else { } else {
// 文字数を確認 // 文字数を確認
if( (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8') < mb_strlen($ueuse, 'UTF-8') ) { if( (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8') < mb_strlen($ueuse, 'UTF-8') ) {
$error_message[] = '内容は'.htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8').'文字以内で入力してください。'; $error_message[] = '内容は'.htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8').'文字以内で入力してください。(INPUT_OVER_MAX_COUNT)';
} }
// 禁止url確認 // 禁止url確認
for($i = 0; $i < count($banurl); $i++) { for($i = 0; $i < count($banurl); $i++) {
if(!($banurl[$i] == "")){
if (false !== strpos($ueuse, 'https://'.$banurl[$i])) { if (false !== strpos($ueuse, 'https://'.$banurl[$i])) {
$error_message[] = '投稿が禁止されているURLが含まれています。'; $error_message[] = '投稿が禁止されているURLが含まれています。(INPUT_CONTAINS_PROHIBITED_URL)';
}
} }
} }
} }
$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', $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($_FILES['upload_images']['name'])) { if (empty($_FILES['upload_images']['name'])) {
$photo1 = "none"; $photo1 = "none";
} else { } else {
@@ -301,17 +286,7 @@ if( !empty($_POST['btn_submit']) ) {
$result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath); $result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath);
// EXIF削除 // EXIF削除
if($extension == "jpg" || $extension == "jpeg"){ delete_exif($extension, $uploadedPath);
$gd = imagecreatefromjpeg($uploadedPath);
$w = imagesx($gd);
$h = imagesy($gd);
$gd_out = imagecreatetruecolor($w,$h);
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
$exif = exif_read_data($uploadedPath);
$gd_out = rotate($gd_out, $exif);
imagejpeg($gd_out, $uploadedPath);
imagedestroy($gd_out);
}
if ($result) { if ($result) {
$photo1 = $uploadedPath; // 保存されたファイルのパスを使用 $photo1 = $uploadedPath; // 保存されたファイルのパスを使用
@@ -333,13 +308,13 @@ if( !empty($_POST['btn_submit']) ) {
} else { } else {
if (empty($_FILES['upload_images']['name'])){ if (empty($_FILES['upload_images']['name'])){
$error_message[] = '画像1から画像を選択してください!!!'; $error_message[] = '画像1から画像を選択してください!!!(PHOTO_SELECT_PLEASE)';
} }
// アップロードされたファイル情報 // アップロードされたファイル情報
$uploadedFile2 = $_FILES['upload_images2']; $uploadedFile2 = $_FILES['upload_images2'];
if( 10000000 < $uploadedFile2["size"] ) { if( 10000000 < $uploadedFile2["size"] ) {
$error_message[] = 'ファイルサイズが大きすぎます!'; $error_message[] = 'ファイルサイズが大きすぎます!(PHOTO_OVER_MAX_SIZE)';
} }
// アップロードされたファイルの拡張子を取得 // アップロードされたファイルの拡張子を取得
$extension2 = pathinfo($uploadedFile2['name'], PATHINFO_EXTENSION); $extension2 = pathinfo($uploadedFile2['name'], PATHINFO_EXTENSION);
@@ -354,17 +329,7 @@ if( !empty($_POST['btn_submit']) ) {
$result2 = move_uploaded_file($uploadedFile2['tmp_name'], $uploadedPath2); $result2 = move_uploaded_file($uploadedFile2['tmp_name'], $uploadedPath2);
// EXIF削除 // EXIF削除
if($extension2 == "jpg" || $extension2 == "jpeg"){ delete_exif($extension2, $uploadedPath2);
$gd = imagecreatefromjpeg($uploadedPath2);
$w = imagesx($gd);
$h = imagesy($gd);
$gd_out = imagecreatetruecolor($w,$h);
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
$exif = exif_read_data($uploadedPath2);
$gd_out = rotate($gd_out, $exif);
imagejpeg($gd_out, $uploadedPath2);
imagedestroy($gd_out);
}
if ($result2) { if ($result2) {
$photo2 = $uploadedPath2; // 保存されたファイルのパスを使用 $photo2 = $uploadedPath2; // 保存されたファイルのパスを使用
@@ -386,13 +351,13 @@ if( !empty($_POST['btn_submit']) ) {
} else { } else {
if (empty($_FILES['upload_images2']['name'])){ if (empty($_FILES['upload_images2']['name'])){
$error_message[] = '画像2から画像を選択してください!!!'; $error_message[] = '画像2から画像を選択してください!!!(PHOTO_SELECT_PLEASE)';
} }
// アップロードされたファイル情報 // アップロードされたファイル情報
$uploadedFile3 = $_FILES['upload_images3']; $uploadedFile3 = $_FILES['upload_images3'];
if( 10000000 < $uploadedFile3["size"] ) { if( 10000000 < $uploadedFile3["size"] ) {
$error_message[] = 'ファイルサイズが大きすぎます!'; $error_message[] = 'ファイルサイズが大きすぎます!(PHOTO_OVER_MAX_SIZE)';
} }
// アップロードされたファイルの拡張子を取得 // アップロードされたファイルの拡張子を取得
$extension3 = pathinfo($uploadedFile3['name'], PATHINFO_EXTENSION); $extension3 = pathinfo($uploadedFile3['name'], PATHINFO_EXTENSION);
@@ -407,17 +372,7 @@ if( !empty($_POST['btn_submit']) ) {
$result3 = move_uploaded_file($uploadedFile3['tmp_name'], $uploadedPath3); $result3 = move_uploaded_file($uploadedFile3['tmp_name'], $uploadedPath3);
// EXIF削除 // EXIF削除
if($extension3 == "jpg" || $extension3 == "jpeg"){ delete_exif($extension3, $uploadedPath3);
$gd = imagecreatefromjpeg($uploadedPath3);
$w = imagesx($gd);
$h = imagesy($gd);
$gd_out = imagecreatetruecolor($w,$h);
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
$exif = exif_read_data($uploadedPath3);
$gd_out = rotate($gd_out, $exif);
imagejpeg($gd_out, $uploadedPath3);
imagedestroy($gd_out);
}
if ($result3) { if ($result3) {
$photo3 = $uploadedPath3; // 保存されたファイルのパスを使用 $photo3 = $uploadedPath3; // 保存されたファイルのパスを使用
@@ -439,13 +394,13 @@ if( !empty($_POST['btn_submit']) ) {
} else { } else {
if (empty($_FILES['upload_images3']['name'])){ if (empty($_FILES['upload_images3']['name'])){
$error_message[] = '画像3から画像を選択してください!!!'; $error_message[] = '画像3から画像を選択してください!!!(PHOTO_SELECT_PLEASE)';
} }
// アップロードされたファイル情報 // アップロードされたファイル情報
$uploadedFile4 = $_FILES['upload_images4']; $uploadedFile4 = $_FILES['upload_images4'];
if( 10000000 < $uploadedFile4["size"] ) { if( 10000000 < $uploadedFile4["size"] ) {
$error_message[] = 'ファイルサイズが大きすぎます!'; $error_message[] = 'ファイルサイズが大きすぎます!(PHOTO_OVER_MAX_SIZE)';
} }
// アップロードされたファイルの拡張子を取得 // アップロードされたファイルの拡張子を取得
$extension4 = pathinfo($uploadedFile4['name'], PATHINFO_EXTENSION); $extension4 = pathinfo($uploadedFile4['name'], PATHINFO_EXTENSION);
@@ -460,17 +415,7 @@ if( !empty($_POST['btn_submit']) ) {
$result4 = move_uploaded_file($uploadedFile4['tmp_name'], $uploadedPath4); $result4 = move_uploaded_file($uploadedFile4['tmp_name'], $uploadedPath4);
// EXIF削除 // EXIF削除
if($extension4 == "jpg" || $extension4 == "jpeg"){ delete_exif($extension4, $uploadedPath4);
$gd = imagecreatefromjpeg($uploadedPath4);
$w = imagesx($gd);
$h = imagesy($gd);
$gd_out = imagecreatetruecolor($w,$h);
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
$exif = exif_read_data($uploadedPath4);
$gd_out = rotate($gd_out, $exif);
imagejpeg($gd_out, $uploadedPath4);
imagedestroy($gd_out);
}
if ($result4) { if ($result4) {
$photo4 = $uploadedPath4; // 保存されたファイルのパスを使用 $photo4 = $uploadedPath4; // 保存されたファイルのパスを使用
@@ -523,7 +468,7 @@ if( !empty($_POST['btn_submit']) ) {
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.''; $error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
} }
} else { } else {
$error_message[] = '対応していないファイル形式です!'; $error_message[] = '対応していないファイル形式です!(SORRY_FILE_HITAIOU)';
} }
@@ -565,13 +510,14 @@ if( !empty($_POST['btn_submit']) ) {
// コミット // コミット
$res = $pdo->commit(); $res = $pdo->commit();
$mentionedUsers = get_mentions_userid($ueuse); $mentionedUsers = array_unique(get_mentions_userid($ueuse));
foreach ($mentionedUsers as $mentionedUser) { foreach ($mentionedUsers as $mentionedUser) {
$pdo->beginTransaction(); $pdo->beginTransaction();
try { try {
$fromuserid = $userid;
$touserid = $mentionedUser; $touserid = $mentionedUser;
$datetime = date("Y-m-d H:i:s"); $datetime = date("Y-m-d H:i:s");
$msg = "" . $ueuse . ""; $msg = "" . $ueuse . "";
@@ -580,9 +526,10 @@ if( !empty($_POST['btn_submit']) ) {
$userchk = 'none'; $userchk = 'none';
// 通知用SQL作成 // 通知用SQL作成
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)"); $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), PDO::PARAM_STR);
$stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR); $stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR);
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR); $stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
$stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR); $stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR);
@@ -622,6 +569,9 @@ if( !empty($_POST['btn_submit']) ) {
// プリペアドステートメントを削除 // プリペアドステートメントを削除
$stmt = null; $stmt = null;
} }
}else{
$error_message[] = "投稿回数のレート制限を超過しています。(OVER_RATE_LIMIT)";
}
} }
@@ -639,9 +589,9 @@ $pdo = null;
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<script src="../js/nsfw_event.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/nsfw_event.js"></script>
<link rel="manifest" href="../manifest/manifest.json" /> <link rel="manifest" href="../manifest/manifest.json" />
<script> <script>
if ("serviceWorker" in navigator) { if ("serviceWorker" in navigator) {
@@ -655,7 +605,7 @@ if ("serviceWorker" in navigator) {
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<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>
@@ -694,7 +644,6 @@ if ("serviceWorker" in navigator) {
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data">
<div class="sendbox"> <div class="sendbox">
<textarea id="ueuse" placeholder="いまどうしてる?" name="ueuse"><?php if( !empty($ueuse) ){ echo htmlspecialchars($ueuse, ENT_QUOTES, 'UTF-8'); } ?></textarea> <textarea id="ueuse" placeholder="いまどうしてる?" name="ueuse"><?php if( !empty($ueuse) ){ echo htmlspecialchars($ueuse, ENT_QUOTES, 'UTF-8'); } ?></textarea>
<p>画像のEXIF情報(位置情報など)は削除されません。<br>情報漏洩に気をつけてくださいね…</p>
<div class="fxbox"> <div class="fxbox">
<label for="upload_images" id="images" title="画像1"> <label for="upload_images" id="images" title="画像1">
<svg><use xlink:href="../img/sysimage/image_1.svg#image"></use></svg> <svg><use xlink:href="../img/sysimage/image_1.svg#image"></use></svg>
@@ -722,7 +671,9 @@ if ("serviceWorker" in navigator) {
<label for="nsfw_chk" class="nsfw_label" title="投稿をNSFW指定にする"><svg><use xlink:href="../img/sysimage/eye_1.svg#eye"></use></svg></label> <label for="nsfw_chk" class="nsfw_label" title="投稿をNSFW指定にする"><svg><use xlink:href="../img/sysimage/eye_1.svg#eye"></use></svg></label>
</div> </div>
<input type="submit" class="ueusebtn" name="btn_submit" value="ユーズする"> <div class="moji_cnt" id="moji_cnt"><?php echo $mojisize; ?></div>
<input type="submit" class="ueusebtn" id='ueusebtn' name="btn_submit" value="ユーズする">
</div> </div>
</div> </div>
</form> </form>
@@ -732,9 +683,7 @@ if ("serviceWorker" in navigator) {
var file_reader = new FileReader(); var file_reader = new FileReader();
// ファイルの読み込みを行ったら実行 // ファイルの読み込みを行ったら実行
file_reader.addEventListener('load', function(e) { file_reader.addEventListener('load', function(e) {
const element = document.querySelector('#videos1'); $('#videos1').addClass('label_set');
const createElement = '<p>動画を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
}); });
file_reader.readAsText(e.target.files[0]); file_reader.readAsText(e.target.files[0]);
}); });
@@ -742,9 +691,7 @@ if ("serviceWorker" in navigator) {
var file_reader = new FileReader(); var file_reader = new FileReader();
// ファイルの読み込みを行ったら実行 // ファイルの読み込みを行ったら実行
file_reader.addEventListener('load', function(e) { file_reader.addEventListener('load', function(e) {
const element = document.querySelector('#images4'); $('#images4').addClass('label_set');
const createElement = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
}); });
file_reader.readAsText(e.target.files[0]); file_reader.readAsText(e.target.files[0]);
}); });
@@ -753,9 +700,7 @@ if ("serviceWorker" in navigator) {
var file_reader = new FileReader(); var file_reader = new FileReader();
// ファイルの読み込みを行ったら実行 // ファイルの読み込みを行ったら実行
file_reader.addEventListener('load', function(e) { file_reader.addEventListener('load', function(e) {
const element = document.querySelector('#images3'); $('#images3').addClass('label_set');
const createElement = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
$("#images4").show(); $("#images4").show();
}); });
file_reader.readAsText(e.target.files[0]); file_reader.readAsText(e.target.files[0]);
@@ -765,9 +710,7 @@ if ("serviceWorker" in navigator) {
var file_reader = new FileReader(); var file_reader = new FileReader();
// ファイルの読み込みを行ったら実行 // ファイルの読み込みを行ったら実行
file_reader.addEventListener('load', function(e) { file_reader.addEventListener('load', function(e) {
const element = document.querySelector('#images2'); $('#images2').addClass('label_set');
const createElement = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
$("#images3").show(); $("#images3").show();
}); });
file_reader.readAsText(e.target.files[0]); file_reader.readAsText(e.target.files[0]);
@@ -776,13 +719,25 @@ if ("serviceWorker" in navigator) {
var file_reader = new FileReader(); var file_reader = new FileReader();
// ファイルの読み込みを行ったら実行 // ファイルの読み込みを行ったら実行
file_reader.addEventListener('load', function(e) { file_reader.addEventListener('load', function(e) {
const element = document.querySelector('#images'); $('#images').addClass('label_set');
const createElement = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
$("#images2").show(); $("#images2").show();
}); });
file_reader.readAsText(e.target.files[0]); 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);
}
})
</script> </script>
<section class="inner"> <section class="inner">
@@ -797,7 +752,7 @@ if ("serviceWorker" in navigator) {
</div> </div>
<div id="error" class="error" style="display: none;"> <div id="error" class="error" style="display: none;">
<h1>エラー</h1> <h1>エラー</h1>
<p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。</p> <p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。<br>(NETWORK_HUKANZEN_STOP)</p>
</div> </div>
</main> </main>
@@ -927,6 +882,42 @@ $(document).on('click', '.favbtn, .favbtn_after', function(event) {
}); });
}); });
$(document).on('click', '.bookmark, .bookmark_after', function(event) {
event.preventDefault();
var postUniqid = $(this).data('uniqid');
var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
var likeCountElement = $(this).find('.like-count'); // いいね数を表示する要素
var isLiked = $(this).hasClass('bookmark_after'); // 現在のいいねの状態を判定
var $this = $(this); // ボタン要素を変数に格納
$.ajax({
url: '../bookmark/bookmark.php',
method: 'POST',
data: { uniqid: postUniqid, userid: userid, account_id: account_id }, // ここに自分のユーザーIDを指定
dataType: 'json',
success: function(response) {
if (response.success) {
// いいね成功時の処理
if (isLiked) {
$this.removeClass('bookmark_after'); // クラスを削除していいねを取り消す
} else {
$this.addClass('bookmark_after'); // クラスを追加していいねを追加する
}
} else {
// いいね失敗時の処理
}
}.bind(this), // コールバック内でthisが適切な要素を指すようにbindする
error: function() {
// エラー時の処理
}
});
});
+131 -113
View File
@@ -3,6 +3,10 @@ $serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true); $serversettings = parse_ini_file($serversettings_file, true);
$mojisizefile = "../server/textsize.txt"; $mojisizefile = "../server/textsize.txt";
$mojisize = (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8');
//投稿及び返信レート制限↓(分):デフォで60件/分まで
$max_ueuse_rate_limit = 60;
$banurldomainfile = "../server/banurldomain.txt"; $banurldomainfile = "../server/banurldomain.txt";
$banurl_info = file_get_contents($banurldomainfile); $banurl_info = file_get_contents($banurldomainfile);
@@ -17,6 +21,9 @@ function createUniqId(){
return base_convert($hashCreateTime,10,36); return base_convert($hashCreateTime,10,36);
} }
require('../db.php'); require('../db.php');
//関数呼び出し
//- EXIF
require('../function/function.php');
// 変数の初期化 // 変数の初期化
$datetime = array(); $datetime = array();
@@ -213,40 +220,6 @@ function get_mentions_userid($postText) {
return $mentionedUsers; return $mentionedUsers;
} }
function rotate($image, $exif)
{
$orientation = $exif['Orientation'] ?? 1;
switch ($orientation) {
case 1: //no rotate
break;
case 2: //FLIP_HORIZONTAL
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 3: //ROTATE 180
$image = imagerotate($image, 180, 0);
break;
case 4: //FLIP_VERTICAL
imageflip($image, IMG_FLIP_VERTICAL);
break;
case 5: //ROTATE 270 FLIP_HORIZONTAL
$image = imagerotate($image, 270, 0);
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 6: //ROTATE 90
$image = imagerotate($image, 270, 0);
break;
case 7: //ROTATE 90 FLIP_HORIZONTAL
$image = imagerotate($image, 90, 0);
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 8: //ROTATE 270
$image = imagerotate($image, 90, 0);
break;
}
return $image;
}
if( !empty($_POST['btn_submit']) ) { if( !empty($_POST['btn_submit']) ) {
$ueuse = htmlentities($_POST['ueuse']); $ueuse = htmlentities($_POST['ueuse']);
@@ -265,23 +238,33 @@ if( !empty($_POST['btn_submit']) ) {
// メッセージの入力チェック // メッセージの入力チェック
if( empty($ueuse) ) { if( empty($ueuse) ) {
$error_message[] = '内容を入力してください。'; $error_message[] = '内容を入力してください。(INPUT_PLEASE)';
} else { } else {
// 文字数を確認 // 文字数を確認
if( (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8') < mb_strlen($ueuse, 'UTF-8') ) { if( (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8') < mb_strlen($ueuse, 'UTF-8') ) {
$error_message[] = '内容は'.htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8').'文字以内で入力してください。'; $error_message[] = '内容は'.htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8').'文字以内で入力してください。(INPUT_OVER_MAX_COUNT)';
} }
// 禁止url確認 // 禁止url確認
for($i = 0; $i < count($banurl); $i++) { for($i = 0; $i < count($banurl); $i++) {
if(!($banurl[$i] == "")){
if (false !== strpos($ueuse, 'https://'.$banurl[$i])) { if (false !== strpos($ueuse, 'https://'.$banurl[$i])) {
$error_message[] = '投稿が禁止されているURLが含まれています。'; $error_message[] = '投稿が禁止されているURLが含まれています。(INPUT_CONTAINS_PROHIBITED_URL)';
}
} }
} }
} }
$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', $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($_FILES['upload_images']['name'])) { if (empty($_FILES['upload_images']['name'])) {
$photo1 = "none"; $photo1 = "none";
} else { } else {
@@ -301,17 +284,7 @@ if( !empty($_POST['btn_submit']) ) {
$result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath); $result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath);
// EXIF削除 // EXIF削除
if($extension == "jpg" || $extension == "jpeg"){ delete_exif($extension, $uploadedPath);
$gd = imagecreatefromjpeg($uploadedPath);
$w = imagesx($gd);
$h = imagesy($gd);
$gd_out = imagecreatetruecolor($w,$h);
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
$exif = exif_read_data($uploadedPath);
$gd_out = rotate($gd_out, $exif);
imagejpeg($gd_out, $uploadedPath);
imagedestroy($gd_out);
}
if ($result) { if ($result) {
$photo1 = $uploadedPath; // 保存されたファイルのパスを使用 $photo1 = $uploadedPath; // 保存されたファイルのパスを使用
@@ -333,13 +306,13 @@ if( !empty($_POST['btn_submit']) ) {
} else { } else {
if (empty($_FILES['upload_images']['name'])){ if (empty($_FILES['upload_images']['name'])){
$error_message[] = '画像1から画像を選択してください!!!'; $error_message[] = '画像1から画像を選択してください!!!(PHOTO_SELECT_PLEASE)';
} }
// アップロードされたファイル情報 // アップロードされたファイル情報
$uploadedFile2 = $_FILES['upload_images2']; $uploadedFile2 = $_FILES['upload_images2'];
if( 10000000 < $uploadedFile2["size"] ) { if( 10000000 < $uploadedFile2["size"] ) {
$error_message[] = 'ファイルサイズが大きすぎます!'; $error_message[] = 'ファイルサイズが大きすぎます!(PHOTO_OVER_MAX_SIZE)';
} }
// アップロードされたファイルの拡張子を取得 // アップロードされたファイルの拡張子を取得
$extension2 = pathinfo($uploadedFile2['name'], PATHINFO_EXTENSION); $extension2 = pathinfo($uploadedFile2['name'], PATHINFO_EXTENSION);
@@ -354,17 +327,7 @@ if( !empty($_POST['btn_submit']) ) {
$result2 = move_uploaded_file($uploadedFile2['tmp_name'], $uploadedPath2); $result2 = move_uploaded_file($uploadedFile2['tmp_name'], $uploadedPath2);
// EXIF削除 // EXIF削除
if($extension2 == "jpg" || $extension2 == "jpeg"){ delete_exif($extension2, $uploadedPath2);
$gd = imagecreatefromjpeg($uploadedPath2);
$w = imagesx($gd);
$h = imagesy($gd);
$gd_out = imagecreatetruecolor($w,$h);
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
$exif = exif_read_data($uploadedPath2);
$gd_out = rotate($gd_out, $exif);
imagejpeg($gd_out, $uploadedPath2);
imagedestroy($gd_out);
}
if ($result2) { if ($result2) {
$photo2 = $uploadedPath2; // 保存されたファイルのパスを使用 $photo2 = $uploadedPath2; // 保存されたファイルのパスを使用
@@ -386,13 +349,13 @@ if( !empty($_POST['btn_submit']) ) {
} else { } else {
if (empty($_FILES['upload_images2']['name'])){ if (empty($_FILES['upload_images2']['name'])){
$error_message[] = '画像2から画像を選択してください!!!'; $error_message[] = '画像2から画像を選択してください!!!(PHOTO_SELECT_PLEASE)';
} }
// アップロードされたファイル情報 // アップロードされたファイル情報
$uploadedFile3 = $_FILES['upload_images3']; $uploadedFile3 = $_FILES['upload_images3'];
if( 10000000 < $uploadedFile3["size"] ) { if( 10000000 < $uploadedFile3["size"] ) {
$error_message[] = 'ファイルサイズが大きすぎます!'; $error_message[] = 'ファイルサイズが大きすぎます!(PHOTO_OVER_MAX_SIZE)';
} }
// アップロードされたファイルの拡張子を取得 // アップロードされたファイルの拡張子を取得
$extension3 = pathinfo($uploadedFile3['name'], PATHINFO_EXTENSION); $extension3 = pathinfo($uploadedFile3['name'], PATHINFO_EXTENSION);
@@ -407,17 +370,7 @@ if( !empty($_POST['btn_submit']) ) {
$result3 = move_uploaded_file($uploadedFile3['tmp_name'], $uploadedPath3); $result3 = move_uploaded_file($uploadedFile3['tmp_name'], $uploadedPath3);
// EXIF削除 // EXIF削除
if($extension3 == "jpg" || $extension3 == "jpeg"){ delete_exif($extension3, $uploadedPath3);
$gd = imagecreatefromjpeg($uploadedPath3);
$w = imagesx($gd);
$h = imagesy($gd);
$gd_out = imagecreatetruecolor($w,$h);
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
$exif = exif_read_data($uploadedPath3);
$gd_out = rotate($gd_out, $exif);
imagejpeg($gd_out, $uploadedPath3);
imagedestroy($gd_out);
}
if ($result3) { if ($result3) {
$photo3 = $uploadedPath3; // 保存されたファイルのパスを使用 $photo3 = $uploadedPath3; // 保存されたファイルのパスを使用
@@ -439,13 +392,13 @@ if( !empty($_POST['btn_submit']) ) {
} else { } else {
if (empty($_FILES['upload_images3']['name'])){ if (empty($_FILES['upload_images3']['name'])){
$error_message[] = '画像3から画像を選択してください!!!'; $error_message[] = '画像3から画像を選択してください!!!(PHOTO_SELECT_PLEASE)';
} }
// アップロードされたファイル情報 // アップロードされたファイル情報
$uploadedFile4 = $_FILES['upload_images4']; $uploadedFile4 = $_FILES['upload_images4'];
if( 10000000 < $uploadedFile4["size"] ) { if( 10000000 < $uploadedFile4["size"] ) {
$error_message[] = 'ファイルサイズが大きすぎます!'; $error_message[] = 'ファイルサイズが大きすぎます!(PHOTO_OVER_MAX_SIZE)';
} }
// アップロードされたファイルの拡張子を取得 // アップロードされたファイルの拡張子を取得
$extension4 = pathinfo($uploadedFile4['name'], PATHINFO_EXTENSION); $extension4 = pathinfo($uploadedFile4['name'], PATHINFO_EXTENSION);
@@ -460,17 +413,7 @@ if( !empty($_POST['btn_submit']) ) {
$result4 = move_uploaded_file($uploadedFile4['tmp_name'], $uploadedPath4); $result4 = move_uploaded_file($uploadedFile4['tmp_name'], $uploadedPath4);
// EXIF削除 // EXIF削除
if($extension4 == "jpg" || $extension4 == "jpeg"){ delete_exif($extension4, $uploadedPath4);
$gd = imagecreatefromjpeg($uploadedPath4);
$w = imagesx($gd);
$h = imagesy($gd);
$gd_out = imagecreatetruecolor($w,$h);
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
$exif = exif_read_data($uploadedPath4);
$gd_out = rotate($gd_out, $exif);
imagejpeg($gd_out, $uploadedPath4);
imagedestroy($gd_out);
}
if ($result4) { if ($result4) {
$photo4 = $uploadedPath4; // 保存されたファイルのパスを使用 $photo4 = $uploadedPath4; // 保存されたファイルのパスを使用
@@ -522,7 +465,7 @@ if( !empty($_POST['btn_submit']) ) {
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.''; $error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
} }
} else { } else {
$error_message[] = '対応していないファイル形式です!'; $error_message[] = '対応していないファイル形式です!(SORRY_FILE_HITAIOU)';
} }
@@ -565,13 +508,14 @@ if( !empty($_POST['btn_submit']) ) {
// コミット // コミット
$res = $pdo->commit(); $res = $pdo->commit();
$mentionedUsers = get_mentions_userid($ueuse); $mentionedUsers = array_unique(get_mentions_userid($ueuse));
foreach ($mentionedUsers as $mentionedUser) { foreach ($mentionedUsers as $mentionedUser) {
$pdo->beginTransaction(); $pdo->beginTransaction();
try { try {
$fromuserid = $userid;
$touserid = $mentionedUser; $touserid = $mentionedUser;
$datetime = date("Y-m-d H:i:s"); $datetime = date("Y-m-d H:i:s");
$msg = "" . $ueuse . ""; $msg = "" . $ueuse . "";
@@ -580,9 +524,10 @@ if( !empty($_POST['btn_submit']) ) {
$userchk = 'none'; $userchk = 'none';
// 通知用SQL作成 // 通知用SQL作成
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)"); $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), PDO::PARAM_STR);
$stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR); $stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR);
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR); $stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
$stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR); $stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR);
@@ -622,6 +567,9 @@ if( !empty($_POST['btn_submit']) ) {
// プリペアドステートメントを削除 // プリペアドステートメントを削除
$stmt = null; $stmt = null;
} }
}else{
$error_message[] = "投稿回数のレート制限を超過しています。(OVER_RATE_LIMIT)";
}
} }
@@ -639,9 +587,9 @@ $pdo = null;
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<script src="../js/nsfw_event.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/nsfw_event.js"></script>
<link rel="manifest" href="../manifest/manifest.json" /> <link rel="manifest" href="../manifest/manifest.json" />
<script> <script>
if ("serviceWorker" in navigator) { if ("serviceWorker" in navigator) {
@@ -655,7 +603,7 @@ if ("serviceWorker" in navigator) {
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<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>
@@ -663,6 +611,9 @@ if ("serviceWorker" in navigator) {
<body> <body>
<div> <div>
<div id="new_ueuse" class="new_ueuse" style="display:none;">
<a onclick="window.location.reload(true);"><p>🍊新しいユーズがあります!</p></a>
</div>
<div id="clipboard" class="online" style="display:none;"> <div id="clipboard" class="online" style="display:none;">
<p>🗒️📎 ユーズのURLをコピーしました!</p> <p>🗒️📎 ユーズのURLをコピーしました!</p>
</div> </div>
@@ -720,7 +671,7 @@ if ("serviceWorker" in navigator) {
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data">
<div class="sendbox"> <div class="sendbox">
<textarea id="ueuse" placeholder="いまどうしてる?" name="ueuse"><?php if( !empty($ueuse) ){ echo htmlspecialchars($ueuse, ENT_QUOTES, 'UTF-8'); } ?></textarea> <textarea id="ueuse" placeholder="いまどうしてる?" name="ueuse"><?php if( !empty($ueuse) ){ echo htmlspecialchars($ueuse, ENT_QUOTES, 'UTF-8'); } ?></textarea>
<p>画像のEXIF情報(位置情報など)は削除されません。<br>情報漏洩に気をつけてくださいね…</p>
<div class="fxbox"> <div class="fxbox">
<label for="upload_images" id="images" title="画像1"> <label for="upload_images" id="images" title="画像1">
<svg><use xlink:href="../img/sysimage/image_1.svg#image"></use></svg> <svg><use xlink:href="../img/sysimage/image_1.svg#image"></use></svg>
@@ -748,7 +699,9 @@ if ("serviceWorker" in navigator) {
<label for="nsfw_chk" class="nsfw_label" title="投稿をNSFW指定にする"><svg><use xlink:href="../img/sysimage/eye_1.svg#eye"></use></svg></label> <label for="nsfw_chk" class="nsfw_label" title="投稿をNSFW指定にする"><svg><use xlink:href="../img/sysimage/eye_1.svg#eye"></use></svg></label>
</div> </div>
<input type="submit" class="ueusebtn" name="btn_submit" value="ユーズする"> <div class="moji_cnt" id="moji_cnt"><?php echo $mojisize; ?></div>
<input type="submit" class="ueusebtn" id='ueusebtn' name="btn_submit" value="ユーズする">
</div> </div>
</div> </div>
</form> </form>
@@ -758,9 +711,7 @@ if ("serviceWorker" in navigator) {
var file_reader = new FileReader(); var file_reader = new FileReader();
// ファイルの読み込みを行ったら実行 // ファイルの読み込みを行ったら実行
file_reader.addEventListener('load', function(e) { file_reader.addEventListener('load', function(e) {
const element = document.querySelector('#videos1'); $('#videos1').addClass('label_set');
const createElement = '<p>動画を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
}); });
file_reader.readAsText(e.target.files[0]); file_reader.readAsText(e.target.files[0]);
}); });
@@ -768,9 +719,7 @@ if ("serviceWorker" in navigator) {
var file_reader = new FileReader(); var file_reader = new FileReader();
// ファイルの読み込みを行ったら実行 // ファイルの読み込みを行ったら実行
file_reader.addEventListener('load', function(e) { file_reader.addEventListener('load', function(e) {
const element = document.querySelector('#images4'); $('#images4').addClass('label_set');
const createElement = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
}); });
file_reader.readAsText(e.target.files[0]); file_reader.readAsText(e.target.files[0]);
}); });
@@ -779,9 +728,7 @@ if ("serviceWorker" in navigator) {
var file_reader = new FileReader(); var file_reader = new FileReader();
// ファイルの読み込みを行ったら実行 // ファイルの読み込みを行ったら実行
file_reader.addEventListener('load', function(e) { file_reader.addEventListener('load', function(e) {
const element = document.querySelector('#images3'); $('#images3').addClass('label_set');
const createElement = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
$("#images4").show(); $("#images4").show();
}); });
file_reader.readAsText(e.target.files[0]); file_reader.readAsText(e.target.files[0]);
@@ -791,9 +738,7 @@ if ("serviceWorker" in navigator) {
var file_reader = new FileReader(); var file_reader = new FileReader();
// ファイルの読み込みを行ったら実行 // ファイルの読み込みを行ったら実行
file_reader.addEventListener('load', function(e) { file_reader.addEventListener('load', function(e) {
const element = document.querySelector('#images2'); $('#images2').addClass('label_set');
const createElement = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
$("#images3").show(); $("#images3").show();
}); });
file_reader.readAsText(e.target.files[0]); file_reader.readAsText(e.target.files[0]);
@@ -802,13 +747,25 @@ if ("serviceWorker" in navigator) {
var file_reader = new FileReader(); var file_reader = new FileReader();
// ファイルの読み込みを行ったら実行 // ファイルの読み込みを行ったら実行
file_reader.addEventListener('load', function(e) { file_reader.addEventListener('load', function(e) {
const element = document.querySelector('#images'); $('#images').addClass('label_set');
const createElement = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
$("#images2").show(); $("#images2").show();
}); });
file_reader.readAsText(e.target.files[0]); 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);
}
})
</script> </script>
<section class="inner"> <section class="inner">
@@ -823,7 +780,7 @@ if ("serviceWorker" in navigator) {
</div> </div>
<div id="error" class="error" style="display: none;"> <div id="error" class="error" style="display: none;">
<h1>エラー</h1> <h1>エラー</h1>
<p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。</p> <p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。<br>(NETWORK_HUKANZEN_STOP)</p>
</div> </div>
</main> </main>
@@ -953,6 +910,43 @@ $(document).ready(function() {
}); });
$(document).on('click', '.bookmark, .bookmark_after', function(event) {
event.preventDefault();
var postUniqid = $(this).data('uniqid');
var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
var likeCountElement = $(this).find('.like-count'); // いいね数を表示する要素
var isLiked = $(this).hasClass('bookmark_after'); // 現在のいいねの状態を判定
var $this = $(this); // ボタン要素を変数に格納
$.ajax({
url: '../bookmark/bookmark.php',
method: 'POST',
data: { uniqid: postUniqid, userid: userid, account_id: account_id }, // ここに自分のユーザーIDを指定
dataType: 'json',
success: function(response) {
if (response.success) {
// いいね成功時の処理
if (isLiked) {
$this.removeClass('bookmark_after'); // クラスを削除していいねを取り消す
} else {
$this.addClass('bookmark_after'); // クラスを追加していいねを追加する
}
} else {
// いいね失敗時の処理
}
}.bind(this), // コールバック内でthisが適切な要素を指すようにbindする
error: function() {
// エラー時の処理
}
});
});
@@ -1123,5 +1117,29 @@ $(document).ready(function() {
osho_gats.style.display = 'none'; osho_gats.style.display = 'none';
}); });
var now_time = new Date().toUTCString();
setInterval(() => {
var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
$.ajax({
url: '../nextpage/newueuse_chk.php',
method: 'POST',
data: { loading_dt: now_time, userid: userid, account_id: account_id }, // ここに自分のユーザーIDを指定
dataType: 'json',
timeout: 300000,
success: function(response) {
if (response.success) {
$("#new_ueuse").show();
} else {
$("#new_ueuse").hide();
}
}.bind(this), // コールバック内でthisが適切な要素を指すようにbindする
error: function(e) {
$("#new_ueuse").hide();
}
});
}, 60000);
</script> </script>
</html> </html>
+1
View File
@@ -0,0 +1 @@
<svg version="1.1" id="bookmark_1" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M200-120v-640q0-33 23.5-56.5T280-840h400q33 0 56.5 23.5T760-760v640L480-240 200-120Zm80-122 200-86 200 86v-518H280v518Zm0-518h400-400Z"/></svg>

After

Width:  |  Height:  |  Size: 270 B

+1
View File
@@ -0,0 +1 @@
<svg id="delete" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"/></svg>

After

Width:  |  Height:  |  Size: 312 B

+6
View File
@@ -0,0 +1,6 @@
<svg version="1.1" id="bookmark" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 720 720" style="fill-rule:evenodd;stroke:none" xml:space="preserve">
<g>
<path
d="M 123.0 346.29227 C 123.0 382.72842 123.0 418.91037 123.0 455.1 C 123.0 482.308 123.0 509.508 123.0 536.7 C 121.414474 554.3934 131.56677 573.50995 149.6362 578.3502 C 163.43123 582.8523 177.79533 577.7443 189.78503 571.06866 C 223.18863 551.6027 257.80328 534.1559 291.0678 514.39197 C 300.09244 509.14188 309.3134 504.27472 318.36746 499.07666 C 322.3138 496.77518 326.33176 494.6167 330.2785 492.33252 C 334.0176 490.71252 338.19977 486.93658 342.63388 486.72327 C 374.43427 502.5596 404.6061 522.02655 436.06085 538.60986 C 447.4583 544.93524 460.70438 552.62427 471.23273 558.2778 C 490.6521 567.8273 513.7729 588.5096 539.45703 576.44885 C 547.0712 572.7499 553.4046 566.6803 557.0342 558.75934 C 561.40015 551.19476 561.4582 542.5698 561.0 534.05585 C 561.0 471.26404 561.0 408.52185 561.0 345.74603 C 561.0 309.77716 561.0 273.76663 561.0 237.79773 C 561.42267 210.96733 560.25934 184.12463 560.192 157.30394 C 562.8581 139.50899 553.9923 120.54065 537.1086 113.28929 C 523.56805 107.88681 508.6871 109.13489 494.43503 109.0 C 449.22772 109.003105 404.02924 108.78634 358.8358 109.63168 C 320.25262 110.30426 281.645 108.64432 243.07033 109.0 C 214.30174 109.899635 185.29768 108.117744 156.61505 110.7815 C 137.64922 113.55554 121.869865 131.18866 123.0 150.79042 C 123.0 215.88974 123.0 280.97073 123.0 346.29227 Z M 196.0 339.7527 C 196.0 383.39685 196.0 426.81714 196.0 470.2 C 196.05473 472.57263 196.02454 476.07217 197.60342 477.3964 C 201.42853 481.48596 206.46455 476.92856 209.60754 475.65057 C 235.75739 461.0549 261.80276 446.33188 287.86047 431.56442 C 300.65976 425.04816 312.65823 416.96768 325.6287 410.80167 C 337.88544 404.93274 352.2533 406.42548 363.71075 413.4204 C 401.48355 434.27805 438.80896 455.95877 476.55402 476.84372 C 481.19254 480.15118 488.62424 479.86826 487.97565 471.7068 C 488.03558 427.63583 487.63156 383.58713 487.5468 339.5189 C 487.4497 315.63007 487.35266 291.75113 487.25558 267.8745 C 487.18246 249.8888 487.1094 231.91107 487.03635 213.94133 C 487.1509 207.71892 487.13306 201.03413 483.5473 195.61748 C 476.92545 185.46762 467.4943 182.21231 456.57755 183.0044 C 421.68292 183.0956 386.78564 183.30772 351.90326 183.42477 C 326.35022 183.53214 300.80835 183.63947 275.25772 183.74681 C 255.94308 184.02916 236.61176 183.66385 217.30849 184.12279 C 205.11444 185.77145 195.39241 198.12938 196.0 210.18584 C 196.0 253.2982 196.0 296.38995 196.0 339.7527 Z " />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

+6
View File
@@ -0,0 +1,6 @@
<svg version="1.1" id="info" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 720 720" style="fill-rule:evenodd;stroke:none" xml:space="preserve">
<g>
<path
d="M 36.0 348.93124 C 35.666733 433.58746 70.79879 517.9621 130.87007 577.37006 C 190.369 638.56476 275.22858 672.52454 360.14355 672.861 C 382.86203 672.657 405.49582 670.80396 427.67548 665.7796 C 463.91885 657.6469 499.0512 644.37256 530.5302 624.3701 C 576.2831 596.58777 613.92145 557.1071 640.88025 511.0299 C 668.6416 461.72232 685.3417 405.04144 684.0 348.12607 C 684.54474 304.5324 675.09174 260.7542 658.08716 220.71588 C 645.70557 192.34683 629.5711 165.50949 609.7692 141.6742 C 595.05695 123.68262 578.2236 107.74955 559.918 93.34298 C 503.59204 47.72092 431.467 24.95519 359.56573 24.052458 C 315.9735 25.593784 272.09363 32.589466 232.12862 50.947617 C 175.48724 75.055046 126.284256 116.09455 91.86122 166.9954 C 55.366768 220.07762 36.071663 284.5189 36.0 348.93124 Z M 113.00009 348.20874 C 113.315704 412.76453 139.1106 477.39804 185.10225 522.60223 C 230.70343 568.2971 295.3347 596.6575 360.36816 595.0 C 425.63843 596.97876 490.01544 568.13074 535.87006 522.62994 C 580.32324 476.5128 608.96356 412.65598 607.0 347.6239 C 608.1291 283.56686 580.29895 219.4818 535.12994 174.62993 C 489.7207 127.12931 423.42877 101.116905 358.14804 102.0 C 294.0522 101.7383 230.83879 128.62993 185.62993 173.87007 C 138.99226 219.16255 113.90137 283.52786 113.00009 348.20874 Z M 313.04303 217.4401 C 312.10455 243.0105 335.93704 265.4914 361.33035 262.563 C 385.39908 261.06235 404.3648 238.1562 401.96353 214.43272 C 401.34726 190.51146 377.61002 171.11916 354.2519 173.2578 C 331.74484 174.72243 312.91537 194.78456 313.04303 217.4401 Z M 320.00082 409.1901 C 320.46008 428.4129 320.5255 447.3825 321.5868 466.28177 C 323.39645 487.47876 322.52676 521.2958 349.98935 531.0583 C 362.33862 535.06616 376.68625 531.153 385.14035 521.20715 C 393.3975 511.47363 395.4434 498.26254 396.82697 486.00836 C 398.53473 460.4119 399.4107 434.77563 398.9999 409.11792 C 398.23743 384.90808 398.31418 356.14084 394.17972 334.22614 C 393.0763 319.35782 384.5467 304.81546 369.90372 299.65494 C 358.91513 296.2197 345.846 298.4299 337.28964 306.30133 C 324.4499 318.18216 322.69443 337.1674 321.62225 353.52676 C 321.19495 371.50903 320.4188 392.47168 320.00082 409.1901 Z " />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 344 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

+20 -4
View File
@@ -120,8 +120,8 @@ $count2 = $result2->num_rows;
<meta name="twitter:title" content="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>"/> <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);?>"/> <meta name="twitter:description" content="<?php echo htmlentities($serverinfo);?>"/>
<!--OGPここまで--> <!--OGPここまで-->
<link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="css/style.css">
<script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="js/unsupported.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">
<link rel="manifest" href="manifest/manifest.json" /> <link rel="manifest" href="manifest/manifest.json" />
@@ -152,7 +152,7 @@ if ("serviceWorker" in navigator) {
</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 }?>
@@ -166,18 +166,34 @@ if ("serviceWorker" in navigator) {
</ul> </ul>
<?php endif; ?> <?php endif; ?>
<h1><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>へようこそ!</h1> <h1><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>へようこそ!</h1>
<?php if( !empty(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8')) ){ ?>
<!--(サーバーアイコン)-->
<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
<div class="serverhead">
<img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_head"], ENT_QUOTES, 'UTF-8'); ?>">
</div>
<?php }?>
<?php if( !empty($serversettings["serverinfo"]["server_icon"]) ){ ?>
<div class="servericon"> <div class="servericon">
<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
<div class="up">
<img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
<div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div>
</div>
<?php }else{?>
<img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>"> <img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
<div class="textzone"> <div class="textzone">
<div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
</div> </div>
<?php }?>
</div> </div>
<?php }else{?> <?php }else{?>
<div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div> <div class="p3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="p2c"><?php echo $domain;?></div> <div class="p2c"><?php echo $domain;?></div>
<?php }?> <?php }?>
<!--(サーバーアイコンここまで)-->
<p><?php <p><?php
$sinfo = explode("\n", $serverinfo); $sinfo = explode("\n", $serverinfo);
+3 -1
View File
@@ -1,6 +1,8 @@
window.onload = function(){ window.onload = function(){
var url = new URL(window.location.href);
var ele = document.getElementsByTagName("body")[0]; var ele = document.getElementsByTagName("body")[0];
var n = Math.floor(Math.random() * 3); // 3枚の画像がある場合 var n = Math.floor(Math.random() * 3); // 3枚の画像がある場合
ele.style.backgroundImage = "url(/img/titleimg/"+n+".png)"; ele.style.backgroundImage = "url("+url.protocol+"//"+url.hostname+"/img/titleimg/"+n+".png)";
} }
+8 -8
View File
@@ -118,11 +118,11 @@ if( !empty($_POST['btn_submit']) ) {
// ... (前略) // ... (前略)
// IDの入力チェック // IDの入力チェック
if( empty($userid) ) { if( empty($userid) ) {
$error_message[] = 'ユーザーIDを入力してください。'; $error_message[] = 'ユーザーIDを入力してください。(USERID_INPUT_PLEASE)';
} else { } else {
if( empty($password) ) { if( empty($password) ) {
$error_message[] = 'パスワードを入力してください。'; $error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
} else { } else {
if($result->rowCount() > 0) { if($result->rowCount() > 0) {
@@ -151,14 +151,14 @@ if( !empty($_POST['btn_submit']) ) {
} }
} }
else{ else{
$error_message[] = 'IDまたはパスワードが違います'; $error_message[] = 'IDまたはパスワードが違います(PASS_AND_ID_CHIGAUYANKE)';
} }
}else{ }else{
$error_message[] = 'IDまたはパスワードが違います'; $error_message[] = 'IDまたはパスワードが違います(PASS_AND_ID_CHIGAUYANKE)';
} }
} }
else { else {
$error_message[] = 'IDまたはパスワードが違います'; $error_message[] = 'IDまたはパスワードが違います(PASS_AND_ID_CHIGAUYANKE)';
} }
} }
@@ -190,8 +190,8 @@ $pdo = null;
<meta name="twitter:title" content="ログイン - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>"/> <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);?>"/> <meta name="twitter:description" content="<?php echo htmlentities($serverinfo);?>"/>
<!--OGPここまで--> <!--OGPここまで-->
<link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="css/style.css">
<script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="js/unsupported.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">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
@@ -208,7 +208,7 @@ $pdo = null;
</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 }?>
+9 -3
View File
@@ -33,8 +33,8 @@ $_SESSION = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/style.css">
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></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="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">
@@ -47,9 +47,15 @@ $_SESSION = null;
<div class="leftbox2"> <div class="leftbox2">
<?php if(!empty(htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8'))){ ?>
<div class="logo"> <div class="logo">
<img src="../img/uwuzulogo.svg"> <a href="../index.php"><img src=<?php echo htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');?>></a>
</div> </div>
<?php }else{?>
<div class="logo">
<a href="../index.php"><img src="../img/uwuzulogo.svg"></a>
</div>
<?php }?>
<div class="textbox"> <div class="textbox">
<h1>ログアウト完了</h1> <h1>ログアウト完了</h1>
+24 -79
View File
@@ -15,6 +15,9 @@ function createUniqId(){
} }
require('db.php'); require('db.php');
//関数呼び出し
//- EXIF
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);
@@ -91,39 +94,6 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset
} }
} }
function rotate($image, $exif)
{
$orientation = $exif['Orientation'] ?? 1;
switch ($orientation) {
case 1: //no rotate
break;
case 2: //FLIP_HORIZONTAL
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 3: //ROTATE 180
$image = imagerotate($image, 180, 0);
break;
case 4: //FLIP_VERTICAL
imageflip($image, IMG_FLIP_VERTICAL);
break;
case 5: //ROTATE 270 FLIP_HORIZONTAL
$image = imagerotate($image, 270, 0);
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 6: //ROTATE 90
$image = imagerotate($image, 270, 0);
break;
case 7: //ROTATE 90 FLIP_HORIZONTAL
$image = imagerotate($image, 90, 0);
imageflip($image, IMG_FLIP_HORIZONTAL);
break;
case 8: //ROTATE 270
$image = imagerotate($image, 90, 0);
break;
}
return $image;
}
if( !empty($_POST['btn_submit']) ) { if( !empty($_POST['btn_submit']) ) {
@@ -144,15 +114,6 @@ if( !empty($_POST['btn_submit']) ) {
$invitationcode = $_POST['invitationcode']; $invitationcode = $_POST['invitationcode'];
} }
//cookieに保存
setcookie("username",$username,time()+60*60*24*14);
setcookie("userid",$userid,time()+60*60*24*14);
setcookie("password",$password,time()+60*60*24*14);
setcookie("mailadds",$mailadds,time()+60*60*24*14);
setcookie("profile",$profile,time()+60*60*24*14);
//----------------[icon image]------------------------------- //----------------[icon image]-------------------------------
if (empty($_FILES['image']['name'])) { if (empty($_FILES['image']['name'])) {
$localFilePathhead = 'img/deficon/icon.png'; $localFilePathhead = 'img/deficon/icon.png';
@@ -197,17 +158,7 @@ if( !empty($_POST['btn_submit']) ) {
$result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath); $result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath);
// EXIF削除 // EXIF削除
if($extension == "jpg" || $extension == "jpeg"){ delete_exif($extension, $uploadedPath);
$gd = imagecreatefromjpeg($uploadedPath);
$w = imagesx($gd);
$h = imagesy($gd);
$gd_out = imagecreatetruecolor($w,$h);
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
$exif = exif_read_data($uploadedPath);
$gd_out = rotate($gd_out, $exif);
imagejpeg($gd_out, $uploadedPath);
imagedestroy($gd_out);
}
if ($result) { if ($result) {
$iconName = $uploadedPath; // 保存されたファイルのパスを使用 $iconName = $uploadedPath; // 保存されたファイルのパスを使用
@@ -273,14 +224,14 @@ if( !empty($_POST['btn_submit']) ) {
// 招待コードの入力チェック // 招待コードの入力チェック
if( empty($invitationcode) ) { if( empty($invitationcode) ) {
$error_message[] = '招待コードを入力してください。'; $error_message[] = '招待コードを入力してください。(INVITATION_CODE_INPUT_PLEASE)';
} else { } else {
if($result > 0){ if($result > 0){
if($result["used"] === "true"){ if($result["used"] === "true"){
$error_message[] = 'この招待コード('.$invitationcode.')は既に使用されています。'; $error_message[] = 'この招待コード('.$invitationcode.')は既に使用されています。(INVITATION_CODE_SHIYOUZUMI)';
} }
}else{ }else{
$error_message[] = 'この招待コード('.$invitationcode.')は使えません。'; $error_message[] = 'この招待コード('.$invitationcode.')は使えません。(INVITATION_CODE_DEAD)';
} }
} }
@@ -296,37 +247,37 @@ if( !empty($_POST['btn_submit']) ) {
// ユーザーネームの入力チェック // ユーザーネームの入力チェック
if( empty($username) ) { if( empty($username) ) {
$error_message[] = '表示名を入力してください。'; $error_message[] = '表示名を入力してください。(USERNAME_INPUT_PLEASE)';
} else { } else {
// 文字数を確認 // 文字数を確認
if( 50 < mb_strlen($username, 'UTF-8') ) { if( 50 < mb_strlen($username, 'UTF-8') ) {
$error_message[] = 'ユーザーネームは50文字以内で入力してください。'; $error_message[] = 'ユーザーネームは50文字以内で入力してください。(USERNAME_OVER_MAX_COUNT)';
} }
} }
// IDの入力チェック // IDの入力チェック
if( empty($userid) ) { if( empty($userid) ) {
$error_message[] = 'ユーザーIDを入力してください。'; $error_message[] = 'ユーザーIDを入力してください。(USERID_INPUT_PLEASE)';
} else { } else {
// 文字数を確認 // 文字数を確認
if( 20 < mb_strlen($userid, 'UTF-8') ) { if( 20 < mb_strlen($userid, 'UTF-8') ) {
$error_message[] = 'IDは20文字以内で入力してください。'; $error_message[] = 'IDは20文字以内で入力してください。(USERID_OVER_MAX_COUNT)';
} }
if(in_array($userid, $banuserid) === true ){ if(in_array($userid, $banuserid) === true ){
$error_message[] = 'そのIDは登録禁止になっています。'; $error_message[] = 'そのIDは登録禁止になっています。(USERID_CONTAINS_PROHIBITED)';
} }
if($result > 0){ if($result > 0){
$error_message[] = 'このID('.$userid.')は既に使用されています。他のIDを作成してください。'; //このE-mailは既に使用されています。 $error_message[] = 'このID('.$userid.')は既に使用されています。他のIDを作成してください。(USERID_SHIYOUZUMI)'; //このE-mailは既に使用されています。
} }
} }
// パスワードの入力チェック // パスワードの入力チェック
if( empty($password) ) { if( empty($password) ) {
$error_message[] = 'パスワードを入力してください。'; $error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
} else { } else {
$weakPasswords = array( $weakPasswords = array(
@@ -396,27 +347,21 @@ if( !empty($_POST['btn_submit']) ) {
return in_array($passwords, $weakPasswords); return in_array($passwords, $weakPasswords);
} }
// テスト用のパスワード(実際にはユーザー入力などから取得することになります。
if (isWeakPassword($password)) { if (isWeakPassword($password)) {
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。"; $error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
} else {
} }
if ($chkpass == $password ){ if (!($chkpass == $password)){
$error_message[] = '確認用パスワードが違います。(PASSWORD_CHIGAUYANKE)';
}else{
$error_message[] = '確認用パスワードが違います。';
} }
if( 4 > mb_strlen($password, 'UTF-8') ) { if( 4 > mb_strlen($password, 'UTF-8') ) {
$error_message[] = 'パスワードは4文字以上である必要があります。'; $error_message[] = 'パスワードは4文字以上である必要があります。(PASSWORD_TODOITENAI_MIN_COUNT)';
} }
// 文字数を確認 // 文字数を確認
if( 100 < mb_strlen($password, 'UTF-8') ) { if( 100 < mb_strlen($password, 'UTF-8') ) {
$error_message[] = 'パスワードは100文字以内で入力してください。'; $error_message[] = 'パスワードは100文字以内で入力してください。(PASSWORD_OVER_MAX_COUNT)';
} }
} }
@@ -459,7 +404,7 @@ if( !empty($_POST['btn_submit']) ) {
// コミット // コミット
$res = $pdo->commit(); $res = $pdo->commit();
if($onlyuser === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') === "true"){
$pdo->beginTransaction(); $pdo->beginTransaction();
$stmt = $pdo->prepare("UPDATE invitation SET used = :used, datetime = :datetime WHERE code = :code;"); $stmt = $pdo->prepare("UPDATE invitation SET used = :used, datetime = :datetime WHERE code = :code;");
@@ -492,7 +437,7 @@ if( !empty($_POST['btn_submit']) ) {
// すべての出力を終了 // すべての出力を終了
exit; exit;
} else { } else {
$error_message[] = '登録に失敗しました。'; $error_message[] = '登録に失敗しました。(REGISTERED_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
@@ -520,8 +465,8 @@ $pdo = null;
<meta name="twitter:title" content="アカウント登録 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?>"/> <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);?>"/> <meta name="twitter:description" content="<?php echo htmlentities($serverinfo);?>"/>
<!--OGPここまで--> <!--OGPここまで-->
<link rel="stylesheet" href="css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="css/style.css">
<script src="js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="js/unsupported.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">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
@@ -540,7 +485,7 @@ $pdo = null;
</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 }?>
+179
View File
@@ -0,0 +1,179 @@
<?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');
require('view.php');
// データベースに接続
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['userid']) && isset($_GET['account_id'])) {
$userid = htmlentities($_GET['userid']);
$loginid = htmlentities($_GET['account_id']);
// データベース接続の設定
$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,
));
$query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
$query->execute(array(':userid' => $userid));
$result2 = $query->fetch();
if(!(empty($result2["loginid"]))){
if($result2["loginid"] === $loginid){
$userid = htmlentities($_GET['userid']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist,bookmark FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]);
$mybookmark = htmlentities($res["bookmark"]);
$itemsPerPage = 15; // 1ページあたりのユーズ数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array();
if (!empty($pdo)) {
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
));
// フォローしているユーザーIDを取得し、カンマで区切る
$bookmarkQuery = $dbh->prepare("SELECT bookmark FROM account WHERE userid = :userid");
$bookmarkQuery->bindValue(':userid', $userid);
$bookmarkQuery->execute();
$bookmarkData = $bookmarkQuery->fetch();
$bookmark = $bookmarkData['bookmark'];
$bookmarkList = explode(',', $bookmark);
// フォローしているユーザーの投稿を取得し、日時順に並び替える
$messages = array(); // 初期化
foreach ($bookmarkList as $bookmarkUniqId) {
$sql = "SELECT ueuse.*
FROM ueuse
LEFT JOIN account ON ueuse.account = account.userid
WHERE uniqid = :bookmarkUniqId AND account.role != 'ice'
ORDER BY ueuse.datetime DESC
LIMIT :offset, :itemsPerPage";
$stmt = $pdo->prepare($sql);
$stmt->bindValue(':bookmarkUniqId', $bookmarkUniqId, PDO::PARAM_STR);
$stmt->bindValue(':offset', $offset, PDO::PARAM_INT);
$stmt->bindValue(':itemsPerPage', $itemsPerPage, PDO::PARAM_INT);
$stmt->execute();
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$messages[] = $row;
}
}
$messages = array_reverse($messages);
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname, sacinfo FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) {
$message['iconname'] = $userData['iconname'];
$message['headname'] = $userData['headname'];
$message['username'] = $userData['username'];
$message['sacinfo'] = $userData['sacinfo'];
$message['role'] = $userData['role'];
}
$rpQuery = $pdo->prepare("SELECT COUNT(*) as reply_count FROM ueuse WHERE rpuniqid = :rpuniqid");
$rpQuery->bindValue(':rpuniqid', $message['uniqid']);
$rpQuery->execute();
$rpData = $rpQuery->fetch(PDO::FETCH_ASSOC);
if ($rpData){
$message['reply_count'] = $rpData['reply_count'];
}
}
//adsystem------------------
$message['ads'] = "false";
$today = date("Y-m-d H:i:s");
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()");
$adsQuery->bindValue(':today', $today);
$adsQuery->execute();
$adsresult = $adsQuery->fetch();
if(!(empty($adsresult))){
$message['ads'] = "true";
$message['ads_url'] = $adsresult["url"];
$message['ads_img_url'] = $adsresult["image_url"];
$message['ads_memo'] = $adsresult["memo"];
}
//--------------------------
if(!empty($messages)){
foreach ($messages as $value) {
if (false === strpos($myblocklist, ','.htmlentities($value['account'], ENT_QUOTES, 'UTF-8'))) {
if(!($value["role"] === "ice")){
$value["bookmark"] = $mybookmark;
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid); // $userid をコンストラクタに渡す
$messageDisplay->display();
}
}
}
if($message['ads'] === "true"){
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
}
}else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
}
$pdo = null;
}
}else{
echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
}
}else{
echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
}
}else{
echo '<div class="tokonone" id="noueuse"><p>取得に失敗しました。</p></div>';
}
?>
+14 -3
View File
@@ -47,11 +47,12 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
if($result2["loginid"] === $loginid){ if($result2["loginid"] === $loginid){
$userid = htmlentities($_GET['userid']); $userid = htmlentities($_GET['userid']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid"); $aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist,bookmark FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid)); $aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute(); $aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch(); $res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]); $myblocklist = htmlentities($res["blocklist"]);
$mybookmark = htmlentities($res["bookmark"]);
$itemsPerPage = 15; // 1ページあたりのユーズ数 $itemsPerPage = 15; // 1ページあたりのユーズ数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1; $pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
@@ -79,11 +80,19 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$messages = array(); // 初期化 $messages = array(); // 初期化
foreach ($followList as $followUserId) { foreach ($followList as $followUserId) {
$sql = "SELECT * FROM ueuse WHERE rpuniqid = '' AND account = :follow_account ORDER BY datetime DESC LIMIT $offset, $itemsPerPage"; $sql = "SELECT ueuse.*
FROM ueuse
LEFT JOIN account ON ueuse.account = account.userid
WHERE ueuse.rpuniqid = '' AND account.role != 'ice' AND ueuse.account = :follow_account
ORDER BY ueuse.datetime DESC
LIMIT :offset, :itemsPerPage";
$stmt = $dbh->prepare($sql); $stmt = $pdo->prepare($sql);
$stmt->bindValue(':offset', $offset, PDO::PARAM_INT);
$stmt->bindValue(':itemsPerPage', $itemsPerPage, PDO::PARAM_INT);
$stmt->bindValue(':follow_account', $followUserId, PDO::PARAM_STR); $stmt->bindValue(':follow_account', $followUserId, PDO::PARAM_STR);
$stmt->execute(); $stmt->execute();
$message_array = $stmt;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$messages[] = $row; $messages[] = $row;
@@ -138,6 +147,8 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
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'))) {
if(!($value["role"] === "ice")){ if(!($value["role"] === "ice")){
$value["bookmark"] = $mybookmark;
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数 $fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える // コンマで区切って配列に分割し、要素数を数える
+92
View File
@@ -0,0 +1,92 @@
<?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');
// データベースに接続
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($_POST['userid']) && isset($_POST['account_id'])) {
$userid = htmlentities($_POST['userid']);
$loginid = htmlentities($_POST['account_id']);
// データベース接続の設定
$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,
));
$query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
$query->execute(array(':userid' => $userid));
$result2 = $query->fetch();
if(!(empty($result2["loginid"]))){
if($result2["loginid"] === $loginid){
$loading_dt = htmlentities($_POST['loading_dt']);
$messages = array();
if (!empty($pdo)) {
$sql = "SELECT * FROM ueuse WHERE rpuniqid = '' ORDER BY datetime DESC LIMIT 1";
$message_array = $pdo->query($sql);
while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) {
$messages[] = $row;
}
if(!empty($messages)){
foreach ($messages as $value) {
$now_time = strtotime($loading_dt);
$loadtime = strtotime($value["datetime"]);
$time_sa = $loadtime - $now_time;
if($time_sa > 0){
echo json_encode(['success' => true, 'info' => 'ueuse_true']);
exit;
}else{
echo json_encode(['success' => false, 'info' => 'ueuse_none']);
exit;
}
}
}else{
echo json_encode(['success' => false, 'info' => 'ueuse_none']);
exit;
}
$pdo = null;
}
}else{
echo json_encode(['success' => false, 'info' => 'not_access1']);
exit;
}
}else{
echo json_encode(['success' => false, 'info' => 'not_access2']);
exit;
}
}else{
echo json_encode(['success' => false, 'info' => 'not_access3']);
exit;
}
?>
+16 -3
View File
@@ -45,11 +45,12 @@ 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 FROM account WHERE userid = :userid"); $aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist,bookmark FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid)); $aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute(); $aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch(); $res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]); $myblocklist = htmlentities($res["blocklist"]);
$mybookmark = htmlentities($res["bookmark"]);
$itemsPerPage = 15; // 1ページあたりのユーズ数 $itemsPerPage = 15; // 1ページあたりのユーズ数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1; $pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
@@ -59,8 +60,18 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
if (!empty($pdo)) { if (!empty($pdo)) {
$sql = "SELECT * FROM ueuse WHERE rpuniqid = '' ORDER BY datetime DESC LIMIT $offset, $itemsPerPage"; $sql = "SELECT ueuse.*
$message_array = $pdo->query($sql); 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', $itemsPerPage, PDO::PARAM_INT);
$stmt->execute();
$message_array = $stmt;
while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) { while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) {
@@ -119,6 +130,8 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$favIds = explode(',', $fav); $favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1; $value["favcnt"] = count($favIds)-1;
$value["bookmark"] = $mybookmark;
$messageDisplay = new MessageDisplay($value, $userid); // $userid をコンストラクタに渡す $messageDisplay = new MessageDisplay($value, $userid); // $userid をコンストラクタに渡す
$messageDisplay->display(); $messageDisplay->display();
} }
+15 -1
View File
@@ -9,6 +9,9 @@ function createUniqId() {
return base_convert($hashCreateTime, 10, 36); return base_convert($hashCreateTime, 10, 36);
} }
$serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
require('../db.php'); require('../db.php');
require('notificationview.php'); require('notificationview.php');
@@ -59,7 +62,7 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
)); ));
$messageQuery = $dbh->prepare("SELECT title,msg,url,datetime,userchk FROM notification WHERE touserid = :userid ORDER BY datetime DESC LIMIT $offset, $itemsPerPage"); $messageQuery = $dbh->prepare("SELECT fromuserid,title,msg,url,datetime,userchk FROM notification WHERE touserid = :userid ORDER BY datetime DESC LIMIT $offset, $itemsPerPage");
$messageQuery->bindValue(':userid', $userid); $messageQuery->bindValue(':userid', $userid);
$messageQuery->execute(); $messageQuery->execute();
$message_array = $messageQuery->fetchAll(); $message_array = $messageQuery->fetchAll();
@@ -77,6 +80,17 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
if (!empty($message_array)) { if (!empty($message_array)) {
foreach ($message_array as $value) { foreach ($message_array as $value) {
$value["servericon"] = htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8');
if(!(empty($value['fromuserid']))){
if(!($value['fromuserid'] == "uwuzu-fromsys")){
$userQuery = $dbh->prepare("SELECT username,iconname FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $value['fromuserid']);
$userQuery->execute();
$user_array = $userQuery->fetch();
$value['fromusericon'] = "../".$user_array["iconname"];
$value['fromusername'] = $user_array["username"];
}
}
$messageDisplay = new MessageDisplay($value); // userid を渡さない $messageDisplay = new MessageDisplay($value); // userid を渡さない
$messageDisplay->display(); $messageDisplay->display();
} }
+60 -2
View File
@@ -1,4 +1,42 @@
<?php <?php
function processMarkdownAndWrapEmptyLines($markdownText){
//\___________________[注意]__________________\
// \____ここの順番を変えるとうまく動かなくなります___\
// \______Markdownうまく動くところを探すべし______\
$markdownText = preg_replace('/\[\[buruburu (.+)\]\]/m', '<span class="buruburu">$1</span>', $markdownText);//ぶるぶる
$markdownText = preg_replace('/(^|[^`])`([^`\n]+)`($|[^`])/m', '$1<span class="inline">$2</span>$3', $markdownText);//Inline Code
$markdownText = preg_replace('/\*\*\*(.*?)\*\*\*/', '<b><i>$1</i></b>', $markdownText);//太字&斜体の全部のせセット
$markdownText = preg_replace('/\_\_\_(.*?)\_\_\_/', '<b><i>$1</i></b>', $markdownText);//太字&斜体の全部のせセット
$markdownText = preg_replace('/\*\*(.*?)\*\*/', '<b>$1</b>', $markdownText);//太字
$markdownText = preg_replace('/\_\_(.*?)\_\_/', '<b>$1</b>', $markdownText);//太字
$markdownText = preg_replace('/\*(.*?)\*/', '<i>$1</i>', $markdownText);//斜体
$markdownText = preg_replace('/\_(.*?)\_/', '<i>$1</i>', $markdownText);//斜体
$markdownText = preg_replace('/\~\~(.*?)\~\~/m', '<s>$1</s>', $markdownText);//打ち消し線
$markdownText = preg_replace('/&gt;&gt;&gt; (.*)/m', '<span class="quote">$1</span>', $markdownText);//>>> 引用
$markdownText = preg_replace('/\|\|(.*)\|\|/m', '<span class="blur">$1</span>', $markdownText);//黒塗り
// タイトル(#、##、###)をHTMLのhタグに変換
$markdownText = preg_replace('/^# (.+)/m', '<h1>$1</h1>', $markdownText);
$markdownText = preg_replace('/^## (.+)/m', '<h2>$1</h2>', $markdownText);
$markdownText = preg_replace('/^### (.+)/m', '<h3>$1</h3>', $markdownText);
// 箇条書き(-)をHTMLのul/liタグに変換
$markdownText = preg_replace('/^- (.+)/m', '<p>・ $1</p>', $markdownText);
// 空行の前に何もない行をHTMLのpタグに変換
$markdownText = preg_replace('/(^\s*)(?!\s)(.*)/m', '$1<p>$2</p>', $markdownText);
return $markdownText;
}
//Profile //Profile
function replaceProfileEmojiImages($postText) { function replaceProfileEmojiImages($postText) {
// プロフィール名で絵文字名(:emoji:)を検出して画像に置き換える // プロフィール名で絵文字名(:emoji:)を検出して画像に置き換える
@@ -88,7 +126,7 @@ class MessageDisplay {
public function display() { public function display() {
if($this->value['userchk'] === "none"){ if($this->value['userchk'] === "none"){
echo '<div class="notification2">'; echo '<div class="notification this">';
}else{ }else{
echo '<div class="notification">'; echo '<div class="notification">';
} }
@@ -106,8 +144,28 @@ class MessageDisplay {
echo ' </div>'; echo ' </div>';
// 投稿内のHTMLコードを表示する部分 // 投稿内のHTMLコードを表示する部分
if(!(empty($this->value['fromuserid']))){
echo ' <div class="flebox">';
echo ' <div class="icon">';
if(($this->value['fromuserid'] == "uwuzu-fromsys")){
if(!(empty($this->value["servericon"]))){
echo ' <a href="/rule/serverabout"><img src="'.$this->value["servericon"].'"></a>';
}else{
echo ' <a href="/rule/serverabout"><img src="../img/uwuzuicon.png"></a>';
}
}else{
echo ' <a href="/@'.$this->value['fromuserid'].'"><img src="' . $this->value['fromusericon'] . '"></a>';
}
echo ' </div>';
if(($this->value['fromuserid'] == "uwuzu-fromsys")){
echo ' <div class="username"><a href="/rule/serverabout">uwuzu</a></div>';
}else{
echo ' <div class="username"><a href="/@'.$this->value['fromuserid'].'">'.$this->value['fromusername'].'</a></div>';
}
echo ' </div>';
}
echo ' <h3>' . replaceEmojisWithImages($this->value['title']) . '</h3>'; echo ' <h3>' . replaceEmojisWithImages($this->value['title']) . '</h3>';
echo ' <p>' . replaceEmojisWithImages(nl2br($this->value['msg'])) . '</p>'; echo ' <p>' . processMarkdownAndWrapEmptyLines(replaceEmojisWithImages(nl2br($this->value['msg']))) . '</p>';
echo ' <a href="' . htmlentities($this->value['url']) . '">詳細をみる</a>'; echo ' <a href="' . htmlentities($this->value['url']) . '">詳細をみる</a>';
echo '</div>'; echo '</div>';
+7
View File
@@ -53,6 +53,12 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
if (!empty($pdo)) { if (!empty($pdo)) {
if (!empty($keyword)) { if (!empty($keyword)) {
$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"]);
$mybookmark = htmlentities($res["bookmark"]);
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array( $dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
@@ -133,6 +139,7 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
} }
if(!empty($messages)){ if(!empty($messages)){
foreach ($messages as $value) { foreach ($messages as $value) {
$value["bookmark"] = $mybookmark;
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数 $fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
+12 -5
View File
@@ -45,11 +45,12 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
if($result2["loginid"] === $loginid){ if($result2["loginid"] === $loginid){
$userid = htmlentities($_GET['userid']); $userid = htmlentities($_GET['userid']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid"); $aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist,bookmark FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid)); $aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute(); $aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch(); $res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]); $myblocklist = htmlentities($res["blocklist"]);
$mybookmark = htmlentities($res["bookmark"]);
$ueuseid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : ''; $ueuseid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
@@ -70,9 +71,11 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
)); ));
// 投稿内容の取得(新しい順に取得) // 投稿内容の取得(新しい順に取得)
$messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE uniqid = :ueuseid OR rpuniqid = :rpueuseid ORDER BY datetime ASC LIMIT $offset, $itemsPerPage"); $messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE uniqid = :ueuseid OR rpuniqid = :rpueuseid ORDER BY datetime ASC LIMIT :offset, :itemsPerPage");
$messageQuery->bindValue(':ueuseid', $ueuseid); $messageQuery->bindValue(':ueuseid', $ueuseid, PDO::PARAM_STR);
$messageQuery->bindValue(':rpueuseid', $ueuseid); $messageQuery->bindValue(':rpueuseid', $ueuseid, PDO::PARAM_STR);
$messageQuery->bindValue(':offset', $offset, PDO::PARAM_INT);
$messageQuery->bindValue(':itemsPerPage', $itemsPerPage, PDO::PARAM_INT);
$messageQuery->execute(); $messageQuery->execute();
$message_array = $messageQuery->fetchAll(); $message_array = $messageQuery->fetchAll();
@@ -84,8 +87,10 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
foreach ($message_array as $row) { foreach ($message_array as $row) {
if(!(empty($row["rpuniqid"]))){ if(!(empty($row["rpuniqid"]))){
if(!($row["rpuniqid"] == $ueuseid)){ if(!($row["rpuniqid"] == $ueuseid)){
$up_messageQuery = $pdo->prepare("SELECT * FROM ueuse WHERE uniqid = :ueuseid ORDER BY datetime ASC LIMIT $offset, $itemsPerPage"); $up_messageQuery = $pdo->prepare("SELECT * FROM ueuse WHERE uniqid = :ueuseid ORDER BY datetime ASC LIMIT :offset, :itemsPerPage");
$up_messageQuery->bindValue(':ueuseid', $row["rpuniqid"]); $up_messageQuery->bindValue(':ueuseid', $row["rpuniqid"]);
$up_messageQuery->bindValue(':offset', $offset, PDO::PARAM_INT);
$up_messageQuery->bindValue(':itemsPerPage', $itemsPerPage, PDO::PARAM_INT);
$up_messageQuery->execute(); $up_messageQuery->execute();
$up_messageData = $up_messageQuery->fetchAll(); $up_messageData = $up_messageQuery->fetchAll();
if(!(empty($up_messageData))){ if(!(empty($up_messageData))){
@@ -145,6 +150,8 @@ 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'))) {
$value["bookmark"] = $mybookmark;
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数 $fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える // コンマで区切って配列に分割し、要素数を数える
+15 -5
View File
@@ -47,11 +47,12 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : ''; $uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
$userid = htmlentities($_GET['userid']); $userid = htmlentities($_GET['userid']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid"); $aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist,bookmark FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid)); $aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute(); $aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch(); $res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]); $myblocklist = htmlentities($res["blocklist"]);
$mybookmark = htmlentities($res["bookmark"]);
$itemsPerPage = 15; // 1ページあたりのユーズ数 $itemsPerPage = 15; // 1ページあたりのユーズ数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1; $pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
@@ -72,11 +73,19 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$userQuery->execute(); $userQuery->execute();
$userData = $userQuery->fetch(); $userData = $userQuery->fetch();
$messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE favorite LIKE :userid ORDER BY datetime DESC LIMIT $offset, $itemsPerPage"); $sql = "SELECT ueuse.*
$messageQuery->bindValue(':userid', '%,' . $uwuzuid . '%', PDO::PARAM_STR); FROM ueuse
LEFT JOIN account ON ueuse.account = account.userid
WHERE ueuse.favorite LIKE :userid AND account.role != 'ice'
ORDER BY ueuse.datetime DESC
LIMIT :offset, :itemsPerPage";
$messageQuery->execute(); $stmt = $pdo->prepare($sql);
$message_array = $messageQuery->fetchAll(); $stmt->bindValue(':userid', '%,' . $uwuzuid . '%', PDO::PARAM_STR);
$stmt->bindValue(':offset', $offset, PDO::PARAM_INT);
$stmt->bindValue(':itemsPerPage', $itemsPerPage, PDO::PARAM_INT);
$stmt->execute();
$message_array = $stmt->fetchAll();
$messages = array(); $messages = array();
foreach ($message_array as $row) { foreach ($message_array as $row) {
@@ -127,6 +136,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'))) {
$value["bookmark"] = $mybookmark;
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数 $fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
+7 -2
View File
@@ -47,11 +47,12 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : ''; $uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
$userid = htmlentities($_GET['userid']); $userid = htmlentities($_GET['userid']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid"); $aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist,bookmark FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid)); $aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute(); $aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch(); $res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]); $myblocklist = htmlentities($res["blocklist"]);
$mybookmark = htmlentities($res["bookmark"]);
$itemsPerPage = 15; // 1ページあたりのユーズ数 $itemsPerPage = 15; // 1ページあたりのユーズ数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1; $pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
@@ -78,9 +79,11 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
(photo3 IS NOT NULL AND photo3 != '' AND photo3 != 'none') OR (photo3 IS NOT NULL AND photo3 != '' AND photo3 != 'none') OR
(photo4 IS NOT NULL AND photo4 != '' AND photo4 != 'none') OR (photo4 IS NOT NULL AND photo4 != '' AND photo4 != 'none') OR
(video1 IS NOT NULL AND video1 != '' AND video1 != 'none') (video1 IS NOT NULL AND video1 != '' AND video1 != 'none')
) ORDER BY datetime DESC LIMIT $offset, $itemsPerPage"); ) ORDER BY datetime DESC LIMIT :offset, :itemsPerPage");
$messageQuery->bindValue(':userid', $uwuzuid); $messageQuery->bindValue(':userid', $uwuzuid);
$messageQuery->bindValue(':offset', $offset, PDO::PARAM_INT);
$messageQuery->bindValue(':itemsPerPage', $itemsPerPage, PDO::PARAM_INT);
$messageQuery->execute(); $messageQuery->execute();
$message_array = $messageQuery->fetchAll(); $message_array = $messageQuery->fetchAll();
@@ -134,6 +137,8 @@ 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'))) {
$value["bookmark"] = $mybookmark;
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数 $fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える // コンマで区切って配列に分割し、要素数を数える
+7 -2
View File
@@ -47,11 +47,12 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : ''; $uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
$userid = htmlentities($_GET['userid']); $userid = htmlentities($_GET['userid']);
$aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid"); $aduserinfoQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo,blocklist,bookmark FROM account WHERE userid = :userid");
$aduserinfoQuery->bindValue(':userid', htmlentities($userid)); $aduserinfoQuery->bindValue(':userid', htmlentities($userid));
$aduserinfoQuery->execute(); $aduserinfoQuery->execute();
$res = $aduserinfoQuery->fetch(); $res = $aduserinfoQuery->fetch();
$myblocklist = htmlentities($res["blocklist"]); $myblocklist = htmlentities($res["blocklist"]);
$mybookmark = htmlentities($res["bookmark"]);
$itemsPerPage = 15; // 1ページあたりのユーズ数 $itemsPerPage = 15; // 1ページあたりのユーズ数
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1; $pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
@@ -72,8 +73,10 @@ if (isset($_GET['userid']) && isset($_GET['account_id'])) {
$userQuery->execute(); $userQuery->execute();
$userData = $userQuery->fetch(); $userData = $userQuery->fetch();
$messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE account = :userid AND rpuniqid = ''ORDER BY datetime DESC LIMIT $offset, $itemsPerPage"); $messageQuery = $dbh->prepare("SELECT * FROM ueuse WHERE account = :userid AND rpuniqid = ''ORDER BY datetime DESC LIMIT :offset, :itemsPerPage");
$messageQuery->bindValue(':userid', $uwuzuid); $messageQuery->bindValue(':userid', $uwuzuid);
$messageQuery->bindValue(':offset', $offset, PDO::PARAM_INT);
$messageQuery->bindValue(':itemsPerPage', $itemsPerPage, PDO::PARAM_INT);
$messageQuery->execute(); $messageQuery->execute();
$message_array = $messageQuery->fetchAll(); $message_array = $messageQuery->fetchAll();
@@ -127,6 +130,8 @@ 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'))) {
$value["bookmark"] = $mybookmark;
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数 $fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える // コンマで区切って配列に分割し、要素数を数える
+39 -2
View File
@@ -2,7 +2,33 @@
<?php <?php
function processMarkdownAndWrapEmptyLines($markdownText){ function processMarkdownAndWrapEmptyLines($markdownText){
$markdownText = preg_replace('/^\[\[buruburu (.+)\]\]/m', '<p class="buruburu">$1</p>', $markdownText);//←ここ!!!!!!!!!!!!!! //\___________________[注意]__________________\
// \____ここの順番を変えるとうまく動かなくなります___\
// \______Markdownうまく動くところを探すべし______\
$markdownText = preg_replace('/\[\[buruburu (.+)\]\]/m', '<span class="buruburu">$1</span>', $markdownText);//ぶるぶる
$markdownText = preg_replace('/(^|[^`])`([^`\n]+)`($|[^`])/m', '$1<span class="inline">$2</span>$3', $markdownText);//Inline Code
/*$markdownText = preg_replace_callback('/^\[\[time (\d+)\]\]/m', function($matches) {
$timestamp = $matches[1];
return '<span class="unixtime">' . date("Y/m/d H:i:s", $timestamp) . '</span>';
}, $markdownText);*/
$markdownText = preg_replace('/\*\*\*(.*?)\*\*\*/', '<b><i>$1</i></b>', $markdownText);//太字&斜体の全部のせセット
$markdownText = preg_replace('/\_\_\_(.*?)\_\_\_/', '<b><i>$1</i></b>', $markdownText);//太字&斜体の全部のせセット
$markdownText = preg_replace('/\*\*(.*?)\*\*/', '<b>$1</b>', $markdownText);//太字
$markdownText = preg_replace('/\_\_(.*?)\_\_/', '<b>$1</b>', $markdownText);//太字
$markdownText = preg_replace('/\*(.*?)\*/', '<i>$1</i>', $markdownText);//斜体
$markdownText = preg_replace('/\_(.*?)\_/', '<i>$1</i>', $markdownText);//斜体
$markdownText = preg_replace('/\~\~(.*?)\~\~/m', '<s>$1</s>', $markdownText);//打ち消し線
$markdownText = preg_replace('/&gt;&gt;&gt; (.*)/m', '<span class="quote">$1</span>', $markdownText);//>>> 引用
$markdownText = preg_replace('/\|\|(.*)\|\|/m', '<span class="blur">$1</span>', $markdownText);//黒塗り
// タイトル(#、##、###)をHTMLのhタグに変換 // タイトル(#、##、###)をHTMLのhタグに変換
$markdownText = preg_replace('/^# (.+)/m', '<h1>$1</h1>', $markdownText); $markdownText = preg_replace('/^# (.+)/m', '<h1>$1</h1>', $markdownText);
@@ -147,7 +173,7 @@ function YouTube_and_nicovideo_Links($postText) {
foreach ($matches[0] as $url) { foreach ($matches[0] as $url) {
// ドメイン部分を抽出 // ドメイン部分を抽出
$parsedUrl = parse_url($url); $parsedUrl = parse_url($url);
if($parsedUrl['host'] == "youtube.com" || $parsedUrl['host'] == "youtu.be" || $parsedUrl['host'] == "www.youtube.com"){ if($parsedUrl['host'] == "youtube.com" || $parsedUrl['host'] == "youtu.be" || $parsedUrl['host'] == "www.youtube.com" || $parsedUrl['host'] == "m.youtube.com"){
if (isset($parsedUrl['query'])) { if (isset($parsedUrl['query'])) {
if(false !== strpos($parsedUrl['query'], 'v=')) { if(false !== strpos($parsedUrl['query'], 'v=')) {
@@ -237,12 +263,15 @@ class MessageDisplay {
echo ' <div class="time">'; echo ' <div class="time">';
$datetime = strtotime(htmlentities($this->value['datetime'])); $datetime = strtotime(htmlentities($this->value['datetime']));
$today = strtotime(date("Y-m-d")); $today = strtotime(date("Y-m-d"));
$tomorrow = date('Y-m-d', strtotime('+1 day'));
if (date("md", $datetime) == "0101") { if (date("md", $datetime) == "0101") {
if (date("Y", $datetime) == date("Y")) { if (date("Y", $datetime) == date("Y")) {
echo "元日 " . date("H:i", $datetime); echo "元日 " . date("H:i", $datetime);
} else { } else {
echo date("Y年m月d日 H:i", $datetime); echo date("Y年m月d日 H:i", $datetime);
} }
} elseif ($datetime >= $tomorrow) {
echo date("Y年m月d日 H:i", $datetime) . " (未来)";
} elseif ($datetime >= $today) { } elseif ($datetime >= $today) {
echo "今日 " . date("H:i", $datetime); echo "今日 " . date("H:i", $datetime);
} elseif (date("Y", $datetime) == date("Y")) { } elseif (date("Y", $datetime) == date("Y")) {
@@ -325,6 +354,14 @@ class MessageDisplay {
} }
echo '<a href="/!'.htmlentities($this->value['uniqid']). '~' . htmlentities($this->value['account']) . '" class="tuduki"><svg><use xlink:href="../img/sysimage/reply_1.svg#reply_1"></use></svg>'.htmlentities($this->value['reply_count']).'</a>'; echo '<a href="/!'.htmlentities($this->value['uniqid']). '~' . htmlentities($this->value['account']) . '" class="tuduki"><svg><use xlink:href="../img/sysimage/reply_1.svg#reply_1"></use></svg>'.htmlentities($this->value['reply_count']).'</a>';
echo '<button name="share" id="share" class="share" data-uniqid="' . htmlentities($this->value['uniqid']) . '" data-userid="' . htmlentities($this->value['account']) . '"><svg><use xlink:href="../img/sysimage/share_1.svg#share_1"></use></svg></button>'; echo '<button name="share" id="share" class="share" data-uniqid="' . htmlentities($this->value['uniqid']) . '" data-userid="' . htmlentities($this->value['account']) . '"><svg><use xlink:href="../img/sysimage/share_1.svg#share_1"></use></svg></button>';
$bookmarkList = explode(',', $this->value['bookmark']);
if (in_array($this->value['uniqid'], $bookmarkList)) {
echo '<button name="bookmark" id="bookmark" class="bookmark bookmark_after" data-uniqid="' . htmlentities($this->value['uniqid']) . '" data-userid="' . htmlentities($this->value['account']) . '"><svg><use xlink:href="../img/sysimage/bookmark_1.svg#bookmark_1"></use></svg></button>';
}else{
echo '<button name="bookmark" id="bookmark" class="bookmark" data-uniqid="' . htmlentities($this->value['uniqid']) . '" data-userid="' . htmlentities($this->value['account']) . '"><svg><use xlink:href="../img/sysimage/bookmark_1.svg#bookmark_1"></use></svg></button>';
}
if($this->value['account'] === $this->userid){ if($this->value['account'] === $this->userid){
if(!($this->value['role'] === "ice")){ if(!($this->value['role'] === "ice")){
if($this->value['abi'] === "none"){ if($this->value['abi'] === "none"){
+21 -12
View File
@@ -1,27 +1,35 @@
<?php <?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);
function decode_yajirushi($postText){
$postText = str_replace('&larr;', '←', $postText);
$postText = str_replace('&darr;', '↓', $postText);
$postText = str_replace('&uarr;', '↑', $postText);
$postText = str_replace('&rarr;', '→', $postText);
return $postText;
}
if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){ if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){
header("Content-Type: application/json; charset=utf-8"); header("Content-Type: application/json");
header("charset=utf-8");
header("Access-Control-Allow-Origin: *");
$mojisizefile = "../../server/textsize.txt"; $mojisizefile = "../../server/textsize.txt";
$adminfile = "../../server/admininfo.txt"; $adminfile = htmlentities($serversettings["serverinfo"]["server_admin"]);
$servernamefile = "../../server/servername.txt"; $servernamefile = htmlentities($serversettings["serverinfo"]["server_name"]);
$serverinfofile = '../../server/info.txt'; $serverinfofile = '../../server/info.txt';
$serverinfo = file_get_contents($serverinfofile); $serverinfo = htmlentities(file_get_contents($serverinfofile));
$contactfile = "../../server/contact.txt"; $contactfile = htmlentities($serversettings["serverinfo"]["server_admin_mailadds"]);
$domain = $_SERVER['HTTP_HOST']; $domain = $_SERVER['HTTP_HOST'];
$softwarefile = "../../server/uwuzuinfo.txt"; $softwarefile = "../../server/uwuzuinfo.txt";
$softwaredata = file_get_contents($softwarefile); $softwaredata = htmlentities(file_get_contents($softwarefile));
$onlyuserfile = "../../server/onlyuser.txt"; $onlyuser = htmlentities($serversettings["serverinfo"]["server_invitation"]);
$onlyuser = file_get_contents($onlyuserfile);
$softwaredata = explode( "\n", $softwaredata ); $softwaredata = explode( "\n", $softwaredata );
$cnt = count( $softwaredata ); $cnt = count( $softwaredata );
@@ -68,6 +76,7 @@ if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUO
"software" => array( "software" => array(
"name" => "uwuzu", "name" => "uwuzu",
"version" => "".str_replace("\r", '', $uwuzuinfo[1])."", "version" => "".str_replace("\r", '', $uwuzuinfo[1])."",
"homepage" => "https://www.uwuzu.com/",
"repository" => "https://github.com/Daichimarukana/uwuzu", "repository" => "https://github.com/Daichimarukana/uwuzu",
), ),
"protocols" => [ "protocols" => [
@@ -85,11 +94,11 @@ if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUO
"localPosts" => $count2, "localPosts" => $count2,
], ],
"metadata" => [ "metadata" => [
"nodeName" => file_get_contents($servernamefile), "nodeName" => $servernamefile,
"nodeDescription" => $serverinfo, "nodeDescription" => $serverinfo,
"maintainer" => array( "maintainer" => array(
"name" => file_get_contents($adminfile), "name" => $adminfile,
"email" => file_get_contents($contactfile), "email" => $contactfile,
), ),
"langs" => array( "langs" => array(
"ja", "ja",
+37 -7
View File
@@ -213,21 +213,36 @@ if( !empty($pdo) ) {
if( !empty($_POST['btn_submit']) ) { if( !empty($_POST['btn_submit']) ) {
//$level = $_POST['notice_level'];
$title = $_POST['title']; $title = $_POST['title'];
$note = $_POST['note']; $note = $_POST['note'];
// IDの入力チェック // IDの入力チェック
if( empty($title) ) { if( empty($title) ) {
$error_message[] = 'タイトルを入力してください!'; $error_message[] = 'タイトルを入力してください!(INPUT_PLEASE)';
} else { } else {
// 文字数を確認 // 文字数を確認
if( 1024 < mb_strlen($title, 'UTF-8') ) { if( 1024 < mb_strlen($title, 'UTF-8') ) {
$error_message[] = 'タイトルは1024文字以内で入力してください。'; $error_message[] = 'タイトルは1024文字以内で入力してください。(INPUT_OVER_MAX_COUNT)';
} }
} }
/*if( empty($level) ) {
$error_message[] = '緊急度レベルを指定してください!(INPUT_PLEASE)';
} else {
if($level == 'normal'){
$notice_level = 'normal';
}elseif($level == 'warning'){
$notice_level = 'warning';
}elseif($level == 'danger'){
$notice_level = 'danger';
}else{
$error_message[] = '緊急度レベルが正しく指定されていません!(ERROR)';
}
}*/
if( empty($error_message) ) { if( empty($error_message) ) {
// 書き込み日時を取得 // 書き込み日時を取得
@@ -243,6 +258,7 @@ if( !empty($_POST['btn_submit']) ) {
// 値をセット // 値をセット
//$stmt->bindParam( ':level', $notice_level, PDO::PARAM_STR);
$stmt->bindParam( ':title', $title, PDO::PARAM_STR); $stmt->bindParam( ':title', $title, PDO::PARAM_STR);
$stmt->bindParam( ':note', $note, PDO::PARAM_STR); $stmt->bindParam( ':note', $note, PDO::PARAM_STR);
@@ -267,7 +283,7 @@ if( !empty($_POST['btn_submit']) ) {
header("Location:".$url.""); header("Location:".$url."");
exit; exit;
} else { } else {
$error_message[] = '配信に失敗しました。'; $error_message[] = '配信に失敗しました。(REGISTERED_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
@@ -290,9 +306,9 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></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="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
@@ -319,7 +335,21 @@ $pdo = null;
<p>タイトルと内容を入力して配信してください。<br>削除と編集はここからは出来ません。<br>DB管理画面から行ってください。</p> <p>タイトルと内容を入力して配信してください。<br>削除と編集はここからは出来ません。<br>DB管理画面から行ってください。</p>
<!--ユーザーネーム関係--> <!--<div>
<p>緊急度レベル</p>
<div class="p2">通常:右側に表示される通常の表示<br>警告:画面上部に常時表示<br>緊急:開いたときに画面中央にお知らせを表示(ウィンドウ)</div>
<div class="radio_btn_zone">
<input type="radio" name="notice_level" value="normal" id="normal" class="radiobtn_input" checked>
<label for="normal" class="radiobtn_label">通常</label>
<input type="radio" name="notice_level" value="warning" id="warning" class="radiobtn_input">
<label for="warning" class="radiobtn_label">警告</label>
<input type="radio" name="notice_level" value="danger" id="danger" class="radiobtn_input">
<label for="danger" class="radiobtn_label">緊急</label>
</div>
</div>-->
<div> <div>
<p>タイトル</p> <p>タイトル</p>
<input placeholder="ここにタイトル" class="inbox" type="text" name="title" value="<?php if( !empty($_SESSION['title']) ){ echo htmlspecialchars( $_SESSION['title'], ENT_QUOTES, 'UTF-8'); } ?>"> <input placeholder="ここにタイトル" class="inbox" type="text" name="title" value="<?php if( !empty($_SESSION['title']) ){ echo htmlspecialchars( $_SESSION['title'], ENT_QUOTES, 'UTF-8'); } ?>">
+290
View File
@@ -0,0 +1,290 @@
<?php
$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);
}
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=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
} catch(PDOException $e) {
// 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
$myblocklist = htmlentities($res["blocklist"]);
$myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, [
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
$myblocklist = htmlentities($res["blocklist"]);
$myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
$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'];
//------------------通知--------------
function replaceURLsWithLinks_forNotice($postText) {
$postText = str_replace('&#039;', '\'', $postText);
// URLを正規表現を使って検出
$pattern = '/(https:\/\/[^\s<>\[\]\'"]+)/'; // 改良された正規表現
preg_match_all($pattern, $postText, $matches);
// 検出したURLごとに処理を行う
foreach ($matches[0] as $url) {
// ドメイン部分を抽出
$parsedUrl = parse_url($url);
if (!isset($parsedUrl['path'])) {
$parsedUrl['path'] = '';
}
if (!isset($parsedUrl['query'])) {
$parsedUrl['query'] = '';
}
$nochk_domain = $parsedUrl['host'].$parsedUrl['path'].$parsedUrl['query'];
if(strlen($nochk_domain) > 47){
$domain = mb_substr($nochk_domain, 0, 48, "UTF-8")."...";
}else{
$domain = $nochk_domain;
}
// 不要な文字を削除してaタグを生成
$urlWithoutSpaces = preg_replace('/\s+/', '', $url);
$link = "<a href='$urlWithoutSpaces' target='_blank' title='$urlWithoutSpaces'>$domain</a>";
// URLをドメインのみを表示するaタグで置き換え
$postText = preg_replace('/' . preg_quote($url, '/') . '/', $link, $postText);
}
return $postText;
}
$sql = "SELECT title, note, account, datetime FROM notice ORDER BY datetime DESC";
$notice_array = $pdo->query($sql);
while ($row = $notice_array->fetch(PDO::FETCH_ASSOC)) {
$notices[] = $row;
}
//------------------------------------------------------
require('../logout/logout.php');
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js"></script>
<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="icon" type="image/png" href="../favicon/icon-192x192.png">
<link rel="stylesheet" href="../css/home.css">
<title>お知らせ - <?php echo htmlspecialchars($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; ?>
<section>
<div class="emojibox">
<h1>お知らせ</h1>
</div>
<div class="inner">
<?php foreach ($notices as $value) {?>
<div class="notification">
<div class="flebox">
<div class="time"><?php echo date('Y年m月d日 H:i', strtotime($value['datetime']));?></div>
</div>
<h3><?php echo $value['title'];?></h3>
<br>
<p><?php echo replaceURLsWithLinks_forNotice(nl2br($value['note']));?></p>
<div class="makeup"><p>編集者 : <a href="/@<?php echo $value['account'];?>">@<?php echo $value['account'];?></a></p></div>
</div>
<?php }?>
</div>
</section>
</main>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
</html>
+7 -3
View File
@@ -187,9 +187,9 @@ $pdo = null;
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<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">
@@ -209,6 +209,10 @@ $pdo = null;
</ul> </ul>
<?php endif; ?> <?php endif; ?>
<div class="emojibox">
<h1>通知</h1>
</div>
<section class="inner"> <section class="inner">
<div id="postContainer"> <div id="postContainer">
+9 -9
View File
@@ -202,7 +202,7 @@ if( !empty($_POST['btn_submit']) ) {
$chkuserid = htmlentities($_POST['chkuserid']); $chkuserid = htmlentities($_POST['chkuserid']);
if( empty($chkuserid) ) { if( empty($chkuserid) ) {
$error_message[] = '確認用ユーザーIDを入力してください。'; $error_message[] = '確認用ユーザーIDを入力してください。(USERID_CHECK_INPUT_PLEASE)';
} else { } else {
if($chkuserid === $userData["userid"]){ if($chkuserid === $userData["userid"]){
$userId = $userData["userid"]; // 削除対象のユーザーID $userId = $userData["userid"]; // 削除対象のユーザーID
@@ -348,14 +348,14 @@ if( !empty($_POST['btn_submit']) ) {
header("Location:../index.php"); header("Location:../index.php");
exit; exit;
} else { } else {
$error_message[] = 'アカウント削除に失敗しました。'; $error_message[] = 'アカウント削除に失敗しました。(ACCOUNT_DELETE_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
$stmt = null; $stmt = null;
}else{ }else{
$error_message[] = '確認用ユーザーIDが違います'; $error_message[] = '確認用ユーザーIDが違います。(USERID_CHIGAUYANKE)';
} }
} }
@@ -402,7 +402,7 @@ if( !empty($_POST['session_submit']) ) {
// すべての出力を終了 // すべての出力を終了
exit; exit;
} else { } else {
$error_message[] = 'セッションの終了に失敗しました。'; $error_message[] = 'セッションの終了に失敗しました。(END_OF_SESSION_DAME)';
} }
} }
@@ -439,7 +439,7 @@ if( !empty($_POST['token_submit']) ) {
header('Location: ' . $url, true, 303); header('Location: ' . $url, true, 303);
exit; exit;
} else { } else {
$error_message[] = 'トークンの発行に失敗しました。'; $error_message[] = 'トークンの発行に失敗しました。(CREATE_TOKEN_DAME)';
} }
} }
@@ -473,7 +473,7 @@ if( !empty($_POST['token_off_submit']) ) {
header("Location:".$url.""); header("Location:".$url."");
exit; exit;
} else { } else {
$error_message[] = 'トークンの削除に失敗しました。'; $error_message[] = 'トークンの削除に失敗しました。(TOKEN_DELETE_DAME)';
} }
} }
@@ -487,9 +487,9 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
+3 -3
View File
@@ -179,10 +179,10 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></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="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 htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title> <title>アクセストークン発行完了 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
+3 -3
View File
@@ -9,15 +9,15 @@ $serversettings = parse_ini_file($serversettings_file, true);
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/style.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.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">
<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>
<body> <body>
+3 -3
View File
@@ -9,15 +9,15 @@ $serversettings = parse_ini_file($serversettings_file, true);
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/style.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.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">
<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>
<body> <body>
+8 -8
View File
@@ -79,11 +79,11 @@ if( !empty($_POST['btn_submit']) ) {
// ... (前略) // ... (前略)
// IDの入力チェック // IDの入力チェック
if( empty($userid) ) { if( empty($userid) ) {
$error_message[] = 'ユーザーIDを入力してください。'; $error_message[] = 'ユーザーIDを入力してください。(USERID_INPUT_PLEASE)';
} else { } else {
if( empty($mailadds) ) { if( empty($mailadds) ) {
$error_message[] = 'メールアドレスを入力してください。'; $error_message[] = 'メールアドレスを入力してください。(INPUT_PLEASE)';
} else { } else {
if($result->rowCount() > 0) { if($result->rowCount() > 0) {
@@ -109,14 +109,14 @@ if( !empty($_POST['btn_submit']) ) {
} }
} }
else{ else{
$error_message[] = 'IDまたはメールアドレスが違います'; $error_message[] = 'IDまたはメールアドレスが違います(ID_OR_MAILADDS_CHIGAUYANKE)';
} }
}else{ }else{
$error_message[] = 'IDまたはメールアドレスが違います'; $error_message[] = 'IDまたはメールアドレスが違います(ID_OR_MAILADDS_CHIGAUYANKE)';
} }
} }
else { else {
$error_message[] = 'IDまたはメールアドレスが違います'; $error_message[] = 'IDまたはメールアドレスが違います(ID_OR_MAILADDS_CHIGAUYANKE)';
} }
} }
@@ -136,15 +136,15 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/style.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.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">
<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>
<body> <body>
<div class="leftbox"> <div class="leftbox">
+10 -10
View File
@@ -77,7 +77,7 @@ if( !empty($_POST['btn_submit']) ) {
$password = $_POST['password']; $password = $_POST['password'];
if(empty($userauthcode)){ if(empty($userauthcode)){
$error_message[] = "コードを入力してください。"; $error_message[] = "コードを入力してください。(AUTHCODE_INPUT_PLEASE)";
}else{ }else{
$discrepancy = 2; $discrepancy = 2;
@@ -87,7 +87,7 @@ if( !empty($_POST['btn_submit']) ) {
// パスワードの入力チェック // パスワードの入力チェック
if( empty($password) ) { if( empty($password) ) {
$error_message[] = 'パスワードを入力してください。'; $error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)';
} else { } else {
$weakPasswords = array( $weakPasswords = array(
@@ -160,18 +160,18 @@ if( !empty($_POST['btn_submit']) ) {
// テスト用のパスワード(実際にはユーザー入力などから取得することになります。 // テスト用のパスワード(実際にはユーザー入力などから取得することになります。
if (isWeakPassword($password)) { if (isWeakPassword($password)) {
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。"; $error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
} else { } else {
} }
if( 4 > mb_strlen($password, 'UTF-8') ) { if( 4 > mb_strlen($password, 'UTF-8') ) {
$error_message[] = 'パスワードは4文字以上である必要があります。'; $error_message[] = 'パスワードは4文字以上である必要があります。(PASSWORD_TODOITENAI_MIN_COUNT)';
} }
// 文字数を確認 // 文字数を確認
if( 100 < mb_strlen($password, 'UTF-8') ) { if( 100 < mb_strlen($password, 'UTF-8') ) {
$error_message[] = 'パスワードは100文字以内で入力してください。'; $error_message[] = 'パスワードは100文字以内で入力してください。(PASSWORD_OVER_MAX_COUNT)';
} }
} }
@@ -211,12 +211,12 @@ if( !empty($_POST['btn_submit']) ) {
// すべての出力を終了 // すべての出力を終了
exit; exit;
} else { } else {
$error_message[] = 'パスワードの更新に失敗しました。'; $error_message[] = 'パスワードの更新に失敗しました。(REGISTERED_DAME)';
} }
} }
}else { }else {
$error_message[] = '二段階認証が出来ませんでした。再度お試しください。'; $error_message[] = '二段階認証が出来ませんでした。再度お試しください。(AUTHCODE_CHECK_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
@@ -233,15 +233,15 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/style.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/style.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.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">
<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>
<body> <body>
<div class="leftbox"> <div class="leftbox">
+5 -1
View File
@@ -16,15 +16,19 @@
<div class="modal-content"> <div class="modal-content">
<p>メニュー</p> <p>メニュー</p>
<div class="bot_menu_area"> <div class="bot_menu_area">
<a href="/bookmark" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/bookmark.svg#bookmark"></use></svg><div>ブックマーク</div></a>
<a href="/emoji" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/emoji.svg#emoji"></use></svg><div>絵文字</div></a> <a href="/emoji" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/emoji.svg#emoji"></use></svg><div>絵文字</div></a>
<a href="/@<?php echo $userid; ?>" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/profile.svg#profile"></use></svg><div>プロフィール</div></a> <a href="/@<?php echo $userid; ?>" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/profile.svg#profile"></use></svg><div>プロフィール</div></a>
<a href="/settings" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/settings.svg#settings"></use></svg><div>設定</div></a> <a href="/settings" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/settings.svg#settings"></use></svg><div>設定</div></a>
<a href="/others" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/others.svg#others"></use></svg><div>その他</div></a> <a href="/others" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/others.svg#others"></use></svg><div>その他</div></a>
<a href="/rule/terms" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/terms.svg#terms"></use></svg><div>利用規約</div></a> <a href="/rule/terms" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/terms.svg#terms"></use></svg><div>利用規約</div></a>
<a href="/rule/privacypolicy" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/privacypolicy.svg#privacypolicy"></use></svg><div>プライバシー<br>ポリシー</div></a> <a href="/rule/privacypolicy" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/privacypolicy.svg#privacypolicy"></use></svg><div>プライバシー<br>ポリシー</div></a>
<a href="/rule/serverabout" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/info.svg#info"></use></svg><div>サーバー情報</div></a>
<a href="/notice" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/addnotice.svg#addnotice"></use></svg><div>お知らせ</div></a>
<?php if($res["admin"] === "yes"){?> <?php if($res["admin"] === "yes"){?>
<a href="/emoji/addemoji" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/addemoji.svg#addemoji"></use></svg><div>絵文字登録</div></a> <a href="/settings_admin/addemoji_admin" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/addemoji.svg#addemoji"></use></svg><div>絵文字登録</div></a>
<a href="/notice/addnotice" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/addnotice.svg#addnotice"></use></svg><div>お知らせ配信</div></a> <a href="/notice/addnotice" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/addnotice.svg#addnotice"></use></svg><div>お知らせ配信</div></a>
<a href="/settings_admin/serveradmin" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/server.svg#server"></use></svg><div>サーバー設定</div></a> <a href="/settings_admin/serveradmin" class="menubutton"><svg><use xlink:href="../img/sysimage/menuicon/server.svg#server"></use></svg><div>サーバー設定</div></a>
<?php }?> <?php }?>
+1 -1
View File
@@ -21,13 +21,13 @@ $serversettings = parse_ini_file($serversettings_file, true);
<?php }else{?> <?php }else{?>
<a href="/notification" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/notification.svg#notification"></use></svg>通知</a> <a href="/notification" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/notification.svg#notification"></use></svg>通知</a>
<?php }?> <?php }?>
<a href="/bookmark" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/bookmark.svg#bookmark"></use></svg>ブックマーク</a>
<a href="/emoji" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/emoji.svg#emoji"></use></svg>絵文字</a> <a href="/emoji" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/emoji.svg#emoji"></use></svg>絵文字</a>
<a href="/@<?php echo $userid; ?>" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/profile.svg#profile"></use></svg>プロフィール</a> <a href="/@<?php echo $userid; ?>" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/profile.svg#profile"></use></svg>プロフィール</a>
<a href="/settings" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/settings.svg#settings"></use></svg>設定</a> <a href="/settings" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/settings.svg#settings"></use></svg>設定</a>
<a href="/others" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/others.svg#others"></use></svg>その他</a> <a href="/others" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/others.svg#others"></use></svg>その他</a>
<?php if($res["admin"] === "yes"){?> <?php if($res["admin"] === "yes"){?>
<hr> <hr>
<a href="/emoji/addemoji" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/addemoji.svg#addemoji"></use></svg>絵文字登録</a>
<a href="/notice/addnotice" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/addnotice.svg#addnotice"></use></svg>お知らせ配信</a> <a href="/notice/addnotice" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/addnotice.svg#addnotice"></use></svg>お知らせ配信</a>
<a href="/settings_admin/serveradmin" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/server.svg#server"></use></svg>サーバー設定</a> <a href="/settings_admin/serveradmin" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/server.svg#server"></use></svg>サーバー設定</a>
<?php }?> <?php }?>
+3 -3
View File
@@ -50,9 +50,9 @@ foreach ($sprivacypolicy as $privacypolicy) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+3 -3
View File
@@ -67,9 +67,9 @@ foreach ($srelease as $release) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+49 -15
View File
@@ -49,15 +49,18 @@ try {
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$result = $mysqli->query("SELECT userid FROM account ORDER BY datetime"); //User
$result = $mysqli->query("SELECT userid FROM account");
/* 結果セットの行数を取得します */
$count1 = $result->num_rows; $count1 = $result->num_rows;
//ueuse
$result2 = $mysqli->query("SELECT uniqid FROM ueuse ORDER BY datetime"); $result2 = $mysqli->query("SELECT uniqid FROM ueuse");
/* 結果セットの行数を取得します */
$count2 = $result2->num_rows; $count2 = $result2->num_rows;
//emoji
$result3 = $mysqli->query("SELECT sysid FROM emoji");
$count3 = $result3->num_rows;
//bot
$result4 = $mysqli->query("SELECT userid FROM account WHERE sacinfo = 'bot'");
$count4 = $result4->num_rows;
?> ?>
@@ -65,9 +68,9 @@ $count2 = $result2->num_rows;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
@@ -92,11 +95,24 @@ $count2 = $result2->num_rows;
<div class="terms"> <div class="terms">
<h1>サーバー情報</h1> <h1>サーバー情報</h1>
<?php if( !empty(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8')) ){ ?> <!--(サーバーアイコン)-->
<div class="servericon"> <?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
<img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>"> <div class="serverhead">
<img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_head"], ENT_QUOTES, 'UTF-8'); ?>">
</div> </div>
<?php }?> <?php }?>
<?php if( !empty($serversettings["serverinfo"]["server_icon"]) ){ ?>
<div class="servericon">
<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
<div class="up">
<img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
</div>
<?php }else{?>
<img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
<?php }?>
</div>
<?php }?>
<!--(サーバーアイコンここまで)-->
<div class="sp3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div> <div class="sp3"><?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></div>
<div class="sp2c"><?php echo $domain;?></div> <div class="sp2c"><?php echo $domain;?></div>
<hr> <hr>
@@ -115,8 +131,26 @@ $count2 = $result2->num_rows;
<hr> <hr>
<h4>統計情報</h4> <h4>統計情報</h4>
<p>ユーザー数 : <?php echo $count1."<br>"?></p> <div class="overview">
<p>投稿数 : <?php echo $count2."<br>"?></p> <div class="overview_cnt_l">
<div class="p2">ユーザー数</div>
<p><b><?php echo htmlentities($count1);?></b></p>
</div>
<div class="overview_cnt_r">
<div class="p2">投稿数</div>
<p><b><?php echo htmlentities($count2);?></b></p>
</div>
</div>
<div class="overview">
<div class="overview_cnt_l">
<div class="p2">カスタム絵文字数</div>
<p><b><?php echo htmlentities($count3);?></b></p>
</div>
<div class="overview_cnt_r">
<div class="p2">Botアカウント数</div>
<p><b><?php echo htmlentities($count4);?></b></p>
</div>
</div>
<?php if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') == "true"){?> <?php if(htmlspecialchars($serversettings["serverinfo"]["server_invitation"], ENT_QUOTES, 'UTF-8') == "true"){?>
<hr> <hr>
+3 -3
View File
@@ -50,9 +50,9 @@ foreach ($sterms as $terms) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+3 -3
View File
@@ -59,9 +59,9 @@ foreach ($sterms as $terms) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+40 -5
View File
@@ -200,13 +200,13 @@ $pdo = null;
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<script src="../js/nsfw_event.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/nsfw_event.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<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>
@@ -251,7 +251,7 @@ $pdo = null;
</div> </div>
<div id="error" class="error" style="display: none;"> <div id="error" class="error" style="display: none;">
<h1>エラー</h1> <h1>エラー</h1>
<p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。</p> <p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。<br>(NETWORK_HUKANZEN_STOP)</p>
</div> </div>
</div> </div>
</main> </main>
@@ -382,6 +382,41 @@ $(document).ready(function() {
}); });
$(document).on('click', '.bookmark, .bookmark_after', function(event) {
event.preventDefault();
var postUniqid = $(this).data('uniqid');
var userid = '<?php echo $userid; ?>';
var account_id = '<?php echo $loginid; ?>';
var likeCountElement = $(this).find('.like-count'); // いいね数を表示する要素
var isLiked = $(this).hasClass('bookmark_after'); // 現在のいいねの状態を判定
var $this = $(this); // ボタン要素を変数に格納
$.ajax({
url: '../bookmark/bookmark.php',
method: 'POST',
data: { uniqid: postUniqid, userid: userid, account_id: account_id }, // ここに自分のユーザーIDを指定
dataType: 'json',
success: function(response) {
if (response.success) {
// いいね成功時の処理
if (isLiked) {
$this.removeClass('bookmark_after'); // クラスを削除していいねを取り消す
} else {
$this.addClass('bookmark_after'); // クラスを追加していいねを追加する
}
} else {
// いいね失敗時の処理
}
}.bind(this), // コールバック内でthisが適切な要素を指すようにbindする
error: function() {
// エラー時の処理
}
});
});
-1
View File
@@ -1 +0,0 @@
false
View File
View File
-1
View File
@@ -1 +0,0 @@
false
View File
View File
View File
+18 -13
View File
@@ -48,30 +48,32 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
- password(varchar(1024)) パスワード保存用(ハッシュ化されます) - password(varchar(1024)) パスワード保存用(ハッシュ化されます)
- loginid(varchar(256)) 自動ログイン時に本人アカウントか確認 - loginid(varchar(256)) 自動ログイン時に本人アカウントか確認
- mailadds(varchar(500)) メールアドレス保存用 - mailadds(varchar(500)) メールアドレス保存用
- profile(TEXT) プロフィールテキスト保存用 - profile(mediumtext) プロフィールテキスト保存用
- iconname(varchar(256)) アイコン画像リンク保存用 - iconname(varchar(256)) アイコン画像リンク保存用
- headname(varchar(256)) ヘッダー画像リンク保存用 - headname(varchar(256)) ヘッダー画像リンク保存用
- role(varchar(1024)) 「user」のようなロール保存用 - role(varchar(1024)) 「user」のようなロール保存用
- datetime(datetime) アカウント作成日時保存用 - datetime(datetime) アカウント作成日時保存用
- follow(text) アカウントがフォローしている人保存用 - follow(mediumtext) アカウントがフォローしている人保存用
- follower(text) アカウントがフォローされている人保存用 - follower(mediumtext) アカウントがフォローされている人保存用
- blocklist(text) ブロックしている人保存用 - blocklist(mediumtext) ブロックしている人保存用
- bookmark(mediumtext) ブックマーク保存用
- admin(varchar(25)) 管理者アカウントなら「yes」、それ以外なら「none」と入力。 - admin(varchar(25)) 管理者アカウントなら「yes」、それ以外なら「none」と入力。
- authcode(varchar(256)) 二段階認証用キー保存用 - authcode(varchar(256)) 二段階認証用キー保存用
- backupcode(varchar(256)) 二段階認証のバックアップコード保存用 - backupcode(varchar(256)) 二段階認証のバックアップコード保存用
- sacinfo(varchar(256)) 特殊アカウント識別用 - sacinfo(varchar(256)) 特殊アカウント識別用
- mail_settings(mediumtext) メールの送信設定保存用
### emoji ### emoji
- sysid(INT)(AUTO_INCREMENT) アカウントが追加されるとカウントされるシステム用ID - sysid(INT)(AUTO_INCREMENT) アカウントが追加されるとカウントされるシステム用ID
- emojifile(varchar(512)) 絵文字ファイルパス保存用 - emojifile(varchar(512)) 絵文字ファイルパス保存用
- emojiname(varchar(512)) 「:emoji:」のような絵文字名保存用 - emojiname(varchar(512)) 「:emoji:」のような絵文字名保存用
- emojiinfo(text) 絵文字についての説明保存用 - emojiinfo(mediumtext) 絵文字についての説明保存用
- emojidate(datetime) 絵文字登録日時保存用 - emojidate(datetime) 絵文字登録日時保存用
### notice ### notice
- sysid(INT)(AUTO_INCREMENT) うんえいからのおしらせが追加されるとカウントされるシステム用ID - sysid(INT)(AUTO_INCREMENT) うんえいからのおしらせが追加されるとカウントされるシステム用ID
- title(varchar(1024)) お知らせのタイトル保存用 - title(varchar(1024)) お知らせのタイトル保存用
- note(text) お知らせの内容保存用 - note(mediumtext) お知らせの内容保存用
- account(varchar(500)) 編集者ID保存用 - account(varchar(500)) 編集者ID保存用
- emojidate(datetime) お知らせ登録日時保存用 - emojidate(datetime) お知らせ登録日時保存用
@@ -87,15 +89,15 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
- account(varchar(256)) 投稿者ID保存用 - account(varchar(256)) 投稿者ID保存用
- uniqid(varchar(256)) 投稿ID保存用 - uniqid(varchar(256)) 投稿ID保存用
- rpuniqid(varchar(256)) リプライ先ID保存用 - rpuniqid(varchar(256)) リプライ先ID保存用
- ueuse(text) 投稿内容保存用 - ueuse(mediumtext) 投稿内容保存用
- photo1(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用 - photo1(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
- photo2(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用 - photo2(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
- photo3(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用 - photo3(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
- photo4(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用 - photo4(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
- video1(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用 - video1(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
- datetime(datetime) 投稿日時保存用 - datetime(datetime) 投稿日時保存用
- favorite(text) いいね保存用 - favorite(mediumtext) いいね保存用
- abi(text) 投稿者の追記保存用 - abi(mediumtext) 投稿者の追記保存用
- abidate(datetime) 追記日時保存用 - abidate(datetime) 追記日時保存用
- nsfw(varchar(25)) NSFW指定有無保存用 - nsfw(varchar(25)) NSFW指定有無保存用
@@ -103,7 +105,7 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
- sysid(INT)(AUTO_INCREMENT) 通知されるとカウントされるシステム用ID - sysid(INT)(AUTO_INCREMENT) 通知されるとカウントされるシステム用ID
- touserid(varchar(512)) 通知先ID保存用 - touserid(varchar(512)) 通知先ID保存用
- title(varchar(1024)) 通知のタイトル - title(varchar(1024)) 通知のタイトル
- msg(text) 通知の内容 - msg(mediumtext) 通知の内容
- datetime(datetime) 通知日時 - datetime(datetime) 通知日時
- userchk(varchar(25)) 通知の既読確認 - userchk(varchar(25)) 通知の既読確認
@@ -118,7 +120,7 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
- uniqid(varchar(256)) 通報ID保存用 - uniqid(varchar(256)) 通報ID保存用
- userid(varchar(500)) 通報先ユーザーID保存用 - userid(varchar(500)) 通報先ユーザーID保存用
- report_userid(varchar(500)) 通報元ユーザーID保存用 - report_userid(varchar(500)) 通報元ユーザーID保存用
- msg(text) サービス管理者宛メッセージ保存用 - msg(mediumtext) サービス管理者宛メッセージ保存用
- datetime(datetime) 通報日時保存用 - datetime(datetime) 通報日時保存用
- admin_chk(varchar(25)) 解決済みかどうか確認用 - admin_chk(varchar(25)) 解決済みかどうか確認用
@@ -127,7 +129,7 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
- uniqid(varchar(512)) 広告ID保存用 - uniqid(varchar(512)) 広告ID保存用
- url(varchar(512)) 広告のクリック先URL保存用 - url(varchar(512)) 広告のクリック先URL保存用
- image_url(varchar(512)) 広告に表示する画像URL保存用 - image_url(varchar(512)) 広告に表示する画像URL保存用
- memo(text) 広告にマウスオーバーしたときに表示されるメッセージ保存用 - memo(mediumtext) 広告にマウスオーバーしたときに表示されるメッセージ保存用
- start_date(datetime) 広告配信開始日時保存用 - start_date(datetime) 広告配信開始日時保存用
- limit_date(datetime) 広告配信終了日時保存用 - limit_date(datetime) 広告配信終了日時保存用
- datetime(datetime) 広告追加日時保存用 - datetime(datetime) 広告追加日時保存用
@@ -179,6 +181,9 @@ daichimarukanaと一緒に開発したいよ~って人は私のHPからメー
### まっしろ ### まっしろ
#img ../img/uwuzulogo.svg #img ../img/uwuzulogo.svg
## 9. ライセンス
UPULライセンスです!
UPULライセンスに関しては同梱されているUPUL_License.txtを確認するか、uwuzu.comより詳細をご確認ください。
編集者 : daichimarukana 編集者 : daichimarukana
最終更新日 : 2023/12/20 22:10 最終更新日 : 2023/02/24 19:02
+2 -2
View File
@@ -1,4 +1,4 @@
uwuzu uwuzu
1.2.29 1.3.0
2023/12/21 2024/02/24
daichimarukana,putonfps daichimarukana,putonfps
+69
View File
@@ -1,6 +1,75 @@
## リリースノートだぜぇぇぇぇぇぇい!!!!!!! ## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...) ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
## Version 1.3.0 (new_Planet)
リリース日:2024/02/24
fix: サーバーロゴ未設定の状態でuwuzuロゴが表示されない問題を修正しました。
fix: ActivityPub機能にて他のサーバーに認識されない問題を修正しました。
fix: APIのCORS公開範囲を設定し、どのオリジンに対してもリソースを共有するようにしたはずができていなかった問題を修正しました。
fix: APIにて正常に情報が返されない問題を修正しました。
fix: 同じ招待コードが複数回に渡って使用できてしまう問題を修正しました。
fix: 投稿禁止URLドメイン機能で、空白行を作ると全てのドメインが禁止されるバグを修正しました。
fix: SQL構造ファイルでtext型の部分の文字数が最大値を超過しないよう修正しました。(?)
既存のSQL構造ではユーズの最大値やその他MySQLのtext型の部分では文字数の最大値が65,535文字で、ユーズの文字数を例にするとサーバー設定から65,535文字以上にすると正常にユーズができなくなるおそれがあります。
お手数ですが、SQL構造で全てのtext型をmediumtext型(最大16,777,215文字)にしていただけますようよろしくお願いします!
fix: メンションをしまくる事により通知を大量に送信できる問題を修正しました。
fix: EmojiIDに使用できない文字を登録できてしまう問題を修正しました。
fix: 画像のEXIF情報が削除されない問題を修正しました。
fix: 凍結されているユーザーが15件以上連続でユーズしている状態でホーム画面にユーズが表示されなくなる問題を修正しました。
fix: 脆弱性を修正しました。
fix: ロール削除時に正常にロールを剥奪できない問題を修正しました。
fix: サーバー作成時管理者アカウント登録にて画像のEXIFが削除されない問題を修正しました。
fix: サーバー作成時管理者アカウント登録にて正常に登録できない問題を修正しました。
chg: APIのレスポンスでHTMLエンコードをやめました。
chg: textareaを広くしました。
chg: uwuzuで想定されているエラー全てにエラーコードをふりました。
chg: 画像選択時に選択ボタンの色を変えることで選択したことを示すようにしました。
chg: 一部UIを変更しました!
chg: CSSの配色を少し変更しました。
chg: 絵文字登録機能をサーバー設定内に移動しました。
chg: サーバー情報ページの表示内容を変更しました!
chg: 通知の表示を少しいじりました
chg: タブレット端末で利用しやすいようCSSを変更しました。
なお、実機による試験ができていないため動作保証はいたしません。
chg: ライセンスを変更しました!
これまでAGPLでしたが、v1.3.0以降は独自のライセンスであるUPULへの変更を行います。
ご迷惑をおかけしますがご理解とご協力お願いいたします。
new: プラグイン機能を作成しました!
現在利用可能なプラグインは以下のものです。
- PHPMailer
new: プラグイン機能よりPHPMailerが導入されているサーバーにてユーザーが重要なお知らせのメール受信の有無を設定できるできるようになりました!
これによりuwuzuのDB内、accountテーブルの構造に「mail_settings」(mediumtext)を追加する必要があります!
プラグイン機能よりPHPMailerを導入していないサーバーでもDBに追加しないとエラーを引き起こすため必ず追加してください!
new: サーバーヘッダー機能を実装しました!
new: 分間投稿数にレート制限を設けました
new: ユーズのMarkdown機能を大幅に更新しました!
以下に全てのuwuzu Markdown書式を記載します。
- # [ここにテキスト] (h1サイズで文字を表示)
- ## [ここにテキスト] (h2サイズで文字を表示)
- ### [ここにテキスト] (h3サイズで文字を表示)
- [[buruburu [ここにテキスト]]] (文字をブルブルさせて表示)
- `[ここにテキスト]` (インラインコードとして表示)
- ***[ここにテキスト]*** (斜体と太字を適用して表示)
- **[ここにテキスト]** (太字を適用して表示)
- *[ここにテキスト]* (斜体を適用して表示)
- ~~[ここにテキスト]~~ (文字に取り消し線を入れて表示)
- >>> [ここにテキスト] (引用として表示)
- ||[ここにテキスト]|| (カーソルをのせて文字を表示)
- - [ここにテキスト] (箇条書きとして左に点を表示)
new: 全てのエラーに明確なエラーコードを設定しました!(uwuzuで想定されているエラーのみ)
new: ブックマーク機能を追加しました!
これによりuwuzuのDB内、accountテーブルの構造に「bookmark」(mediumtext)を追加する必要があります!
必ず追加するようよろしくお願いいたします。
new: 通知の送信元がわかりやすくなるようにしました!
これにより、uwuzuのDB内のnotificationテーブルの構造に「fromuserid」(varchar(512))を追加する必要があります!
お手数ですが必ず追加するようお願い致します!
new: スマホからもサーバーからのお知らせやサーバー情報を見られるようにしました!
new: 「新しいユーズがあります!」機能を追加しました。
new: 投稿画面にて残り文字数表示を追加しました!
new: 管理用ページよりロールの剥奪機能を実装しました!
uwuzu_database.sqlは更新済みです。
## Version 1.2.29 ## Version 1.2.29
リリース日:2023/12/21 リリース日:2023/12/21
fix: ログインがうまくできない・ログインループを起こしてしまう問題を修正しました。 fix: ログインがうまくできない・ログインループを起こしてしまう問題を修正しました。
+5 -5
View File
@@ -241,14 +241,14 @@ if( !empty($_POST['btn_submit']) ) {
header('Location: ' . $url, true, 303); header('Location: ' . $url, true, 303);
exit; exit;
} else { } else {
$error_message[] = '更新に失敗しました。'; $error_message[] = '更新に失敗しました。(REGISTERED_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
$stmt = null; $stmt = null;
} }
} else { } else {
$error_message[] = "二段階認証が出来ませんでした。再度お試しください。"; $error_message[] = "二段階認証が出来ませんでした。再度お試しください。(AUTHCODE_CHECK_DAME)";
} }
} }
@@ -262,9 +262,9 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
+62 -23
View File
@@ -11,6 +11,10 @@ function createUniqId(){
return base_convert($hashCreateTime,10,36); return base_convert($hashCreateTime,10,36);
} }
function random_key($moji_cnt = 16){
return substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyz', $moji_cnt)), 0, $moji_cnt);
}
require('../db.php'); require('../db.php');
// 変数の初期化 // 変数の初期化
@@ -45,7 +49,7 @@ try {
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) { if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid"); $passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist,mail_settings FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid'])); $passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
$passQuery->execute(); $passQuery->execute();
$res = $passQuery->fetch(); $res = $passQuery->fetch();
@@ -101,7 +105,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) { } 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 = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist,mail_settings FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid'])); $passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
$passQuery->execute(); $passQuery->execute();
$res = $passQuery->fetch(); $res = $passQuery->fetch();
@@ -175,6 +179,12 @@ $notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
$notificationcount = $notiData['notification_count']; $notificationcount = $notiData['notification_count'];
//ページ内のみ使用変数-------------------------
$mail_settings = htmlentities($res["mail_settings"]);
//------------------------------------------
//phpmailer--------------------------------------------
require('../settings_admin/plugin_settings/phpmailer_settings.php');
//------------------------------------------------------
if( !empty($pdo) ) { if( !empty($pdo) ) {
// データベース接続の設定 // データベース接続の設定
@@ -201,7 +211,6 @@ if( !empty($pdo) ) {
$userdata = $rerole->fetch(); // ここでデータベースから取得した値を $role に代入する $userdata = $rerole->fetch(); // ここでデータベースから取得した値を $role に代入する
} }
@@ -213,7 +222,6 @@ if( !empty($_POST['btn_submit']) ) {
}else{ }else{
$im_bot = "false"; $im_bot = "false";
} }
if($im_bot === "true"){ if($im_bot === "true"){
$saveim_bot = "bot"; $saveim_bot = "bot";
}else{ }else{
@@ -225,6 +233,22 @@ if( !empty($_POST['btn_submit']) ) {
$mailadds = $_POST['mailadds']; $mailadds = $_POST['mailadds'];
if( !empty($_POST['mail_important']) ) {
$mail_important = $_POST['mail_important'];
}else{
$mail_important = "false";
}
if($mail_important === "true"){
if(filter_var($mailadds, FILTER_VALIDATE_EMAIL)){
$savemail_important = "important";
}else{
$savemail_important = "none";
$error_message[] = 'メールアドレスが無効なため重要なお知らせをメールで受信する機能は使用できません。(MAILADDS_CHECK_DAME)';
}
}else{
$savemail_important = "none";
}
$profile = $_POST['profile']; $profile = $_POST['profile'];
$options = array( $options = array(
@@ -249,11 +273,11 @@ if( !empty($_POST['btn_submit']) ) {
// ユーザーネームの入力チェック // ユーザーネームの入力チェック
if( empty($username) ) { if( empty($username) ) {
$error_message[] = '表示名を入力してください。'; $error_message[] = '表示名を入力してください。(USERNAME_INPUT_PLEASE)';
} else { } else {
// 文字数を確認 // 文字数を確認
if( 50 < mb_strlen($username, 'UTF-8') ) { if( 50 < mb_strlen($username, 'UTF-8') ) {
$error_message[] = 'ユーザーネームは50文字以内で入力してください。'; $error_message[] = 'ユーザーネームは50文字以内で入力してください。(USERNAME_OVER_MAX_COUNT)';
} }
} }
@@ -264,13 +288,14 @@ if( !empty($_POST['btn_submit']) ) {
try { try {
// SQL作成 // SQL作成
$stmt = $pdo->prepare("UPDATE account SET username = :username, mailadds = :mailadds, profile = :profile, sacinfo = :saveimbot WHERE userid = :userid;"); $stmt = $pdo->prepare("UPDATE account SET username = :username, mailadds = :mailadds, profile = :profile, sacinfo = :saveimbot, mail_settings = :mail_settings WHERE userid = :userid;");
// 他の値をセット // 他の値をセット
$stmt->bindParam(':username', $username, PDO::PARAM_STR); $stmt->bindParam(':username', $username, PDO::PARAM_STR);
$stmt->bindParam(':mailadds', $mailadds, PDO::PARAM_STR); $stmt->bindParam(':mailadds', $mailadds, PDO::PARAM_STR);
$stmt->bindParam(':profile', $profile, PDO::PARAM_STR); $stmt->bindParam(':profile', $profile, PDO::PARAM_STR);
$stmt->bindParam(':saveimbot', $saveim_bot, PDO::PARAM_STR); $stmt->bindParam(':saveimbot', $saveim_bot, PDO::PARAM_STR);
$stmt->bindParam(':mail_settings', $savemail_important, PDO::PARAM_STR);
// 条件を指定 // 条件を指定
// 以下の部分を適切な条件に置き換えてください // 以下の部分を適切な条件に置き換えてください
@@ -293,7 +318,7 @@ if( !empty($_POST['btn_submit']) ) {
header("Location:".$url.""); header("Location:".$url."");
exit; exit;
} else { } else {
$error_message[] = '更新に失敗しました。'; $error_message[] = '更新に失敗しました。(REGISTERED_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
@@ -311,16 +336,16 @@ if( !empty($_POST['pass_submit']) ) {
$hashpassword = password_hash($password, PASSWORD_DEFAULT); $hashpassword = password_hash($password, PASSWORD_DEFAULT);
if(empty($pass_chk)){ if(empty($pass_chk)){
$error_message[] = 'ユーザーidを入力してください。'; $error_message[] = 'ユーザーidを入力してください。(USERID_INPUT_PLEASE)';
}else{ }else{
if(!($pass_chk === $userData["userid"])){ if(!($pass_chk === $userData["userid"])){
$error_message[] = 'ユーザーidが不正です。'; $error_message[] = 'ユーザーidが不正です。(USERID_CHIGAUYANKE)';
} }
} }
// ユーザーネームの入力チェック // ユーザーネームの入力チェック
if( empty($password) ) { if( empty($password) ) {
$error_message[] = '新しいパスワードを入力してください。'; $error_message[] = '新しいパスワードを入力してください。(PASSWORD_NEW_INPUT_PLEASE)';
} else { } else {
$weakPasswords = array( $weakPasswords = array(
@@ -393,17 +418,17 @@ if( !empty($_POST['pass_submit']) ) {
// テスト用のパスワード(実際にはユーザー入力などから取得することになります。 // テスト用のパスワード(実際にはユーザー入力などから取得することになります。
if (isWeakPassword($password)) { if (isWeakPassword($password)) {
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。"; $error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)";
} else { } else {
} }
// 文字数を確認 // 文字数を確認
if( 100 < mb_strlen($password, 'UTF-8') ) { if( 100 < mb_strlen($password, 'UTF-8') ) {
$error_message[] = 'パスワードは100文字以内で入力してください。'; $error_message[] = 'パスワードは100文字以内で入力してください。(PASSWORD_OVER_MAX_COUNT)';
} }
if( 4 > mb_strlen($password, 'UTF-8') ) { if( 4 > mb_strlen($password, 'UTF-8') ) {
$error_message[] = 'パスワードは4文字以上である必要があります。'; $error_message[] = 'パスワードは4文字以上である必要があります。(PASSWORD_TODOITENAI_MIN_COUNT)';
} }
} }
@@ -441,7 +466,7 @@ if( !empty($_POST['pass_submit']) ) {
header("Location:".$url.""); header("Location:".$url."");
exit; exit;
} else { } else {
$error_message[] = '更新に失敗しました。'; $error_message[] = '更新に失敗しました。(REGISTERED_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
@@ -547,7 +572,7 @@ if( !empty($_POST['img1btn_submit']) ) {
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.''; $error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
} }
}else{ }else{
$error_message[] = 'ヘッダー画像を選択してください'; $error_message[] = 'ヘッダー画像を選択してください(PHOTO_SELECT_PLEASE)';
} }
$options = array( $options = array(
@@ -605,7 +630,7 @@ if( !empty($_POST['img1btn_submit']) ) {
header("Location:".$url.""); header("Location:".$url."");
exit; exit;
} else { } else {
$error_message[] = '更新に失敗しました。'; $error_message[] = '更新に失敗しました。(REGISTERED_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
@@ -659,7 +684,7 @@ if( !empty($_POST['img2btn_submit']) ) {
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.''; $error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
} }
}else{ }else{
$error_message[] = 'アイコン画像を選択してください'; $error_message[] = 'アイコン画像を選択してください(PHOTO_SELECT_PLEASE)';
} }
@@ -718,7 +743,7 @@ if( !empty($_POST['img2btn_submit']) ) {
header("Location:".$url.""); header("Location:".$url."");
exit; exit;
} else { } else {
$error_message[] = '更新に失敗しました。'; $error_message[] = '更新に失敗しました。(REGISTERED_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
@@ -774,7 +799,7 @@ if( !empty($_POST['auth_off_submit']) ) {
header("Location:".$url.""); header("Location:".$url."");
exit; exit;
} else { } else {
$error_message[] = '更新に失敗しました。'; $error_message[] = '更新に失敗しました。(REGISTERED_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
@@ -790,9 +815,9 @@ $pdo = null;
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
@@ -870,6 +895,20 @@ $pdo = null;
<p>アカウントが凍結されているためBotであることの設定変更はできません。</p> <p>アカウントが凍結されているためBotであることの設定変更はできません。</p>
<?php }?> <?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="情報更新"> <input type="submit" class = "irobutton" name="btn_submit" value="情報更新">
<?php }?> <?php }?>
+3 -3
View File
@@ -179,9 +179,9 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
+12 -8
View File
@@ -192,21 +192,22 @@ if( !empty($_POST['ads_btn_submit']) ) {
$ads_memo = htmlentities($_POST['ads_memo']); $ads_memo = htmlentities($_POST['ads_memo']);
if(empty($ads_url)){ if(empty($ads_url)){
$error_message[] = "URLが入力されていません。"; $error_message[] = "URLが入力されていません。(INPUT_PLEASE)";
} }
if(empty($ads_img_url)){ if(empty($ads_img_url)){
$error_message[] = "画像のURLが入力されていません。"; $error_message[] = "画像のURLが入力されていません。(INPUT_PLEASE)";
} }
if(empty($ads_start_url)){ if(empty($ads_start_url)){
$error_message[] = "設置開始日時が入力されていません。"; $error_message[] = "設置開始日時が入力されていません。(INPUT_PLEASE)";
} }
if(empty($ads_limit_url)){ if(empty($ads_limit_url)){
$error_message[] = "設置終了日時が入力されていません。"; $error_message[] = "設置終了日時が入力されていません。(INPUT_PLEASE)";
} }
if(empty($ads_memo_url)){ if(empty($ads_memo_url)){
$error_message[] = "メモが入力されていません。"; $error_message[] = "メモが入力されていません。(INPUT_PLEASE)";
} }
if(empty($error_message)){
if (!empty($pdo)) { if (!empty($pdo)) {
// 書き込み日時を取得 // 書き込み日時を取得
$datetime = date("Y-m-d H:i:s"); $datetime = date("Y-m-d H:i:s");
@@ -253,6 +254,7 @@ if( !empty($_POST['ads_btn_submit']) ) {
} }
} }
}
if( !empty($_POST['ads_del']) ) { if( !empty($_POST['ads_del']) ) {
$ads_uniqid = htmlentities($_POST['ads_id']); $ads_uniqid = htmlentities($_POST['ads_id']);
try{ try{
@@ -303,10 +305,10 @@ if (!empty($pdo)) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
@@ -394,6 +396,8 @@ if (!empty($pdo)) {
</details> </details>
</div> </div>
<?php }?> <?php }?>
<?php }else{?>
<div class="tokonone" id="noueuse"><p>広告がありません</p></div>
<?php }?> <?php }?>
</div> </div>
</div> </div>
+449
View File
@@ -0,0 +1,449 @@
<?php
$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);
}
require('../db.php');
//関数呼び出し
//- EXIF
require('../function/function.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=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
} catch(PDOException $e) {
// 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
$myblocklist = htmlentities($res["blocklist"]);
$myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, [
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
$myblocklist = htmlentities($res["blocklist"]);
$myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
if(!($res["admin"] === "yes")){
header("Location: ../login.php");
exit;
}
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
$notiQuery->bindValue(':userid', $userid);
$notiQuery->execute();
$notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
$notificationcount = $notiData['notification_count'];
if( !empty($pdo) ) {
// データベース接続の設定
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
));
$userQuery = $dbh->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $userid);
$userQuery->execute();
$userData = $userQuery->fetch();
$role = $userData["role"];
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
$rerole = $dbh->prepare("SELECT username, userid, password, mailadds, profile, iconname, headname, role, datetime FROM account WHERE userid = :userid");
$rerole->bindValue(':userid', $userid);
// SQL実行
$rerole->execute();
$userdata = $rerole->fetch(); // ここでデータベースから取得した値を $role に代入する
}
if( !empty($_POST['btn_submit']) ) {
$emojiname = $_POST['emojiname'];
$emojiinfo = $_POST['emojiinfo'];
if (!empty($_FILES['image']['name'])) {
// アップロードされたファイル情報
$uploadedFile = $_FILES['image'];
// アップロードされたファイルの拡張子を取得
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
// 新しいファイル名を生成(uniqid + 拡張子)
$newFilename = uniqid() . '.' . $extension;
// 保存先のパスを生成
$uploadedPath = 'emojiimage/' . $newFilename;
// ファイルを移動
$result = move_uploaded_file($uploadedFile['tmp_name'], '../'.$uploadedPath);
// EXIF削除
delete_exif($extension2, $uploadedPath2);
if ($result) {
$emoji_path = $uploadedPath; // 保存されたファイルのパスを使用
} else {
$errnum = $uploadedFile['error'];
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
}
}else{
$error_message[] = '画像を選択してください';
}
$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=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
$query = $dbh->prepare('SELECT * FROM emoji WHERE emojiname = :emojiname limit 1');
$query->execute(array(':emojiname' => $emojiname));
$result = $query->fetch();
// IDの入力チェック
if( empty($emojiname) ) {
$error_message[] = '絵文字IDを入力してください!(EMOJI_ID_INPUT_PLEASE)';
} else {
// 文字数を確認
if( 20 < mb_strlen($emojiname, 'UTF-8') ) {
$error_message[] = 'IDは20文字以内で入力してください。(EMOJI_ID_OVER_MAX_COUNT)';
}
if($result > 0){
$error_message[] = 'このID('.$emojiname.')は既に使用されています。他のIDを作成してください。(EMOJI_ID_SHIYOUZUMI)'; //このE-mailは既に使用されています。
}
}
if( empty($error_message) ) {
// 書き込み日時を取得
$datetime = date("Y-m-d H:i:s");
// トランザクション開始
$pdo->beginTransaction();
try {
// SQL作成
$stmt = $pdo->prepare("INSERT INTO emoji (emojifile, emojiname, emojiinfo, emojidate) VALUES ( :emojifile, :emojiname, :emojiinfo, :emojidate)");
$stmt->bindValue(':emojifile', $emoji_path, PDO::PARAM_STR);
// 値をセット
$stmt->bindParam( ':emojiname', $emojiname, PDO::PARAM_STR);
$stmt->bindParam( ':emojiinfo', $emojiinfo, PDO::PARAM_STR);
$stmt->bindParam( ':emojidate', $datetime, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->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[] = '登録に失敗しました。(REGISTERED_DAME)';
}
// プリペアドステートメントを削除
$stmt = null;
}
}
require('../logout/logout.php');
// データベースの接続を閉じる
$pdo = null;
?>
<!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="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>絵文字登録 - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?></title>
</head>
<body>
<?php require('../require/leftbox.php');?>
<main>
<div class="admin_settings">
<?php require('settings_left_menu.php');?>
<div class="admin_right">
<?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>絵文字登録です。</p>
<div id="wrap">
<label class="irobutton" for="file_upload">ファイル選択
<input type="file" id="file_upload" name="image" >
</label>
</div>
<!--ユーザーネーム関係-->
<div>
<p>EmojiID</p>
<input id="username" onInput="checkForm(this)" placeholder="kusa" class="inbox" type="text" name="emojiname" value="<?php if( !empty($_SESSION['emojiname']) ){ echo htmlspecialchars( $_SESSION['emojiname'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<div>
<p>この絵文字について</p>
<input id="username" placeholder="くさデス" class="inbox" type="text" name="emojiinfo" value="<?php if( !empty($_SESSION['emojiinfo']) ){ echo htmlspecialchars( $_SESSION['emojiinfo'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<div>
<input type="submit" class = "irobutton" name="btn_submit" value="登録">
</div>
</form>
</div>
</div>
</main>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
<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(){
// ファイルが選択されたら実行
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>
</html>
+4 -4
View File
@@ -262,7 +262,7 @@ if( !empty($_POST['code_btn_submit']) ) {
header("Location:".$url.""); header("Location:".$url."");
exit; exit;
} else { } else {
$error_message[] = '発行に失敗しました。'; $error_message[] = '発行に失敗しました。(REGISTERED_DAME)';
} }
// プリペアドステートメントを削除 // プリペアドステートメントを削除
@@ -274,10 +274,10 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+3 -3
View File
@@ -261,10 +261,10 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+3 -3
View File
@@ -283,10 +283,10 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
+4 -4
View File
@@ -268,10 +268,10 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
@@ -311,7 +311,7 @@ require('../logout/logout.php');
<div> <div>
<p>投稿の最大文字数</p> <p>投稿の最大文字数</p>
<div class="p2">ここで設定した文字数までの投稿が可能です。<br>なお、データベースより最大文字数を設定している場合そちらが優先されて使用されます。<br>1文字から16777216文字の間で設定が可能です。</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 htmlspecialchars(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 htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8'); } ?>">
</div> </div>
+19 -6
View File
@@ -214,10 +214,10 @@ require('../logout/logout.php');
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
@@ -242,11 +242,24 @@ require('../logout/logout.php');
<div class="admin_right"> <div class="admin_right">
<div class="formarea"> <div class="formarea">
<h1>サーバー概要</h1> <h1>サーバー概要</h1>
<?php if( !empty(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8')) ){ ?> <!--(サーバーアイコン)-->
<div class="servericon"> <?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
<img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>"> <div class="serverhead">
<img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_head"], ENT_QUOTES, 'UTF-8'); ?>">
</div> </div>
<?php }?> <?php }?>
<?php if( !empty($serversettings["serverinfo"]["server_icon"]) ){ ?>
<div class="servericon">
<?php if( !empty($serversettings["serverinfo"]["server_head"]) ){ ?>
<div class="up">
<img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
</div>
<?php }else{?>
<img src="<?php echo htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'); ?>">
<?php }?>
</div>
<?php }?>
<!--(サーバーアイコンここまで)-->
<p>サーバー名</p> <p>サーバー名</p>
<p><?php if( !empty(htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8')) ){ echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8'); } ?></p> <p><?php if( !empty(htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8')) ){ echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8'); } ?></p>
<hr> <hr>
+363
View File
@@ -0,0 +1,363 @@
<?php
$serversettings_file = "../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
$serverstopfile = "../server/serverstop.txt";
$domain = $_SERVER['HTTP_HOST'];
if(!empty(file_get_contents($serverstopfile))){
$serverstop = htmlspecialchars(file_get_contents($serverstopfile), ENT_QUOTES, 'UTF-8');
}else{
$serverstop = "";
}
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime,10,36);
}
function random_code($length = 8){
return substr(str_shuffle('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, $length);
}
// 変数の初期化
$datetime = array();
$user_name = null;
$message = array();
$message_data = null;
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
require('../db.php');
//phpmailer--------------------------------------------
require('plugin_settings/phpmailer_settings.php');
require('plugin_settings/phpmailer_sender.php');
//------------------------------------------------------
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=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
} catch(PDOException $e) {
// 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
// セッションに値をセット
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
$myblocklist = htmlentities($res["blocklist"]);
$myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, [
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] == $res["userid"]){
// セッションに値をセット
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット
$username = htmlentities($res['username']); // クッキーから取得した値をセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
$myblocklist = htmlentities($res["blocklist"]);
$myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('username', $username,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('loginid', $res["loginid"],[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
setcookie('admin_login', true,[
'expires' => time() + 60 * 60 * 24 * 14,
'path' => '/',
'samesite' => 'lax',
'secure' => true,
'httponly' => true,
]);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
if(!($res["admin"] === "yes")){
header("Location: ../login.php");
exit;
}
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
$notiQuery->bindValue(':userid', $userid);
$notiQuery->execute();
$notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
$notificationcount = $notiData['notification_count'];
if( !empty($_POST['btn_submit']) ) {
$N_MAIL_ONOFF = $_POST['mailchks_onoff'];
$N_MAIL_ADDS = $_POST['N_MAIL_ADDS'];
$N_MAIL_HOST = $_POST['N_MAIL_HOST'];
$N_MAIL_PORT = $_POST['N_MAIL_PORT'];
$N_MAIL_USER = $_POST['N_MAIL_USER'];
$N_MAIL_PASS = $_POST['N_MAIL_PASS'];
$N_MAIL_SSL_ = $_POST['ssl_tls_none'];
$New_Mail_Settings = "
<?php // メールサーバーの情報
define( 'MAIL_CHKS', '".htmlentities($N_MAIL_ONOFF)."');// trueならPHPMailerが有効
define( 'MAIL_ADDS', '".htmlentities($N_MAIL_ADDS)."');
define( 'MAIL_HOST', '".htmlentities($N_MAIL_HOST)."');
define( 'MAIL_PORT', '".htmlentities($N_MAIL_PORT)."');
define( 'MAIL_USER', '".htmlentities($N_MAIL_USER)."');
define( 'MAIL_PASS', '".htmlentities($N_MAIL_PASS)."');
define( 'MAIL_SSL_', '".htmlentities($N_MAIL_SSL_)."');
?>
";
//設定上書き
$file = fopen('plugin_settings/phpmailer_settings.php', 'w');
$data = $New_Mail_Settings;
fputs($file, $data);
fclose($file);
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:".$url."");
exit;
}
if( !empty($_POST['testmail_send_btn_submit']) ) {
$test_mail_adds = $_POST['test_sender_adds'];
$mail_title = "Test email";
$mail_text = "これはuwuzuのテストメールです。 問題なく受信できていますか?";
$error_message = send_html_mail($test_mail_adds,$mail_title,$mail_text,"../");
}
require('../logout/logout.php');
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js"></script>
<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="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>プラグイン - <?php echo htmlspecialchars($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; ?>
<div class="admin_settings">
<?php require('settings_left_menu.php');?>
<div class="admin_right">
<form class="formarea" enctype="multipart/form-data" method="post">
<h1>プラグイン</h1>
<p>PHPMailerなどとの連携が可能です。</p>
<div>
<p>自動メールプラグイン</p>
<div class="p2">PHPMailerと連携し、パスワードリセット時やログイン通知などを自動送信することができます。<br>SMTP送信のみ対応です。<br><b>pluginフォルダに解凍済みのPHPMailerのファイル一式が入っていることが必須要件になります。</b><br>plugin/PHPMailer/README.MDなど一式</div>
<p>自動メールプラグインのオンオフ</p>
<div class="switch_button">
<?php if(!empty(MAIL_CHKS && MAIL_CHKS == "true")){?>
<input id="mailchks_onoff" class="switch_input" type='checkbox' name="mailchks_onoff" value="true" checked/>
<label for="mailchks_onoff" class="switch_label"></label>
<?php }else{?>
<input id="mailchks_onoff" class="switch_input" type='checkbox' name="mailchks_onoff" value="true" />
<label for="mailchks_onoff" class="switch_label"></label>
<?php }?>
</div>
<div id="mail_plugin">
<p>PHPMailer - メールサーバー設定</p>
<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 htmlspecialchars(MAIL_ADDS, ENT_QUOTES, 'UTF-8'); } ?>">
<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 htmlspecialchars(MAIL_HOST, ENT_QUOTES, 'UTF-8'); } ?>">
<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 htmlspecialchars(MAIL_PORT, ENT_QUOTES, 'UTF-8'); } ?>">
<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 htmlspecialchars(MAIL_USER, ENT_QUOTES, 'UTF-8'); } ?>">
<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 htmlspecialchars(MAIL_PASS, ENT_QUOTES, 'UTF-8'); } ?>">
<div class="p2">暗号化設定</div>
<div class="radio_btn_zone">
<input type="radio" name="ssl_tls_none" value="SSL" id="SSL" class="radiobtn_input" <?php if(!empty(MAIL_SSL_ && MAIL_SSL_ == "SSL")){echo "checked";}?>>
<label for="SSL" class="radiobtn_label">SSL</label>
<input type="radio" name="ssl_tls_none" value="TLS" id="TLS" class="radiobtn_input" <?php if(!empty(MAIL_SSL_ && MAIL_SSL_ == "TLS")){echo "checked";}?>>
<label for="TLS" class="radiobtn_label">TLS</label>
<input type="radio" name="ssl_tls_none" value="NONE" id="NONE" class="radiobtn_input" <?php if(!empty(MAIL_SSL_ && MAIL_SSL_ == "NONE")){echo "checked";}?>>
<label for="NONE" class="radiobtn_label">なし</label>
</div>
</div>
</div>
<input type="submit" class = "irobutton" name="btn_submit" value="保存&更新">
</form>
<?php if(!empty(MAIL_CHKS && MAIL_CHKS == "true")){?>
<form class="formarea" enctype="multipart/form-data" method="post">
<div id="mail_plugin_chk">
<p>メールテスト送信</p>
<input id="mail_plugin" placeholder="admin@localhost" class="inbox" type="text" name="test_sender_adds" value="">
<input type="submit" class = "irobutton" name="testmail_send_btn_submit" value="テスト送信">
</div>
</form>
<?php }?>
</div>
</div>
</main>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
</html>
<script>
$(function(){
$("input"). keydown(function(e) {
if ((e.which && e.which === 13) || (e.keyCode && e.keyCode === 13)) {
return false;
} else {
return true;
}
});
});
if ($("#mailchks_onoff").prop("checked")) {
$('#mail_plugin').show();
$('#mail_plugin_chk').show();
}else{
$('#mail_plugin').hide();
$('#mail_plugin_chk').hide();
}
$('#mailchks_onoff').change(function(){
$('#mail_plugin').toggle();
$('#mail_plugin_chk').toggle();
});
</script>
@@ -0,0 +1,105 @@
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\SMTP;
function send_html_mail($mailadds,$mailtitle,$mailtext,$server_file_backslash){
if(!empty(MAIL_CHKS && MAIL_CHKS == "true")){
if(file_exists("".$server_file_backslash."plugin/PHPMailer/")){
require(''.$server_file_backslash.'plugin/PHPMailer/src/PHPMailer.php');
require(''.$server_file_backslash.'plugin/PHPMailer/src/Exception.php');
require(''.$server_file_backslash.'plugin/PHPMailer/src/SMTP.php');
}else{
$error_message[] = "pluginフォルダにPHPMailerがありません<br>ファイル名などをお間違いではありませんか?(PLUGIN_NOT_FOUND)";
}
}else{
$error_message[] = "メール送信プラグインは無効です。(PLUGIN_MUKOU)";
}
$serversettings = parse_ini_file("".$server_file_backslash."server/serversettings.ini", true);
$domain = $_SERVER['HTTP_HOST'];
$mail_adds = htmlentities($mailadds);
$mail_title = htmlentities($mailtitle);
$x_mailtext = htmlentities($mailtext);
$mail_text = str_replace( ' ', '<br>', $x_mailtext );
if(!(filter_var($mail_adds, FILTER_VALIDATE_EMAIL))){
$error_message[] = 'メールアドレスが正しくありません...(MAILADDS_CHECK_DAME)';
}
if(empty($error_message)){
if(htmlentities(MAIL_SSL_) == "NONE"){
$Mail_SSL = false;
}elseif(htmlentities(MAIL_SSL_) == "SSL"){
$Mail_SSL = "ssl";
}elseif(htmlentities(MAIL_SSL_) == "TLS"){
$Mail_SSL = "tls";
}
$s_name = htmlspecialchars($serversettings['serverinfo']['server_name'], ENT_QUOTES, 'UTF-8');
$now_date = date("Y-m-d H:i:s");
$logo_path = htmlspecialchars($serversettings["serverinfo"]["server_logo_login"], ENT_QUOTES, 'UTF-8');
if(empty($logo_path)){
$logo_path = "https://".$domain."/img/uwuzulogo.svg";
}
mb_language('uni');
mb_internal_encoding('UTF-8');
$mail = new PHPMailer(true);
$mail->CharSet = 'utf-8';
try {
// SMTPサーバの設定
$mail->isSMTP(); // SMTPの使用宣言
$mail->Host = htmlentities(MAIL_HOST); // SMTPサーバーを指定
$mail->SMTPAuth = true; // SMTP authenticationを有効化
$mail->Username = htmlentities(MAIL_USER); // SMTPサーバーのユーザ名
$mail->Password = htmlentities(MAIL_PASS); // SMTPサーバーのパスワード
$mail->SMTPSecure = $Mail_SSL; // 暗号化を有効(tls or ssl)無効の場合はfalse
$mail->Port = (int)htmlentities(MAIL_PORT); // TCPポートを指定(tlsの場合は465や587)
$mail->setFrom(htmlentities(MAIL_ADDS), htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8')); // 送信者
$mail->addAddress(htmlentities($mail_adds)); // 宛先
$mail->addReplyTo(htmlspecialchars($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8'), 'お問い合わせ'); // 返信先
$mail->Sender = htmlspecialchars($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8'); // Return-path
// 送信内容設定
$mail->isHTML(true);
$mail->Subject = $mail_title;
$mail->Body = <<<EOD
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<div class="header" style="background-color:#FFC832; width:100%; height: 48px;">
<a href="https://{$domain}"><img src="{$logo_path}" style="height: 32px;width:auto;margin-top:8px; margin-left:12px; margin-bottom:8px;"></a>
</div>
<body style="width: 100%;">
<main>
<h1 style="margin-left:12px; margin-right:12px; font-family: 'BIZ UDPGothic', sans-serif; font-weight: bold;font-size: 32px;text-align: left;color: #252525;">{$mail_title}</h1>
<p style="margin-left:12px; margin-right:12px; font-family: 'BIZ UDPGothic', sans-serif; font-weight: normal;font-size: 16px; line-height: 125%; text-align: left;color: #252525;">{$mail_text}</p>
<a href="https://{$domain}" style="margin-left:12px; margin-right:12px; font-family: 'BIZ UDPGothic', sans-serif; font-weight: normal;font-size: 16px;text-align: left;color: #4e4428;">{$s_name}</a>
<p style="margin-right:12px; margin-left:12px; font-family: 'BIZ UDPGothic', sans-serif; font-weight: normal;font-size: 16px;text-align: left;color: #252525;">{$now_date}</p>
</main>
</body
</html>
EOD;
// 送信
$mail->send();
} catch (Exception $e) {
// エラーの場合
$error_message[] = "PHPMailer Error:<br> ".$mail->ErrorInfo."";
}
}
return $error_message;
}
?>
@@ -0,0 +1,12 @@
<?php // メールサーバーの情報
define( 'MAIL_CHKS', 'false');// trueならPHPMailerが有効
define( 'MAIL_ADDS', '');
define( 'MAIL_HOST', '');
define( 'MAIL_PORT', '');
define( 'MAIL_USER', '');
define( 'MAIL_PASS', '');
define( 'MAIL_SSL_', '');
?>
+124 -23
View File
@@ -195,16 +195,16 @@ if( !empty($_POST['role_btn_submit']) ) {
$result3 = $query->fetch(); $result3 = $query->fetch();
if(empty($rolename)){ if(empty($rolename)){
$error_message[] = "ロール名が入力されていません。"; $error_message[] = "ロール名が入力されていません。(INPUT_PLEASE)";
} }
if(empty($roleid)){ if(empty($roleid)){
$error_message[] = "ロールのidが入力されていません。"; $error_message[] = "ロールのidが入力されていません。(ROLE_ID_INPUT_PLEASE)";
}elseif($result3 > 0){ }elseif($result3 > 0){
$error_message[] = 'このロールのid('.$roleid.')は既に使用されています。他のidを作成してください。'; $error_message[] = 'このロールのid('.$roleid.')は既に使用されています。他のidを作成してください。(ROLE_ID_SHIYOUZUMI)';
} }
if(empty($rolecolor)){ if(empty($rolecolor)){
$error_message[] = "ロールの色が入力されていません。"; $error_message[] = "ロールの色が入力されていません。(INPUT_PLEASE)";
} }
if (!empty($pdo)) { if (!empty($pdo)) {
@@ -260,17 +260,26 @@ if( !empty($_POST['role_del']) ) {
$deleteQuery->bindValue(':roleid', $role_id, PDO::PARAM_STR); $deleteQuery->bindValue(':roleid', $role_id, PDO::PARAM_STR);
$res = $deleteQuery->execute(); $res = $deleteQuery->execute();
try{ // ロールを削除したい全てのアカウントを取得
$query = $pdo->prepare("SELECT * FROM account WHERE role LIKE :pattern1 OR role LIKE :pattern2 OR role LIKE :pattern3");
$query->bindValue(':pattern1', "%,$role_id,%", PDO::PARAM_STR);
$query->bindValue(':pattern2', "%,$role_id", PDO::PARAM_STR);
$query->bindValue(':pattern3', "$role_id,%", PDO::PARAM_STR);
$query->execute();
$accounts = $query->fetchAll();
foreach ($accounts as $account) {
// フォローの更新 // フォローの更新
$updateFollowQuery = $pdo->prepare("UPDATE account SET role = REPLACE(role, :roleid, '') WHERE role LIKE :pattern"); if (strpos($account['role'], ",$role_id,") !== false || strpos($account['role'], ",$role_id") !== false || strpos($account['role'], "$role_id,") !== false) {
$updateFollowQuery->bindValue(':roleid', ",$role_id", PDO::PARAM_STR); $delrole_roleList = explode(',', $account['role']);
$updateFollowQuery->bindValue(':pattern', "%,$role_id%", PDO::PARAM_STR); $delrole_roleList = array_diff($delrole_roleList, array($role_id));
$res = $updateFollowQuery->execute(); $new_delrole_roleList = implode(',', $delrole_roleList);
} catch (Exception $e) { $updateroleQuery = $pdo->prepare("UPDATE account SET role = :role WHERE userid = :userid");
$updateroleQuery->bindValue(':role', $new_delrole_roleList, PDO::PARAM_STR);
// エラーが発生した時はロールバック $updateroleQuery->bindValue(':userid', $account['userid'], PDO::PARAM_STR);
$pdo->rollBack(); $updateroleQuery->execute();
}
} }
} catch (Exception $e) { } catch (Exception $e) {
@@ -310,7 +319,7 @@ if( !empty($_POST['send_add_role_submit']) ) {
if($result4 > 0 && $result5 > 0){ if($result4 > 0 && $result5 > 0){
if (false !== strstr($result4["role"], ','.$add_roleid)) { if (false !== strstr($result4["role"], ','.$add_roleid)) {
$error_message[] = "既に".$add_roleid."は付与済みです。"; $error_message[] = "既に".$add_roleid."は付与済みです。(ROLE_HUYOZUMI)";
} }
$New_role_id = $result4["role"] . ',' . $add_roleid; $New_role_id = $result4["role"] . ',' . $add_roleid;
@@ -342,7 +351,54 @@ if( !empty($_POST['send_add_role_submit']) ) {
$stmt = null; $stmt = null;
} }
}else{ }else{
$error_message[] = "ロールがないまたはユーザーがいません。"; $error_message[] = "ロールがないまたはユーザーがいません。(ROLE_OR_USER_NOT_FOUND)";
}
}
if( !empty($_POST['send_del_role_submit']) ) {
$del_userid = htmlentities($_POST['del_userid']);
$del_roleid = htmlentities($_POST['del_roleid']);
$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->execute(array(':userid' => $del_userid));
$result4 = $query->fetch();
$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->execute(array(':roleid' => $del_roleid));
$result5 = $query->fetch();
if($result4 > 0 && $result5 > 0){
$userQuery = $dbh->prepare("SELECT role FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $del_userid);
$userQuery->execute();
$userData = $userQuery->fetch();
// ロール剥奪ボタンが押された場合の処理
$roleList = explode(',', $userData['role']);
if (in_array($del_roleid, $roleList)) {
// 自分が相手をフォローしている場合、相手のfollowerカラムと自分のfollowカラムを更新
$roleList = array_diff($roleList, array($del_roleid));
$newroleList = implode(',', $roleList);
// UPDATE文を実行してフォロー情報を更新
$updateQuery = $pdo->prepare("UPDATE account SET role = :role WHERE userid = :userid");
$updateQuery->bindValue(':role', $newroleList, PDO::PARAM_STR);
$updateQuery->bindValue(':userid', $del_userid, PDO::PARAM_STR);
$res = $updateQuery->execute();
if ($res) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:" . $url);
exit;
} else {
$error_message[] = '更新に失敗しました。(REGISTERED_DAME)';
}
$stmt = null;
}
}else{
$error_message[] = "ロールがないまたはユーザーがいません。(ROLE_OR_USER_NOT_FOUND)";
} }
} }
@@ -363,10 +419,10 @@ if (!empty($pdo)) {
<html lang="ja"> <html lang="ja">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css?<?php echo date('Ymd-Hi'); ?>"> <link rel="stylesheet" href="../css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="../js/unsupported.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/unsupported.js"></script>
<script src="../js/console_notice.js?<?php echo date('Ymd-Hi'); ?>"></script> <script src="../js/console_notice.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png"> <link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
@@ -405,7 +461,7 @@ if (!empty($pdo)) {
<div> <div>
<p>ロールの色</p> <p>ロールの色</p>
<div class="p2">ロールの色です。<br>HEXコードで入力してください。(#はつけないでください。)</div> <div class="p2">ロールの色です。<br>HEXコードで入力してください。(#はつけないでください。)</div>
<input id="rolecolor" placeholder="256238" class="inbox" type="text" name="rolecolor" maxlength="6" value=""> <input id="rolecolor" onInput="checkForm(this)" placeholder="256238" class="inbox" type="text" name="rolecolor" maxlength="6" value="">
</div> </div>
<input type="submit" class = "irobutton" name="role_btn_submit" value="作成"> <input type="submit" class = "irobutton" name="role_btn_submit" value="作成">
@@ -416,6 +472,10 @@ if (!empty($pdo)) {
<p>特定のユーザーにロール付与するときに使用してください。</p> <p>特定のユーザーにロール付与するときに使用してください。</p>
<button id="addrole" class="irobutton">付与</button> <button id="addrole" class="irobutton">付与</button>
<hr> <hr>
<h1>ロール剥奪</h1>
<p>特定のユーザーからロールを剥奪する時に使用してください。</p>
<button id="delrole" class="irobutton">剥奪</button>
<hr>
<h1>ロール一覧</h1> <h1>ロール一覧</h1>
<?php if(!(empty($roles))){?> <?php if(!(empty($roles))){?>
<?php foreach ($roles as $value) {?> <?php foreach ($roles as $value) {?>
@@ -454,9 +514,9 @@ if (!empty($pdo)) {
<p>ロール付与先のユーザーidと付与したいロールのidを入力してください。<br>なお、現時点ではここからロールの剥奪は出来ませんのでご注意ください。</p> <p>ロール付与先のユーザーidと付与したいロールのidを入力してください。<br>なお、現時点ではここからロールの剥奪は出来ませんのでご注意ください。</p>
<form method="post" id="deleteForm"> <form method="post" id="deleteForm">
<div class="p2">付与先ユーザーid</div> <div class="p2">付与先ユーザーid</div>
<input type="text" id="add_userid" class="inbox" placeholder="admin" name="add_userid" value=""> <input type="text" id="add_userid" onInput="checkForm(this)" class="inbox" placeholder="admin" name="add_userid" value="">
<div class="p2">付与するロールid</div> <div class="p2">付与するロールid</div>
<input type="text" id="add_roleid" class="inbox" placeholder="role" name="add_roleid" value=""> <input type="text" id="add_roleid" onInput="checkForm(this)" class="inbox" placeholder="role" name="add_roleid" value="">
<div class="btn_area"> <div class="btn_area">
<input type="submit" id="deleteButton" class="fbtn_no" name="send_add_role_submit" value="付与"> <input type="submit" id="deleteButton" class="fbtn_no" name="send_add_role_submit" value="付与">
<input type="button" id="cancelButton" class="fbtn" value="キャンセル"> <input type="button" id="cancelButton" class="fbtn" value="キャンセル">
@@ -465,14 +525,30 @@ if (!empty($pdo)) {
</div> </div>
</div> </div>
<div id="account_delrole_Modal" class="modal">
<div class="modal-content">
<h1>ロール付与</h1>
<p>ロール付与先のユーザーidと付与したいロールのidを入力してください。<br>なお、現時点ではここからロールの剥奪は出来ませんのでご注意ください。</p>
<form method="post" id="delrole_Form">
<div class="p2">剥奪先ユーザーid</div>
<input type="text" id="del_userid" onInput="checkForm(this)" class="inbox" placeholder="admin" name="del_userid" value="">
<div class="p2">剥奪するロールid</div>
<input type="text" id="del_roleid" onInput="checkForm(this)" class="inbox" placeholder="role" name="del_roleid" value="">
<div class="btn_area">
<input type="submit" id="delrole_deleteButton" class="fbtn_no" name="send_del_role_submit" value="剥奪">
<input type="button" id="delrole_cancelButton" class="fbtn" value="キャンセル">
</div>
</form>
</div>
</div>
</main> </main>
<?php require('../require/rightbox.php');?> <?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?> <?php require('../require/botbox.php');?>
</body> </body>
<script> <script type="text/javascript">
$(document).ready(function() {
function checkForm(inputElement) { function checkForm(inputElement) {
var str = inputElement.value; var str = inputElement.value;
while (str.match(/[^A-Za-z\d_]/)) { while (str.match(/[^A-Za-z\d_]/)) {
@@ -507,7 +583,32 @@ $(document).ready(function() {
}, 150); }, 150);
}); });
}); });
var modal2 = document.getElementById('account_delrole_Modal');
var delrole_deleteButton = document.getElementById('delrole_deleteButton');
var delrole_cancelButton = document.getElementById('delrole_cancelButton'); // 追加
var modalMain = $('.modal-content');
document.getElementById("delrole").addEventListener('click', function(){
modal2.style.display = 'block';
modalMain.addClass("slideUp");
modalMain.removeClass("slideDown");
delrole_deleteButton.addEventListener('click', () => {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
modal2.style.display = 'none';
}, 150);
}); });
delrole_cancelButton.addEventListener('click', () => { // 追加
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
modal2.style.display = 'none';
}, 150);
});
});
</script> </script>
</html> </html>

Some files were not shown because too many files have changed in this diff Show More