mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-05 03:24:41 +00:00
uwuzu version 1.2.27
This commit is contained in:
@@ -36,7 +36,7 @@ $res = null;
|
||||
$option = null;
|
||||
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
$userid = htmlentities($_SESSION['userid']);
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ try {
|
||||
|
||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
@@ -65,11 +65,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
exit;
|
||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){
|
||||
// セッションに値をセット
|
||||
$userid = htmlentities($_SESSION['userid']); // セッションに格納されている値をそのままセット
|
||||
$username = htmlentities($_SESSION['username']); // セッションに格納されている値をそのままセット
|
||||
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
|
||||
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
|
||||
$loginid = htmlentities($res["loginid"]);
|
||||
$role = htmlentities($res["role"]);
|
||||
$sacinfo = htmlentities($res["sacinfo"]);
|
||||
$myblocklist = htmlentities($res["blocklist"]);
|
||||
$myfollowlist = htmlentities($res["follow"]);
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
@@ -102,7 +104,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
|
||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
@@ -111,11 +113,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
exit;
|
||||
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){
|
||||
// セッションに値をセット
|
||||
$userid = htmlentities($_COOKIE['userid']); // クッキーから取得した値をセット
|
||||
$username = htmlentities($_COOKIE['username']); // クッキーから取得した値をセット
|
||||
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット
|
||||
$username = htmlentities($res['username']); // クッキーから取得した値をセット
|
||||
$loginid = htmlentities($res["loginid"]);
|
||||
$role = htmlentities($res["role"]);
|
||||
$sacinfo = htmlentities($res["sacinfo"]);
|
||||
$myblocklist = htmlentities($res["blocklist"]);
|
||||
$myfollowlist = htmlentities($res["follow"]);
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
@@ -244,6 +248,7 @@ $pdo = null;
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<script src="../js/unsupported.js"></script>
|
||||
<script src="../js/console_notice.js"></script>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
|
||||
|
||||
+69
-9
@@ -27,9 +27,6 @@ session_name('uwuzu_s_id');
|
||||
session_start();
|
||||
session_regenerate_id(true);
|
||||
|
||||
$userid = htmlentities($_SESSION['userid']);
|
||||
$username = htmlentities($_SESSION['username']);
|
||||
|
||||
try {
|
||||
|
||||
$option = array(
|
||||
@@ -46,7 +43,7 @@ try {
|
||||
|
||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
@@ -55,11 +52,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
exit;
|
||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){
|
||||
// セッションに値をセット
|
||||
$userid = htmlentities($_SESSION['userid']); // セッションに格納されている値をそのままセット
|
||||
$username = htmlentities($_SESSION['username']); // セッションに格納されている値をそのままセット
|
||||
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
|
||||
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
|
||||
$loginid = htmlentities($res["loginid"]);
|
||||
$role = htmlentities($res["role"]);
|
||||
$sacinfo = htmlentities($res["sacinfo"]);
|
||||
$myblocklist = htmlentities($res["blocklist"]);
|
||||
$myfollowlist = htmlentities($res["follow"]);
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
@@ -92,7 +91,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
|
||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
@@ -101,11 +100,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
exit;
|
||||
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){
|
||||
// セッションに値をセット
|
||||
$userid = htmlentities($_COOKIE['userid']); // クッキーから取得した値をセット
|
||||
$username = htmlentities($_COOKIE['username']); // クッキーから取得した値をセット
|
||||
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット
|
||||
$username = htmlentities($res['username']); // クッキーから取得した値をセット
|
||||
$loginid = htmlentities($res["loginid"]);
|
||||
$role = htmlentities($res["role"]);
|
||||
$sacinfo = htmlentities($res["sacinfo"]);
|
||||
$myblocklist = htmlentities($res["blocklist"]);
|
||||
$myfollowlist = htmlentities($res["follow"]);
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
@@ -445,7 +446,39 @@ if( !empty($_POST['logout']) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function rotate($image, $exif)
|
||||
{
|
||||
$orientation = $exif['Orientation'] ?? 1;
|
||||
|
||||
switch ($orientation) {
|
||||
case 1: //no rotate
|
||||
break;
|
||||
case 2: //FLIP_HORIZONTAL
|
||||
imageflip($image, IMG_FLIP_HORIZONTAL);
|
||||
break;
|
||||
case 3: //ROTATE 180
|
||||
$image = imagerotate($image, 180, 0);
|
||||
break;
|
||||
case 4: //FLIP_VERTICAL
|
||||
imageflip($image, IMG_FLIP_VERTICAL);
|
||||
break;
|
||||
case 5: //ROTATE 270 FLIP_HORIZONTAL
|
||||
$image = imagerotate($image, 270, 0);
|
||||
imageflip($image, IMG_FLIP_HORIZONTAL);
|
||||
break;
|
||||
case 6: //ROTATE 90
|
||||
$image = imagerotate($image, 270, 0);
|
||||
break;
|
||||
case 7: //ROTATE 90 FLIP_HORIZONTAL
|
||||
$image = imagerotate($image, 90, 0);
|
||||
imageflip($image, IMG_FLIP_HORIZONTAL);
|
||||
break;
|
||||
case 8: //ROTATE 270
|
||||
$image = imagerotate($image, 90, 0);
|
||||
break;
|
||||
}
|
||||
return $image;
|
||||
}
|
||||
|
||||
if( !empty($_POST['img1btn_submit']) ) {
|
||||
|
||||
@@ -464,6 +497,19 @@ if( !empty($_POST['img1btn_submit']) ) {
|
||||
|
||||
// ファイルを移動
|
||||
$result = move_uploaded_file($uploadedFile['tmp_name'], '../'.$uploadedPath);
|
||||
|
||||
// EXIF削除
|
||||
if($extension == "jpg" || $extension == "jpeg"){
|
||||
$gd = imagecreatefromjpeg('../'.$uploadedPath);
|
||||
$w = imagesx($gd);
|
||||
$h = imagesy($gd);
|
||||
$gd_out = imagecreatetruecolor($w,$h);
|
||||
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
|
||||
$exif = exif_read_data('../'.$uploadedPath);
|
||||
$gd_out = rotate($gd_out, $exif);
|
||||
imagejpeg($gd_out, '../'.$uploadedPath);
|
||||
imagedestroy($gd_out);
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
$headName = $uploadedPath; // 保存されたファイルのパスを使用
|
||||
@@ -563,6 +609,19 @@ if( !empty($_POST['img2btn_submit']) ) {
|
||||
|
||||
// ファイルを移動
|
||||
$result = move_uploaded_file($uploadedFile['tmp_name'], '../'.$uploadedPath);
|
||||
|
||||
// EXIF削除
|
||||
if($extension == "jpg" || $extension == "jpeg"){
|
||||
$gd = imagecreatefromjpeg('../'.$uploadedPath);
|
||||
$w = imagesx($gd);
|
||||
$h = imagesy($gd);
|
||||
$gd_out = imagecreatetruecolor($w,$h);
|
||||
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
|
||||
$exif = exif_read_data('../'.$uploadedPath);
|
||||
$gd_out = rotate($gd_out, $exif);
|
||||
imagejpeg($gd_out, '../'.$uploadedPath);
|
||||
imagedestroy($gd_out);
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
||||
@@ -710,6 +769,7 @@ $pdo = null;
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<script src="../js/unsupported.js"></script>
|
||||
<script src="../js/console_notice.js"></script>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
|
||||
|
||||
+13
-8
@@ -23,8 +23,8 @@ $res = null;
|
||||
$option = null;
|
||||
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
$backupcode = $_SESSION['backupcode'];
|
||||
$userid = htmlentities($_SESSION['userid']);
|
||||
$backupcode = htmlentities($_SESSION['backupcode']);
|
||||
|
||||
|
||||
try {
|
||||
@@ -43,7 +43,7 @@ try {
|
||||
|
||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
@@ -52,11 +52,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
exit;
|
||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){
|
||||
// セッションに値をセット
|
||||
$userid = htmlentities($_SESSION['userid']); // セッションに格納されている値をそのままセット
|
||||
$username = htmlentities($_SESSION['username']); // セッションに格納されている値をそのままセット
|
||||
$userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
|
||||
$username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
|
||||
$loginid = htmlentities($res["loginid"]);
|
||||
$role = htmlentities($res["role"]);
|
||||
$sacinfo = htmlentities($res["sacinfo"]);
|
||||
$myblocklist = htmlentities($res["blocklist"]);
|
||||
$myfollowlist = htmlentities($res["follow"]);
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
@@ -89,7 +91,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
|
||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
@@ -98,11 +100,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
exit;
|
||||
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){
|
||||
// セッションに値をセット
|
||||
$userid = htmlentities($_COOKIE['userid']); // クッキーから取得した値をセット
|
||||
$username = htmlentities($_COOKIE['username']); // クッキーから取得した値をセット
|
||||
$userid = htmlentities($res['userid']); // クッキーから取得した値をセット
|
||||
$username = htmlentities($res['username']); // クッキーから取得した値をセット
|
||||
$loginid = htmlentities($res["loginid"]);
|
||||
$role = htmlentities($res["role"]);
|
||||
$sacinfo = htmlentities($res["sacinfo"]);
|
||||
$myblocklist = htmlentities($res["blocklist"]);
|
||||
$myfollowlist = htmlentities($res["follow"]);
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
@@ -162,6 +166,7 @@ require('../logout/logout.php');
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<script src="../js/unsupported.js"></script>
|
||||
<script src="../js/console_notice.js"></script>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user