mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-04 19:14:41 +00:00
uwuzu v1.4.12 Funium
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
||||||
header("Content-Type: application/xml; charset=UTF-8");
|
header("Content-Type: application/xml; charset=UTF-8");
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
||||||
header("Content-Type: application/activity+json; charset=utf-8");
|
header("Content-Type: application/activity+json; charset=utf-8");
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
||||||
header("Content-Type: application/jrd+json; charset=utf-8");
|
header("Content-Type: application/jrd+json; charset=utf-8");
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ $banurl = array_filter(preg_split("/\r\n|\n|\r/", $banurl_info));
|
|||||||
require('../db.php');
|
require('../db.php');
|
||||||
|
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['abitext'])) && safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id']))) {
|
if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['abitext'])) && safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id']))) {
|
||||||
$userid = safetext($_POST['userid']);
|
$userid = safetext($_POST['userid']);
|
||||||
|
|||||||
+2
-2
@@ -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);
|
||||||
|
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
||||||
header("Content-Type: application/activity+json; charset=utf-8");
|
header("Content-Type: application/activity+json; charset=utf-8");
|
||||||
@@ -10,8 +12,6 @@ if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
|||||||
|
|
||||||
$domain = $_SERVER['HTTP_HOST'];
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
|
||||||
require('../db.php');
|
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
|
|||||||
+7
-42
@@ -50,49 +50,14 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset($_COOKIE['loginid']) && isset($_SESSION['userid'])) {
|
//ログイン認証---------------------------------------------------
|
||||||
$options = array(
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
// SQL実行失敗時に例外をスルー
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
if(!($is_login === false)){
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
header("Location: /home/");
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
exit;
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_SESSION['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_SESSION['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true && isset($_COOKIE['loginid']) && isset($_COOKIE['userid'])) {
|
|
||||||
$options = array(
|
|
||||||
// SQL実行失敗時に例外をスルー
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_COOKIE['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_COOKIE['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
require_once 'authcode/GoogleAuthenticator.php';
|
require_once 'authcode/GoogleAuthenticator.php';
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ require('../db.php');
|
|||||||
//関数呼び出し
|
//関数呼び出し
|
||||||
//- EXIF
|
//- EXIF
|
||||||
require('../function/function.php');
|
require('../function/function.php');
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
$serversettings_file = "../server/serversettings.ini";
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
$softwarefile = "../server/uwuzuinfo.txt";
|
$softwarefile = "../server/uwuzuinfo.txt";
|
||||||
$softwaredata = file_get_contents($softwarefile);
|
$softwaredata = file_get_contents($softwarefile);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
$softwarefile = "../server/uwuzuinfo.txt";
|
$softwarefile = "../server/uwuzuinfo.txt";
|
||||||
$softwaredata = file_get_contents($softwarefile);
|
$softwaredata = file_get_contents($softwarefile);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
$softwarefile = "../server/uwuzuinfo.txt";
|
$softwarefile = "../server/uwuzuinfo.txt";
|
||||||
$softwaredata = file_get_contents($softwarefile);
|
$softwaredata = file_get_contents($softwarefile);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
$serversettings_file = "../server/serversettings.ini";
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ require('../../db.php');
|
|||||||
//関数呼び出し
|
//関数呼び出し
|
||||||
//- Base64_mime
|
//- Base64_mime
|
||||||
require('../../function/function.php');
|
require('../../function/function.php');
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
||||||
$max_ueuse_rate_limit = 60;
|
$max_ueuse_rate_limit = 60;
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ require('../../db.php');
|
|||||||
//関数呼び出し
|
//関数呼び出し
|
||||||
//- Base64_mime
|
//- Base64_mime
|
||||||
require('../../function/function.php');
|
require('../../function/function.php');
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
||||||
$max_ueuse_rate_limit = 60;
|
$max_ueuse_rate_limit = 60;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
$domain = $_SERVER['HTTP_HOST'];
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
require('../../db.php');
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
@@ -9,8 +11,6 @@ function random_iv($length = 16){
|
|||||||
|
|
||||||
$domain = $_SERVER['HTTP_HOST'];
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
|
|
||||||
require('../db.php');
|
|
||||||
|
|
||||||
$datetime = array();
|
$datetime = array();
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
@@ -23,9 +24,6 @@ for( $i=0;$i<$cnt;$i++ ){
|
|||||||
$uwuzuinfo[$i] = ($softwaredata[$i]);
|
$uwuzuinfo[$i] = ($softwaredata[$i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
require('../db.php');
|
|
||||||
|
|
||||||
$datetime = array();
|
$datetime = array();
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ require('../../db.php');
|
|||||||
//関数呼び出し
|
//関数呼び出し
|
||||||
//- Base64_mime
|
//- Base64_mime
|
||||||
require('../../function/function.php');
|
require('../../function/function.php');
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
||||||
$max_ueuse_rate_limit = 60;
|
$max_ueuse_rate_limit = 60;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
$domain = $_SERVER['HTTP_HOST'];
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
require('../../db.php');
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
$domain = $_SERVER['HTTP_HOST'];
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
require('../../db.php');
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
$domain = $_SERVER['HTTP_HOST'];
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
require('../../db.php');
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
$domain = $_SERVER['HTTP_HOST'];
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
require('../../db.php');
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
$domain = $_SERVER['HTTP_HOST'];
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
require('../../db.php');
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
$domain = $_SERVER['HTTP_HOST'];
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
require('../../db.php');
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ require('../../db.php');
|
|||||||
//関数呼び出し
|
//関数呼び出し
|
||||||
//- Base64_mime
|
//- Base64_mime
|
||||||
require('../../function/function.php');
|
require('../../function/function.php');
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
||||||
$max_ueuse_rate_limit = 60;
|
$max_ueuse_rate_limit = 60;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
$domain = $_SERVER['HTTP_HOST'];
|
$domain = $_SERVER['HTTP_HOST'];
|
||||||
require('../../db.php');
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ require('../../db.php');
|
|||||||
//関数呼び出し
|
//関数呼び出し
|
||||||
//- Base64_mime
|
//- Base64_mime
|
||||||
require('../../function/function.php');
|
require('../../function/function.php');
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
||||||
$max_ueuse_rate_limit = 60;
|
$max_ueuse_rate_limit = 60;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$serversettings_file = "../../server/serversettings.ini";
|
$serversettings_file = "../../server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
|
|||||||
+7
-42
@@ -47,49 +47,14 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset($_COOKIE['loginid']) && isset($_SESSION['userid'])) {
|
//ログイン認証---------------------------------------------------
|
||||||
$options = array(
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
// SQL実行失敗時に例外をスルー
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
if(!($is_login === false)){
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
header("Location: /home/");
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
exit;
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_SESSION['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_SESSION['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true && isset($_COOKIE['loginid']) && isset($_COOKIE['userid'])) {
|
|
||||||
$options = array(
|
|
||||||
// SQL実行失敗時に例外をスルー
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_COOKIE['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_COOKIE['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
$_SESSION['userid'] = $userid;
|
$_SESSION['userid'] = $userid;
|
||||||
|
|||||||
+41
-98
@@ -46,55 +46,21 @@ try {
|
|||||||
);
|
);
|
||||||
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
|
||||||
|
$userData = getUserData($pdo, $userid);
|
||||||
} catch(PDOException $e) {
|
} catch(PDOException $e) {
|
||||||
|
|
||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset($_COOKIE['loginid']) && isset($_SESSION['userid'])) {
|
//ログイン認証---------------------------------------------------
|
||||||
$options = array(
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
// SQL実行失敗時に例外をスルー
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
if(!($is_login === false)){
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
header("Location: /home/");
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
exit;
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_SESSION['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_SESSION['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true && isset($_COOKIE['loginid']) && isset($_COOKIE['userid'])) {
|
|
||||||
$options = array(
|
|
||||||
// SQL実行失敗時に例外をスルー
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_COOKIE['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_COOKIE['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
$useragent = safetext($_SERVER['HTTP_USER_AGENT']);
|
$useragent = safetext($_SERVER['HTTP_USER_AGENT']);
|
||||||
@@ -180,41 +146,30 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setcookie('userid', $userid,[
|
setcookie('loginid', $userData["loginid"],[
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
'expires' => time() + 60 * 60 * 24 * 28,
|
||||||
'path' => '/',
|
'path' => '/',
|
||||||
'samesite' => 'lax',
|
'samesite' => 'lax',
|
||||||
'secure' => true,
|
'secure' => true,
|
||||||
'httponly' => true,
|
'httponly' => true,
|
||||||
]);
|
]);
|
||||||
setcookie('loginid', $row["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $row["username"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['loginid'] = $row["loginid"];
|
|
||||||
|
|
||||||
$_SESSION['username'] = $row["username"];
|
$userEncKey = GenUserEnckey($userData["datetime"]);
|
||||||
$_SESSION['password'] = "";
|
$userLoginKey = hash_hmac('sha256', $userData["loginid"], $userEncKey);
|
||||||
|
setcookie('loginkey', $userLoginKey,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 28,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$_SESSION['userid'] = $userid;
|
||||||
|
$_SESSION['loginid'] = $userData["loginid"];
|
||||||
|
$_SESSION['loginkey'] = $userLoginKey;
|
||||||
|
|
||||||
|
$_SESSION['username'] = $username;
|
||||||
|
$_SESSION['password'] = null;
|
||||||
|
|
||||||
// リダイレクト先のURLへ転送する
|
// リダイレクト先のURLへ転送する
|
||||||
$url = '/home';
|
$url = '/home';
|
||||||
@@ -292,41 +247,29 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setcookie('userid', $userid,[
|
setcookie('loginid', $userData["loginid"],[
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
'expires' => time() + 60 * 60 * 24 * 28,
|
||||||
'path' => '/',
|
'path' => '/',
|
||||||
'samesite' => 'lax',
|
'samesite' => 'lax',
|
||||||
'secure' => true,
|
'secure' => true,
|
||||||
'httponly' => true,
|
'httponly' => true,
|
||||||
]);
|
]);
|
||||||
setcookie('loginid', $row["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $row["username"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['loginid'] = $row["loginid"];
|
|
||||||
|
|
||||||
$_SESSION['username'] = $row["username"];
|
$userEncKey = GenUserEnckey($userData["datetime"]);
|
||||||
|
$userLoginKey = hash_hmac('sha256', $userData["loginid"], $userEncKey);
|
||||||
|
setcookie('loginkey', $userLoginKey,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 28,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$_SESSION['userid'] = $userid;
|
||||||
|
$_SESSION['loginid'] = $userData["loginid"];
|
||||||
|
$_SESSION['loginkey'] = $userLoginKey;
|
||||||
|
|
||||||
|
$_SESSION['username'] = $username;
|
||||||
$_SESSION['password'] = null;
|
$_SESSION['password'] = null;
|
||||||
|
|
||||||
// リダイレクト先のURLへ転送する
|
// リダイレクト先のURLへ転送する
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ $res = null;
|
|||||||
$option = null;
|
$option = null;
|
||||||
$error_message = array();
|
$error_message = array();
|
||||||
|
|
||||||
$row["userid"] = array();
|
|
||||||
$row["password"] = array();
|
|
||||||
|
|
||||||
$ruserid = array();
|
$ruserid = array();
|
||||||
$rpassword = array();
|
$rpassword = array();
|
||||||
|
|
||||||
@@ -47,54 +44,17 @@ try {
|
|||||||
|
|
||||||
$userid = $_SESSION['userid'];
|
$userid = $_SESSION['userid'];
|
||||||
|
|
||||||
|
$userData = getUserData($pdo, $userid);
|
||||||
$options = array(
|
|
||||||
// SQL実行失敗時に例外をスルー
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
|
|
||||||
|
|
||||||
$result = $dbh->prepare("SELECT userid, username, profile, role FROM account WHERE userid = :userid");
|
|
||||||
|
|
||||||
$result->bindValue(':userid', $userid);
|
|
||||||
// SQL実行
|
|
||||||
$result->execute();
|
|
||||||
|
|
||||||
|
|
||||||
$row = $result->fetch(); // ここでデータベースから取得した値を $row に代入する
|
|
||||||
|
|
||||||
$username = $row["username"];
|
|
||||||
|
|
||||||
$role = $row["role"];
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------
|
|
||||||
|
|
||||||
$userQuery = $dbh->prepare("SELECT username, userid, loginid, profile, role, iconname FROM account WHERE userid = :userid");
|
|
||||||
$userQuery->bindValue(':userid', $userid);
|
|
||||||
$userQuery->execute();
|
|
||||||
$userData = $userQuery->fetch();
|
|
||||||
|
|
||||||
$roles = explode(',', $userData["role"]); // カンマで区切られたロールを配列に分割
|
$roles = explode(',', $userData["role"]); // カンマで区切られたロールを配列に分割
|
||||||
|
|
||||||
$roleDataArray = array();
|
$roleDataArray = array();
|
||||||
|
|
||||||
foreach ($roles as $roleId) {
|
foreach ($roles as $roleId) {
|
||||||
$rerole = $dbh->prepare("SELECT rolename, roleauth, rolecolor, roleeffect FROM role WHERE roleidname = :role");
|
$rerole = $pdo->prepare("SELECT rolename, roleauth, rolecolor, roleeffect FROM role WHERE roleidname = :role");
|
||||||
$rerole->bindValue(':role', $roleId);
|
$rerole->bindValue(':role', $roleId);
|
||||||
$rerole->execute();
|
$rerole->execute();
|
||||||
$roleDataArray[$roleId] = $rerole->fetch();
|
$roleDataArray[$roleId] = $rerole->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} catch(PDOException $e) {
|
} catch(PDOException $e) {
|
||||||
|
|
||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
@@ -192,13 +152,6 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $userData["loginid"],[
|
setcookie('loginid', $userData["loginid"],[
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
'expires' => time() + 60 * 60 * 24 * 28,
|
||||||
'path' => '/',
|
'path' => '/',
|
||||||
@@ -206,14 +159,10 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
'secure' => true,
|
'secure' => true,
|
||||||
'httponly' => true,
|
'httponly' => true,
|
||||||
]);
|
]);
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
$userEncKey = GenUserEnckey($userData["datetime"]);
|
||||||
'path' => '/',
|
$userLoginKey = hash_hmac('sha256', $userData["loginid"], $userEncKey);
|
||||||
'samesite' => 'lax',
|
setcookie('loginkey', $userLoginKey,[
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
'expires' => time() + 60 * 60 * 24 * 28,
|
||||||
'path' => '/',
|
'path' => '/',
|
||||||
'samesite' => 'lax',
|
'samesite' => 'lax',
|
||||||
@@ -221,9 +170,9 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
'httponly' => true,
|
'httponly' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
$_SESSION['userid'] = $userid;
|
||||||
$_SESSION['loginid'] = $userData["loginid"];
|
$_SESSION['loginid'] = $userData["loginid"];
|
||||||
|
$_SESSION['loginkey'] = $userLoginKey;
|
||||||
|
|
||||||
$_SESSION['username'] = $username;
|
$_SESSION['username'] = $username;
|
||||||
$_SESSION['password'] = null;
|
$_SESSION['password'] = null;
|
||||||
@@ -285,7 +234,7 @@ $pdo = null;
|
|||||||
<div class="textbox">
|
<div class="textbox">
|
||||||
<h1>確認</h1>
|
<h1>確認</h1>
|
||||||
|
|
||||||
<p>あなたは <?php if( !empty($row["username"]) ){ echo replaceProfileEmojiImages(safetext( $row["username"])); } ?> ですか?</p>
|
<p>あなたは <?php if( !empty($userData["username"]) ){ echo replaceProfileEmojiImages(safetext( $userData["username"])); } ?> ですか?</p>
|
||||||
|
|
||||||
<?php if( !empty($error_message) ): ?>
|
<?php if( !empty($error_message) ): ?>
|
||||||
<ul class="errmsg">
|
<ul class="errmsg">
|
||||||
@@ -298,7 +247,7 @@ $pdo = null;
|
|||||||
<div class="myarea">
|
<div class="myarea">
|
||||||
<img src="<?php echo safetext($userData['iconname']); ?>">
|
<img src="<?php echo safetext($userData['iconname']); ?>">
|
||||||
<p>ユーザー名</p>
|
<p>ユーザー名</p>
|
||||||
<h2><?php if( !empty($row["username"]) ){ echo replaceProfileEmojiImages(safetext( $row["username"])); } ?></h2>
|
<h2><?php if( !empty($userData["username"]) ){ echo replaceProfileEmojiImages(safetext( $userData["username"])); } ?></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]; ?>
|
||||||
@@ -322,7 +271,7 @@ $pdo = null;
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<p>プロフィール</p>
|
<p>プロフィール</p>
|
||||||
<h3><?php if( !empty($row["profile"]) ){ echo safetext( $row["profile"]); } ?></h3>
|
<h3><?php if( !empty($userData["profile"]) ){ echo safetext( $userData["profile"]); } ?></h3>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+34
-1
@@ -2598,6 +2598,31 @@ main h1{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sendbox .harmful_notice{
|
||||||
|
animation: Up_to_down_slideY 0.5s cubic-bezier(0.25, 1, 0.5, 1) 1 forwards;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
margin-top: 24px;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 12px;
|
||||||
|
background-color: color-mix(in srgb, var(--tl-color) 90%, var(--warn));
|
||||||
|
border: 1px solid var(--warn);
|
||||||
|
width: auto;
|
||||||
|
max-height: 260px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
.sendbox .harmful_notice p{
|
||||||
|
margin: 0px;
|
||||||
|
word-wrap: break-word;
|
||||||
|
line-height: 16px;
|
||||||
|
color: var(--text-color);
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
.ueusebtn{
|
.ueusebtn{
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: none;
|
border: none;
|
||||||
@@ -4057,6 +4082,7 @@ label>input {
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
.notification .flebox .icon a{
|
.notification .flebox .icon a{
|
||||||
margin:0px;
|
margin:0px;
|
||||||
@@ -7773,7 +7799,14 @@ noscript .noscript_modal .inner .center_text p{
|
|||||||
.sendbox .emoji_picker .tokonone p{
|
.sendbox .emoji_picker .tokonone p{
|
||||||
color:var(--dark-text-color);
|
color:var(--dark-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sendbox .harmful_notice{
|
||||||
|
background-color: color-mix(in srgb, var(--dark-sub-color) 90%, var(--warn));
|
||||||
|
border: 1px solid var(--warn);
|
||||||
|
}
|
||||||
|
.sendbox .harmful_notice p{
|
||||||
|
color: var(--dark-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
.emjtex{
|
.emjtex{
|
||||||
background-color: var(--dark-sub-color);
|
background-color: var(--dark-sub-color);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id']))){
|
if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id']))){
|
||||||
$postUserid = safetext($_POST['userid']);
|
$postUserid = safetext($_POST['userid']);
|
||||||
|
|||||||
+15
-124
@@ -4,7 +4,7 @@ $serversettings = parse_ini_file($serversettings_file, true);
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
// 変数の初期化
|
// 変数の初期化
|
||||||
$datetime = array();
|
$datetime = array();
|
||||||
@@ -46,130 +46,21 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
$serversettings_file = "../server/serversettings.ini";
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
|
||||||
$serverstopfile = "../server/serverstop.txt";
|
$serverstopfile = "../server/serverstop.txt";
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require('../function/function.php');
|
require('../function/function.php');
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id']))) {
|
if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id']))) {
|
||||||
$postUniqid = safetext($_POST['uniqid']);
|
$postUniqid = safetext($_POST['uniqid']);
|
||||||
|
|||||||
@@ -1,4 +1,180 @@
|
|||||||
<?php
|
<?php
|
||||||
|
function blockedIP($ip_addr){
|
||||||
|
// データベースに接続
|
||||||
|
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) {
|
||||||
|
actionLog(null, "error", "blockedIP", null, $e, 4);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$search_query = $pdo->prepare('SELECT * FROM ipblock WHERE ipaddr = :ipaddr limit 1');
|
||||||
|
$search_query->execute(array(':ipaddr' => $ip_addr));
|
||||||
|
$result = $search_query->fetch();
|
||||||
|
|
||||||
|
if($result > 0){
|
||||||
|
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . "/unsupported.php?errcode=IP_BANNED";
|
||||||
|
header("Location:".$url."");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function uwuzuUserLogin($session, $cookie, $ip_addr, $operation_permission = "user") {
|
||||||
|
//セッション,クッキー,IPアドレス,閲覧権限(userかadminかの二種類)を受け取る
|
||||||
|
$serversettings_file = $_SERVER['DOCUMENT_ROOT']."/server/serversettings.ini";
|
||||||
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
// データベースに接続
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
actionLog(null, "error", "uwuzuUserLogin", null, $e, 4);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($session['loginid'])){
|
||||||
|
$loginid = safetext($session['loginid']);
|
||||||
|
if(isset($session['loginkey'])) {
|
||||||
|
$loginkey = safetext($session['loginkey']);
|
||||||
|
} else {
|
||||||
|
$loginkey = null;
|
||||||
|
}
|
||||||
|
} elseif (isset($cookie['loginid'])){
|
||||||
|
$loginid = safetext($cookie['loginid']);
|
||||||
|
if(isset($cookie['loginkey'])) {
|
||||||
|
$loginkey = safetext($cookie['loginkey']);
|
||||||
|
} else {
|
||||||
|
$loginkey = null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$loginQuery = $pdo->prepare("SELECT * FROM account WHERE loginid = :loginid");
|
||||||
|
$loginQuery->bindValue(':loginid', $loginid);
|
||||||
|
$loginQuery->execute();
|
||||||
|
$loginResponse = $loginQuery->fetch();
|
||||||
|
if(empty($loginResponse["userid"])){
|
||||||
|
return false;
|
||||||
|
}elseif($loginid === $loginResponse["loginid"]){
|
||||||
|
$userEncKey = GenUserEnckey($loginResponse["datetime"]);
|
||||||
|
$userLoginKey = hash_hmac('sha256', $loginResponse["loginid"], $userEncKey);
|
||||||
|
|
||||||
|
if(!(empty($loginkey))){
|
||||||
|
if(hash_equals($loginkey, $userLoginKey)){
|
||||||
|
if($operation_permission == "admin"){
|
||||||
|
if($loginResponse["admin"] == "yes"){
|
||||||
|
$is_login = true;
|
||||||
|
}else{
|
||||||
|
$is_login = false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$is_login = true;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$is_login = false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(isset($session['userid']) && isset($session['username'])){
|
||||||
|
if($session['userid'] === $loginResponse["userid"] && $session['username'] === $loginResponse["username"]){
|
||||||
|
if($operation_permission === "admin"){
|
||||||
|
if($loginResponse["admin"] == "yes"){
|
||||||
|
$is_login = true;
|
||||||
|
}else{
|
||||||
|
$is_login = false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$is_login = true;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$is_login = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($cookie['userid']) && isset($cookie['username'])){
|
||||||
|
if($cookie['userid'] === $loginResponse["userid"] && $cookie['username'] === $loginResponse["username"]){
|
||||||
|
if($operation_permission === "admin"){
|
||||||
|
if($loginResponse["admin"] == "yes"){
|
||||||
|
$is_login = true;
|
||||||
|
}else{
|
||||||
|
$is_login = false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$is_login = true;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$is_login = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($is_login === true){
|
||||||
|
$userid = safetext($loginResponse['userid']); // セッションに格納されている値をそのままセット
|
||||||
|
$username = safetext($loginResponse['username']); // セッションに格納されている値をそのままセット
|
||||||
|
$loginid = safetext($loginResponse["loginid"]);
|
||||||
|
|
||||||
|
$_SESSION['userid'] = $userid;
|
||||||
|
$_SESSION['username'] = $username;
|
||||||
|
$_SESSION['loginid'] = $loginid;
|
||||||
|
|
||||||
|
setcookie('loginid', $loginid,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 28,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
setcookie('loginkey', $userLoginKey,[
|
||||||
|
'expires' => time() + 60 * 60 * 24 * 28,
|
||||||
|
'path' => '/',
|
||||||
|
'samesite' => 'lax',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
//IP保存が有効であれば保存する---------------------------------------------------
|
||||||
|
if(safetext($serversettings["serverinfo"]["server_get_ip"]) === "true"){
|
||||||
|
if(filter_var($ip_addr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) || filter_var($ip_addr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){
|
||||||
|
$enc_ip_addr = EncryptionUseEncrKey($ip_addr, $userEncKey, $loginResponse["encryption_ivkey"]);
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
try {
|
||||||
|
$updateQuery = $pdo->prepare("UPDATE account SET last_ip = :last_ip WHERE userid = :userid");
|
||||||
|
$updateQuery->bindValue(':last_ip', $enc_ip_addr, PDO::PARAM_STR);
|
||||||
|
$updateQuery->bindValue(':userid', $userid, PDO::PARAM_STR);
|
||||||
|
$res = $updateQuery->execute();
|
||||||
|
|
||||||
|
if($res){
|
||||||
|
$pdo->commit();
|
||||||
|
}else{
|
||||||
|
// ロールバック
|
||||||
|
$pdo->rollBack();
|
||||||
|
actionLog($userid, "error", "uwuzuUserLogin", null, "IPアドレスを記録できませんでした!", 3);
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
// ロールバック
|
||||||
|
$pdo->rollBack();
|
||||||
|
actionLog($userid, "error", "uwuzuUserLogin", null, $e, 4);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
actionLog($userid, "notice", "uwuzuUserLogin", null, "ユーザーのIPアドレスが不正な値でした!", 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $loginResponse;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
//---------UNIQID-MAKER---------
|
//---------UNIQID-MAKER---------
|
||||||
function createUniqId(){
|
function createUniqId(){
|
||||||
list($msec, $sec) = explode(" ", microtime());
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ header('Content-Type: application/json');
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("function.php");
|
require("function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['reusetext'])) && safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id']))) {
|
if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['reusetext'])) && safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id']))) {
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
|
|||||||
+24
-120
@@ -55,129 +55,24 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$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', safetext($_SESSION['userid']));
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery->execute();
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
$res = $passQuery->fetch();
|
if($is_login === false){
|
||||||
if(empty($res["userid"])){
|
header("Location: ../index.php");
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
@@ -377,6 +272,10 @@ if ("serviceWorker" in navigator) {
|
|||||||
<input type="submit" class="ueusebtn" id='ueusebtn' name="btn_submit" value="ユーズする">
|
<input type="submit" class="ueusebtn" id='ueusebtn' name="btn_submit" value="ユーズする">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="harmful_notice" id="harmful_ueuse_warn" style="display:none;">
|
||||||
|
<p>この内容は他のユーザーを傷つけてしまう可能性があります。少し見直してみませんか?</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="emoji_picker" id="emoji_picker" style="display:none;">
|
<div class="emoji_picker" id="emoji_picker" style="display:none;">
|
||||||
<p>カスタム絵文字</p>
|
<p>カスタム絵文字</p>
|
||||||
<div class="emoji_picker_flex">
|
<div class="emoji_picker_flex">
|
||||||
@@ -1131,6 +1030,11 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#ueuse').on('input', function () {
|
$('#ueuse').on('input', function () {
|
||||||
|
if(check_Harmful_ueuse($(this).val())){
|
||||||
|
$('#harmful_ueuse_warn').show();
|
||||||
|
}else{
|
||||||
|
$('#harmful_ueuse_warn').hide();
|
||||||
|
}
|
||||||
var mojisize = '<?php echo $mojisize; ?>';
|
var mojisize = '<?php echo $mojisize; ?>';
|
||||||
var mojicount = Number(mojisize) - $(this).val().length;
|
var mojicount = Number(mojisize) - $(this).val().length;
|
||||||
if(mojicount >= 0){
|
if(mojicount >= 0){
|
||||||
|
|||||||
@@ -16,49 +16,14 @@ session_set_cookie_params([
|
|||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset($_COOKIE['loginid']) && isset($_SESSION['userid'])) {
|
//ログイン認証---------------------------------------------------
|
||||||
$option = array(
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
// SQL実行失敗時に例外をスルー
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
if(!($is_login === false)){
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
header("Location: /home/");
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
exit;
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_SESSION['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_SESSION['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true && isset($_COOKIE['loginid']) && isset($_COOKIE['userid'])) {
|
|
||||||
$option = array(
|
|
||||||
// SQL実行失敗時に例外をスルー
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_COOKIE['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_COOKIE['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
$serversettings_file = "server/serversettings.ini";
|
$serversettings_file = "server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|||||||
@@ -39,3 +39,73 @@ function view_notify(notify){
|
|||||||
$("#notify").hide();
|
$("#notify").hide();
|
||||||
}, 10000);
|
}, 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isHarmfulContent(text, examples, keywords, similarityThreshold = 0.7) {
|
||||||
|
var total_score = 0;
|
||||||
|
// レーベンシュタイン距離を計算
|
||||||
|
function levenshteinDistance(a, b) {
|
||||||
|
const dp = Array(a.length + 1).fill().map(() => Array(b.length + 1).fill(0));
|
||||||
|
for (let i = 0; i <= a.length; i++) dp[i][0] = i;
|
||||||
|
for (let j = 0; j <= b.length; j++) dp[0][j] = j;
|
||||||
|
for (let i = 1; i <= a.length; i++) {
|
||||||
|
for (let j = 1; j <= b.length; j++) {
|
||||||
|
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
||||||
|
dp[i][j] = Math.min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dp[a.length][b.length];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 類似度スコアを計算
|
||||||
|
function similarityScore(a, b) {
|
||||||
|
const distance = levenshteinDistance(a, b);
|
||||||
|
const maxLength = Math.max(a.length, b.length);
|
||||||
|
return maxLength === 0 ? 0 : 1 - distance / maxLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 文脈的な有害性を判定
|
||||||
|
function hasHarmfulContext(text, keywords, examples) {
|
||||||
|
const normalizedText = text.replace(/[!。!?、]/g, '');
|
||||||
|
|
||||||
|
let harmfulCharCount = 0;
|
||||||
|
let nonHarmfulCharCount = normalizedText.length;
|
||||||
|
|
||||||
|
const combinedPattern = new RegExp([...keywords, ...examples].join('|'), 'g');
|
||||||
|
const matches = normalizedText.match(combinedPattern);
|
||||||
|
if (matches) {
|
||||||
|
const harmfulText = matches.join('');
|
||||||
|
harmfulCharCount += harmfulText.length;
|
||||||
|
nonHarmfulCharCount -= harmfulText.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (harmfulCharCount > nonHarmfulCharCount) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasHarmfulContext(text, keywords, examples)){
|
||||||
|
total_score += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 類似度スコアチェック
|
||||||
|
const textScore = examples.map(example => similarityScore(text, example));
|
||||||
|
const maxScore = Math.max(...textScore);
|
||||||
|
|
||||||
|
if (maxScore >= similarityThreshold) {
|
||||||
|
total_score += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(total_score >= 1){
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function check_Harmful_ueuse(text){
|
||||||
|
const examples = ["お前なんかいらない", "死んでしまえ", "無能すぎる", "もう関わるな", "お前マジ死ね", "死ねばいいのに", "死んだほうがいいよ", "よく恥ずかしくないね", "社会の迷惑", "存在価値ないだろ", "死んでくれ", "ほんと馬鹿だから", "話しかけてくんな", "口聞かない", "許さないからな", "なんで生きてるの", "早く死ねよ", "凍結されろ", "BANされろ"];
|
||||||
|
const keywords = ["死ね", "バカ", "馬鹿", "嫌い", "クズ", "ゴミ", "低能", "無能", "関わるな", "いらない", "消えろ", "殺す", "来るな", "死んで", "死刑", "Fuck", "しね", "下手", "カス", "ますが", "ですが", "ですが何か", "かよ", "荒らし", "黙って", "黙れ", "凍結されろ", "BANされろ"];
|
||||||
|
return isHarmfulContent(text, examples, keywords)
|
||||||
|
}
|
||||||
+1
-1
@@ -113,7 +113,7 @@ console.log('errorcode : '+errcode);
|
|||||||
if (user_agent_access == 'bad') {
|
if (user_agent_access == 'bad') {
|
||||||
setTimeout(link(), 0);
|
setTimeout(link(), 0);
|
||||||
function link() {
|
function link() {
|
||||||
location.href = "../unsupported.php?errcode=" + errcode + "&browser=" + user_agent_browser + "&os=" + user_agent_os + "&cookie=" + user_agent_cookie + "&ssl=" + user_agent_ssl + ""
|
location.href = "../unsupported.php?errcode=" + errcode + "&browser=" + user_agent_browser + "&os=" + user_agent_os + "&cookie=" + user_agent_cookie + "&ssl=" + user_agent_ssl + "&block=null"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,49 +57,14 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset($_COOKIE['loginid']) && isset($_SESSION['userid'])) {
|
//ログイン認証---------------------------------------------------
|
||||||
$options = array(
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
// SQL実行失敗時に例外をスルー
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
if(!($is_login === false)){
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
header("Location: /home/");
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
exit;
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_SESSION['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_SESSION['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true && isset($_COOKIE['loginid']) && isset($_COOKIE['userid'])) {
|
|
||||||
$options = array(
|
|
||||||
// SQL実行失敗時に例外をスルー
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_COOKIE['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_COOKIE['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
$_SESSION['form_data'] = $_POST;
|
$_SESSION['form_data'] = $_POST;
|
||||||
@@ -181,9 +146,6 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$result->execute();
|
$result->execute();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ... (前略)
|
|
||||||
// IDの入力チェック
|
|
||||||
if( empty($userid) ) {
|
if( empty($userid) ) {
|
||||||
$error_message[] = 'ユーザーIDを入力してください。(USERID_INPUT_PLEASE)';
|
$error_message[] = 'ユーザーIDを入力してください。(USERID_INPUT_PLEASE)';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+34
-37
@@ -1,37 +1,37 @@
|
|||||||
<?php
|
<?php
|
||||||
require("../function/function.php");
|
require('../db.php');
|
||||||
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
$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 (isset($_SERVER['HTTP_COOKIE'])) {
|
session_name('uwuzu_s_id');
|
||||||
$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
|
session_set_cookie_params([
|
||||||
foreach($cookies as $cookie) {
|
'lifetime' => 0,
|
||||||
$parts = explode('=', $cookie);
|
'path' => '/',
|
||||||
$name = trim($parts[0]);
|
'domain' => '',
|
||||||
setcookie($name, '', time()-1000);
|
'secure' => true,
|
||||||
setcookie($name, '', time()-1000, '');
|
'httponly' => true,
|
||||||
setcookie($name, '', time()-1000, '/');
|
'samesite' => 'Lax'
|
||||||
setcookie($name, '', time()-1000, '/emoji');
|
]);
|
||||||
setcookie($name, '', time()-1000, '/home');
|
|
||||||
setcookie($name, '', time()-1000, '/notice');
|
|
||||||
setcookie($name, '', time()-1000, '/notification');
|
|
||||||
setcookie($name, '', time()-1000, '/others');
|
|
||||||
setcookie($name, '', time()-1000, '/search');
|
|
||||||
setcookie($name, '', time()-1000, '/settings');
|
|
||||||
setcookie($name, '', time()-1000, '/emoji');
|
|
||||||
setcookie($name, '', time()-1000, '/user');
|
|
||||||
setcookie('admin_login', '', time()-1000, '');
|
|
||||||
setcookie('loginid', '', time()-1000, '');
|
|
||||||
setcookie('userid', '', time()-1000, '');
|
|
||||||
setcookie('username', '', time()-1000, '');
|
|
||||||
}
|
|
||||||
header("Location: " . $_SERVER['PHP_SELF']);
|
|
||||||
}
|
|
||||||
session_start();
|
session_start();
|
||||||
$_SESSION = array();
|
$_SESSION = array();
|
||||||
session_destroy();
|
session_regenerate_id(true);
|
||||||
?>
|
session_destroy();
|
||||||
|
|
||||||
|
if (isset($_SERVER['HTTP_COOKIE'])) {
|
||||||
|
$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
|
||||||
|
foreach ($cookies as $cookie) {
|
||||||
|
$parts = explode('=', $cookie);
|
||||||
|
$name = trim($parts[0]);
|
||||||
|
|
||||||
|
// Cookie削除(パスとドメインを指定)
|
||||||
|
setcookie($name, '', time() - 3600, '/');
|
||||||
|
setcookie($name, '', time() - 3600, '/', $_SERVER['HTTP_HOST']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
@@ -67,16 +67,13 @@ session_destroy();
|
|||||||
<h1>ログアウト完了</h1>
|
<h1>ログアウト完了</h1>
|
||||||
<p><br>ログアウトが完了しました!</p>
|
<p><br>ログアウトが完了しました!</p>
|
||||||
<p>ボタンを押すとログインページにリダイレクトします。</p>
|
<p>ボタンを押すとログインページにリダイレクトします。</p>
|
||||||
|
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a href="../login.php" class="sirobutton">ログイン</a>
|
<a href="../index.php" class="sirobutton">ログイン</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
<script>
|
|
||||||
document.cookie.split(";").forEach(function(c) { document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); });
|
|
||||||
</script>
|
|
||||||
+8
-42
@@ -41,49 +41,15 @@ $stmt = null;
|
|||||||
$res = null;
|
$res = null;
|
||||||
$option = null;
|
$option = null;
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset($_COOKIE['loginid']) && isset($_SESSION['userid'])) {
|
//ログイン認証---------------------------------------------------
|
||||||
$options = array(
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
// SQL実行失敗時に例外をスルー
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
if(!($is_login === false)){
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
header("Location: ../home/");
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
exit;
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_SESSION['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_SESSION['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: /home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true && isset($_COOKIE['loginid']) && isset($_COOKIE['userid'])) {
|
|
||||||
$options = array(
|
|
||||||
// SQL実行失敗時に例外をスルー
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_COOKIE['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_COOKIE['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: /home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
|||||||
@@ -56,50 +56,14 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset($_COOKIE['loginid']) && isset($_SESSION['userid'])) {
|
//ログイン認証---------------------------------------------------
|
||||||
$options = array(
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
// SQL実行失敗時に例外をスルー
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
if(!($is_login === false)){
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
header("Location: /home/");
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
exit;
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_SESSION['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_SESSION['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true && isset($_COOKIE['loginid']) && isset($_COOKIE['userid'])) {
|
|
||||||
$options = array(
|
|
||||||
// SQL実行失敗時に例外をスルー
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_COOKIE['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_COOKIE['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
$_SESSION['form_data'] = $_POST;
|
$_SESSION['form_data'] = $_POST;
|
||||||
|
|||||||
+7
-43
@@ -15,50 +15,14 @@ session_set_cookie_params([
|
|||||||
]);
|
]);
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
//ログイン認証---------------------------------------------------
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset($_COOKIE['loginid']) && isset($_SESSION['userid'])) {
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$option = array(
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
// SQL実行失敗時に例外をスルー
|
if(!($is_login === false)){
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
header("Location: /home/");
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
exit;
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_SESSION['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_SESSION['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true && isset($_COOKIE['loginid']) && isset($_COOKIE['userid'])) {
|
|
||||||
$option = array(
|
|
||||||
// SQL実行失敗時に例外をスルー
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
// デフォルトフェッチモードを連想配列形式に設定
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
// バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減)
|
|
||||||
// SELECTで得た結果に対してもrowCountメソッドを使えるようにする
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
);
|
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
|
||||||
$acck = $dbh->prepare("SELECT userid, loginid FROM account WHERE userid = :userid");
|
|
||||||
$acck->bindValue(':userid', $_COOKIE['userid']);
|
|
||||||
$acck->execute();
|
|
||||||
$acck_data = $acck->fetch();
|
|
||||||
if(!empty($acck_data)){
|
|
||||||
if($_COOKIE['loginid'] === $acck_data["loginid"] && $_COOKIE['userid'] === $acck_data["userid"] ){
|
|
||||||
header("Location: home/index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
$serversettings_file = "server/serversettings.ini";
|
$serversettings_file = "server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
require('view.php');
|
require('view.php');
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
require('view.php');
|
require('view.php');
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
require('view.php');
|
require('view.php');
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
require('view.php');
|
require('view.php');
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ $serversettings = parse_ini_file($serversettings_file, true);
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
require('notificationview.php');
|
require('notificationview.php');
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
require('view.php');
|
require('view.php');
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
require('view.php');
|
require('view.php');
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
require('view.php');
|
require('view.php');
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
require('view.php');
|
require('view.php');
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require('../db.php');
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
require('view.php');
|
require('view.php');
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$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(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
||||||
header("Content-Type: application/activity+json");
|
header("Content-Type: application/activity+json; charset=utf-8");
|
||||||
header("charset=utf-8");
|
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
$mojisizefile = "../../server/textsize.txt";
|
$mojisizefile = "../../server/textsize.txt";
|
||||||
@@ -31,7 +32,6 @@ if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
|
|||||||
for( $i=0;$i<$cnt;$i++ ){
|
for( $i=0;$i<$cnt;$i++ ){
|
||||||
$uwuzuinfo[$i] = ($softwaredata[$i]);
|
$uwuzuinfo[$i] = ($softwaredata[$i]);
|
||||||
}
|
}
|
||||||
require('../../db.php');
|
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
|
|||||||
+14
-127
@@ -44,136 +44,23 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
|
|||||||
+14
-123
@@ -46,130 +46,21 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
|
|||||||
+14
-123
@@ -43,130 +43,21 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
|
|||||||
+14
-123
@@ -55,130 +55,21 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
|
|||||||
@@ -43,130 +43,21 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
|
|||||||
+16
-2
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
|
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
|
||||||
header( 'Cache-Control: post-check=0, pre-check=0', FALSE );
|
header( 'Cache-Control: post-check=0, pre-check=0', FALSE );
|
||||||
header( 'Pragma: no-cache' );
|
header( 'Pragma: no-cache' );
|
||||||
@@ -16,12 +18,24 @@ if(isset($_SERVER['HTTP_REFERER'])){
|
|||||||
<script src="../js/unsupported.js?v=<?php echo createUniqId();?>"></script>
|
<script src="../js/unsupported.js?v=<?php echo createUniqId();?>"></script>
|
||||||
<script src="../js/console_notice.js?v=<?php echo createUniqId();?>"></script>
|
<script src="../js/console_notice.js?v=<?php echo createUniqId();?>"></script>
|
||||||
<script src="../js/nsfw_event.js?v=<?php echo createUniqId();?>"></script>
|
<script src="../js/nsfw_event.js?v=<?php echo createUniqId();?>"></script>
|
||||||
<link rel="manifest" href="../manifest/manifest.json?v=<?php echo createUniqId();?>" />
|
<link rel="manifest" href="../manifest/manifest.json" />
|
||||||
<link rel="stylesheet" href="../css/home.css?v=<?php echo createUniqId();?>">
|
<link rel="stylesheet" href="../css/home.css?v=<?php echo createUniqId();?>">
|
||||||
<title>キャッシュクリア中</title>
|
<title>キャッシュクリア中</title>
|
||||||
</head>
|
</head>
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener('load', function(){
|
window.addEventListener('load', function(){
|
||||||
|
if ("serviceWorker" in navigator) {
|
||||||
|
navigator.serviceWorker.getRegistration()
|
||||||
|
.then(registration => {
|
||||||
|
registration.unregister();
|
||||||
|
navigator.serviceWorker.register("../../sw.js").then(reg => {
|
||||||
|
console.log("ServiceWorker OK", reg);
|
||||||
|
}).catch(err => {
|
||||||
|
console.log("ServiceWorker BAD", err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
window.location.href = "<?php echo $back?>";
|
window.location.href = "<?php echo $back?>";
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
+25
-124
@@ -49,130 +49,21 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
@@ -410,9 +301,13 @@ if( !empty($_POST['session_submit']) ) {
|
|||||||
} else {
|
} else {
|
||||||
$error_message[] = 'セッショントークンの再生成に失敗しました。(END_OF_SESSION_DAME)';
|
$error_message[] = 'セッショントークンの再生成に失敗しました。(END_OF_SESSION_DAME)';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !empty($_POST['logout_submit']) ) {
|
||||||
|
$url = '../logout/index.php';
|
||||||
|
header('Location: ' . $url);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if( !empty($_POST['token_submit']) ) {
|
if( !empty($_POST['token_submit']) ) {
|
||||||
$token = random_token();
|
$token = random_token();
|
||||||
@@ -527,6 +422,12 @@ require('../logout/logout.php');
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
<h1>ログアウト</h1>
|
||||||
|
<p>ログアウトです。他のログイン済みの端末からはログアウトされません。</p>
|
||||||
|
<input type="submit" class = "irobutton" name="logout_submit" value="ログアウト">
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
<h1>キャッシュクリア</h1>
|
<h1>キャッシュクリア</h1>
|
||||||
<p>下のボタンを押すことでキャッシュクリアが可能です。</p>
|
<p>下のボタンを押すことでキャッシュクリアが可能です。</p>
|
||||||
<div class="p2">この機能は試験的なものであり、正常に動作しない可能性があります。</div>
|
<div class="p2">この機能は試験的なものであり、正常に動作しない可能性があります。</div>
|
||||||
|
|||||||
+14
-123
@@ -47,130 +47,21 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
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);
|
||||||
|
|
||||||
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
|
if(!($is_login === false)){
|
||||||
|
header("Location: ../home/");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
//-------------------------------------------------------------
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
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);
|
||||||
|
|
||||||
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
|
if(!($is_login === false)){
|
||||||
|
header("Location: ../home/");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
//-------------------------------------------------------------
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
+11
-10
@@ -66,13 +66,18 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
|
if(!($is_login === false)){
|
||||||
|
header("Location: ../home/");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
|
$userid = safetext($_POST['userid']);
|
||||||
|
$mailadds = safetext($_POST['mailadds']);
|
||||||
//$row['userid'] = "daichimarukn";
|
|
||||||
|
|
||||||
$userid = $_POST['userid'];
|
|
||||||
$mailadds = $_POST['mailadds'];
|
|
||||||
|
|
||||||
if(!empty(H_CAPTCHA_ONOFF && H_CAPTCHA_ONOFF == "true")){
|
if(!empty(H_CAPTCHA_ONOFF && H_CAPTCHA_ONOFF == "true")){
|
||||||
if(isset($_POST['h-captcha-response'])){
|
if(isset($_POST['h-captcha-response'])){
|
||||||
@@ -219,10 +224,6 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ... (後略)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// データベースの接続を閉じる
|
// データベースの接続を閉じる
|
||||||
|
|||||||
@@ -62,6 +62,16 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = 'データベース接続エラー: ' . $e->getMessage();
|
$error_message[] = 'データベース接続エラー: ' . $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
|
if(!($is_login === false)){
|
||||||
|
header("Location: ../home/");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
if(!($userid == null)){
|
if(!($userid == null)){
|
||||||
if( !empty($_SESSION['mailadds']) ) {
|
if( !empty($_SESSION['mailadds']) ) {
|
||||||
$result = $pdo->prepare("SELECT userid, username, mailadds, loginid, authcode, encryption_ivkey, datetime FROM account WHERE userid = :userid");
|
$result = $pdo->prepare("SELECT userid, username, mailadds, loginid, authcode, encryption_ivkey, datetime FROM account WHERE userid = :userid");
|
||||||
|
|||||||
+1
-5
@@ -26,15 +26,11 @@ $serversettings = parse_ini_file($serversettings_file, true);
|
|||||||
<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($is_Admin === "yes"){?>
|
||||||
<hr>
|
<hr>
|
||||||
<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 }?>
|
||||||
<hr>
|
|
||||||
<form method="post">
|
|
||||||
<input type="submit" name="logout" class="leftbutton" value="ログアウト">
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php ?>
|
<?php ?>
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
$serversettings_file = "../server/serversettings.ini";
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
$serversettings_file = "../server/serversettings.ini";
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ require('../db.php');
|
|||||||
//関数呼び出し
|
//関数呼び出し
|
||||||
//- php.iniのファイル最大サイズ
|
//- php.iniのファイル最大サイズ
|
||||||
require('../function/function.php');
|
require('../function/function.php');
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
session_name('uwuzu_s_id');
|
session_name('uwuzu_s_id');
|
||||||
session_start();
|
session_start();
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
$serversettings_file = "../server/serversettings.ini";
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
$serversettings_file = "../server/serversettings.ini";
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|||||||
+14
-123
@@ -45,130 +45,21 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_GET['q'])){
|
if(isset($_GET['q'])){
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require('../db.php');
|
||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
$serversettings_file = "../server/serversettings.ini";
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
$serversettings = parse_ini_file($serversettings_file, true);
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|||||||
@@ -16,4 +16,6 @@
|
|||||||
;ActivityPubのオンオフ
|
;ActivityPubのオンオフ
|
||||||
server_activitypub = "false"
|
server_activitypub = "false"
|
||||||
;アカウントの移行登録を許可するか
|
;アカウントの移行登録を許可するか
|
||||||
server_account_migration = "true"
|
server_account_migration = "true"
|
||||||
|
;IPアドレスを取得するか
|
||||||
|
server_get_ip = "false"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
uwuzu
|
uwuzu
|
||||||
1.4.11
|
1.4.12
|
||||||
2024/12/29
|
2025/01/12
|
||||||
daichimarukana,putonfps
|
daichimarukana,putonfps
|
||||||
@@ -1,6 +1,35 @@
|
|||||||
## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
|
## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
|
||||||
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
|
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
|
||||||
|
|
||||||
|
## Version 1.4.12 (Funium)
|
||||||
|
2025/01/12
|
||||||
|
chg: ログイン認証の仕組みを大幅に変更しました。
|
||||||
|
chg: ログアウトボタンの場所を移動しました。
|
||||||
|
新しいログアウトボタンの場所は「その他」です。
|
||||||
|
chg: UIを一部変更しました。
|
||||||
|
new: ユーザーを傷つけてしまうおそれのある投稿を未然に防ぐ機能を実装しました
|
||||||
|
new: ユーザーの最終アクセスIP機能を実装しました!
|
||||||
|
この機能を使用するにはデータベースの更新とサーバー設定の更新が必要となります。
|
||||||
|
データベースのaccountテーブルに以下のカラムを追加してください。
|
||||||
|
- last_ip(1024):指定なし:最終アクセス時の暗号化されたIPアドレス
|
||||||
|
加えて、/server/serversettings.iniに
|
||||||
|
|
||||||
|
;IPアドレスを取得するか
|
||||||
|
server_get_ip = "false"
|
||||||
|
|
||||||
|
この項目を書き加えて上書き保存をしてください。
|
||||||
|
値がtrueだとIPアドレスを収集します。
|
||||||
|
new: IPブロック機能を実装しました!
|
||||||
|
この機能を使用するにはデータベースの更新が必要となります。
|
||||||
|
データベースに新規でipblockというテーブルを追加してください。
|
||||||
|
- sysid(int):AUTO_INCREMENT:システムID
|
||||||
|
- ipaddr(varchar(256)):指定なし:IPアドレス
|
||||||
|
- note(mediumtext):指定なし:ノート
|
||||||
|
- adduserid(varchar(512)):指定なし:登録ユーザー
|
||||||
|
- datetime(datetime):指定なし:記録日時
|
||||||
|
また、このブロック機能ではIPアドレスは暗号化されずに保存されます。
|
||||||
|
プライバシーデータの管理にはご注意ください。
|
||||||
|
|
||||||
## Version 1.4.11 (Funium)
|
## Version 1.4.11 (Funium)
|
||||||
2024/12/29
|
2024/12/29
|
||||||
fix: CGI版のphpでエラーが発生してしまう問題を修正しました。
|
fix: CGI版のphpでエラーが発生してしまう問題を修正しました。
|
||||||
|
|||||||
+14
-123
@@ -54,130 +54,21 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
|
|||||||
+154
-262
@@ -52,130 +52,21 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist,mail_settings FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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,mail_settings FROM account WHERE userid = :userid");
|
|
||||||
$passQuery->bindValue(':userid', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
@@ -185,19 +76,14 @@ $notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
|
|||||||
$notificationcount = $notiData['notification_count'];
|
$notificationcount = $notiData['notification_count'];
|
||||||
|
|
||||||
//ページ内のみ使用変数-------------------------
|
//ページ内のみ使用変数-------------------------
|
||||||
$mail_settings = safetext($res["mail_settings"]);
|
$mail_settings = safetext($is_login["mail_settings"]);
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
//phpmailer--------------------------------------------
|
//phpmailer--------------------------------------------
|
||||||
require('../settings_admin/plugin_settings/phpmailer_settings.php');
|
require('../settings_admin/plugin_settings/phpmailer_settings.php');
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
require('../settings_admin/plugin_settings/aiblockwatermark_settings.php');
|
require('../settings_admin/plugin_settings/aiblockwatermark_settings.php');
|
||||||
if( !empty($pdo) ) {
|
if( !empty($pdo) ) {
|
||||||
|
$userData = getUserData($pdo, $userid);
|
||||||
// データベース接続の設定
|
|
||||||
$userQuery = $pdo->prepare("SELECT * FROM account WHERE userid = :userid");
|
|
||||||
$userQuery->bindValue(':userid', $userid);
|
|
||||||
$userQuery->execute();
|
|
||||||
$userData = $userQuery->fetch();
|
|
||||||
|
|
||||||
$role = $userData["role"];
|
$role = $userData["role"];
|
||||||
|
|
||||||
@@ -220,158 +106,164 @@ if( !empty($pdo) ) {
|
|||||||
|
|
||||||
|
|
||||||
if( !empty($_POST['btn_submit']) ) {
|
if( !empty($_POST['btn_submit']) ) {
|
||||||
|
$userRoleList = explode(',', safetext($role));
|
||||||
if(!(empty($_POST['im_bot']))){
|
if(in_array("ice", $userRoleList)){
|
||||||
if($_POST['im_bot'] == "on"){
|
$error_message[] = 'アカウントが凍結されています。(ACCOUNT_HAS_BEEN_FROZEN)';
|
||||||
$saveim_bot = "bot";
|
}
|
||||||
|
if( empty($error_message) ) {
|
||||||
|
if(!(empty($_POST['im_bot']))){
|
||||||
|
if($_POST['im_bot'] == "on"){
|
||||||
|
$saveim_bot = "bot";
|
||||||
|
}else{
|
||||||
|
$saveim_bot = "none";
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$saveim_bot = "none";
|
$saveim_bot = "none";
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
$saveim_bot = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
$username = safetext($_POST['username']);
|
$username = safetext($_POST['username']);
|
||||||
|
|
||||||
$mailadds = safetext($_POST['mailadds']);
|
$mailadds = safetext($_POST['mailadds']);
|
||||||
|
|
||||||
if( !empty($_POST['isAIBlock']) ) {
|
if( !empty($_POST['isAIBlock']) ) {
|
||||||
$new_isAIBlock = safetext($_POST['isAIBlock']);
|
$new_isAIBlock = safetext($_POST['isAIBlock']);
|
||||||
}else{
|
}else{
|
||||||
$new_isAIBlock = "false";
|
$new_isAIBlock = "false";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($new_isAIBlock === "true"){
|
if($new_isAIBlock === "true"){
|
||||||
$save_isAIBlock = true;
|
$save_isAIBlock = true;
|
||||||
}else{
|
}else{
|
||||||
$save_isAIBlock = false;
|
$save_isAIBlock = false;
|
||||||
}
|
}
|
||||||
$other_settings_json = val_AddOtherSettings("isAIBlock", $save_isAIBlock, $userData["other_settings"]);
|
$other_settings_json = val_AddOtherSettings("isAIBlock", $save_isAIBlock, $userData["other_settings"]);
|
||||||
|
|
||||||
if( !empty($_POST['isAIBMW']) ) {
|
if( !empty($_POST['isAIBMW']) ) {
|
||||||
$new_isAIBMW = safetext($_POST['isAIBMW']);
|
$new_isAIBMW = safetext($_POST['isAIBMW']);
|
||||||
}else{
|
}else{
|
||||||
$new_isAIBMW = "false";
|
$new_isAIBMW = "false";
|
||||||
}
|
}
|
||||||
if($new_isAIBMW === "true"){
|
if($new_isAIBMW === "true"){
|
||||||
$save_isAIBMW = true;
|
$save_isAIBMW = true;
|
||||||
}else{
|
}else{
|
||||||
$save_isAIBMW = false;
|
$save_isAIBMW = false;
|
||||||
}
|
}
|
||||||
$other_settings_json = val_AddOtherSettings("isAIBlockWaterMark", $save_isAIBMW, $other_settings_json);
|
$other_settings_json = val_AddOtherSettings("isAIBlockWaterMark", $save_isAIBMW, $other_settings_json);
|
||||||
|
|
||||||
if( !empty($_POST['mail_important']) ) {
|
if( !empty($_POST['mail_important']) ) {
|
||||||
$mail_important = safetext($_POST['mail_important']);
|
$mail_important = safetext($_POST['mail_important']);
|
||||||
}else{
|
}else{
|
||||||
$mail_important = "false";
|
$mail_important = "false";
|
||||||
}
|
}
|
||||||
if(!(empty($mailadds))){
|
if(!(empty($mailadds))){
|
||||||
if(filter_var($mailadds, FILTER_VALIDATE_EMAIL)){
|
if(filter_var($mailadds, FILTER_VALIDATE_EMAIL)){
|
||||||
if($mail_important === "true"){
|
if($mail_important === "true"){
|
||||||
$savemail_important = "important";
|
$savemail_important = "important";
|
||||||
|
}else{
|
||||||
|
$savemail_important = "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(empty($userData["encryption_ivkey"]))){
|
||||||
|
$userEnckey = GenUserEnckey($userData["datetime"]);
|
||||||
|
$enc_mailadds = EncryptionUseEncrKey($mailadds, $userEnckey, $userData["encryption_ivkey"]);
|
||||||
|
}else{
|
||||||
|
$ivLength = openssl_cipher_iv_length('aes-256-cbc');
|
||||||
|
$randomBytes = random_bytes($ivLength);
|
||||||
|
$randomhash = hash('sha3-512', $randomBytes);
|
||||||
|
$iv = substr($randomhash, 0, $ivLength);
|
||||||
|
|
||||||
|
// トランザクション開始
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// SQL作成
|
||||||
|
$stmt = $pdo->prepare("UPDATE account SET encryption_ivkey = :encryption_ivkey WHERE userid = :userid;");
|
||||||
|
$stmt->bindParam(':encryption_ivkey', $iv, PDO::PARAM_STR);
|
||||||
|
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR);
|
||||||
|
$res = $stmt->execute();
|
||||||
|
$res = $pdo->commit();
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$pdo->rollBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!($res)) {
|
||||||
|
$error_message[] = "アカウント操作に失敗しました(ERROR)";
|
||||||
|
}
|
||||||
|
$stmt = null;
|
||||||
|
|
||||||
|
$userEnckey = GenUserEnckey($userData["datetime"]);
|
||||||
|
$enc_mailadds = EncryptionUseEncrKey($mailadds, $userEnckey, $iv);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$savemail_important = "none";
|
$savemail_important = "none";
|
||||||
}
|
$error_message[] = 'メールアドレスが正しい形式ではありません。(MAILADDS_CHECK_DAME)';
|
||||||
|
|
||||||
if(!(empty($userData["encryption_ivkey"]))){
|
|
||||||
$userEnckey = GenUserEnckey($userData["datetime"]);
|
|
||||||
$enc_mailadds = EncryptionUseEncrKey($mailadds, $userEnckey, $userData["encryption_ivkey"]);
|
|
||||||
}else{
|
|
||||||
$ivLength = openssl_cipher_iv_length('aes-256-cbc');
|
|
||||||
$randomBytes = random_bytes($ivLength);
|
|
||||||
$randomhash = hash('sha3-512', $randomBytes);
|
|
||||||
$iv = substr($randomhash, 0, $ivLength);
|
|
||||||
|
|
||||||
// トランザクション開始
|
|
||||||
$pdo->beginTransaction();
|
|
||||||
|
|
||||||
try {
|
|
||||||
// SQL作成
|
|
||||||
$stmt = $pdo->prepare("UPDATE account SET encryption_ivkey = :encryption_ivkey WHERE userid = :userid;");
|
|
||||||
$stmt->bindParam(':encryption_ivkey', $iv, PDO::PARAM_STR);
|
|
||||||
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR);
|
|
||||||
$res = $stmt->execute();
|
|
||||||
$res = $pdo->commit();
|
|
||||||
|
|
||||||
} catch (Exception $e) {
|
|
||||||
$pdo->rollBack();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!($res)) {
|
|
||||||
$error_message[] = "アカウント操作に失敗しました(ERROR)";
|
|
||||||
}
|
|
||||||
$stmt = null;
|
|
||||||
|
|
||||||
$userEnckey = GenUserEnckey($userData["datetime"]);
|
|
||||||
$enc_mailadds = EncryptionUseEncrKey($mailadds, $userEnckey, $iv);
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$savemail_important = "none";
|
$enc_mailadds = "";
|
||||||
$error_message[] = 'メールアドレスが正しい形式ではありません。(MAILADDS_CHECK_DAME)';
|
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
$enc_mailadds = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$profile = safetext($_POST['profile']);
|
$profile = safetext($_POST['profile']);
|
||||||
if( 1024 < mb_strlen($profile, 'UTF-8') ) {
|
if( 1024 < mb_strlen($profile, 'UTF-8') ) {
|
||||||
$error_message[] = 'プロフィールは1024文字以内で入力してください。(INPUT_OVER_MAX_COUNT)';
|
$error_message[] = 'プロフィールは1024文字以内で入力してください。(INPUT_OVER_MAX_COUNT)';
|
||||||
}
|
|
||||||
|
|
||||||
// ユーザーネームの入力チェック
|
|
||||||
if( empty($username) ) {
|
|
||||||
$error_message[] = '表示名を入力してください。(USERNAME_INPUT_PLEASE)';
|
|
||||||
} else {
|
|
||||||
// 文字数を確認
|
|
||||||
if( 50 < mb_strlen($username, 'UTF-8') ) {
|
|
||||||
$error_message[] = 'ユーザーネームは50文字以内で入力してください。(USERNAME_OVER_MAX_COUNT)';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( empty($error_message) ) {
|
|
||||||
// トランザクション開始
|
|
||||||
$pdo->beginTransaction();
|
|
||||||
|
|
||||||
try {
|
|
||||||
// SQL作成
|
|
||||||
$stmt = $pdo->prepare("UPDATE account SET username = :username, mailadds = :mailadds, profile = :profile, sacinfo = :saveimbot, mail_settings = :mail_settings, other_settings = :other_settings WHERE userid = :userid;");
|
|
||||||
|
|
||||||
// 他の値をセット
|
|
||||||
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':mailadds', $enc_mailadds, PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':profile', $profile, PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':saveimbot', $saveim_bot, PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':mail_settings', $savemail_important, PDO::PARAM_STR);
|
|
||||||
$stmt->bindParam(':other_settings', $other_settings_json, PDO::PARAM_STR);
|
|
||||||
|
|
||||||
// 条件を指定
|
|
||||||
// 以下の部分を適切な条件に置き換えてください
|
|
||||||
$stmt->bindValue(':userid', $userid, 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'];
|
if( empty($username) ) {
|
||||||
header("Location:".$url."");
|
$error_message[] = '表示名を入力してください。(USERNAME_INPUT_PLEASE)';
|
||||||
exit;
|
|
||||||
} else {
|
} else {
|
||||||
$error_message[] = '更新に失敗しました。(REGISTERED_DAME)';
|
// 文字数を確認
|
||||||
|
if( 50 < mb_strlen($username, 'UTF-8') ) {
|
||||||
|
$error_message[] = 'ユーザーネームは50文字以内で入力してください。(USERNAME_OVER_MAX_COUNT)';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// プリペアドステートメントを削除
|
if( empty($error_message) ) {
|
||||||
$stmt = null;
|
// トランザクション開始
|
||||||
}
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// SQL作成
|
||||||
|
$stmt = $pdo->prepare("UPDATE account SET username = :username, mailadds = :mailadds, profile = :profile, sacinfo = :saveimbot, mail_settings = :mail_settings, other_settings = :other_settings WHERE userid = :userid;");
|
||||||
|
|
||||||
|
// 他の値をセット
|
||||||
|
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':mailadds', $enc_mailadds, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':profile', $profile, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':saveimbot', $saveim_bot, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':mail_settings', $savemail_important, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':other_settings', $other_settings_json, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// 条件を指定
|
||||||
|
// 以下の部分を適切な条件に置き換えてください
|
||||||
|
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// SQLクエリの実行
|
||||||
|
$res = $stmt->execute();
|
||||||
|
|
||||||
|
// コミット
|
||||||
|
$res = $pdo->commit();
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
|
||||||
|
// エラーが発生した時はロールバック
|
||||||
|
$pdo->rollBack();
|
||||||
|
actionLog($userid, "error", "user-settings", null, $e, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+14
-123
@@ -48,130 +48,21 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
|
|||||||
@@ -47,136 +47,23 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
|
|||||||
+16
-127
@@ -47,136 +47,23 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
@@ -241,9 +128,11 @@ if( !empty($_POST['ads_btn_submit']) ) {
|
|||||||
|
|
||||||
// エラーが発生した時はロールバック
|
// エラーが発生した時はロールバック
|
||||||
$pdo->rollBack();
|
$pdo->rollBack();
|
||||||
|
actionLog($userid, "error", "ad_admin", null, $e, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $res ) {
|
if( $res ) {
|
||||||
|
actionLog($userid, "info", "ad_admin", null, "広告が新規作成されました", 0);
|
||||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||||
header("Location:".$url."");
|
header("Location:".$url."");
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -45,136 +45,23 @@ try {
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
@@ -312,9 +199,11 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
|
|
||||||
// エラーが発生した時はロールバック
|
// エラーが発生した時はロールバック
|
||||||
$pdo->rollBack();
|
$pdo->rollBack();
|
||||||
|
actionLog($userid, "error", "addemoji_admin", null, $e, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $res ) {
|
if( $res ) {
|
||||||
|
actionLog($userid, "info", "addemoji_admin", null, "カスタム絵文字が追加されました", 0);
|
||||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||||
header("Location:".$url."");
|
header("Location:".$url."");
|
||||||
exit;
|
exit;
|
||||||
@@ -353,9 +242,11 @@ if( !empty($_POST['emoji_del']) ) {
|
|||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$pdo->rollBack();
|
$pdo->rollBack();
|
||||||
|
actionLog($userid, "error", "addemoji_admin_del", null, $e, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $res ) {
|
if( $res ) {
|
||||||
|
actionLog($userid, "info", "addemoji_admin_del", null, "カスタム絵文字が削除されました", 0);
|
||||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||||
header("Location:".$url."");
|
header("Location:".$url."");
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../../db.php');
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../../db.php');
|
require('../../db.php');
|
||||||
require("../../function/function.php");
|
require("../../function/function.php");
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|||||||
+16
-127
@@ -49,136 +49,23 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
@@ -259,10 +146,12 @@ if( !empty($_POST['code_btn_submit']) ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($res) {
|
if ($res) {
|
||||||
|
actionLog($userid, "info", "codeadmin", null, "招待コードを".$make_code."件発行しました", 0);
|
||||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||||
header("Location:".$url."");
|
header("Location:".$url."");
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
|
actionLog($userid, "error", "codeadmin", null, "招待コードを".$make_code."件発行できませんでした", 3);
|
||||||
$error_message[] = '発行に失敗しました。(REGISTERED_DAME)';
|
$error_message[] = '発行に失敗しました。(REGISTERED_DAME)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,136 +60,23 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
@@ -262,6 +149,8 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
fputs($file, $data);
|
fputs($file, $data);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
|
actionLog($userid, "info", "customize_admin", null, "サーバーカスタマイズを更新しました", 0);
|
||||||
|
|
||||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||||
header("Location:".$url."");
|
header("Location:".$url."");
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -0,0 +1,275 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$serversettings_file = "../server/serversettings.ini";
|
||||||
|
$serversettings = parse_ini_file($serversettings_file, true);
|
||||||
|
|
||||||
|
require('../db.php');
|
||||||
|
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([
|
||||||
|
'lifetime' => 0,
|
||||||
|
'path' => '/',
|
||||||
|
'domain' => '',
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
'samesite' => 'Lax'
|
||||||
|
]);
|
||||||
|
session_start();
|
||||||
|
session_regenerate_id(true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
|
if($is_login === false){
|
||||||
|
header("Location: ../index.php");
|
||||||
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
|
$notiQuery->execute();
|
||||||
|
$notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
$notificationcount = $notiData['notification_count'];
|
||||||
|
|
||||||
|
if( !empty($pdo) ) {
|
||||||
|
|
||||||
|
// データベース接続の設定
|
||||||
|
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$userQuery = $dbh->prepare("SELECT 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=utf8mb4;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($pdo)) {
|
||||||
|
|
||||||
|
$sql = "SELECT ipaddr,note,adduserid,datetime FROM ipblock ORDER BY datetime DESC";
|
||||||
|
$ipaddr_query = $pdo->query($sql);
|
||||||
|
|
||||||
|
while ($row = $ipaddr_query->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
$ipaddr_list[] = $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !empty($_POST['ip_btn_submit']) ) {
|
||||||
|
$ipaddr = safetext($_POST['ipaddr']);
|
||||||
|
$note = safetext($_POST['note']);
|
||||||
|
|
||||||
|
if(filter_var($ipaddr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) || filter_var($ipaddr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){
|
||||||
|
|
||||||
|
$search_query = $pdo->prepare('SELECT * FROM ipblock WHERE ipaddr = :ipaddr limit 1');
|
||||||
|
$search_query->execute(array(':ipaddr' => $ipaddr));
|
||||||
|
$result = $search_query->fetch();
|
||||||
|
|
||||||
|
if($result > 0){
|
||||||
|
$error_message[] = 'IPアドレスはすでに登録されています。(ERROR)';
|
||||||
|
} else {
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
$datetime = date("Y-m-d H:i:s");
|
||||||
|
try {
|
||||||
|
$stmt = $pdo->prepare("INSERT INTO ipblock (ipaddr, note, adduserid, datetime) VALUES (:ipaddr, :note, :adduserid, :datetime)");
|
||||||
|
|
||||||
|
$stmt->bindParam(':ipaddr', $ipaddr, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':note', $note, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':adduserid', $userid, PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// SQLクエリの実行
|
||||||
|
$res = $stmt->execute();
|
||||||
|
|
||||||
|
$res = $pdo->commit();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$pdo->rollBack();
|
||||||
|
actionLog($userid, "error", "ipblock_admin_add", null, $e, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($res) {
|
||||||
|
actionLog($userid, "info", "ipblock_admin_add", null, "ブロックするIPアドレスを追加しました", 0);
|
||||||
|
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||||
|
header("Location:".$url."");
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
actionLog($userid, "error", "ipblock_admin_add", null, "ブロックするIPアドレスを追加できませんでした", 3);
|
||||||
|
$error_message[] = '登録に失敗しました。(REGISTERED_DAME)';
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt = null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$error_message[] = '不正なIPアドレスです。(ERROR)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !empty($_POST['ip_del_submit']) ) {
|
||||||
|
$ipaddr = safetext($_POST['del_ipaddr']);
|
||||||
|
|
||||||
|
if(filter_var($ipaddr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) || filter_var($ipaddr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){
|
||||||
|
$search_query = $pdo->prepare('SELECT * FROM ipblock WHERE ipaddr = :ipaddr limit 1');
|
||||||
|
$search_query->execute(array(':ipaddr' => $ipaddr));
|
||||||
|
$result = $search_query->fetch();
|
||||||
|
|
||||||
|
if($result > 0){
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
try{
|
||||||
|
$deleteQuery = $pdo->prepare("DELETE FROM ipblock WHERE ipaddr = :ipaddr");
|
||||||
|
$deleteQuery->bindValue(':ipaddr', $ipaddr, PDO::PARAM_STR);
|
||||||
|
$res = $deleteQuery->execute();
|
||||||
|
$res = $pdo->commit();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$pdo->rollBack();
|
||||||
|
$res = null;
|
||||||
|
actionLog($userid, "error", "ipblock_admin_del", null, $e, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($res) {
|
||||||
|
actionLog($userid, "info", "ipblock_admin_del", null, "ブロックするIPアドレスを削除しました", 0);
|
||||||
|
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||||
|
header("Location:".$url."");
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
actionLog($userid, "error", "ipblock_admin_del", null, "ブロックするIPアドレスを削除できませんでした", 3);
|
||||||
|
$error_message[] = '削除に失敗しました。(REGISTERED_DAME)';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$error_message[] = 'IPアドレスが見つかりませんでした。(ERROR)';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$error_message[] = '不正なIPアドレスです。(ERROR)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
require('../logout/logout.php');
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ja">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="stylesheet" href="../css/home.css">
|
||||||
|
<script src="../js/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>IPブロック - <?php echo safetext($serversettings["serverinfo"]["server_name"]);?></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>IPブロック</h1>
|
||||||
|
<p>IPアドレスのブロック機能です。</p>
|
||||||
|
<div>
|
||||||
|
<p>IPアドレス</p>
|
||||||
|
<div class="p2">IPv4とIPv6に対応しています。</div>
|
||||||
|
<input id="ipaddr" placeholder="000.000.000.000" class="inbox" type="text" name="ipaddr">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>ノート</p>
|
||||||
|
<textarea placeholder="ここに内容" class="inbox" name="note"></textarea>
|
||||||
|
</div>
|
||||||
|
<input type="submit" class = "irobutton" name="ip_btn_submit" value="登録">
|
||||||
|
</form>
|
||||||
|
<div class="formarea">
|
||||||
|
<h1>ブロック中のIPアドレス</h1>
|
||||||
|
<?php
|
||||||
|
if(!(empty($ipaddr_list))){
|
||||||
|
foreach ($ipaddr_list as $value) {?>
|
||||||
|
<div class="server_code">
|
||||||
|
<details>
|
||||||
|
<summary><?php if( !empty($value["ipaddr"]) ){ echo safetext($value["ipaddr"]); }?></summary>
|
||||||
|
<p>登録ユーザー:<?php if( !empty($value["adduserid"]) ){ echo safetext($value["adduserid"]); }?></p>
|
||||||
|
<p>登録日時:<?php if( !empty($value["datetime"]) ){ echo safetext($value["datetime"]); }?></p>
|
||||||
|
<hr>
|
||||||
|
<p><?php if( !empty($value["note"]) ){ echo nl2br(safetext($value["note"])); }?></p>
|
||||||
|
<hr>
|
||||||
|
<form class="delbox" enctype="multipart/form-data" method="post">
|
||||||
|
<p>削除ボタンを押すとこのIPアドレスは削除されます。</p>
|
||||||
|
<input id="del_ipaddr" style="display: none;" type="text" name="del_ipaddr" value="<?php if( !empty($value["ipaddr"]) ){ echo safetext($value["ipaddr"]); }?>">
|
||||||
|
<input type="submit" class="delbtn" name="ip_del_submit" value="削除">
|
||||||
|
</form>
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
<?php }?>
|
||||||
|
<?php }else{?>
|
||||||
|
<p>IPアドレスは登録されていません。</p>
|
||||||
|
<?php }?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<?php require('../require/rightbox.php');?>
|
||||||
|
<?php require('../require/botbox.php');?>
|
||||||
|
<?php require('../require/noscript_modal.php');?>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -59,136 +59,23 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
@@ -276,6 +163,8 @@ RewriteRule ^.*$ - [R=403,L]
|
|||||||
fputs($file, $data);
|
fputs($file, $data);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
|
actionLog($userid, "info", "maintenance_admin", null, "サーバーを停止しました", 0);
|
||||||
|
|
||||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||||
header("Location:".$url."");
|
header("Location:".$url."");
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -60,136 +60,23 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
|
|||||||
@@ -60,136 +60,23 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
|
|||||||
+14
-127
@@ -66,136 +66,23 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
|
|||||||
+14
-127
@@ -47,136 +47,23 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
|
|||||||
+40
-130
@@ -59,136 +59,23 @@ try {
|
|||||||
// 接続エラーのときエラー内容を取得する
|
// 接続エラーのときエラー内容を取得する
|
||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] == true) {
|
//ログイン認証---------------------------------------------------
|
||||||
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "admin");
|
||||||
$passQuery->bindValue(':userid', safetext($_SESSION['userid']));
|
if($is_login === false){
|
||||||
$passQuery->execute();
|
header("Location: ../index.php");
|
||||||
$res = $passQuery->fetch();
|
|
||||||
if(empty($res["userid"])){
|
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] == $res["userid"]){
|
|
||||||
// セッションに値をセット
|
|
||||||
$userid = safetext($res['userid']); // セッションに格納されている値をそのままセット
|
|
||||||
$username = safetext($res['username']); // セッションに格納されている値をそのままセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid, [
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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', safetext($_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 = safetext($res['userid']); // クッキーから取得した値をセット
|
|
||||||
$username = safetext($res['username']); // クッキーから取得した値をセット
|
|
||||||
$loginid = safetext($res["loginid"]);
|
|
||||||
$role = safetext($res["role"]);
|
|
||||||
$sacinfo = safetext($res["sacinfo"]);
|
|
||||||
$myblocklist = safetext($res["blocklist"]);
|
|
||||||
$myfollowlist = safetext($res["follow"]);
|
|
||||||
$_SESSION['admin_login'] = true;
|
|
||||||
$_SESSION['userid'] = $userid;
|
|
||||||
$_SESSION['username'] = $username;
|
|
||||||
$_SESSION['loginid'] = $res["loginid"];
|
|
||||||
setcookie('userid', $userid,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('username', $username,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('loginid', $res["loginid"],[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'path' => '/',
|
|
||||||
'samesite' => 'lax',
|
|
||||||
'secure' => true,
|
|
||||||
'httponly' => true,
|
|
||||||
]);
|
|
||||||
setcookie('admin_login', true,[
|
|
||||||
'expires' => time() + 60 * 60 * 24 * 28,
|
|
||||||
'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;
|
exit;
|
||||||
|
}else{
|
||||||
|
$userid = safetext($is_login['userid']);
|
||||||
|
$username = safetext($is_login['username']);
|
||||||
|
$loginid = safetext($is_login["loginid"]);
|
||||||
|
$role = safetext($is_login["role"]);
|
||||||
|
$sacinfo = safetext($is_login["sacinfo"]);
|
||||||
|
$myblocklist = safetext($is_login["blocklist"]);
|
||||||
|
$myfollowlist = safetext($is_login["follow"]);
|
||||||
|
$is_Admin = safetext($is_login["admin"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||||
$notiQuery->bindValue(':userid', $userid);
|
$notiQuery->bindValue(':userid', $userid);
|
||||||
$notiQuery->execute();
|
$notiQuery->execute();
|
||||||
@@ -280,6 +167,13 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$savemigration = "false";
|
$savemigration = "false";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$get_ip_addr = safetext($_POST['get_ip_addr']);
|
||||||
|
if($get_ip_addr === "true"){
|
||||||
|
$saveget_ip_addr = "true";
|
||||||
|
}else{
|
||||||
|
$saveget_ip_addr = "false";
|
||||||
|
}
|
||||||
|
|
||||||
$postrobots = safetext($_POST['robots']);
|
$postrobots = safetext($_POST['robots']);
|
||||||
if($postrobots === "true"){
|
if($postrobots === "true"){
|
||||||
//GPTBotによるクロールを拒否
|
//GPTBotによるクロールを拒否
|
||||||
@@ -319,6 +213,8 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
server_activitypub = "'.$saveactivitypub.'"
|
server_activitypub = "'.$saveactivitypub.'"
|
||||||
;アカウントの移行登録を許可するか
|
;アカウントの移行登録を許可するか
|
||||||
server_account_migration = "'.$savemigration.'"
|
server_account_migration = "'.$savemigration.'"
|
||||||
|
;IPアドレスを取得するか
|
||||||
|
server_get_ip = "'.$saveget_ip_addr.'"
|
||||||
';
|
';
|
||||||
|
|
||||||
//サーバー設定上書き
|
//サーバー設定上書き
|
||||||
@@ -471,7 +367,7 @@ require('../logout/logout.php');
|
|||||||
<div>
|
<div>
|
||||||
<p>招待制にするかどうか</p>
|
<p>招待制にするかどうか</p>
|
||||||
<div class="switch_button">
|
<div class="switch_button">
|
||||||
<?php if($serversettings["serverinfo"]["server_invitation"] === "true"){?>
|
<?php if(isset($serversettings["serverinfo"]["server_invitation"]) && $serversettings["serverinfo"]["server_invitation"] === "true"){?>
|
||||||
<input id="onlyuser" class="switch_input" type='checkbox' name="onlyuser" value="true" checked/>
|
<input id="onlyuser" class="switch_input" type='checkbox' name="onlyuser" value="true" checked/>
|
||||||
<label for="onlyuser" class="switch_label"></label>
|
<label for="onlyuser" class="switch_label"></label>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
@@ -485,7 +381,7 @@ require('../logout/logout.php');
|
|||||||
<p>アカウントの移行登録を許可するか</p>
|
<p>アカウントの移行登録を許可するか</p>
|
||||||
<div class="p2">他のuwuzuサーバーからのアカウント移行を許可するかです。<br>このサーバーが招待制の場合移行登録にも招待コードが必要となります。</div>
|
<div class="p2">他のuwuzuサーバーからのアカウント移行を許可するかです。<br>このサーバーが招待制の場合移行登録にも招待コードが必要となります。</div>
|
||||||
<div class="switch_button">
|
<div class="switch_button">
|
||||||
<?php if($serversettings["serverinfo"]["server_account_migration"] === "true"){?>
|
<?php if(isset($serversettings["serverinfo"]["server_account_migration"]) && $serversettings["serverinfo"]["server_account_migration"] === "true"){?>
|
||||||
<input id="migration" class="switch_input" type='checkbox' name="migration" value="true" checked/>
|
<input id="migration" class="switch_input" type='checkbox' name="migration" value="true" checked/>
|
||||||
<label for="migration" class="switch_label"></label>
|
<label for="migration" class="switch_label"></label>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
@@ -514,7 +410,7 @@ require('../logout/logout.php');
|
|||||||
<p>ActivityPubサーバーとして認識されるようにするか</p>
|
<p>ActivityPubサーバーとして認識されるようにするか</p>
|
||||||
<div class="p2">ActivityPubの仮実装をオンにするかです。inboxに入ってきた内容には今現在これといったレスポンスを返しません。<br>また、publicKeyも返却しません。<br>現状ActivityPubサーバーと連合を組むことは出来ません。(リモートユーザーの確認程度なら出来ます。)<br>オフの状態だと410 Goneを返します。</div>
|
<div class="p2">ActivityPubの仮実装をオンにするかです。inboxに入ってきた内容には今現在これといったレスポンスを返しません。<br>また、publicKeyも返却しません。<br>現状ActivityPubサーバーと連合を組むことは出来ません。(リモートユーザーの確認程度なら出来ます。)<br>オフの状態だと410 Goneを返します。</div>
|
||||||
<div class="switch_button">
|
<div class="switch_button">
|
||||||
<?php if($serversettings["serverinfo"]["server_activitypub"] === "true"){?>
|
<?php if(isset($serversettings["serverinfo"]["server_activitypub"]) && $serversettings["serverinfo"]["server_activitypub"] === "true"){?>
|
||||||
<input id="activitypub" class="switch_input" type='checkbox' name="activitypub" value="true" checked/>
|
<input id="activitypub" class="switch_input" type='checkbox' name="activitypub" value="true" checked/>
|
||||||
<label for="activitypub" class="switch_label"></label>
|
<label for="activitypub" class="switch_label"></label>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
@@ -524,6 +420,20 @@ require('../logout/logout.php');
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>IPアドレスを取得するか</p>
|
||||||
|
<div class="p2">ユーザーの最終アクセス時のIPアドレスを取得して保存するかどうかを設定します。<br>IPアドレスは最終アクセス時のものを暗号化されて保存されます。<br>プライバシーに関わる事項のため注意して設定してください。</div>
|
||||||
|
<div class="switch_button">
|
||||||
|
<?php if(isset($serversettings["serverinfo"]["server_get_ip"]) && $serversettings["serverinfo"]["server_get_ip"] === "true"){?>
|
||||||
|
<input id="get_ip_addr" class="switch_input" type='checkbox' name="get_ip_addr" value="true" checked/>
|
||||||
|
<label for="get_ip_addr" class="switch_label"></label>
|
||||||
|
<?php }else{?>
|
||||||
|
<input id="get_ip_addr" class="switch_input" type='checkbox' name="get_ip_addr" value="true" />
|
||||||
|
<label for="get_ip_addr" class="switch_label"></label>
|
||||||
|
<?php }?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p>利用規約</p>
|
<p>利用規約</p>
|
||||||
<textarea id="serverterms" placeholder="しっかり書きましょう" class="inbox" type="text" name="serverterms"><?php $sinfo = explode("\n", $serverterms); foreach ($sinfo as $info) { echo $info; }?></textarea>
|
<textarea id="serverterms" placeholder="しっかり書きましょう" class="inbox" type="text" name="serverterms"><?php $sinfo = explode("\n", $serverterms); foreach ($sinfo as $info) { echo $info; }?></textarea>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user