mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-04 19:14:41 +00:00
uwuzu v1.5.0 Combeny
This commit is contained in:
@@ -248,7 +248,6 @@ if (!empty($pdo)) {
|
||||
<input type="submit" class = "irobutton" name="ads_btn_submit" value="追加">
|
||||
</form>
|
||||
<div class="formarea">
|
||||
<hr>
|
||||
<h1>広告一覧</h1>
|
||||
<?php if(!(empty($adss))){?>
|
||||
<?php foreach ($adss as $value) {?>
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
<?php
|
||||
|
||||
$serversettings_file = "../server/serversettings.ini";
|
||||
$serversettings = parse_ini_file($serversettings_file, true);
|
||||
|
||||
function random_code($length = 8){
|
||||
return substr(str_shuffle('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, $length);
|
||||
}
|
||||
|
||||
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'];
|
||||
|
||||
require('../logout/logout.php');
|
||||
|
||||
if (!empty($pdo)) {
|
||||
$sql = "SELECT * FROM jobs ORDER BY datetime DESC LIMIT 100";
|
||||
$alljobs = $pdo->query($sql);
|
||||
|
||||
while ($row = $alljobs->fetch(PDO::FETCH_ASSOC)) {
|
||||
$jobs[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!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>ログ - <?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">
|
||||
<div class="formarea">
|
||||
<h1>ジョブ</h1>
|
||||
<p>直近100件のジョブを表示します。</p>
|
||||
<div class="p2">この機能はベータ版機能であり、今後変更や削除が行われるおそれがあります。</div>
|
||||
<?php if(!(empty($jobs))){?>
|
||||
<?php foreach ($jobs as $value) {
|
||||
switch ($value["status"]){
|
||||
case "waiting":
|
||||
$status = "Waiting";
|
||||
$color = "WARNING";
|
||||
break;
|
||||
case "running":
|
||||
$status = "Running";
|
||||
$color = "NOTICE";
|
||||
break;
|
||||
case "finished":
|
||||
$status = "Finished";
|
||||
$color = "INFO";
|
||||
break;
|
||||
case "error":
|
||||
$status = "Error";
|
||||
$color = "CRITICAL";
|
||||
break;
|
||||
default:
|
||||
$status = "Waiting";
|
||||
$color = "WARNING";
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<div class="actionlog">
|
||||
<details>
|
||||
<summary><span class="<?php echo safetext($color);?>"><?php echo safetext($status);?></span><?php echo safetext($value["job"]);?> | <?php echo safetext($value["step"]);?></summary>
|
||||
<p>ジョブ: <?php echo safetext($value["job"]);?></p>
|
||||
<p>ステップ: <?php echo safetext($value["step"]);?></p>
|
||||
<p>発生日時: <?php echo safetext($value["datetime"]);?></p>
|
||||
<p>実行ユーザー: <?php echo safetext($value["userid"]);?></p>
|
||||
</details>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php }else{?>
|
||||
<p>ジョブはありません</p>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php require('../require/rightbox.php');?>
|
||||
<?php require('../require/botbox.php');?>
|
||||
<?php require('../require/noscript_modal.php');?>
|
||||
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
function checkForm(inputElement) {
|
||||
var str = inputElement.value;
|
||||
while (str.match(/[^A-Za-z\d_]/)) {
|
||||
str = str.replace(/[^A-Za-z\d_]/, "");
|
||||
}
|
||||
inputElement.value = str;
|
||||
}
|
||||
|
||||
var modal = document.getElementById('account_addrole_Modal');
|
||||
var deleteButton = document.getElementById('deleteButton');
|
||||
var cancelButton = document.getElementById('cancelButton'); // 追加
|
||||
var modalMain = $('.modal-content');
|
||||
|
||||
document.getElementById("addrole").addEventListener('click', function(){
|
||||
modal.style.display = 'block';
|
||||
modalMain.addClass("slideUp");
|
||||
modalMain.removeClass("slideDown");
|
||||
|
||||
deleteButton.addEventListener('click', () => {
|
||||
modalMain.removeClass("slideUp");
|
||||
modalMain.addClass("slideDown");
|
||||
window.setTimeout(function(){
|
||||
modal.style.display = 'none';
|
||||
}, 150);
|
||||
});
|
||||
|
||||
cancelButton.addEventListener('click', () => { // 追加
|
||||
modalMain.removeClass("slideUp");
|
||||
modalMain.addClass("slideDown");
|
||||
window.setTimeout(function(){
|
||||
modal.style.display = 'none';
|
||||
}, 150);
|
||||
});
|
||||
});
|
||||
|
||||
var modal2 = document.getElementById('account_delrole_Modal');
|
||||
var delrole_deleteButton = document.getElementById('delrole_deleteButton');
|
||||
var delrole_cancelButton = document.getElementById('delrole_cancelButton'); // 追加
|
||||
var modalMain = $('.modal-content');
|
||||
|
||||
document.getElementById("delrole").addEventListener('click', function(){
|
||||
modal2.style.display = 'block';
|
||||
modalMain.addClass("slideUp");
|
||||
modalMain.removeClass("slideDown");
|
||||
|
||||
delrole_deleteButton.addEventListener('click', () => {
|
||||
modalMain.removeClass("slideUp");
|
||||
modalMain.addClass("slideDown");
|
||||
window.setTimeout(function(){
|
||||
modal2.style.display = 'none';
|
||||
}, 150);
|
||||
});
|
||||
|
||||
delrole_cancelButton.addEventListener('click', () => { // 追加
|
||||
modalMain.removeClass("slideUp");
|
||||
modalMain.addClass("slideDown");
|
||||
window.setTimeout(function(){
|
||||
modal2.style.display = 'none';
|
||||
}, 150);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
@@ -317,6 +317,14 @@ require('../logout/logout.php');
|
||||
<p>過去1分間のロードアベレージ : <?php echo $loadAve?></p>
|
||||
<?php };?>
|
||||
<hr>
|
||||
<p>自動停止ロードアベレージ上限</p>
|
||||
<div class="p2">uwuzuが自動停止するロードアベレージの上限です。<br>"-1"で無制限です。</div>
|
||||
<p><?php echo safetext(STOP_LA);?></p>
|
||||
<hr>
|
||||
<p>ユーズのレートリミット</p>
|
||||
<div class="p2">1分間にユーズできる上限です。<br>"-1"で無制限です。</div>
|
||||
<p><?php echo safetext(RATE_LM);?> ueuse/min</p>
|
||||
<hr>
|
||||
<p>データベース</p>
|
||||
<div class="p2">データベースの容量情報です。</div>
|
||||
<table>
|
||||
|
||||
@@ -41,6 +41,10 @@ require('plugin_settings/phpmailer_sender.php');
|
||||
require('plugin_settings/aiblockwatermark_settings.php');
|
||||
//------------------------------------------------------
|
||||
|
||||
//AmazonS3--------------------------------------------
|
||||
require('plugin_settings/amazons3_settings.php');
|
||||
//------------------------------------------------------
|
||||
|
||||
session_name('uwuzu_s_id');
|
||||
session_set_cookie_params([
|
||||
'lifetime' => 0,
|
||||
@@ -136,6 +140,40 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
$N_AMS3_CHKS = safetext($_POST['ams3chk_onoff']);
|
||||
|
||||
$N_AMS3_BASE_URLS = safetext($_POST['N_AMS3_BASE_URLS']);
|
||||
$N_AMS3_BUCKET_NM = safetext($_POST['N_AMS3_BUCKET_NM']);
|
||||
$N_AMS3_PREFIX_NM = safetext($_POST['N_AMS3_PREFIX_NM']);
|
||||
$N_AMS3_ENDPOINTS = safetext($_POST['N_AMS3_ENDPOINTS']);
|
||||
$N_AMS3_REGION_NM = safetext($_POST['N_AMS3_REGION_NM']);
|
||||
$N_AMS3_ACCESSKEY = safetext($_POST['N_AMS3_ACCESSKEY']);
|
||||
$N_AMS3_SECRETKEY = safetext($_POST['N_AMS3_SECRETKEY']);
|
||||
$N_AMS3_IS_S3FPS_ = safetext($_POST['N_AMS3_IS_S3FPS_']);
|
||||
|
||||
$New_AMS3_Settings = "
|
||||
<?php // S3の設定
|
||||
define('AMS3_CHKS', '".$N_AMS3_CHKS."'); // trueならオブジェクトストレージが有効
|
||||
|
||||
define('AMS3_BASE_URLS', '".$N_AMS3_BASE_URLS."');
|
||||
define('AMS3_BUCKET_NM', '".$N_AMS3_BUCKET_NM."');
|
||||
define('AMS3_PREFIX_NM', '".$N_AMS3_PREFIX_NM."');
|
||||
define('AMS3_ENDPOINTS', '".$N_AMS3_ENDPOINTS."');
|
||||
define('AMS3_REGION_NM', '".$N_AMS3_REGION_NM."');
|
||||
define('AMS3_ACCESSKEY', '".$N_AMS3_ACCESSKEY."');
|
||||
define('AMS3_SECRETKEY', '".$N_AMS3_SECRETKEY."');
|
||||
define('AMS3_IS_S3FPS_', '".$N_AMS3_IS_S3FPS_."');
|
||||
?>
|
||||
";
|
||||
|
||||
//設定上書き
|
||||
$file = fopen('plugin_settings/amazons3_settings.php', 'w');
|
||||
$data = $New_AMS3_Settings;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
header("Location:".$url."");
|
||||
exit;
|
||||
@@ -278,6 +316,45 @@ require('../logout/logout.php');
|
||||
<label for="aibwmchk_onoff" class="switch_label"></label>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<p>オブジェクトストレージプラグイン</p>
|
||||
<div class="p2">Amazon S3及びAmazon S3互換オブジェクトストレージが使用できるようになるプラグインです。<b>pluginフォルダに解凍済みのAWS SDK for PHPのファイル一式が入っていることが必須要件になります。</b><br>plugin/aws/README.MDなど一式</div>
|
||||
<p>オブジェクトストレージのオンオフ</p>
|
||||
<div class="switch_button">
|
||||
<?php if(!empty(AMS3_CHKS && AMS3_CHKS == "true")){?>
|
||||
<input id="ams3chk_onoff" class="switch_input" type='checkbox' name="ams3chk_onoff" value="true" checked/>
|
||||
<label for="ams3chk_onoff" class="switch_label"></label>
|
||||
<?php }else{?>
|
||||
<input id="ams3chk_onoff" class="switch_input" type='checkbox' name="ams3chk_onoff" value="true" />
|
||||
<label for="ams3chk_onoff" class="switch_label"></label>
|
||||
<?php }?>
|
||||
</div>
|
||||
<div id="ams3_plugin">
|
||||
<p>オブジェクトストレージ - 保存先設定</p>
|
||||
<div class="p2">BaseURL</div>
|
||||
<input id="ams3_plugin" placeholder="https://example.com" class="inbox" type="text" name="N_AMS3_BASE_URLS" value="<?php if( !empty(AMS3_BASE_URLS) ){ echo safetext(AMS3_BASE_URLS); } ?>">
|
||||
<div class="p2">Bucket</div>
|
||||
<input id="ams3_plugin" placeholder="uwuzu-bucket" class="inbox" type="text" name="N_AMS3_BUCKET_NM" value="<?php if( !empty(AMS3_BUCKET_NM) ){ echo safetext(AMS3_BUCKET_NM); } ?>">
|
||||
<div class="p2">Prefix</div>
|
||||
<input id="ams3_plugin" placeholder="files" class="inbox" type="text" name="N_AMS3_PREFIX_NM" value="<?php if( !empty(AMS3_PREFIX_NM) ){ echo safetext(AMS3_PREFIX_NM); } ?>">
|
||||
<div class="p2">Endpoint</div>
|
||||
<input id="ams3_plugin" placeholder="https://example.com" class="inbox" type="text" name="N_AMS3_ENDPOINTS" value="<?php if( !empty(AMS3_ENDPOINTS) ){ echo safetext(AMS3_ENDPOINTS); } ?>">
|
||||
<div class="p2">Region</div>
|
||||
<input id="ams3_plugin" placeholder="us-east-1" class="inbox" type="text" name="N_AMS3_REGION_NM" value="<?php if( !empty(AMS3_REGION_NM) ){ echo safetext(AMS3_REGION_NM); } ?>">
|
||||
<div class="p2">Access Key</div>
|
||||
<input id="ams3_plugin" placeholder="アクセスキー" class="inbox" type="text" name="N_AMS3_ACCESSKEY" value="<?php if( !empty(AMS3_ACCESSKEY) ){ echo safetext(AMS3_ACCESSKEY); } ?>">
|
||||
<div class="p2">Secret Key</div>
|
||||
<input id="ams3_plugin" placeholder="シークレットキー" class="inbox" type="text" name="N_AMS3_SECRETKEY" style="-webkit-text-security:disc;" value="<?php if( !empty(AMS3_SECRETKEY) ){ echo safetext(AMS3_SECRETKEY); } ?>">
|
||||
|
||||
<div class="p2">s3ForcePathStyle設定</div>
|
||||
<div class="switch_button">
|
||||
<input id="ams3_plugin" class="switch_input" type='checkbox' name="N_AMS3_IS_S3FPS_" value="true" <?php if(!empty(AMS3_IS_S3FPS_ && AMS3_IS_S3FPS_ == "true")){?>checked<?php }?>/>
|
||||
<label for="N_AMS3_IS_S3FPS_" class="switch_label"></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<input type="submit" class = "irobutton" name="btn_submit" value="保存&更新">
|
||||
</form>
|
||||
@@ -324,4 +401,13 @@ require('../logout/logout.php');
|
||||
$('#mail_plugin').toggle();
|
||||
$('#mail_plugin_chk').toggle();
|
||||
});
|
||||
|
||||
if ($("#ams3chk_onoff").prop("checked")) {
|
||||
$('#ams3_plugin').show();
|
||||
}else{
|
||||
$('#ams3_plugin').hide();
|
||||
}
|
||||
$('#ams3chk_onoff').change(function(){
|
||||
$('#ams3_plugin').toggle();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
<?php // S3の設定
|
||||
define('AMS3_CHKS', ''); // trueならオブジェクトストレージが有効
|
||||
|
||||
define('AMS3_BASE_URLS', '');
|
||||
define('AMS3_BUCKET_NM', '');
|
||||
define('AMS3_PREFIX_NM', '');
|
||||
define('AMS3_ENDPOINTS', '');
|
||||
define('AMS3_REGION_NM', '');
|
||||
define('AMS3_ACCESSKEY', '');
|
||||
define('AMS3_SECRETKEY', '');
|
||||
define('AMS3_IS_S3FPS_', '');
|
||||
?>
|
||||
|
||||
@@ -401,7 +401,6 @@ if (!empty($pdo)) {
|
||||
<input type="submit" class = "irobutton" name="role_btn_submit" value="作成">
|
||||
</form>
|
||||
<div class="formarea">
|
||||
<hr>
|
||||
<h1>ロール付与</h1>
|
||||
<p>特定のユーザーにロール付与するときに使用してください。</p>
|
||||
<button id="addrole" class="irobutton">付与</button>
|
||||
|
||||
@@ -14,5 +14,6 @@
|
||||
<a href="update_admin" class="admin_leftbtn">アップデート</a>
|
||||
<a href="ipblock_admin" class="admin_leftbtn">IPブロック</a>
|
||||
<a href="actionlog_admin" class="admin_leftbtn">ログ</a>
|
||||
<a href="jobs_admin" class="admin_leftbtn">ジョブ</a>
|
||||
</div>
|
||||
<?php ?>
|
||||
@@ -91,7 +91,7 @@ if (!empty($_POST['update_submit'])) {
|
||||
|
||||
copy($sourceFile, $destinationFile);
|
||||
} else {
|
||||
$error_message[] = "アップデート元のzipファイルに本来予定されていたファイルがありませんでしたが、アップデート作業は完了しました。(UPDATE_FILE_NOT_FOUND)";
|
||||
$error_message[] = "アップデート元のzipファイルに本来予定されていたファイルがありませんでしたが、アップデート作業は完了しました。(UPDATE_FILE_NOT_FOUND(".$sourceFile."))";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ if (!empty($_POST['update_submit'])) {
|
||||
if (file_exists($deleteFile)) {
|
||||
unlink($deleteFile);
|
||||
} else {
|
||||
$error_message[] = "削除予定のファイルがありませんでしたが、アップデート作業は完了しました。(DELETE_FILE_NOT_FOUND)";
|
||||
$error_message[] = "削除予定のファイルがありませんでしたが、アップデート作業は完了しました。(DELETE_FILE_NOT_FOUND(".$deleteFile."))";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,8 +215,6 @@ if (!empty($pdo)) {
|
||||
<div id="loading" class="loading" style="display: none;">
|
||||
🤔
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
</form>
|
||||
<div class="formarea">
|
||||
<h1>通報</h1>
|
||||
|
||||
+35
-167
@@ -96,7 +96,7 @@ if (!empty($pdo)) {
|
||||
$view_ip_addr = $userdata["last_ip"];
|
||||
}
|
||||
|
||||
$roles = explode(',', $userdata["role"]);
|
||||
$roles = array_filter(explode(',', $userdata["role"]));
|
||||
|
||||
$roleDataArray = array();
|
||||
|
||||
@@ -118,6 +118,7 @@ if (!empty($pdo)) {
|
||||
$result->execute();
|
||||
$upload_cnt1 = $result->rowCount();
|
||||
|
||||
$userdata['iconname'] = filter_var($userdata['iconname'], FILTER_VALIDATE_URL) ? $userdata['iconname'] : "../" . $userdata['iconname'];
|
||||
}
|
||||
|
||||
if( !empty($_POST['send_notification_submit']) ) {
|
||||
@@ -344,162 +345,35 @@ if( !empty($_POST['send_water_submit']) ) {
|
||||
|
||||
|
||||
if( !empty($_POST['send_ban_submit']) ) {
|
||||
$userId2 = $userdata['userid']; // 削除対象のユーザーID
|
||||
$folderPath = "../ueuseimages/"; // フォルダのパス
|
||||
try{
|
||||
$userId2 = $userdata['userid']; // 削除対象のユーザーID
|
||||
$res = addJob($pdo, $userId2, "deleteUser", "stop_account");
|
||||
|
||||
// 指定したフォルダ内でユーザーIDを含むファイルを検索
|
||||
$filesToDelete = glob($folderPath . "*-$userId2.*"); // 「-ユーザーID.拡張子」というパターンを検索
|
||||
|
||||
// ファイルを順に削除
|
||||
foreach ($filesToDelete as $file) {
|
||||
if (is_file($file)) {
|
||||
unlink($file); // ファイルを削除
|
||||
}
|
||||
}
|
||||
|
||||
$folderPath2 = "../ueusevideos/"; // フォルダのパス
|
||||
|
||||
// 指定したフォルダ内でユーザーIDを含むファイルを検索
|
||||
$filesToDelete2 = glob($folderPath2 . "*-$userId2.*"); // 「-ユーザーID.拡張子」というパターンを検索
|
||||
|
||||
// ファイルを順に削除
|
||||
foreach ($filesToDelete2 as $file2) {
|
||||
if (is_file($file2)) {
|
||||
unlink($file2); // ファイルを削除
|
||||
}
|
||||
}
|
||||
if ($res) {
|
||||
actionLog($userid, "info", "send_ban_submit", $userId2, $userid."さんが".$userId2."さんをBANしました", 4);
|
||||
header("Location:useradmin");
|
||||
exit;
|
||||
|
||||
$folderPath3 = "../usericons/"; // フォルダのパス
|
||||
|
||||
// 指定したフォルダ内でユーザーIDを含むファイルを検索
|
||||
$filesToDelete3 = glob($folderPath3 . "*-$userId2.*"); // 「-ユーザーID.拡張子」というパターンを検索
|
||||
|
||||
// ファイルを順に削除
|
||||
foreach ($filesToDelete3 as $file3) {
|
||||
if (is_file($file3)) {
|
||||
unlink($file3); // ファイルを削除
|
||||
}
|
||||
}
|
||||
//BAN通知メール
|
||||
if(false !== strpos($userdata["mail_settings"], 'important')) {
|
||||
if(!empty(MAIL_CHKS)){
|
||||
if(MAIL_CHKS == "true"){
|
||||
if( !empty($view_mailadds) ){
|
||||
if(filter_var($view_mailadds, FILTER_VALIDATE_EMAIL)){
|
||||
$mail_title = "お使いの".safetext($serversettings["serverinfo"]["server_name"])."アカウントはBANされました";
|
||||
$mail_text = "".$userdata["username"]."(".$userdata["userid"].")さん いつもuwuzuをご利用いただきありがとうございます。 この度、ご利用のアカウント(".$userdata["userid"].")が".safetext($serversettings["serverinfo"]["server_name"])."管理者によりBAN(削除)されたためお知らせいたします。 今後は今までご利用いただいた".safetext($serversettings["serverinfo"]["server_name"])."アカウントは利用できません。 ".safetext($serversettings["serverinfo"]["server_name"])."サーバー上から今までご利用いただいていたアカウントの情報は削除されたためログインなどもできません。 ご理解とご協力のほどよろしくお願いします。";
|
||||
|
||||
$folderPath4 = "../userheads/"; // フォルダのパス
|
||||
|
||||
// 指定したフォルダ内でユーザーIDを含むファイルを検索
|
||||
$filesToDelete4 = glob($folderPath4 . "*-$userId2.*"); // 「-ユーザーID.拡張子」というパターンを検索
|
||||
|
||||
// ファイルを順に削除
|
||||
foreach ($filesToDelete4 as $file4) {
|
||||
if (is_file($file4)) {
|
||||
unlink($file4); // ファイルを削除
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// フォロー・フォロワー情報を削除したい全てのアカウントを取得
|
||||
$flw_query = $pdo->prepare("SELECT *
|
||||
FROM account
|
||||
WHERE follow LIKE :pattern1
|
||||
OR follow LIKE :pattern2
|
||||
OR follow LIKE :pattern3
|
||||
OR follower LIKE :pattern1
|
||||
OR follower LIKE :pattern2
|
||||
OR follower LIKE :pattern3
|
||||
");
|
||||
$flw_query->bindValue(':pattern1', "%,$userId2,%", PDO::PARAM_STR); // 中間に位置する場合
|
||||
$flw_query->bindValue(':pattern2', "%,$userId2", PDO::PARAM_STR); // 末尾に位置する場合
|
||||
$flw_query->bindValue(':pattern3', "$userId2,%", PDO::PARAM_STR); // 先頭に位置する場合
|
||||
$flw_query->execute();
|
||||
$flw_accounts = $flw_query->fetchAll();
|
||||
|
||||
foreach ($flw_accounts as $account) {
|
||||
unfollow_user($pdo, $account['userid'], $userId2);
|
||||
unfollow_user($pdo, $userId2, $account['userid']);
|
||||
}
|
||||
|
||||
// ユーザーIDを削除したい全てのアカウントを取得
|
||||
$blk_query = $pdo->prepare("SELECT *
|
||||
FROM account
|
||||
WHERE blocklist LIKE :pattern1
|
||||
OR blocklist LIKE :pattern2
|
||||
OR blocklist LIKE :pattern3
|
||||
");
|
||||
$blk_query->bindValue(':pattern1', "%,$userId2,%", PDO::PARAM_STR); // 中間に位置する場合
|
||||
$blk_query->bindValue(':pattern2', "%,$userId2", PDO::PARAM_STR); // 末尾に位置する場合
|
||||
$blk_query->bindValue(':pattern3', "$userId2,%", PDO::PARAM_STR); // 先頭に位置する場合
|
||||
$blk_query->execute();
|
||||
$blk_accounts = $blk_query->fetchAll();
|
||||
|
||||
foreach ($blk_accounts as $account) {
|
||||
unblock_user($pdo, $userId2, $account['userid']);
|
||||
}
|
||||
|
||||
$pdo->beginTransaction();
|
||||
try {
|
||||
// 投稿削除クエリを実行
|
||||
$deleteQuery = $pdo->prepare("DELETE FROM ueuse WHERE account = :userid");
|
||||
$deleteQuery->bindValue(':userid', $userId2, PDO::PARAM_STR);
|
||||
$res = $deleteQuery->execute();
|
||||
|
||||
// 通知削除クエリを実行(自分宛ての通知)
|
||||
$deleteQuery = $pdo->prepare("DELETE FROM notification WHERE touserid = :touserid");
|
||||
$deleteQuery->bindValue(':touserid', $userId2, PDO::PARAM_STR);
|
||||
$res = $deleteQuery->execute();
|
||||
|
||||
// 通知削除クエリを実行(自分からの通知)
|
||||
$deleteQuery = $pdo->prepare("DELETE FROM notification WHERE fromuserid = :fromuserid");
|
||||
$deleteQuery->bindValue(':fromuserid', $userId2, PDO::PARAM_STR);
|
||||
$res = $deleteQuery->execute();
|
||||
|
||||
// いいねの削除
|
||||
$query = $pdo->prepare("SELECT * FROM ueuse WHERE favorite LIKE :pattern1 OR favorite LIKE :pattern2 OR favorite LIKE :pattern3");
|
||||
$query->bindValue(':pattern1', "%,$userId2,%", PDO::PARAM_STR);
|
||||
$query->bindValue(':pattern2', "%,$userId2", PDO::PARAM_STR);
|
||||
$query->bindValue(':pattern3', "$userId2,%", PDO::PARAM_STR);
|
||||
$query->execute();
|
||||
$accounts = $query->fetchAll();
|
||||
|
||||
foreach ($accounts as $account) {
|
||||
// いいねの更新
|
||||
if (strpos($account['favorite'], ",$userId2,") !== false || strpos($account['favorite'], ",$userId2") !== false || strpos($account['favorite'], "$userId2,") !== false) {
|
||||
$favoriteList = explode(',', $account['favorite']);
|
||||
$favoriteList = array_diff($favoriteList, array($userId2));
|
||||
$newFavoriteList = implode(',', $favoriteList);
|
||||
|
||||
$updateFavoriteQuery = $pdo->prepare("UPDATE ueuse SET favorite = :favorite WHERE uniqid = :uniqid");
|
||||
$updateFavoriteQuery->bindValue(':favorite', $newFavoriteList, PDO::PARAM_STR);
|
||||
$updateFavoriteQuery->bindValue(':uniqid', $account['uniqid'], PDO::PARAM_STR);
|
||||
$updateFavoriteQuery->execute();
|
||||
}
|
||||
}
|
||||
|
||||
$deleteQuery = $pdo->prepare("DELETE FROM account WHERE userid = :userid");
|
||||
$deleteQuery->bindValue(':userid', $userId2, PDO::PARAM_STR);
|
||||
$res = $deleteQuery->execute();
|
||||
|
||||
$pdo->commit();
|
||||
} catch (Exception $e) {
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
actionLog($userId2, "error", "deleteAccount", null, $e, 4);
|
||||
}
|
||||
|
||||
//BAN通知メール
|
||||
if(false !== strpos($userdata["mail_settings"], 'important')) {
|
||||
if(!empty(MAIL_CHKS)){
|
||||
if(MAIL_CHKS == "true"){
|
||||
if( !empty($view_mailadds) ){
|
||||
if(filter_var($view_mailadds, FILTER_VALIDATE_EMAIL)){
|
||||
$mail_title = "お使いの".safetext($serversettings["serverinfo"]["server_name"])."アカウントはBANされました";
|
||||
$mail_text = "".$userdata["username"]."(".$userdata["userid"].")さん いつもuwuzuをご利用いただきありがとうございます。 この度、ご利用のアカウント(".$userdata["userid"].")が".safetext($serversettings["serverinfo"]["server_name"])."管理者によりBAN(削除)されたためお知らせいたします。 今後は今までご利用いただいた".safetext($serversettings["serverinfo"]["server_name"])."アカウントは利用できません。 ".safetext($serversettings["serverinfo"]["server_name"])."サーバー上から今までご利用いただいていたアカウントの情報は削除されたためログインなどもできません。 ご理解とご協力のほどよろしくお願いします。";
|
||||
|
||||
$error_message[] = send_html_mail($view_mailadds,$mail_title,$mail_text,"../");
|
||||
$error_message[] = send_html_mail($view_mailadds,$mail_title,$mail_text,"../");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------
|
||||
} else {
|
||||
$error_message[] = 'アカウント削除に失敗しました。(ACCOUNT_DELETE_DAME)';
|
||||
actionLog($userid, "error", "send_ban_submit", $userId2, $error_message[], 4);
|
||||
}
|
||||
//------------
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
@@ -507,16 +381,6 @@ if( !empty($_POST['send_ban_submit']) ) {
|
||||
actionLog($userid, "error", "send_ban_submit", $userId2, $e, 4);
|
||||
}
|
||||
|
||||
if ($res) {
|
||||
actionLog($userid, "info", "send_ban_submit", $userId2, $userid."さんが".$userId2."さんをBANしました", 4);
|
||||
header("Location:useradmin");
|
||||
exit;
|
||||
} else {
|
||||
$error_message[] = 'アカウント削除に失敗しました。(ACCOUNT_DELETE_DAME)';
|
||||
actionLog($userid, "error", "send_ban_submit", $userId2, $error_message, 4);
|
||||
}
|
||||
|
||||
|
||||
// プリペアドステートメントを削除
|
||||
$stmt = null;
|
||||
}
|
||||
@@ -555,7 +419,7 @@ require('../logout/logout.php');
|
||||
<div class="admin_right">
|
||||
<div class="admin_userinfo">
|
||||
<div class="icon">
|
||||
<img src="<?php echo safetext('../'.$userdata['iconname']); ?>">
|
||||
<img src="<?php echo safetext($userdata['iconname']); ?>">
|
||||
<div class="tatext">
|
||||
<h2><?php echo safetext($userdata['username']); ?></h2>
|
||||
<p>@<?php echo safetext($userdata['userid']); ?></p>
|
||||
@@ -566,13 +430,17 @@ require('../logout/logout.php');
|
||||
<?php foreach ($roles as $roleId): ?>
|
||||
<?php $roleData = $roleDataArray[$roleId]; ?>
|
||||
<?php
|
||||
if(safetext($roleData["roleeffect"]) == '' || safetext($roleData["roleeffect"]) == 'none'){
|
||||
$role_view_effect = "";
|
||||
}elseif(safetext($roleData["roleeffect"]) == 'shine'){
|
||||
$role_view_effect = "shine";
|
||||
}elseif(safetext($roleData["roleeffect"]) == 'rainbow'){
|
||||
$role_view_effect = "rainbow";
|
||||
}else{
|
||||
if(!(empty($roleData))){
|
||||
if (safetext($roleData["roleeffect"]) == '' || safetext($roleData["roleeffect"]) == 'none') {
|
||||
$role_view_effect = "";
|
||||
} elseif (safetext($roleData["roleeffect"]) == 'shine') {
|
||||
$role_view_effect = "shine";
|
||||
} elseif (safetext($roleData["roleeffect"]) == 'rainbow') {
|
||||
$role_view_effect = "rainbow";
|
||||
} else {
|
||||
$role_view_effect = "";
|
||||
}
|
||||
} else {
|
||||
$role_view_effect = "";
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user