mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-04 19:14:41 +00:00
uwuzu version 1.2.14
This commit is contained in:
+82
-37
@@ -26,7 +26,9 @@ $stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
session_name('uwuzu_s_id');
|
||||
session_start();
|
||||
session_regenerate_id(true);
|
||||
|
||||
$userid = htmlentities($_SESSION['userid']);
|
||||
$username = htmlentities($_SESSION['username']);
|
||||
@@ -62,10 +64,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
$_SESSION['loginid'] = $res["loginid"];
|
||||
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
|
||||
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
|
||||
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
|
||||
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
|
||||
setcookie('userid', $userid,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('username', $username,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('loginid', $res["loginid"],[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('admin_login', true,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
}else{
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
@@ -89,10 +107,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
$_SESSION['loginid'] = $res["loginid"];
|
||||
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
|
||||
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
|
||||
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
|
||||
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
|
||||
setcookie('userid', $userid,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('username', $username,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('loginid', $res["loginid"],[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('admin_login', true,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
}else{
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
@@ -317,7 +351,7 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$msg = ''.$ueuse.'';
|
||||
$title = ''.$userid.'さんが返信しました!';
|
||||
$title = ''.$username.'さんが返信しました!';
|
||||
$url = $_SERVER['REQUEST_URI'];
|
||||
$userchk = 'none';
|
||||
// 通知用SQL作成
|
||||
@@ -669,45 +703,56 @@ $(document).ready(function() {
|
||||
|
||||
$(document).on('click', '.addabi', function (event) {
|
||||
|
||||
abimodal.style.display = 'block';
|
||||
abimodal.style.display = 'block';
|
||||
modalMain.addClass("slideUp");
|
||||
modalMain.removeClass("slideDown");
|
||||
|
||||
var uniqid2 = $(this).attr('data-uniqid2');
|
||||
var postAbiElement = $(this).closest('.addabi');
|
||||
var uniqid2 = $(this).attr('data-uniqid2');
|
||||
var postAbiElement = $(this).closest('.addabi');
|
||||
|
||||
AbiCancelButton.addEventListener('click', () => {
|
||||
AbiCancelButton.addEventListener('click', () => {
|
||||
modalMain.removeClass("slideUp");
|
||||
modalMain.addClass("slideDown");
|
||||
window.setTimeout(function(){
|
||||
abimodal.style.display = 'none';
|
||||
});
|
||||
}, 150);
|
||||
});
|
||||
|
||||
$('#AbiForm').off('submit').on('submit', function (event) {
|
||||
$('#AbiForm').off('submit').on('submit', function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
event.preventDefault();
|
||||
|
||||
var abitext = document.getElementById("abitexts").value;
|
||||
var abitext = document.getElementById("abitexts").value;
|
||||
var username = "<?php echo $username?>";
|
||||
|
||||
if(abitext == ""){
|
||||
if(abitext == ""){
|
||||
modalMain.removeClass("slideUp");
|
||||
modalMain.addClass("slideDown");
|
||||
window.setTimeout(function(){
|
||||
abimodal.style.display = 'none';
|
||||
}else{
|
||||
$.ajax({
|
||||
url: '../abi/addabi.php',
|
||||
method: 'POST',
|
||||
data: { uniqid: uniqid2, abitext: abitext},
|
||||
dataType: 'json',
|
||||
success: function (response) {
|
||||
console.log(response); // レスポンス内容をコンソールに表示
|
||||
if (response.success) {
|
||||
abimodal.style.display = 'none';
|
||||
postAbiElement.remove();
|
||||
}, 150);
|
||||
}else{
|
||||
$.ajax({
|
||||
url: '../abi/addabi.php',
|
||||
method: 'POST',
|
||||
data: { uniqid: uniqid2, abitext: abitext, username: username},
|
||||
dataType: 'json',
|
||||
success: function (response) {
|
||||
console.log(response); // レスポンス内容をコンソールに表示
|
||||
if (response.success) {
|
||||
abimodal.style.display = 'none';
|
||||
postAbiElement.remove();
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user