mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-05 11:34:41 +00:00
Version 1.2.5
This commit is contained in:
+3
-3
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
require('../db.php');
|
||||
|
||||
if (isset($_POST['uniqid']) && isset($_POST['abitext'])) {
|
||||
$postUniqid = $_POST['uniqid'];
|
||||
$abitext = $_POST['abitext'];
|
||||
if (htmlentities(isset($_POST['uniqid'])) && htmlentities(isset($_POST['abitext']))) {
|
||||
$postUniqid = htmlentities($_POST['uniqid']);
|
||||
$abitext = htmlentities($_POST['abitext']);
|
||||
$abidate = date("Y-m-d H:i:s");
|
||||
|
||||
try {
|
||||
|
||||
+224
@@ -0,0 +1,224 @@
|
||||
<?php
|
||||
|
||||
function createUniqId(){
|
||||
list($msec, $sec) = explode(" ", microtime());
|
||||
$hashCreateTime = $sec.floor($msec*1000000);
|
||||
|
||||
$hashCreateTime = strrev($hashCreateTime);
|
||||
|
||||
return base_convert($hashCreateTime,10,36);
|
||||
}
|
||||
|
||||
require('db.php');
|
||||
|
||||
$servernamefile = "server/servername.txt";
|
||||
|
||||
$onlyuserfile = "server/onlyuser.txt";
|
||||
$onlyuser = file_get_contents($onlyuserfile);
|
||||
|
||||
session_start();
|
||||
|
||||
// 変数の初期化
|
||||
$current_date = null;
|
||||
$message_array = array();
|
||||
$error_message = array();
|
||||
$authcode = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
|
||||
|
||||
// データベースに接続
|
||||
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();
|
||||
}
|
||||
|
||||
require_once 'authcode/GoogleAuthenticator.php';
|
||||
|
||||
if(empty($_SESSION['secretcode'])){
|
||||
$authcode = new PHPGangsta_GoogleAuthenticator();
|
||||
$secret = $authcode->createSecret();
|
||||
$_SESSION['secretcode'] = $secret;
|
||||
}else{
|
||||
$authcode = new PHPGangsta_GoogleAuthenticator();
|
||||
$secret = $_SESSION['secretcode'];
|
||||
}
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
$chkauthcode = new PHPGangsta_GoogleAuthenticator();
|
||||
//二段階認証の確認
|
||||
$userauthcode = $_POST['usercode'];
|
||||
|
||||
$discrepancy = 2;
|
||||
|
||||
$checkResult = $chkauthcode->verifyCode($secret, $userauthcode, $discrepancy);
|
||||
if ($checkResult) {
|
||||
if( empty($error_message) ) {
|
||||
$secret = $_SESSION['secretcode'];
|
||||
// トランザクション開始
|
||||
$pdo->beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
// SQL作成
|
||||
$stmt = $pdo->prepare("UPDATE account SET authcode = :authcode WHERE userid = :userid");
|
||||
|
||||
$stmt->bindValue(':authcode', $secret, PDO::PARAM_STR);
|
||||
|
||||
// ユーザーIDのバインド(WHERE句に必要)
|
||||
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
if ($res) {
|
||||
if (isset($_SERVER['HTTP_COOKIE'])) {
|
||||
$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
|
||||
foreach($cookies as $cookie) {
|
||||
$parts = explode('=', $cookie);
|
||||
$name = trim($parts[0]);
|
||||
setcookie($name, '', time()-1000);
|
||||
setcookie($name, '', time()-1000, '/');
|
||||
}
|
||||
}
|
||||
$userid = "";
|
||||
// リダイレクト先のURLへ転送する
|
||||
$url = 'success.php';
|
||||
header('Location: ' . $url, true, 303);
|
||||
exit;
|
||||
} else {
|
||||
$error_message[] = '更新に失敗しました。';
|
||||
}
|
||||
|
||||
// プリペアドステートメントを削除
|
||||
$stmt = null;
|
||||
}
|
||||
} else {
|
||||
$error_message[] = "二段階認証が出来ませんでした。再度お試しください。";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// データベースの接続を閉じる
|
||||
$pdo = null;
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<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">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>アカウント登録 - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
|
||||
<script src="js/back.js"></script>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="leftbox">
|
||||
<div class="logo">
|
||||
<img src="img/uwuzulogo.svg">
|
||||
</div>
|
||||
|
||||
<div class="textbox">
|
||||
<h1>二段階認証</h1>
|
||||
|
||||
<p>以下の二次元コードより二段階認証をセットアップしてください。</p>
|
||||
<p>セットアップが完了したら入力ボックスにコードを入力して「次へ」ボタンを押してください!<br>注意:まだ二段階認証の設定は終わっていません。次へを押すと設定が完了します。</p>
|
||||
|
||||
<?php if( !empty($error_message) ): ?>
|
||||
<ul class="errmsg">
|
||||
<?php foreach( $error_message as $value ): ?>
|
||||
<p>・ <?php echo $value; ?></p>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
|
||||
$title = file_get_contents($servernamefile);
|
||||
|
||||
$name = $userid;
|
||||
|
||||
$qrCodeUrl = $authcode->getQRCodeGoogleUrl($name, $secret, $title);
|
||||
?>
|
||||
<div class="authzone">
|
||||
<img src="<?php echo $qrCodeUrl;?>">
|
||||
</div>
|
||||
|
||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||
<div>
|
||||
<p>二段階認証コード</p>
|
||||
<div class="p2">先程セットアップして出力された6桁のコードを入力してください。</div>
|
||||
<input id="profile" type="text" placeholder="123456" class="inbox" name="usercode" value="">
|
||||
</div>
|
||||
<input type="submit" class = "irobutton" name="btn_submit" value="次へ">
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function checkForm($this) {
|
||||
var str = $this.value;
|
||||
while (str.match(/[^A-Za-z\d]/)) {
|
||||
str = str.replace(/[^A-Za-z\d]/, "");
|
||||
}
|
||||
$this.value = str;
|
||||
}
|
||||
|
||||
|
||||
window.addEventListener('DOMContentLoaded', function(){
|
||||
|
||||
// ファイルが選択されたら実行
|
||||
document.getElementById("file_upload").addEventListener('change', function(e){
|
||||
|
||||
var file_reader = new FileReader();
|
||||
|
||||
// ファイルの読み込みを行ったら実行
|
||||
file_reader.addEventListener('load', function(e) {
|
||||
console.log(e.target.result);
|
||||
const element = document.querySelector('#wrap');
|
||||
const createElement = '<p>画像を選択しました。</p>';
|
||||
element.insertAdjacentHTML('afterend', createElement);
|
||||
});
|
||||
|
||||
file_reader.readAsText(e.target.files[0]);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+10
-10
@@ -2,7 +2,7 @@
|
||||
|
||||
if(isset($_GET['userid'])) {
|
||||
|
||||
$search = $_GET['userid'];
|
||||
$search = htmlentities($_GET['userid']);
|
||||
|
||||
|
||||
require('../db.php');
|
||||
@@ -52,16 +52,16 @@ if (empty($userdata)){
|
||||
$userdata["follower_cnt"] = count($followercnts)-1;
|
||||
|
||||
$response = array(
|
||||
'user_name' => $userdata["username"],
|
||||
'profile' => $userdata["profile"],
|
||||
'registered_date' => $userdata["datetime"],
|
||||
'follow' => $userdata["follow"],
|
||||
'follow_cnt' => $userdata["follow_cnt"],
|
||||
'follower' => $userdata["follower"],
|
||||
'follower_cnt' => $userdata["follower_cnt"],
|
||||
'user_name' => htmlentities($userdata["username"]),
|
||||
'profile' => htmlentities($userdata["profile"]),
|
||||
'registered_date' => htmlentities($userdata["datetime"]),
|
||||
'follow' => htmlentities($userdata["follow"]),
|
||||
'follow_cnt' => htmlentities($userdata["follow_cnt"]),
|
||||
'follower' => htmlentities($userdata["follower"]),
|
||||
'follower_cnt' => htmlentities($userdata["follower_cnt"]),
|
||||
);
|
||||
}
|
||||
echo json_encode($response);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);;
|
||||
|
||||
}else{
|
||||
|
||||
@@ -70,6 +70,6 @@ echo json_encode($response);
|
||||
'error_code' => $err,
|
||||
);
|
||||
|
||||
echo json_encode($response);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,252 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHP Class for handling Google Authenticator 2-factor authentication.
|
||||
*
|
||||
* @author Michael Kliewe
|
||||
* @copyright 2012 Michael Kliewe
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
|
||||
*
|
||||
* @link http://www.phpgangsta.de/
|
||||
*/
|
||||
class PHPGangsta_GoogleAuthenticator
|
||||
{
|
||||
protected $_codeLength = 6;
|
||||
|
||||
/**
|
||||
* Create new secret.
|
||||
* 16 characters, randomly chosen from the allowed base32 characters.
|
||||
*
|
||||
* @param int $secretLength
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function createSecret($secretLength = 16)
|
||||
{
|
||||
$validChars = $this->_getBase32LookupTable();
|
||||
|
||||
// Valid secret lengths are 80 to 640 bits
|
||||
if ($secretLength < 16 || $secretLength > 128) {
|
||||
throw new Exception('Bad secret length');
|
||||
}
|
||||
$secret = '';
|
||||
$rnd = false;
|
||||
if (function_exists('random_bytes')) {
|
||||
$rnd = random_bytes($secretLength);
|
||||
} elseif (function_exists('mcrypt_create_iv')) {
|
||||
$rnd = mcrypt_create_iv($secretLength, MCRYPT_DEV_URANDOM);
|
||||
} elseif (function_exists('openssl_random_pseudo_bytes')) {
|
||||
$rnd = openssl_random_pseudo_bytes($secretLength, $cryptoStrong);
|
||||
if (!$cryptoStrong) {
|
||||
$rnd = false;
|
||||
}
|
||||
}
|
||||
if ($rnd !== false) {
|
||||
for ($i = 0; $i < $secretLength; ++$i) {
|
||||
$secret .= $validChars[ord($rnd[$i]) & 31];
|
||||
}
|
||||
} else {
|
||||
throw new Exception('No source of secure random');
|
||||
}
|
||||
|
||||
return $secret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the code, with given secret and point in time.
|
||||
*
|
||||
* @param string $secret
|
||||
* @param int|null $timeSlice
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCode($secret, $timeSlice = null)
|
||||
{
|
||||
if ($timeSlice === null) {
|
||||
$timeSlice = floor(time() / 30);
|
||||
}
|
||||
|
||||
$secretkey = $this->_base32Decode($secret);
|
||||
|
||||
// Pack time into binary string
|
||||
$time = chr(0).chr(0).chr(0).chr(0).pack('N*', $timeSlice);
|
||||
// Hash it with users secret key
|
||||
$hm = hash_hmac('SHA1', $time, $secretkey, true);
|
||||
// Use last nipple of result as index/offset
|
||||
$offset = ord(substr($hm, -1)) & 0x0F;
|
||||
// grab 4 bytes of the result
|
||||
$hashpart = substr($hm, $offset, 4);
|
||||
|
||||
// Unpak binary value
|
||||
$value = unpack('N', $hashpart);
|
||||
$value = $value[1];
|
||||
// Only 32 bits
|
||||
$value = $value & 0x7FFFFFFF;
|
||||
|
||||
$modulo = pow(10, $this->_codeLength);
|
||||
|
||||
return str_pad($value % $modulo, $this->_codeLength, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get QR-Code URL for image, from google charts.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $secret
|
||||
* @param string $title
|
||||
* @param array $params
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQRCodeGoogleUrl($name, $secret, $title = null, $params = array())
|
||||
{
|
||||
$width = !empty($params['width']) && (int) $params['width'] > 0 ? (int) $params['width'] : 200;
|
||||
$height = !empty($params['height']) && (int) $params['height'] > 0 ? (int) $params['height'] : 200;
|
||||
$level = !empty($params['level']) && array_search($params['level'], array('L', 'M', 'Q', 'H')) !== false ? $params['level'] : 'M';
|
||||
|
||||
$urlencoded = urlencode('otpauth://totp/'.$name.'?secret='.$secret.'');
|
||||
if (isset($title)) {
|
||||
$urlencoded .= urlencode('&issuer='.urlencode($title));
|
||||
}
|
||||
|
||||
return "https://api.qrserver.com/v1/create-qr-code/?data=$urlencoded&size=${width}x${height}&ecc=$level";
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the code is correct. This will accept codes starting from $discrepancy*30sec ago to $discrepancy*30sec from now.
|
||||
*
|
||||
* @param string $secret
|
||||
* @param string $code
|
||||
* @param int $discrepancy This is the allowed time drift in 30 second units (8 means 4 minutes before or after)
|
||||
* @param int|null $currentTimeSlice time slice if we want use other that time()
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function verifyCode($secret, $code, $discrepancy = 1, $currentTimeSlice = null)
|
||||
{
|
||||
if ($currentTimeSlice === null) {
|
||||
$currentTimeSlice = floor(time() / 30);
|
||||
}
|
||||
|
||||
if (strlen($code) != 6) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for ($i = -$discrepancy; $i <= $discrepancy; ++$i) {
|
||||
$calculatedCode = $this->getCode($secret, $currentTimeSlice + $i);
|
||||
if ($this->timingSafeEquals($calculatedCode, $code)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the code length, should be >=6.
|
||||
*
|
||||
* @param int $length
|
||||
*
|
||||
* @return PHPGangsta_GoogleAuthenticator
|
||||
*/
|
||||
public function setCodeLength($length)
|
||||
{
|
||||
$this->_codeLength = $length;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper class to decode base32.
|
||||
*
|
||||
* @param $secret
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
protected function _base32Decode($secret)
|
||||
{
|
||||
if (empty($secret)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$base32chars = $this->_getBase32LookupTable();
|
||||
$base32charsFlipped = array_flip($base32chars);
|
||||
|
||||
$paddingCharCount = substr_count($secret, $base32chars[32]);
|
||||
$allowedValues = array(6, 4, 3, 1, 0);
|
||||
if (!in_array($paddingCharCount, $allowedValues)) {
|
||||
return false;
|
||||
}
|
||||
for ($i = 0; $i < 4; ++$i) {
|
||||
if ($paddingCharCount == $allowedValues[$i] &&
|
||||
substr($secret, -($allowedValues[$i])) != str_repeat($base32chars[32], $allowedValues[$i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$secret = str_replace('=', '', $secret);
|
||||
$secret = str_split($secret);
|
||||
$binaryString = '';
|
||||
for ($i = 0; $i < count($secret); $i = $i + 8) {
|
||||
$x = '';
|
||||
if (!in_array($secret[$i], $base32chars)) {
|
||||
return false;
|
||||
}
|
||||
for ($j = 0; $j < 8; ++$j) {
|
||||
$x .= str_pad(base_convert(@$base32charsFlipped[@$secret[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
|
||||
}
|
||||
$eightBits = str_split($x, 8);
|
||||
for ($z = 0; $z < count($eightBits); ++$z) {
|
||||
$binaryString .= (($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48) ? $y : '';
|
||||
}
|
||||
}
|
||||
|
||||
return $binaryString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get array with all 32 characters for decoding from/encoding to base32.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function _getBase32LookupTable()
|
||||
{
|
||||
return array(
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7
|
||||
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15
|
||||
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23
|
||||
'Y', 'Z', '2', '3', '4', '5', '6', '7', // 31
|
||||
'=', // padding char
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A timing safe equals comparison
|
||||
* more info here: http://blog.ircmaxell.com/2014/11/its-all-about-time.html.
|
||||
*
|
||||
* @param string $safeString The internal (safe) value to be checked
|
||||
* @param string $userString The user submitted (unsafe) value
|
||||
*
|
||||
* @return bool True if the two strings are identical
|
||||
*/
|
||||
private function timingSafeEquals($safeString, $userString)
|
||||
{
|
||||
if (function_exists('hash_equals')) {
|
||||
return hash_equals($safeString, $userString);
|
||||
}
|
||||
$safeLen = strlen($safeString);
|
||||
$userLen = strlen($userString);
|
||||
|
||||
if ($userLen != $safeLen) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$result = 0;
|
||||
|
||||
for ($i = 0; $i < $userLen; ++$i) {
|
||||
$result |= (ord($safeString[$i]) ^ ord($userString[$i]));
|
||||
}
|
||||
|
||||
// They are only identical strings if $result is exactly 0...
|
||||
return $result === 0;
|
||||
}
|
||||
}
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
function createUniqId(){
|
||||
list($msec, $sec) = explode(" ", microtime());
|
||||
$hashCreateTime = $sec.floor($msec*1000000);
|
||||
|
||||
$hashCreateTime = strrev($hashCreateTime);
|
||||
|
||||
return base_convert($hashCreateTime,10,36);
|
||||
}
|
||||
|
||||
require('db.php');
|
||||
|
||||
$servernamefile = "server/servername.txt";
|
||||
|
||||
$onlyuserfile = "server/onlyuser.txt";
|
||||
$onlyuser = file_get_contents($onlyuserfile);
|
||||
|
||||
session_start();
|
||||
|
||||
// 変数の初期化
|
||||
$current_date = null;
|
||||
$message_array = array();
|
||||
$error_message = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
|
||||
|
||||
// データベースに接続
|
||||
try {
|
||||
|
||||
$option = array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||
);
|
||||
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
} catch(PDOException $e) {
|
||||
|
||||
// 接続エラーのときエラー内容を取得する
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
$_SESSION['userid'] = $userid;
|
||||
// リダイレクト先のURLへ転送する
|
||||
$url = 'addauthcode.php';
|
||||
header('Location: ' . $url, true, 303);
|
||||
|
||||
// すべての出力を終了
|
||||
exit;
|
||||
}
|
||||
|
||||
if( !empty($_POST['skip_submit']) ) {
|
||||
if (isset($_SERVER['HTTP_COOKIE'])) {
|
||||
$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
|
||||
foreach($cookies as $cookie) {
|
||||
$parts = explode('=', $cookie);
|
||||
$name = trim($parts[0]);
|
||||
setcookie($name, '', time()-1000);
|
||||
setcookie($name, '', time()-1000, '/');
|
||||
}
|
||||
}
|
||||
$userid = "";
|
||||
// リダイレクト先のURLへ転送する
|
||||
$url = 'success.php';
|
||||
header('Location: ' . $url, true, 303);
|
||||
|
||||
// すべての出力を終了
|
||||
exit;
|
||||
}
|
||||
|
||||
// データベースの接続を閉じる
|
||||
$pdo = null;
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<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">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>アカウント登録 - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
|
||||
<script src="js/back.js"></script>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="leftbox">
|
||||
<div class="logo">
|
||||
<img src="img/uwuzulogo.svg">
|
||||
</div>
|
||||
|
||||
<div class="textbox">
|
||||
<h1>二段階認証</h1>
|
||||
|
||||
<p>二段階認証を設定しますか?</p>
|
||||
<p>二段階認証を設定することによりログイン時の一時キーが必要となりセキュリティを強化することが出来ます。<br>設定にはGoogleAuthenticatorなどの二段階認証アプリが必要です。</p>
|
||||
|
||||
<?php if( !empty($error_message) ): ?>
|
||||
<ul class="errmsg">
|
||||
<?php foreach( $error_message as $value ): ?>
|
||||
<p>・ <?php echo $value; ?></p>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||
<input type="submit" class = "irobutton" name="btn_submit" value="登録">
|
||||
<input type="submit" class = "sirobutton" name="skip_submit" value="スキップ">
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function checkForm($this) {
|
||||
var str = $this.value;
|
||||
while (str.match(/[^A-Za-z\d]/)) {
|
||||
str = str.replace(/[^A-Za-z\d]/, "");
|
||||
}
|
||||
$this.value = str;
|
||||
}
|
||||
|
||||
|
||||
window.addEventListener('DOMContentLoaded', function(){
|
||||
|
||||
// ファイルが選択されたら実行
|
||||
document.getElementById("file_upload").addEventListener('change', function(e){
|
||||
|
||||
var file_reader = new FileReader();
|
||||
|
||||
// ファイルの読み込みを行ったら実行
|
||||
file_reader.addEventListener('load', function(e) {
|
||||
console.log(e.target.result);
|
||||
const element = document.querySelector('#wrap');
|
||||
const createElement = '<p>画像を選択しました。</p>';
|
||||
element.insertAdjacentHTML('afterend', createElement);
|
||||
});
|
||||
|
||||
file_reader.readAsText(e.target.files[0]);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
|
||||
$servernamefile = "server/servername.txt";
|
||||
|
||||
require('db.php');
|
||||
|
||||
|
||||
// 変数の初期化
|
||||
$current_date = null;
|
||||
$message_array = array();
|
||||
$error_message = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
$row["loginid"] = "";
|
||||
$row["authcode"] = "";
|
||||
|
||||
$ruserid = "";
|
||||
$rpassword = "";
|
||||
|
||||
$userid = "";
|
||||
$_SESSION["userid"]="";
|
||||
|
||||
$password = null;
|
||||
$_SESSION["password"]="";
|
||||
|
||||
|
||||
session_start();
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
try {
|
||||
$options = 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, $options);
|
||||
} catch(PDOException $e) {
|
||||
// 接続エラーのときエラー内容を取得する
|
||||
$error_message[] = 'データベース接続エラー: ' . $e->getMessage();
|
||||
}
|
||||
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
$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, $options);
|
||||
|
||||
require_once 'authcode/GoogleAuthenticator.php';
|
||||
|
||||
$result = $dbh->prepare("SELECT authcode,loginid,username FROM account WHERE userid = :userid");
|
||||
|
||||
$result->bindValue(':userid', $userid);
|
||||
// SQL実行
|
||||
$result->execute();
|
||||
if($result->rowCount() > 0) {
|
||||
$row = $result->fetch();
|
||||
|
||||
$tousercode = $row["authcode"];
|
||||
|
||||
$chkauthcode = new PHPGangsta_GoogleAuthenticator();
|
||||
|
||||
$userauthcode = $_POST['usercode'];
|
||||
|
||||
if(empty($userauthcode)){
|
||||
$error_message[] = "コードを入力してください。";
|
||||
}else{
|
||||
|
||||
$discrepancy = 2;
|
||||
|
||||
$checkResult = $chkauthcode->verifyCode($tousercode, $userauthcode, $discrepancy);
|
||||
if ($checkResult) {
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['loginid'] = $row["loginid"];
|
||||
|
||||
$_SESSION['username'] = $row["username"];
|
||||
$_SESSION['password'] = "";
|
||||
|
||||
// リダイレクト先のURLへ転送する
|
||||
$url = '/home';
|
||||
header('Location: ' . $url, true, 303);
|
||||
|
||||
// すべての出力を終了
|
||||
exit;
|
||||
|
||||
}else {
|
||||
$error_message[] = '二段階認証が出来ませんでした。再度お試しください。';
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$error_message[] = 'データの取得が出来ませんでした。再度お試しください。';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// データベースの接続を閉じる
|
||||
$pdo = null;
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<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">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>ログイン - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
<script src="js/back.js"></script>
|
||||
<body>
|
||||
|
||||
<div class="leftbox">
|
||||
<div class="logo">
|
||||
<img src="img/uwuzulogo.svg">
|
||||
</div>
|
||||
|
||||
<div class="textbox">
|
||||
<h1>二段階認証</h1>
|
||||
|
||||
<p>二段階認証コードを入力してください。</p>
|
||||
|
||||
<?php if( !empty($error_message) ): ?>
|
||||
<ul class="errmsg">
|
||||
<?php foreach( $error_message as $value ): ?>
|
||||
<p>・ <?php echo $value; ?></p>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||
<div>
|
||||
<p>二段階認証コード</p>
|
||||
<div class="p2">6桁のコードを入力してください。</div>
|
||||
<input id="profile" type="text" placeholder="123456" class="inbox" name="usercode" value="">
|
||||
</div>
|
||||
<input type="submit" class = "irobutton" name="btn_submit" value="次へ">
|
||||
</form>
|
||||
|
||||
<div class="btnbox">
|
||||
<a href="index.php" class="sirobutton">戻る</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function checkForm($this)
|
||||
{
|
||||
var str=$this.value;
|
||||
while(str.match(/[^A-Z^a-z\d\-]/))
|
||||
{
|
||||
str=str.replace(/[^A-Z^a-z\d\-]/,"");
|
||||
}
|
||||
$this.value=str;
|
||||
}
|
||||
|
||||
|
||||
window.onload = function(){
|
||||
var ele = document.getElementsByTagName("body")[0];
|
||||
var n = Math.floor(Math.random() * 3); // 3枚の画像がある場合
|
||||
ele.style.backgroundImage = "url(img/titleimg/"+n+".png)";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -167,7 +167,7 @@ $pdo = null;
|
||||
<div class="textbox">
|
||||
<h1>確認</h1>
|
||||
|
||||
<p>あなたは <?php if( !empty($row["username"]) ){ echo htmlspecialchars( $row["username"], ENT_QUOTES, 'UTF-8'); } ?> ですか?</p>
|
||||
<p>あなたは <?php if( !empty($row["username"]) ){ echo htmlentities( $row["username"], ENT_QUOTES, 'UTF-8'); } ?> ですか?</p>
|
||||
|
||||
<?php if( !empty($error_message) ): ?>
|
||||
<ul class="errmsg">
|
||||
@@ -180,20 +180,20 @@ $pdo = null;
|
||||
<div class="myarea">
|
||||
<img src="image.php">
|
||||
<p>名前</p>
|
||||
<h2><?php if( !empty($row["username"]) ){ echo htmlspecialchars( $row["username"], ENT_QUOTES, 'UTF-8'); } ?></h2>
|
||||
<h2><?php if( !empty($row["username"]) ){ echo htmlentities( $row["username"], ENT_QUOTES, 'UTF-8'); } ?></h2>
|
||||
<div class="roleboxes">
|
||||
<?php foreach ($roles as $roleId): ?>
|
||||
<?php $roleData = $roleDataArray[$roleId]; ?>
|
||||
<div class="rolebox" style="border: 1px solid <?php echo '#' . $roleData["rolecolor"]; ?>;">
|
||||
<p style="color: <?php echo '#' . $roleData["rolecolor"]; ?>;">
|
||||
<?php if (!empty($roleData["rolename"])) { echo htmlspecialchars($roleData["rolename"], ENT_QUOTES, 'UTF-8'); } ?>
|
||||
<?php if (!empty($roleData["rolename"])) { echo htmlentities($roleData["rolename"], ENT_QUOTES, 'UTF-8'); } ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<hr>
|
||||
<p>プロフィール</p>
|
||||
<h3><?php if( !empty($row["profile"]) ){ echo htmlspecialchars( $row["profile"], ENT_QUOTES, 'UTF-8'); } ?></h3>
|
||||
<h3><?php if( !empty($row["profile"]) ){ echo htmlentities( $row["profile"], ENT_QUOTES, 'UTF-8'); } ?></h3>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1612,12 +1612,31 @@ main h1{
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.formarea .authzone{
|
||||
width: 100%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.formarea .sub{
|
||||
display: flex;
|
||||
margin: 48px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.formarea .p2{
|
||||
margin-top: 0px;
|
||||
margin-bottom: 10px;
|
||||
word-wrap: break-word;
|
||||
line-height: 20px;
|
||||
color: #868686;
|
||||
font-size: 12px;
|
||||
font-family: 'BIZ UDPGothic', sans-serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
label>input {
|
||||
display:none; /* アップロードボタンのスタイルを無効にする */
|
||||
}
|
||||
@@ -2446,6 +2465,13 @@ hr{
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.userheader .roleboxes{
|
||||
margin-left: 24px;
|
||||
display: flex;
|
||||
padding: 0px;
|
||||
flex-wrap : wrap;
|
||||
}
|
||||
|
||||
main{
|
||||
height: 88dvh;
|
||||
overflow: auto;
|
||||
|
||||
@@ -348,6 +348,17 @@ label > input {
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.formarea label{
|
||||
overflow-wrap: break-word;
|
||||
margin-top: 24px;
|
||||
margin-bottom: 24px;
|
||||
font-size: 16px;
|
||||
color:#252525;
|
||||
text-decoration: none;
|
||||
font-family: 'BIZ UDPGothic', sans-serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.myarea{
|
||||
padding-top: 16px;
|
||||
padding-bottom: 32px;
|
||||
@@ -382,6 +393,16 @@ label > input {
|
||||
font-family: 'BIZ UDPGothic', sans-serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
.ueuse2 a{
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
margin-left: 6px;
|
||||
font-size: 16px;
|
||||
color:#4e4428;
|
||||
text-decoration: none;
|
||||
font-family: 'BIZ UDPGothic', sans-serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.inbox {
|
||||
width: 96%;
|
||||
@@ -683,6 +704,17 @@ main h1{
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
|
||||
width:45%;
|
||||
}
|
||||
.textbox .authzone{
|
||||
width: 100%;
|
||||
margin-top: 64px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.textbox .authzone img{
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------------------------------------*/
|
||||
/*--------------------------------------------------スマホ向け--------------------------------------------------*/
|
||||
@@ -852,4 +884,8 @@ main h1{
|
||||
margin-left: 0px;
|
||||
padding: 32px;
|
||||
}
|
||||
|
||||
.textbox .authzone img{
|
||||
width: 80%;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -2,10 +2,10 @@
|
||||
require('../db.php');
|
||||
|
||||
if (isset($_POST['uniqid'])){
|
||||
$postUniqid = $_POST['uniqid'];
|
||||
$postUniqid = htmlentities($_POST['uniqid']);
|
||||
|
||||
try {
|
||||
$pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS);
|
||||
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS);
|
||||
|
||||
// 削除クエリを実行
|
||||
$deleteQuery = $pdo->prepare("DELETE FROM ueuse WHERE uniqid = :uniqid");
|
||||
|
||||
+2
-2
@@ -25,8 +25,8 @@ $option = null;
|
||||
|
||||
session_start();
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
$username = $_SESSION['username'];
|
||||
$userid = htmlentities($_SESSION['userid']);
|
||||
$username = htmlentities($_SESSION['username']);
|
||||
|
||||
try {
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ $pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER,
|
||||
|
||||
//$row['userid'] = "daichimarukn";
|
||||
|
||||
$emojiname = $_GET['emoji'];
|
||||
$emojiname = htmlentities($_GET['emoji']);
|
||||
|
||||
|
||||
$options = array(
|
||||
|
||||
@@ -23,8 +23,10 @@ $res = null;
|
||||
$option = null;
|
||||
|
||||
session_start();
|
||||
session_regenerate_id(true);
|
||||
|
||||
//------------------------------------------
|
||||
|
||||
try {
|
||||
|
||||
$option = array(
|
||||
@@ -107,6 +109,7 @@ if(empty($username)){
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if (!empty($pdo)) {
|
||||
$sql = "SELECT emojiname,emojiinfo,emojidate FROM emoji ORDER BY emojidate DESC";
|
||||
$message_array = $pdo->query($sql);
|
||||
|
||||
@@ -21,8 +21,6 @@ $termsdata = file_get_contents($termsfile);
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title>400 Bad Request - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ $termsdata = file_get_contents($termsfile);
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title>401 Unauthorized - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ $termsdata = file_get_contents($termsfile);
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title>403 Forbidden - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ $termsdata = file_get_contents($termsfile);
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title>404 Not found - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ $termsdata = file_get_contents($termsfile);
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title>500 Internal Server Error - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ $termsdata = file_get_contents($termsfile);
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title>503 Service Unavailable - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -1,61 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<?php
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
//-------------------------------------
|
||||
|
||||
$domain = $_SERVER['HTTP_HOST'];
|
||||
|
||||
//------------------------
|
||||
|
||||
$contactfile = "../server/contact.txt";
|
||||
|
||||
$termsfile = "../server/serverstop.txt";
|
||||
$termsdata = file_get_contents($termsfile);
|
||||
|
||||
function processMarkdownAndWrapEmptyLines($markdownText) {
|
||||
|
||||
// コード(#code)をHTMLのdiv class="code"タグに変換
|
||||
$markdownText = preg_replace('/^#code (.+)/m', '<div class="code"><p>$1</p></div>', $markdownText);
|
||||
|
||||
// 画像(#img)をHTMLのimgタグに変換
|
||||
$markdownText = preg_replace('/^#img (.+)/m', '<img src="$1">', $markdownText);
|
||||
|
||||
// タイトル(#、##、###)をHTMLのhタグに変換
|
||||
$markdownText = preg_replace('/^# (.+)/m', '<h2>$1</h2>', $markdownText);
|
||||
$markdownText = preg_replace('/^## (.+)/m', '<h3>$1</h3>', $markdownText);
|
||||
$markdownText = preg_replace('/^### (.+)/m', '<h4>$1</h4>', $markdownText);
|
||||
|
||||
// 箇条書き(-)をHTMLのul/liタグに変換
|
||||
$markdownText = preg_replace('/^- (.+)/m', '<ul><li>$1</li></ul>', $markdownText);
|
||||
|
||||
// 空行の前に何もない行をHTMLのpタグに変換
|
||||
$markdownText = preg_replace('/(^\s*)(?!\s)(.*)/m', '$1<p>$2</p>', $markdownText);
|
||||
|
||||
return $markdownText;
|
||||
}
|
||||
|
||||
$sterms = explode("\n", $termsdata);
|
||||
$htmltext = ''; // 初期化
|
||||
|
||||
foreach ($sterms as $terms) {
|
||||
$markdowntext = $terms;
|
||||
$convertedText = processMarkdownAndWrapEmptyLines($markdowntext);
|
||||
$htmltext .= $convertedText . "\n"; // 変換されたテキストを追加
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<link rel="stylesheet" href="home.css">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title>サーバー停止 - <?php echo file_get_contents($servernamefile);?></title>
|
||||
<title>サーバー停止 - ゆずさば</title>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -63,20 +13,20 @@ foreach ($sterms as $terms) {
|
||||
|
||||
<div class="topbox">
|
||||
<div class="logo">
|
||||
<img src="../img/uwuzulogo.svg">
|
||||
<img src="uwuzulogo.svg">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="terms">
|
||||
|
||||
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
|
||||
<div class="p2c"><?php echo $domain;?></div>
|
||||
<div class="p3">ゆずさば</div>
|
||||
<div class="p2c">uwuzu.net</div>
|
||||
<div class="err404">
|
||||
<h1>サーバー停止中</h1>
|
||||
<p>(/´・ヮ・`\)<br>現在サーバーが管理者によって停止されています...<br>停止の理由は以下の通りです。</p>
|
||||
|
||||
<hr>
|
||||
<p><?php echo $htmltext;?></p>
|
||||
<p>あまりにも脆弱すぎたためサービスを止めさせていただきました。<br>復旧の目処はたっておりません。</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
require('../db.php');
|
||||
|
||||
if (isset($_POST['uniqid']) && isset($_POST['userid'])) {
|
||||
$postUniqid = $_POST['uniqid'];
|
||||
$userId = $_POST['userid'];
|
||||
if (htmlentities(isset($_POST['uniqid'])) && htmlentities(isset($_POST['userid']))) {
|
||||
$postUniqid = htmlentities($_POST['uniqid']);
|
||||
$userId = htmlentities($_POST['userid']);
|
||||
|
||||
try {
|
||||
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS);
|
||||
|
||||
+28
-4
@@ -112,7 +112,7 @@ if(empty($username)){
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
$ueuse = $_POST['ueuse'];
|
||||
$ueuse = htmlentities($_POST['ueuse']);
|
||||
|
||||
// メッセージの入力チェック
|
||||
if( empty($ueuse) ) {
|
||||
@@ -146,7 +146,15 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
if ($result) {
|
||||
$photo1 = $uploadedPath; // 保存されたファイルのパスを使用
|
||||
} else {
|
||||
$error_message[] = 'アップロード失敗!(1)エラーコード:' . $uploadedFile['error'].'<br>'.var_dump($_FILES['upload_images']);
|
||||
$errnum = $uploadedFile['error'];
|
||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +186,15 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
if ($result2) {
|
||||
$photo2 = $uploadedPath2; // 保存されたファイルのパスを使用
|
||||
} else {
|
||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' . $uploadedFile2['error'].'<br>'.var_dump($_FILES['upload_images']);
|
||||
$errnum = $uploadedFile2['error'];
|
||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +222,15 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
if ($result3) {
|
||||
$video1 = $uploadedPath3; // 保存されたファイルのパスを使用
|
||||
} else {
|
||||
$error_message[] = 'アップロード失敗!エラーコード:' . $uploadedFile3['error'];
|
||||
$errnum = $uploadedFile3['error'];
|
||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
|
||||
}
|
||||
} else {
|
||||
$error_message[] = '対応していないファイル形式です!';
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ $pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER,
|
||||
|
||||
//$row['userid'] = "daichimarukn";
|
||||
|
||||
$userid = $_GET['account'];
|
||||
$userid = htmlentities($_GET['account']);
|
||||
|
||||
|
||||
$options = array(
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
@@ -1,20 +1,79 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<?php
|
||||
|
||||
require('db.php');
|
||||
|
||||
session_start();
|
||||
if (empty($_SESSION['admin_login'])){
|
||||
|
||||
}else{
|
||||
if($_SESSION['admin_login'] == true) {
|
||||
// ログインページへリダイレクト
|
||||
header("Location: /home/index.php");
|
||||
try {
|
||||
|
||||
$option = array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||
);
|
||||
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
} catch(PDOException $e) {
|
||||
|
||||
// 接続エラーのときエラー内容を取得する
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
|
||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', $_SESSION['userid']);
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
if(empty($res["userid"])){
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}elseif($_SESSION['loginid'] === $res["loginid"]){
|
||||
// セッションに値をセット
|
||||
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
|
||||
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
|
||||
$_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);
|
||||
header("Location: home/index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', $_COOKIE['userid']);
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
if(empty($res["userid"])){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}elseif($_COOKIE['loginid'] === $res["loginid"]){
|
||||
// セッションに値をセット
|
||||
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
|
||||
$username = $_COOKIE['username']; // クッキーから取得した値をセット
|
||||
$_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);
|
||||
header("Location: home/index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$servernamefile = "server/servername.txt";
|
||||
|
||||
//------------------------
|
||||
@@ -32,6 +91,9 @@ $contactfile = "server/contact.txt";
|
||||
|
||||
//------------------------
|
||||
|
||||
$onlyuserfile = "server/onlyuser.txt";
|
||||
$onlyuser = file_get_contents($onlyuserfile);
|
||||
|
||||
try {
|
||||
|
||||
$option = array(
|
||||
@@ -120,6 +182,13 @@ if ("serviceWorker" in navigator) {
|
||||
|
||||
<a class="maillink" href="mailto:<?php echo file_get_contents($contactfile);?>">お問い合わせ : <?php echo file_get_contents($contactfile);?></a>
|
||||
|
||||
<?php if($onlyuser === "true"){?>
|
||||
<p>このサーバーには招待コードがないと登録できません。<br>招待コードはお手元にありますか?</p>
|
||||
<div class="btnbox">
|
||||
<a href="new.php" class="irobutton">アカウント登録</a>
|
||||
<a href="login.php" class="sirobutton">ログイン</a>
|
||||
</div>
|
||||
<?php }else{?>
|
||||
<div class="cntzone">
|
||||
<div class="usercnt">
|
||||
<div class="p1">ユーザー数</div>
|
||||
@@ -131,12 +200,11 @@ if ("serviceWorker" in navigator) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="btnbox">
|
||||
<a href="new.php" class="irobutton">アカウント登録</a>
|
||||
<a href="login.php" class="sirobutton">ログイン</a>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
|
||||
$result = $dbh->prepare("SELECT userid, password, loginid FROM account WHERE userid = :userid");
|
||||
$result = $dbh->prepare("SELECT userid, password, loginid, authcode FROM account WHERE userid = :userid");
|
||||
|
||||
$result->bindValue(':userid', $userid);
|
||||
// SQL実行
|
||||
@@ -88,6 +88,7 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
if($row["userid"] == $userid){
|
||||
if(password_verify($password,$row["password"])){
|
||||
if(empty($row["authcode"])){
|
||||
$_SESSION['admin_login'] = true;
|
||||
|
||||
$_SESSION['userid'] = $userid;
|
||||
@@ -98,6 +99,14 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
// すべての出力を終了
|
||||
exit;
|
||||
}else{
|
||||
$_SESSION['userid'] = $userid;
|
||||
$url = 'authlogin.php';
|
||||
header('Location: ' . $url, true, 303);
|
||||
|
||||
// すべての出力を終了
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$error_message[] = 'IDまたはパスワードが違います';
|
||||
@@ -159,14 +168,14 @@ $pdo = null;
|
||||
<!--ユーザーネーム関係-->
|
||||
<div>
|
||||
<label for="userid">ユーザーID</label>
|
||||
<input onInput="checkForm(this)" id="userid" class="inbox" type="text" name="userid" value="<?php if( !empty($_SESSION['userid']) ){ echo htmlspecialchars( $_SESSION['userid'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
<input onInput="checkForm(this)" id="userid" class="inbox" type="text" name="userid" value="<?php if( !empty($_SESSION['userid']) ){ echo htmlentities( $_SESSION['userid'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
<!--個人情報関係-->
|
||||
|
||||
<!--アカウント関連-->
|
||||
<div>
|
||||
<label for="password">パスワード</label>
|
||||
<input onInput="checkForm(this)" id="password" class="inbox" type="password" name="password" value="<?php if( !empty($_SESSION['password']) ){ echo htmlspecialchars( $_SESSION['password'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
<input onInput="checkForm(this)" id="password" class="inbox" type="password" name="password" value="<?php if( !empty($_SESSION['password']) ){ echo htmlentities( $_SESSION['password'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
|
||||
<input type="submit" name="btn_submit" class="irobutton" value="ログイン">
|
||||
@@ -174,6 +183,7 @@ $pdo = null;
|
||||
|
||||
<div class="btnbox">
|
||||
<a href="index.php" class="sirobutton">戻る</a>
|
||||
<a href="passrecovery" class="sirobutton">パスワード復元</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
@@ -13,6 +13,9 @@ require('db.php');
|
||||
|
||||
$servernamefile = "server/servername.txt";
|
||||
|
||||
$onlyuserfile = "server/onlyuser.txt";
|
||||
$onlyuser = file_get_contents($onlyuserfile);
|
||||
|
||||
session_start();
|
||||
|
||||
// 変数の初期化
|
||||
@@ -97,6 +100,9 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
$profile = $_POST['profile'];
|
||||
|
||||
if($onlyuser === "true"){
|
||||
$invitationcode = $_POST['invitationcode'];
|
||||
}
|
||||
|
||||
//cookieに保存
|
||||
setcookie("username",$username,time()+60*60*24*14);
|
||||
@@ -143,6 +149,28 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
if($onlyuser === "true"){
|
||||
$query = $dbh->prepare('SELECT * FROM invitation WHERE code = :code limit 1');
|
||||
|
||||
$query->execute(array(':code' => $invitationcode));
|
||||
|
||||
$result = $query->fetch();
|
||||
|
||||
// 招待コードの入力チェック
|
||||
if( empty($invitationcode) ) {
|
||||
$error_message[] = '招待コードを入力してください。';
|
||||
} else {
|
||||
if($result > 0){
|
||||
if($result["used"] === "true"){
|
||||
$error_message[] = 'この招待コード('.$invitationcode.')は既に使用されています。';
|
||||
}
|
||||
}else{
|
||||
$error_message[] = 'この招待コード('.$invitationcode.')は使えません。';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
||||
|
||||
@@ -333,6 +361,24 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
|
||||
if($onlyuser === "true"){
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$stmt = $pdo->prepare("UPDATE invitation SET used = :used, datetime = :datetime WHERE code = :code;");
|
||||
|
||||
$true = "true";
|
||||
$stmt->bindParam(':used', $true, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindValue(':code', $invitationcode, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
@@ -341,7 +387,8 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
if ($res) {
|
||||
// リダイレクト先のURLへ転送する
|
||||
$url = 'success.php';
|
||||
$_SESSION['userid'] = $userid;
|
||||
$url = 'authcodechk';
|
||||
header('Location: ' . $url, true, 303);
|
||||
|
||||
// すべての出力を終了
|
||||
@@ -448,9 +495,16 @@ $pdo = null;
|
||||
</div>
|
||||
|
||||
<p>登録を押すと利用規約とプライバシーポリシーに同意したこととなります。<br>未確認の場合は上のボタンよりお読みください。</p>
|
||||
|
||||
<?php if($onlyuser === "true"){?>
|
||||
<div>
|
||||
<p>招待コード</p>
|
||||
<div class="p2">招待コードがないとこのサーバーには登録できません。</div>
|
||||
<input id="profile" type="text" placeholder="" class="inbox" name="invitationcode" value="<?php if( !empty($_SESSION['invitationcode']) ){ echo htmlspecialchars( $_SESSION['invitationcode'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
<input type="submit" class = "irobutton" name="btn_submit" value="登録">
|
||||
|
||||
<?php }else{?>
|
||||
<input type="submit" class = "irobutton" name="btn_submit" value="登録">
|
||||
<?php }?>
|
||||
</form>
|
||||
|
||||
<div class="btnbox">
|
||||
|
||||
+2
-14
@@ -25,22 +25,16 @@ try {
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
|
||||
$userid = $_GET['userid'];
|
||||
$userid = htmlentities($_GET['userid']);
|
||||
|
||||
$itemsPerPage = 30; // 1ページあたりのユーズ数
|
||||
$pageNumber = isset($_GET['page']) ? intval($_GET['page']) : 1;
|
||||
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
|
||||
$offset = ($pageNumber - 1) * $itemsPerPage;
|
||||
|
||||
$messages = array();
|
||||
|
||||
if (!empty($pdo)) {
|
||||
|
||||
function customStripTags($html, $allowedTags) {
|
||||
$allowedTagString = implode('|', $allowedTags);
|
||||
$pattern = "/<(?!$allowedTagString)[^>]+>/";
|
||||
return preg_replace($pattern, '', $html);
|
||||
}
|
||||
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font');
|
||||
|
||||
// ユーズ内の絵文字を画像に置き換える
|
||||
function replaceEmojisWithImages($postText) {
|
||||
@@ -95,12 +89,6 @@ if (!empty($pdo)) {
|
||||
}
|
||||
}
|
||||
|
||||
// ユーズ内のHTMLコードに指定のタグを有効化する関数
|
||||
function replaceUnescapedHTMLTags($html) {
|
||||
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font'); // 有効化するタグ
|
||||
return customStripTags($html, $allowedTags);
|
||||
}
|
||||
|
||||
if(!empty($messages)){
|
||||
foreach ($messages as $value) {
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ try {
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
|
||||
$userid = $_GET['userid'];
|
||||
$userid = htmlentities($_GET['userid']);
|
||||
|
||||
$itemsPerPage = 30; // 1ページあたりの投稿数
|
||||
$pageNumber = isset($_GET['page']) ? intval($_GET['page']) : 1;
|
||||
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
|
||||
$offset = ($pageNumber - 1) * $itemsPerPage;
|
||||
|
||||
$messages = array();
|
||||
|
||||
@@ -11,20 +11,20 @@ class MessageDisplay {
|
||||
echo ' <div class="flebox">';
|
||||
|
||||
echo ' <div class="time">';
|
||||
$day = date("Ymd", strtotime(htmlspecialchars($this->value['datetime'])));
|
||||
$day = date("Ymd", strtotime(htmlentities($this->value['datetime'])));
|
||||
if ($day == date("Ymd")) {
|
||||
echo date("今日 H:i", strtotime(htmlspecialchars($this->value['datetime'])));
|
||||
echo date("今日 H:i", strtotime(htmlentities($this->value['datetime'])));
|
||||
} else {
|
||||
echo date("Y年m月d日 H:i", strtotime(htmlspecialchars($this->value['datetime'])));
|
||||
echo date("Y年m月d日 H:i", strtotime(htmlentities($this->value['datetime'])));
|
||||
}
|
||||
echo ' </div>';
|
||||
|
||||
echo ' </div>';
|
||||
|
||||
// 投稿内のHTMLコードを表示する部分
|
||||
echo ' <h3>' . htmlspecialchars($this->value['title']) . '</h3>';
|
||||
echo ' <p>' . htmlspecialchars($this->value['msg']) . '</p>';
|
||||
echo ' <a href="' . htmlspecialchars($this->value['url']) . '">続きをみる</a>';
|
||||
echo ' <h3>' . htmlentities($this->value['title']) . '</h3>';
|
||||
echo ' <p>' . htmlentities($this->value['msg']) . '</p>';
|
||||
echo ' <a href="' . htmlentities($this->value['url']) . '">続きをみる</a>';
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
+2
-15
@@ -26,8 +26,8 @@ try {
|
||||
}
|
||||
|
||||
|
||||
$keyword = isset($_GET['keyword']) ? $_GET['keyword'] : '';
|
||||
$userid = $_GET['userid'];
|
||||
$keyword = htmlentities(isset($_GET['keyword'])) ? htmlentities($_GET['keyword']) : '';
|
||||
$userid = htmlentities($_GET['userid']);
|
||||
|
||||
$messages = array();
|
||||
|
||||
@@ -44,13 +44,6 @@ if (!empty($pdo)) {
|
||||
$messageQuery->execute();
|
||||
$message_array = $messageQuery->fetchAll();
|
||||
|
||||
function customStripTags($html, $allowedTags) {
|
||||
$allowedTagString = implode('|', $allowedTags);
|
||||
$pattern = "/<(?!$allowedTagString)[^>]+>/";
|
||||
return preg_replace($pattern, '', $html);
|
||||
}
|
||||
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font');
|
||||
|
||||
// ユーズ内の絵文字を画像に置き換える
|
||||
function replaceEmojisWithImages($postText) {
|
||||
// ユーズ内で絵文字名(:emoji:)を検出して画像に置き換える
|
||||
@@ -102,12 +95,6 @@ if (!empty($pdo)) {
|
||||
}
|
||||
}
|
||||
|
||||
// ユーズ内のHTMLコードに指定のタグを有効化する関数
|
||||
function replaceUnescapedHTMLTags($html) {
|
||||
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font'); // 有効化するタグ
|
||||
return customStripTags($html, $allowedTags);
|
||||
}
|
||||
|
||||
if(!empty($messages)){
|
||||
foreach ($messages as $value) {
|
||||
|
||||
|
||||
+3
-17
@@ -25,12 +25,12 @@ try {
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
|
||||
$userid = $_GET['userid'];
|
||||
$userid = htmlentities($_GET['userid']);
|
||||
|
||||
$ueuseid = isset($_GET['id']) ? $_GET['id'] : '';
|
||||
$ueuseid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
|
||||
|
||||
$itemsPerPage = 30; // 1ページあたりの投稿数
|
||||
$pageNumber = isset($_GET['page']) ? intval($_GET['page']) : 1;
|
||||
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
|
||||
$offset = ($pageNumber - 1) * $itemsPerPage;
|
||||
|
||||
$messages = array();
|
||||
@@ -45,14 +45,6 @@ if (!empty($pdo)) {
|
||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||
));
|
||||
|
||||
|
||||
|
||||
function customStripTags($html, $allowedTags) {
|
||||
$allowedTagString = implode('|', $allowedTags);
|
||||
$pattern = "/<(?!$allowedTagString)[^>]+>/";
|
||||
return preg_replace($pattern, '', $html);
|
||||
}
|
||||
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font');
|
||||
// 投稿内の絵文字を画像に置き換える
|
||||
function replaceEmojisWithImages($postText) {
|
||||
// 投稿内で絵文字名(:emoji:)を検出して画像に置き換える
|
||||
@@ -111,12 +103,6 @@ if (!empty($pdo)) {
|
||||
}
|
||||
}
|
||||
|
||||
// 投稿内のHTMLコードに指定のタグを有効化する関数
|
||||
function replaceUnescapedHTMLTags($html) {
|
||||
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font'); // 有効化するタグ
|
||||
return customStripTags($html, $allowedTags);
|
||||
}
|
||||
|
||||
if(!empty($messages)){
|
||||
foreach ($messages as $value) {
|
||||
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
|
||||
|
||||
+3
-18
@@ -26,11 +26,11 @@ try {
|
||||
}
|
||||
|
||||
|
||||
$uwuzuid = isset($_GET['id']) ? $_GET['id'] : '';
|
||||
$userid = $_GET['userid'];
|
||||
$uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
|
||||
$userid = htmlentities($_GET['userid']);
|
||||
|
||||
$itemsPerPage = 30; // 1ページあたりのユーズ数
|
||||
$pageNumber = isset($_GET['page']) ? intval($_GET['page']) : 1;
|
||||
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
|
||||
$offset = ($pageNumber - 1) * $itemsPerPage;
|
||||
|
||||
$messages = array();
|
||||
@@ -53,13 +53,6 @@ if (!empty($pdo)) {
|
||||
$messageQuery->execute();
|
||||
$message_array = $messageQuery->fetchAll();
|
||||
|
||||
function customStripTags($html, $allowedTags) {
|
||||
$allowedTagString = implode('|', $allowedTags);
|
||||
$pattern = "/<(?!$allowedTagString)[^>]+>/";
|
||||
return preg_replace($pattern, '', $html);
|
||||
}
|
||||
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font');
|
||||
|
||||
// ユーズ内の絵文字を画像に置き換える
|
||||
function replaceEmojisWithImages($postText) {
|
||||
// ユーズ内で絵文字名(:emoji:)を検出して画像に置き換える
|
||||
@@ -93,8 +86,6 @@ if (!empty($pdo)) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$messages = array();
|
||||
foreach ($message_array as $row) {
|
||||
$messages[] = $row;
|
||||
@@ -111,12 +102,6 @@ if (!empty($pdo)) {
|
||||
}
|
||||
}
|
||||
|
||||
// ユーズ内のHTMLコードに指定のタグを有効化する関数
|
||||
function replaceUnescapedHTMLTags($html) {
|
||||
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font'); // 有効化するタグ
|
||||
return customStripTags($html, $allowedTags);
|
||||
}
|
||||
|
||||
if(!empty($messages)){
|
||||
foreach ($messages as $value) {
|
||||
|
||||
|
||||
+19
-19
@@ -19,63 +19,63 @@ class MessageDisplay {
|
||||
}
|
||||
echo ' <div class="flebox">';
|
||||
|
||||
echo ' <a href="/@' . htmlspecialchars($this->value['account']) . '"><img src="../home/tlimage.php?account=' . urlencode($this->value['account']) . '"></a>';
|
||||
echo ' <a href="/@' . htmlspecialchars($this->value['account']) . '">' . htmlspecialchars($this->value['username']) . '</a>';
|
||||
echo ' <a href="/@' . htmlentities($this->value['account']) . '"><img src="../home/tlimage.php?account=' . urlencode($this->value['account']) . '"></a>';
|
||||
echo ' <a href="/@' . htmlentities($this->value['account']) . '">' . htmlentities($this->value['username']) . '</a>';
|
||||
echo ' <div class="idbox">';
|
||||
echo ' <a href="/@' . htmlspecialchars($this->value['account']) . '">@' . htmlspecialchars($this->value['account']) . '</a>';
|
||||
echo ' <a href="/@' . htmlentities($this->value['account']) . '">@' . htmlentities($this->value['account']) . '</a>';
|
||||
echo ' </div>';
|
||||
echo ' <div class="time">';
|
||||
$day = date("Ymd", strtotime(htmlspecialchars($this->value['datetime'])));
|
||||
$day = date("Ymd", strtotime(htmlentities($this->value['datetime'])));
|
||||
if ($day == date("Ymd")) {
|
||||
echo date("今日 H:i", strtotime(htmlspecialchars($this->value['datetime'])));
|
||||
echo date("今日 H:i", strtotime(htmlentities($this->value['datetime'])));
|
||||
} else {
|
||||
echo date("Y年m月d日 H:i", strtotime(htmlspecialchars($this->value['datetime'])));
|
||||
echo date("Y年m月d日 H:i", strtotime(htmlentities($this->value['datetime'])));
|
||||
}
|
||||
echo ' </div>';
|
||||
|
||||
echo ' </div>';
|
||||
|
||||
echo ' <p>' . replaceEmojisWithImages(replaceURLsWithLinks(nl2br(replaceUnescapedHTMLTags($this->value['ueuse'])))) . '</h1></h2></h3></font></center></p>';
|
||||
echo ' <p>' . replaceEmojisWithImages(replaceURLsWithLinks(nl2br($this->value['ueuse']))) . '</h1></h2></h3></font></center></p>';
|
||||
|
||||
if (!empty($this->value['photo2']) && $this->value['photo2'] !== 'none') {
|
||||
echo ' <div class="photo2">';
|
||||
echo ' <img src="' . htmlspecialchars($this->value['photo1']) . '" alt="画像">';
|
||||
echo ' <img src="' . htmlspecialchars($this->value['photo2']) . '" alt="画像">';
|
||||
echo ' <img src="' . htmlentities($this->value['photo1']) . '" alt="画像">';
|
||||
echo ' <img src="' . htmlentities($this->value['photo2']) . '" alt="画像">';
|
||||
echo ' </div>';
|
||||
} elseif (!empty($this->value['photo1']) && $this->value['photo1'] !== 'none') {
|
||||
echo ' <div class="photo1">';
|
||||
echo ' <img src="' . htmlspecialchars($this->value['photo1']) . '" alt="画像">';
|
||||
echo ' <img src="' . htmlentities($this->value['photo1']) . '" alt="画像">';
|
||||
echo ' </div>';
|
||||
}
|
||||
if (!empty($this->value['video1']) && $this->value['video1'] !== 'none') {
|
||||
echo ' <div class="video1">';
|
||||
echo ' <video controls src="' . htmlspecialchars($this->value['video1']) . '"></video>';
|
||||
echo ' <video controls src="' . htmlentities($this->value['video1']) . '"></video>';
|
||||
echo ' </div>';
|
||||
}
|
||||
|
||||
if(!($this->value['abi'] == "none")){
|
||||
echo '<div class="abi">';
|
||||
echo ' <div class="back">';
|
||||
echo '<h1>' . htmlspecialchars($this->value['username']) . 'さんが追記しました</h1>';
|
||||
echo '<h1>' . htmlentities($this->value['username']) . 'さんが追記しました</h1>';
|
||||
echo ' </div>';
|
||||
echo '<p>'. htmlspecialchars($this->value['abi']) . '</p>';
|
||||
echo '<h3>追記日時 : '. date("Y年m月d日 H:i", strtotime(htmlspecialchars($this->value['abidate']))) . '</h3>';
|
||||
echo '<p>'.replaceEmojisWithImages(replaceURLsWithLinks(nl2br($this->value['abi']))) . '</p>';
|
||||
echo '<h3>追記日時 : '. date("Y年m月d日 H:i", strtotime(htmlentities($this->value['abidate']))) . '</h3>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '<hr>';
|
||||
echo '<div class="favbox">';
|
||||
if (false !== strstr($this->value['favorite'], $this->userid)) {
|
||||
echo '<button class="favbtn favbtn_after" id="favbtn" data-uniqid="' . htmlspecialchars($this->value['uniqid']) . '" data-userid2="' . htmlspecialchars($this->value['account']) . '"><img src="../img/sysimage/favorite_2.svg" alt="いいね" /> <span class="like-count">' . htmlspecialchars($this->value['favcnt']) . '</span></button>';
|
||||
echo '<button class="favbtn favbtn_after" id="favbtn" data-uniqid="' . htmlentities($this->value['uniqid']) . '" data-userid2="' . htmlentities($this->value['account']) . '"><img src="../img/sysimage/favorite_2.svg" alt="いいね" /> <span class="like-count">' . htmlentities($this->value['favcnt']) . '</span></button>';
|
||||
}else{
|
||||
echo '<button class="favbtn" id="favbtn" data-uniqid="' . htmlspecialchars($this->value['uniqid']) . '" data-userid2="' . htmlspecialchars($this->value['account']) . '"><img src="../img/sysimage/favorite_1.svg" alt="いいね" /> <span class="like-count">' . htmlspecialchars($this->value['favcnt']) . '</span></button>';
|
||||
echo '<button class="favbtn" id="favbtn" data-uniqid="' . htmlentities($this->value['uniqid']) . '" data-userid2="' . htmlentities($this->value['account']) . '"><img src="../img/sysimage/favorite_1.svg" alt="いいね" /> <span class="like-count">' . htmlentities($this->value['favcnt']) . '</span></button>';
|
||||
}
|
||||
echo '<a href="/!'.htmlspecialchars($this->value['uniqid']). '~' . htmlspecialchars($this->value['account']) . '" class="tuduki">返信をみる&する</a>';
|
||||
echo '<a href="/!'.htmlentities($this->value['uniqid']). '~' . htmlentities($this->value['account']) . '" class="tuduki">返信をみる&する</a>';
|
||||
if($this->value['account'] === $this->userid){
|
||||
if($this->value['abi'] === "none"){
|
||||
echo '<input type="submit" name="addabi" id="addabi" data-uniqid2="' . htmlspecialchars($this->value['uniqid']) . '" class="addabi" value="追記する">';
|
||||
echo '<input type="submit" name="addabi" id="addabi" data-uniqid2="' . htmlentities($this->value['uniqid']) . '" class="addabi" value="追記する">';
|
||||
}
|
||||
echo '<input type="submit" name="delueuse" id="uniqid2" data-uniqid2="' . htmlspecialchars($this->value['uniqid']) . '" class="delbtn" value="削除">';
|
||||
echo '<input type="submit" name="delueuse" id="uniqid2" data-uniqid2="' . htmlentities($this->value['uniqid']) . '" class="delbtn" value="削除">';
|
||||
}
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
@@ -25,8 +25,8 @@ $option = null;
|
||||
|
||||
session_start();
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
$username = $_SESSION['username'];
|
||||
$userid = htmlentities($_SESSION['userid']);
|
||||
$username = htmlentities($_SESSION['username']);
|
||||
|
||||
try {
|
||||
|
||||
|
||||
+4
-4
@@ -26,10 +26,10 @@ while ($row = $notice_array->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
if(!empty($notices)){
|
||||
foreach ($notices as $value) {
|
||||
$uneinoticenote = $value['note'];
|
||||
$uneinoticetitle = $value['title'];
|
||||
$uneinoticeaccount = $value['account'];
|
||||
$uneinoticedatetime = $value['datetime'];
|
||||
$uneinoticenote = htmlentities($value['note']);
|
||||
$uneinoticetitle = htmlentities($value['title']);
|
||||
$uneinoticeaccount = htmlentities($value['account']);
|
||||
$uneinoticedatetime = htmlentities($value['datetime']);
|
||||
}
|
||||
}else{
|
||||
$uneinoticenote = "";
|
||||
|
||||
@@ -26,8 +26,8 @@ $option = null;
|
||||
|
||||
session_start();
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
$username = $_SESSION['username'];
|
||||
$userid = htmlentities($_SESSION['userid']);
|
||||
$username = htmlentities($_SESSION['username']);
|
||||
|
||||
|
||||
try {
|
||||
|
||||
+56
-5
@@ -25,8 +25,8 @@ $option = null;
|
||||
|
||||
session_start();
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
$username = $_SESSION['username'];
|
||||
$userid = htmlentities($_SESSION['userid']);
|
||||
$username = htmlentities($_SESSION['username']);
|
||||
|
||||
// 管理者としてログインしているか確認
|
||||
if( empty($_SESSION['admin_login']) || $_SESSION['admin_login'] !== true ) {
|
||||
@@ -136,7 +136,7 @@ if( !empty($pdo) ) {
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
$chkuserid = $_POST['chkuserid'];
|
||||
$chkuserid = htmlentities($_POST['chkuserid']);
|
||||
|
||||
if( empty($chkuserid) ) {
|
||||
$error_message[] = '確認用ユーザーIDを入力してください。';
|
||||
@@ -233,6 +233,51 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
}
|
||||
|
||||
|
||||
if( !empty($_POST['session_submit']) ) {
|
||||
$loginid = sha1(uniqid(mt_rand(), true));
|
||||
$pdo->beginTransaction();
|
||||
try {
|
||||
|
||||
$stmt = $pdo->prepare("UPDATE account SET loginid = :loginid WHERE userid = :userid;");
|
||||
|
||||
$stmt->bindParam(':loginid', $loginid, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
} catch (Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
if ($res) {
|
||||
if (isset($_SERVER['HTTP_COOKIE'])) {
|
||||
$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
|
||||
foreach($cookies as $cookie) {
|
||||
$parts = explode('=', $cookie);
|
||||
$name = trim($parts[0]);
|
||||
setcookie($name, '', time()-1000);
|
||||
setcookie($name, '', time()-1000, '/');
|
||||
}
|
||||
}
|
||||
// リダイレクト先のURLへ転送する
|
||||
$url = '../index.php';
|
||||
header('Location: ' . $url, true, 303);
|
||||
|
||||
// すべての出力を終了
|
||||
exit;
|
||||
} else {
|
||||
$error_message[] = '登録に失敗しました。';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if( !empty($_POST['logout']) ) {
|
||||
if (isset($_SERVER['HTTP_COOKIE'])) {
|
||||
$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
|
||||
@@ -259,7 +304,9 @@ if( !empty($_POST['logout']) ) {
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>アカウント削除ページ - <?php echo file_get_contents($servernamefile);?></title>
|
||||
<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 file_get_contents($servernamefile);?></title>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -275,7 +322,11 @@ if( !empty($_POST['logout']) ) {
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<form class="formarea" method="post">
|
||||
<h1>アカウント削除ページ</h1>
|
||||
<h1>セッション終了</h1>
|
||||
<p>下のセッションを終了ボタンを押すと全てのログイン中のデバイスからログアウトされます。<br>再度uwuzu使用するにはログインが必須になります。</p>
|
||||
<input type="submit" class = "irobutton" name="session_submit" value="セッションを終了">
|
||||
<hr>
|
||||
<h1>アカウント削除</h1>
|
||||
<p>アカウント誤削除を防ぐため下の入力ボックスにご自身のユーザーIDを入力する必要があります。</p>
|
||||
|
||||
<?php if($res["admin"] === "yes"){?>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
window.onload = function(){
|
||||
var ele = document.getElementsByTagName("body")[0];
|
||||
var n = Math.floor(Math.random() * 3); // 3枚の画像がある場合
|
||||
ele.style.backgroundImage = "url(../img/titleimg/"+n+".png)";
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
$servernamefile = "../server/servername.txt";
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<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">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>残念なお知らせ - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
<script src="back.js"></script>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div class="leftbox2">
|
||||
<div class="logo">
|
||||
<img src="../img/uwuzulogo.svg">
|
||||
</div>
|
||||
|
||||
<div class="textbox">
|
||||
<h1>パスワード変更不可</h1>
|
||||
|
||||
<p>申し訳ございませんがお使いのアカウントのパスワードは変更できません。</p>
|
||||
|
||||
<div class="btnbox">
|
||||
<a href="../index.php" class="sirobutton">もどる</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
$servernamefile = "../server/servername.txt";
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<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">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>パスワード変更完了 - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
<script src="back.js"></script>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div class="leftbox2">
|
||||
<div class="logo">
|
||||
<img src="../img/uwuzulogo.svg">
|
||||
</div>
|
||||
|
||||
<div class="textbox">
|
||||
<h1>パスワードの変更が完了しました!</h1>
|
||||
|
||||
<p>パスワードの変更が完了しました。下のボタンよりログインしてください!</p>
|
||||
|
||||
<div class="btnbox">
|
||||
<a href="../login.php" class="sirobutton">ログイン</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,204 @@
|
||||
<?php
|
||||
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
require('../db.php');
|
||||
|
||||
|
||||
// 変数の初期化
|
||||
$current_date = null;
|
||||
$message_array = array();
|
||||
$error_message = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
$row["userid"] = "";
|
||||
$row["password"] = "";
|
||||
|
||||
$ruserid = "";
|
||||
$rpassword = "";
|
||||
|
||||
$userid = "";
|
||||
$_SESSION["userid"]="";
|
||||
|
||||
$password = null;
|
||||
$_SESSION["password"]="";
|
||||
|
||||
|
||||
session_start();
|
||||
// データベースに接続
|
||||
try {
|
||||
|
||||
$option = array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||
);
|
||||
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
} catch(PDOException $e) {
|
||||
|
||||
// 接続エラーのときエラー内容を取得する
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
|
||||
//$row['userid'] = "daichimarukn";
|
||||
|
||||
$userid = $_POST['userid'];
|
||||
$mailadds = $_POST['mailadds'];
|
||||
|
||||
|
||||
$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, mailadds, loginid, authcode FROM account WHERE userid = :userid");
|
||||
|
||||
$result->bindValue(':userid', $userid);
|
||||
// SQL実行
|
||||
$result->execute();
|
||||
|
||||
|
||||
|
||||
// ... (前略)
|
||||
// IDの入力チェック
|
||||
if( empty($userid) ) {
|
||||
$error_message[] = 'ユーザーIDを入力してください。';
|
||||
} else {
|
||||
|
||||
if( empty($mailadds) ) {
|
||||
$error_message[] = 'メールアドレスを入力してください。';
|
||||
} else {
|
||||
|
||||
if($result->rowCount() > 0) {
|
||||
$row = $result->fetch(); // ここでデータベースから取得した値を $row に代入する
|
||||
|
||||
if($row["userid"] == $userid){
|
||||
if($row["mailadds"] == $mailadds){
|
||||
if(empty($row["authcode"])){
|
||||
|
||||
$_SESSION['userid'] = "";
|
||||
$url = 'badrecovery.php';
|
||||
header('Location: ' . $url, true, 303);
|
||||
|
||||
// すべての出力を終了
|
||||
exit;
|
||||
}else{
|
||||
$_SESSION['userid'] = $userid;
|
||||
$url = 'startrecovery.php';
|
||||
header('Location: ' . $url, true, 303);
|
||||
|
||||
// すべての出力を終了
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$error_message[] = 'IDまたはメールアドレスが違います';
|
||||
}
|
||||
}else{
|
||||
$error_message[] = 'IDまたはメールアドレスが違います';
|
||||
}
|
||||
}
|
||||
else {
|
||||
$error_message[] = 'IDまたはメールアドレスが違います';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ... (後略)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// データベースの接続を閉じる
|
||||
$pdo = null;
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<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">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>パスワードの復元 - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
<script src="back.js"></script>
|
||||
<body>
|
||||
|
||||
<div class="leftbox">
|
||||
<div class="logo">
|
||||
<img src="../img/uwuzulogo.svg">
|
||||
</div>
|
||||
|
||||
<div class="textbox">
|
||||
<h1>パスワードの復元</h1>
|
||||
|
||||
<p>IDと登録したメールアドレスを入力してください。</p>
|
||||
|
||||
<?php if( !empty($error_message) ): ?>
|
||||
<ul class="errmsg">
|
||||
<?php foreach( $error_message as $value ): ?>
|
||||
<p>・ <?php echo $value; ?></p>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<form class="formarea" method="post">
|
||||
<!--ユーザーネーム関係-->
|
||||
<div>
|
||||
<label for="userid">ユーザーID</label>
|
||||
<input onInput="checkForm(this)" id="userid" class="inbox" type="text" name="userid" value="<?php if( !empty($_SESSION['userid']) ){ echo htmlentities( $_SESSION['userid'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
<!--個人情報関係-->
|
||||
|
||||
<!--アカウント関連-->
|
||||
<div>
|
||||
<label for="mailadds">メールアドレス</label>
|
||||
<input id="mailadds" class="inbox" type="text" name="mailadds" value="<?php if( !empty($_SESSION['mailadds']) ){ echo htmlentities( $_SESSION['mailadds'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
|
||||
<input type="submit" name="btn_submit" class="irobutton" value="次へ">
|
||||
</form>
|
||||
|
||||
<div class="btnbox">
|
||||
<a href="../index.php" class="sirobutton">戻る</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function checkForm($this)
|
||||
{
|
||||
var str=$this.value;
|
||||
while(str.match(/[^A-Z^a-z\d\-]/))
|
||||
{
|
||||
str=str.replace(/[^A-Z^a-z\d\-]/,"");
|
||||
}
|
||||
$this.value=str;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,298 @@
|
||||
<?php
|
||||
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
require('../db.php');
|
||||
|
||||
|
||||
// 変数の初期化
|
||||
$current_date = null;
|
||||
$message_array = array();
|
||||
$error_message = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
$row["loginid"] = "";
|
||||
$row["authcode"] = "";
|
||||
|
||||
$ruserid = "";
|
||||
$rpassword = "";
|
||||
|
||||
$userid = "";
|
||||
$_SESSION["userid"]="";
|
||||
|
||||
$password = null;
|
||||
$_SESSION["password"]="";
|
||||
|
||||
|
||||
session_start();
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
try {
|
||||
$options = 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, $options);
|
||||
} catch(PDOException $e) {
|
||||
// 接続エラーのときエラー内容を取得する
|
||||
$error_message[] = 'データベース接続エラー: ' . $e->getMessage();
|
||||
}
|
||||
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
$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, $options);
|
||||
|
||||
require_once '../authcode/GoogleAuthenticator.php';
|
||||
|
||||
$result = $dbh->prepare("SELECT authcode,loginid,username FROM account WHERE userid = :userid");
|
||||
|
||||
$result->bindValue(':userid', $userid);
|
||||
// SQL実行
|
||||
$result->execute();
|
||||
if($result->rowCount() > 0) {
|
||||
$row = $result->fetch();
|
||||
|
||||
$tousercode = $row["authcode"];
|
||||
|
||||
$chkauthcode = new PHPGangsta_GoogleAuthenticator();
|
||||
|
||||
$userauthcode = $_POST['usercode'];
|
||||
$password = $_POST['password'];
|
||||
|
||||
if(empty($userauthcode)){
|
||||
$error_message[] = "コードを入力してください。";
|
||||
}else{
|
||||
|
||||
$discrepancy = 2;
|
||||
|
||||
$checkResult = $chkauthcode->verifyCode($tousercode, $userauthcode, $discrepancy);
|
||||
if ($checkResult) {
|
||||
|
||||
// パスワードの入力チェック
|
||||
if( empty($password) ) {
|
||||
$error_message[] = 'パスワードを入力してください。';
|
||||
} else {
|
||||
|
||||
$weakPasswords = array(
|
||||
"password",
|
||||
"123456",
|
||||
"123456789",
|
||||
"12345",
|
||||
"12345678",
|
||||
"123123",
|
||||
"1234567890",
|
||||
"1234567",
|
||||
"1q2w3e",
|
||||
"qwerty123",
|
||||
"aa12345678",
|
||||
"password1",
|
||||
"1234",
|
||||
"qwertyuiop",
|
||||
"123321",
|
||||
"12321",
|
||||
"qwertyui",
|
||||
"abcd1234",
|
||||
"zaq12wsx",
|
||||
"1q2w3e4r",
|
||||
"qwer1234",
|
||||
"sakura",
|
||||
"asdf1234",
|
||||
"asdfghjkl",
|
||||
"asdfghjk",
|
||||
"member",
|
||||
"1qaz2wsx",
|
||||
"doraemon",
|
||||
"makoto",
|
||||
"takeshi",
|
||||
"machi1",
|
||||
"machida",
|
||||
"machida1",
|
||||
"tokyo",
|
||||
"arashi",
|
||||
"dropbox",
|
||||
"twitter",
|
||||
"elonmusk",
|
||||
"xcorp",
|
||||
"1234qwer",
|
||||
"japan",
|
||||
"nippon",
|
||||
"tukareta",
|
||||
"tweet",
|
||||
"discord",
|
||||
"misskey",
|
||||
"qwerty",
|
||||
"123456789",
|
||||
"abc123",
|
||||
"password123",
|
||||
"admin",
|
||||
"letmein",
|
||||
"iloveyou",
|
||||
"111111",
|
||||
"12345678910",
|
||||
"user",
|
||||
"root",
|
||||
"system",
|
||||
// 他にも弱いパスワードを追加できます
|
||||
);
|
||||
|
||||
function isWeakPassword($passwords) {
|
||||
global $weakPasswords;
|
||||
return in_array($passwords, $weakPasswords);
|
||||
}
|
||||
|
||||
// テスト用のパスワード(実際にはユーザー入力などから取得することになります。
|
||||
|
||||
if (isWeakPassword($password)) {
|
||||
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。";
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if( 4 > mb_strlen($password, 'UTF-8') ) {
|
||||
$error_message[] = 'パスワードは4文字以上である必要があります。';
|
||||
}
|
||||
|
||||
// 文字数を確認
|
||||
if( 100 < mb_strlen($password, 'UTF-8') ) {
|
||||
$error_message[] = 'パスワードは100文字以内で入力してください。';
|
||||
}
|
||||
}
|
||||
|
||||
if( empty($error_message) ) {
|
||||
// トランザクション開始
|
||||
$pdo->beginTransaction();
|
||||
$hashpassword = password_hash($password, PASSWORD_DEFAULT);
|
||||
|
||||
try {
|
||||
// SQL作成
|
||||
$stmt = $pdo->prepare("UPDATE account SET password = :password WHERE userid = :userid;");
|
||||
|
||||
// 他の値をセット
|
||||
$stmt->bindParam(':password', $hashpassword, PDO::PARAM_STR);
|
||||
|
||||
// 条件を指定
|
||||
// 以下の部分を適切な条件に置き換えてください
|
||||
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
if ($res) {
|
||||
$_SESSION['userid'] = "";
|
||||
$url = 'donerecovery.php';
|
||||
header('Location: ' . $url, true, 303);
|
||||
|
||||
// すべての出力を終了
|
||||
exit;
|
||||
} else {
|
||||
$error_message[] = 'パスワードの更新に失敗しました。';
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
$error_message[] = '二段階認証が出来ませんでした。再度お試しください。';
|
||||
}
|
||||
|
||||
// プリペアドステートメントを削除
|
||||
$stmt = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// データベースの接続を閉じる
|
||||
$pdo = null;
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<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">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>ログイン - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
<script src="back.js"></script>
|
||||
<body>
|
||||
|
||||
<div class="leftbox">
|
||||
<div class="logo">
|
||||
<img src="../img/uwuzulogo.svg">
|
||||
</div>
|
||||
|
||||
<div class="textbox">
|
||||
<h1>二段階認証</h1>
|
||||
|
||||
<p>二段階認証コードと新しいパスワードを入力してください。</p>
|
||||
|
||||
<?php if( !empty($error_message) ): ?>
|
||||
<ul class="errmsg">
|
||||
<?php foreach( $error_message as $value ): ?>
|
||||
<p>・ <?php echo $value; ?></p>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||
<div>
|
||||
<p>二段階認証コード</p>
|
||||
<div class="p2">6桁のコードを入力してください。</div>
|
||||
<input id="profile" type="number" placeholder="123456" class="inbox" name="usercode" value="">
|
||||
</div>
|
||||
<div>
|
||||
<p>新しいパスワード</p>
|
||||
<div class="p2">新しいパスワードを入力してください。</div>
|
||||
<input id="profile" type="text" placeholder="" class="inbox" name="password" value="">
|
||||
</div>
|
||||
<input type="submit" class = "irobutton" name="btn_submit" value="次へ">
|
||||
</form>
|
||||
|
||||
<div class="btnbox">
|
||||
<a href="index.php" class="sirobutton">戻る</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function checkForm($this)
|
||||
{
|
||||
var str=$this.value;
|
||||
while(str.match(/[^A-Z^a-z\d\-]/))
|
||||
{
|
||||
str=str.replace(/[^A-Z^a-z\d\-]/,"");
|
||||
}
|
||||
$this.value=str;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+2
-2
@@ -14,8 +14,8 @@
|
||||
<a href="/others" class="leftbutton">その他</a>
|
||||
<?php if($res["admin"] === "yes"){?>
|
||||
<hr>
|
||||
<a href="/emoji/addemoji.php" class="leftbutton">絵文字登録</a>
|
||||
<a href="/notice/addnotice.php" class="leftbutton">お知らせ配信</a>
|
||||
<a href="/emoji/addemoji" class="leftbutton">絵文字登録</a>
|
||||
<a href="/notice/addnotice" class="leftbutton">お知らせ配信</a>
|
||||
<hr>
|
||||
<?php }?>
|
||||
<form method="post">
|
||||
|
||||
+1
-1
@@ -200,7 +200,7 @@ $pdo = null;
|
||||
<h1>ユーズに追記しますか?</h1>
|
||||
<p>※追記は削除出来ません。</p>
|
||||
<form method="post" id="AbiForm">
|
||||
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlspecialchars( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
||||
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlentities( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
||||
<div class="btn_area">
|
||||
<input type="submit" id="AbiAddButton" class="fbtn_no" name="abi" value="追記">
|
||||
<input type="button" id="AbiCancelButton" class="fbtn" value="キャンセル">
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
TEST/@test
|
||||
@@ -0,0 +1 @@
|
||||
test@test.com
|
||||
@@ -0,0 +1,3 @@
|
||||
XXXXへようこそ!
|
||||
XXXXはuwuzu~~~~~~~~~
|
||||
とりあえず適当に書いてみよう!
|
||||
@@ -0,0 +1 @@
|
||||
false
|
||||
@@ -0,0 +1 @@
|
||||
ここもしっかり書こう
|
||||
@@ -0,0 +1 @@
|
||||
tesutoさば
|
||||
@@ -0,0 +1,2 @@
|
||||
今現在サーバーは停止していません
|
||||
もしサーバーを止めるならここに理由書こう
|
||||
@@ -0,0 +1 @@
|
||||
利用規約、しっかり書こう
|
||||
@@ -0,0 +1,147 @@
|
||||
## 1. まずそもそもuwuzuとは何か
|
||||
使っている方ならわかると思いますが普通のSNSです!
|
||||
これと言った大きな特徴もなく、平凡で、なんとも言えないSNSです…
|
||||
あっ!特徴かもしれないのが誰でもサーバーを建てられることです!!!
|
||||
詳細は5. サーバーの立て方をご覧ください!
|
||||
### 1.1 作られた理由は?
|
||||
uwuzuは某X社のSNSを再構築しようと考えたdaichimarukanaにより作成されたSNSです()
|
||||
uwuzuの読みはゆずです。
|
||||
|
||||
## 2. 誰でもサーバーを建てれるってことは、分散型?
|
||||
残念っ!
|
||||
uwuzuにはActivityPubやその他の連合用機能がないため基本的に導入されたサーバー中心の中央集権型SNSです!
|
||||
今後いつかはActivityPubも導入しようかと思っています...
|
||||
|
||||
## 3. 名前の由来って何?
|
||||
おっ!いい着眼点ですねぇ~~~
|
||||
uwuzu(ゆず)の名前の由来は、開発者のdaichimarukanaがサービス名を考えていたときに某X社のSNSに「TwitterみたいなSNS作ってるけどサービス名が全く思いつかねぇ()」と投稿したところ思ったより多くの名前の案が集まり、
|
||||
その中に「With you」という名前の案があったところから来ています。
|
||||
daichimarukana < 「うぃずゆー(With you)」「うぃじゅー(witzou)」「うずー(wuzu)」「ゆず(yuzu)」あれっ?なんか普通すぎ?そうだ!!!!これでいいやん!!!!
|
||||
### 「ゆず(uwuzu)」
|
||||
|
||||
ちなみに、この案が来るまでは「Twilus」という名前にする予定だったんですよっ!
|
||||
|
||||
## 4. 開発言語は?
|
||||
uwuzuはPHPとJS、HTML(プログラミング言語じゃないか)、CSSで作られています!
|
||||
ライブラリはjQueryを導入しています!
|
||||
|
||||
## 5. サーバーの建て方
|
||||
※MySQLの設定結構めんどいです。脆弱です。
|
||||
まず、Apache2とPHP 8とmysql Ver 15が導入されているサーバーを準備します!
|
||||
次にSQLを設定します。(InnoDB)
|
||||
まず、お好きな名前でDBを作成し、その中に、account,emoji,notice,role,ueuse,notificationとテーブルを作成します。
|
||||
テーブルの中身は以下のとおりです。
|
||||
照合順序は全て標準でutf8mb4_general_ciです。
|
||||
### account
|
||||
- sysid(INT)(AUTO_INCREMENT ) アカウントが追加されるとカウントされるシステム用ID
|
||||
- username(varchar(500)) ユーザーネーム保存用
|
||||
- userid(varchar(500)) ユーザーID保存用
|
||||
- password(varchar(1024)) パスワード保存用(ハッシュ化されます)
|
||||
- loginid(varchar(256)) 自動ログイン時に本人アカウントか確認
|
||||
- mailadds(varchar(500)) メールアドレス保存用
|
||||
- profile(TEXT) プロフィールテキスト保存用
|
||||
- iconname(varchar(256)) アイコン画像名保存用
|
||||
- iconcontent(mediumblob) アイコン画像保存用
|
||||
- icontype(varchar(256)) アイコン画像拡張子保存用
|
||||
- iconsize(INT) アイコン画像サイズ保存用
|
||||
- headname(varchar(256)) ヘッダー画像名保存用
|
||||
- headcontent(mediumblob) ヘッダー画像保存用
|
||||
- headtype(varchar(256)) ヘッダー画像拡張子保存用
|
||||
- headsize(INT) ヘッダー画像サイズ保存用
|
||||
- role(varchar(1024)) 「user」のようなロール保存用
|
||||
- datetime(datetime) アカウント作成日時保存用
|
||||
- follow(text) アカウントがフォローしている人保存用
|
||||
- follower(text) アカウントがフォローされている人保存用
|
||||
- admin(varchar(25)) 管理者アカウントなら「yes」、それ以外なら「none」と入力。
|
||||
|
||||
### emoji
|
||||
- sysid(INT)(AUTO_INCREMENT) アカウントが追加されるとカウントされるシステム用ID
|
||||
- emojifile(varchar(512)) 絵文字ファイル名保存用
|
||||
- emojitype(varchar(256)) 絵文字拡張子保存用
|
||||
- emojicontent(mediumblob) 絵文字画像保存用
|
||||
- emojiname(varchar(512)) 「:emoji:」のような絵文字名保存用
|
||||
- emojiinfo(text) 絵文字についての説明保存用
|
||||
- emojidate(datetime) 絵文字登録日時保存用
|
||||
|
||||
### notice
|
||||
- sysid(INT)(AUTO_INCREMENT) うんえいからのおしらせが追加されるとカウントされるシステム用ID
|
||||
- title(varchar(1024)) お知らせのタイトル保存用
|
||||
- note(text) お知らせの内容保存用
|
||||
- account(varchar(500)) 編集者ID保存用
|
||||
- emojidate(datetime) お知らせ登録日時保存用
|
||||
|
||||
### role
|
||||
- sysid(INT)(AUTO_INCREMENT) ロールが追加されるとカウントされるシステム用ID
|
||||
- rolename(varchar(512)) ロール表示名保存用
|
||||
- roleauth(varchar(256)) ロールの権限保存用
|
||||
- rolecolor(varchar(25)) ロールの色保存用
|
||||
- roleidname(varchar(512)) 「user」のようなロール指定用
|
||||
|
||||
### ueuse
|
||||
- sysid(INT)(AUTO_INCREMENT) 投稿されるとカウントされるシステム用ID
|
||||
- account(varchar(256)) 投稿者ID保存用
|
||||
- uniqid(varchar(256)) 投稿ID保存用
|
||||
- rpuniqid(varchar(256)) リプライ先ID保存用
|
||||
- ueuse(text) 投稿内容保存用
|
||||
- photo1(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
|
||||
- photo2(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
|
||||
- video1(varchar(512)) 投稿に添付されたファイルの保存ディレクトリ保存用
|
||||
- datetime(datetime) 投稿日時保存用
|
||||
- favorite(text) いいね保存用
|
||||
- abi(text) 投稿者の追記保存用
|
||||
- abidate(datetime) 追記日時保存用
|
||||
|
||||
### notification
|
||||
- sysid(INT)(AUTO_INCREMENT) 通知されるとカウントされるシステム用ID
|
||||
- touserid(varchar(512)) 通知先ID保存用
|
||||
- title(varchar(1024)) 通知のタイトル
|
||||
- msg(text) 通知の内容
|
||||
- datetime(datetime) 通知日時
|
||||
- userchk(varchar(25)) 通知の既読確認
|
||||
|
||||
### invitation
|
||||
- sysid(INT)(AUTO_INCREMENT) 追加されるとカウントされるシステム用ID
|
||||
- code(varchar(512)) 招待コード
|
||||
- used(varchar(25)) 使用済みかそうでないか
|
||||
- datetime(datetime) 招待コード仕様日時更新用
|
||||
|
||||
すべて作成完了したらGithubよりuwuzuのファイルをDLし、解凍し、それをサーバーの動作ディレクトリに置き、Apacheのhttpd.confからその動作ディレクトリを指定し、あとはApacheとphpとMy SQLを起動するだけ!
|
||||
起動したらまずDBのroleにphpmyadminから「user」ロールを追加権限は「user」でOK。ロール名はとりあえず「一般ユーザー」ロールの色はHEXコード(#を除く)で000000のように指定。
|
||||
そしたら普通にuwuzuにアクセスして自分のアカウントを登録。
|
||||
それが終わったら一度サーバーを止め、uwuzuの動作ディレクトリ内のserverフォルダ内のファイルを各自設定
|
||||
ファイルの機能は以下の通り!
|
||||
- admininfo.txt : 管理者名(てすとまる/@sampledayo)
|
||||
- contact.txt : 管理者への連絡用メアド(sample@test.com)
|
||||
- info.txt : サーバー登録時に表示されるメッセージ(好きな内容)
|
||||
- privacypolicy.txt : プライバシーポリシー(サーバーのプライバシーポリシーを記載)
|
||||
- servername.txt : サーバー名(てすとさば)
|
||||
- terms.txt : 利用規約(サーバーの利用規約を記載)
|
||||
- uwuzuabout.txt : このファイル(uwuzuを改造した場合は書き換え)
|
||||
- uwuzuinfo.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え)
|
||||
- uwuzurelease.txt : uwuzuのバージョン等記載(uwuzuを改造した場合は書き換え)
|
||||
- onlyuser.txt : 招待コード機能をオンにするかどうか、「true」でオン、「false」でオフ。招待コードはDBに直接追加。
|
||||
|
||||
### これでサーバーは完成!!!
|
||||
結構脆弱だから気をつけてね...
|
||||
|
||||
## 6. Android、iOS、その他OS向けのアプリについて
|
||||
残念ですが今現在は公式アプリ等はなく、Webブラウザからお楽しみいただけます。
|
||||
誰かが作ってくれたらありがたいな~()
|
||||
|
||||
## 7. 開発したいです!!!
|
||||
uwuzuを自分の思うように改造して使いたい場合はAGPLライセンスのもと改造後ソースコードを公開するということで改造してください!
|
||||
場合によってはdaichimarukanaの作る本家(?)uwuzuにも改造で追加された機能が実装されるかも...()
|
||||
daichimarukanaと一緒に開発したいよ~って人は私のHPからメールとか某Xとかから連絡してくださいな~
|
||||
|
||||
## 8. ロゴは誰が作ったのですか?
|
||||
ロゴはまだない。
|
||||
ロゴは下記のリンクよりuwuzuに関連しているコンテンツのみDLしてご利用いただけます。(uwuzuへ飛ぶリンクボタンなどはOK)
|
||||
|
||||
### 色付き
|
||||
#img ../img/uwuzucolorlogo.svg
|
||||
### まっしろ
|
||||
#img ../img/uwuzulogo.svg
|
||||
|
||||
|
||||
編集者 : daichimarukana
|
||||
最終更新日 : 2023/08/18 12:44
|
||||
@@ -0,0 +1,4 @@
|
||||
uwuzu
|
||||
1.2.5
|
||||
2023/08/19
|
||||
daichimarukana,putonfps
|
||||
@@ -0,0 +1,105 @@
|
||||
## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
|
||||
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
|
||||
|
||||
## Version 1.2.5
|
||||
リリース日:2023/08/19
|
||||
全てのデバイスでセッションを終了する機能を実装しました!
|
||||
パスワードの復元をできるようにしました!
|
||||
|
||||
## Version 1.2.4
|
||||
リリース日:2023/08/19
|
||||
二段階認証機能を実装しました!
|
||||
使用ライブラリ - GoogleAuthenticator.php
|
||||
ライセンス表示↓
|
||||
Copyright (c) 2012, Michael Kliewe All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1.Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
## Version 1.2.3
|
||||
リリース日:2023/08/18
|
||||
脆弱性の修正をしました。
|
||||
追記機能で二回文字列が変換されてしまうバグを修正しました。
|
||||
追記機能で絵文字とURLを使用できるようにしました!
|
||||
|
||||
## Version 1.2.2
|
||||
リリース日:2023/08/18
|
||||
モバイル向けUIを変更しました。
|
||||
PutonFPSさんに手伝っていただきAPIの文字がUnicodeになってしまう問題を修正しました。
|
||||
|
||||
## Version 1.2.1
|
||||
リリース日:2023/08/18
|
||||
エラーコードをわかりやすくしました。
|
||||
追記でHTMLタグが二回変換される問題を修正しました。
|
||||
|
||||
## Version 1.2.0
|
||||
リリース日:2023/08/18
|
||||
招待コード機能を実装しました!
|
||||
開発版のテストや鯖のスペック的にこれ以上ユーザーを受け入れられない場面で使えるかもです!
|
||||
|
||||
## Version 1.1.6
|
||||
リリース日:2023/08/18
|
||||
API利用時にプロフィールに<h1>などのHTMLタグが含まれていると正しくAPIが取得できない問題を修正しました。
|
||||
|
||||
## Version 1.1.5
|
||||
リリース日:2023/08/18
|
||||
無限にログインしてしまう、またはアカウント登録が出来ない可能性のあるバグを修正しました。
|
||||
投稿に添付されているURLを新しいタブで開くようにしました。
|
||||
その他一部脆弱性を修正しました。
|
||||
無駄な処理をすこ~しだけなくしました。
|
||||
<h1>から<h3>、<cernter>、<font>を投稿内で使えてしまうと危険だと判断し、投稿の文字装飾機能を廃止しました。
|
||||
なお、投稿の文字装飾はMarkdownにし、復活予定です。
|
||||
|
||||
## Version 1.1.4
|
||||
リリース日:2023/08/17
|
||||
脆弱性に対しての応急処置です。
|
||||
全てのHTMLコードを無効化するよう修正しました。
|
||||
|
||||
## Version 1.1.3
|
||||
リリース日:2023/08/17
|
||||
早速脆弱性を見つけ出すとんでもない人間が出始めたので対策をしました()
|
||||
部分的にUIを変更しました。
|
||||
|
||||
## Version 1.1.2
|
||||
リリース日:2023/08/17
|
||||
絵文字文字化けバグを修正しました。(文字コードをUTF8からUTF8mb4にしました。)
|
||||
|
||||
## Version 1.1.1
|
||||
リリース日:2023/08/16
|
||||
小さなバグを修正しました。
|
||||
|
||||
## Version 1.1.0
|
||||
リリース日:2023/08/16
|
||||
超極激ヤババグを修正しました。
|
||||
ユーザーIDにハイフンが使えてしまうバグを修正しました。
|
||||
|
||||
## Version 1.0.0
|
||||
リリース日:2023/08/16
|
||||
### 初リリース!!!やったね!!!!
|
||||
機能は以下の通り!遊んでみてね!!!
|
||||
- 投稿(ユーズしよう!みんなに自分のつぶやきを見せつけるぞ!(?))
|
||||
- 投稿に画像添付(最大2枚まで画像を添付できるぞ!位置情報など漏洩しないよう写真にGPS情報が残っていないか厳重に注意しよう...)
|
||||
- 投稿に動画添付(好きな動画を載せてみよう!)
|
||||
- 投稿への追記(投稿者が追記できるよ!誤字ったりミスった時はこれを使おう!)
|
||||
- フォロー(アカウントをフォロー!周りのユーザーとの交流を増やそう!)
|
||||
- いいね(いいねを押してみよう!気軽にどのくらいの人が「いいね!」と思ったかがわかる優れものさ!)
|
||||
- 返信(返信だ!少し手抜きで作ったから見た目はよろしくないけど十分使える機能だッ!どちらかと言えばスレッドといったほうがいいかも...)
|
||||
- カスタム絵文字(自分の思うことを画像で表せるカスタム絵文字!サーバー管理者に追加してほしい絵文字を報告して追加してもらおう!)
|
||||
- カスタム絵文字総合ページ(PCの人なら左側のメニューからアクセスできるかな!自分のお気に入りの絵文字をここから見つけよう!)
|
||||
- 投稿の文字装飾(5つだけHTMLタグを開放したんだ!<h1>,<h2>,<h3>,<center>,<font>を使って自由に作ろう!)
|
||||
- プロフィール(無いと困る機能だけど一応書いとくね~!自分や他のユーザーのプロフィールページだよッ!)
|
||||
- 設定(無いと一番困る機能!少し操作が複雑だけど頑張って!)
|
||||
- 検索(ユーザー検索は出来ないけど投稿は検索できるよ!「あの投稿がまた見たい...」というときに使おう!)
|
||||
- 通知(今のところほぼ使い物にならないけど今後良くしていく予定!待っててくれよっ!)
|
||||
- アカウント削除(消したくなったタイミングで自分の投稿やアカウントなどの情報を全て消せるよ!)
|
||||
- API(開発者のみんな~!ちゃんとAPIを実装したよ!内容はユーザー情報の取得!それ以外はまだないけど...まぁ!<br>/api/userdata-api.php?userid=me2)
|
||||
- PWA(スマホでも快適に!※動作未確認())
|
||||
- ダークモード(暗い夜でも目に優しく!)
|
||||
他にも小さ~な機能は色々あるけどあまり気にならないだろうから今回はパスで!
|
||||
ということで最初のバージョンである<b>uwuzu 1.0.0をお楽しみください!</b>
|
||||
@@ -0,0 +1,253 @@
|
||||
<?php
|
||||
|
||||
function createUniqId(){
|
||||
list($msec, $sec) = explode(" ", microtime());
|
||||
$hashCreateTime = $sec.floor($msec*1000000);
|
||||
|
||||
$hashCreateTime = strrev($hashCreateTime);
|
||||
|
||||
return base_convert($hashCreateTime,10,36);
|
||||
}
|
||||
|
||||
require('../db.php');
|
||||
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
$onlyuserfile = "../server/onlyuser.txt";
|
||||
$onlyuser = file_get_contents($onlyuserfile);
|
||||
|
||||
session_start();
|
||||
|
||||
// 変数の初期化
|
||||
$current_date = null;
|
||||
$message_array = array();
|
||||
$error_message = array();
|
||||
$authcode = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
|
||||
|
||||
|
||||
try {
|
||||
|
||||
$option = array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||
);
|
||||
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
} catch(PDOException $e) {
|
||||
|
||||
// 接続エラーのときエラー内容を取得する
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
|
||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', $_SESSION['userid']);
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
if(empty($res["userid"])){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}elseif($_SESSION['loginid'] === $res["loginid"]){
|
||||
// セッションに値をセット
|
||||
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
|
||||
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
|
||||
$_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);
|
||||
}else{
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', $_COOKIE['userid']);
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
if(empty($res["userid"])){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}elseif($_COOKIE['loginid'] === $res["loginid"]){
|
||||
// セッションに値をセット
|
||||
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
|
||||
$username = $_COOKIE['username']; // クッキーから取得した値をセット
|
||||
$_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);
|
||||
}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;
|
||||
}
|
||||
|
||||
require_once '../authcode/GoogleAuthenticator.php';
|
||||
|
||||
if(empty($_SESSION['secretcode'])){
|
||||
$authcode = new PHPGangsta_GoogleAuthenticator();
|
||||
$secret = $authcode->createSecret();
|
||||
$_SESSION['secretcode'] = $secret;
|
||||
}else{
|
||||
$authcode = new PHPGangsta_GoogleAuthenticator();
|
||||
$secret = $_SESSION['secretcode'];
|
||||
}
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
$chkauthcode = new PHPGangsta_GoogleAuthenticator();
|
||||
//二段階認証の確認
|
||||
$userauthcode = $_POST['usercode'];
|
||||
|
||||
$discrepancy = 2;
|
||||
|
||||
$checkResult = $chkauthcode->verifyCode($secret, $userauthcode, $discrepancy);
|
||||
if ($checkResult) {
|
||||
if( empty($error_message) ) {
|
||||
$secret = $_SESSION['secretcode'];
|
||||
// トランザクション開始
|
||||
$pdo->beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
// SQL作成
|
||||
$stmt = $pdo->prepare("UPDATE account SET authcode = :authcode WHERE userid = :userid");
|
||||
|
||||
$stmt->bindValue(':authcode', $secret, PDO::PARAM_STR);
|
||||
|
||||
// ユーザーIDのバインド(WHERE句に必要)
|
||||
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
if ($res) {
|
||||
// リダイレクト先のURLへ転送する
|
||||
$url = 'success.php';
|
||||
header('Location: ' . $url, true, 303);
|
||||
exit;
|
||||
} else {
|
||||
$error_message[] = '更新に失敗しました。';
|
||||
}
|
||||
|
||||
// プリペアドステートメントを削除
|
||||
$stmt = null;
|
||||
}
|
||||
} else {
|
||||
$error_message[] = "二段階認証が出来ませんでした。再度お試しください。";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// データベースの接続を閉じる
|
||||
$pdo = null;
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title>設定 - <?php echo file_get_contents($servernamefile);?></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="emojibox">
|
||||
<h1>二段階認証の登録</h1>
|
||||
<?php if( !empty($error_message) ): ?>
|
||||
<ul class="errmsg">
|
||||
<?php foreach( $error_message as $value ): ?>
|
||||
<p>・ <?php echo $value; ?></p>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
|
||||
$title = file_get_contents($servernamefile);
|
||||
|
||||
$name = $userid;
|
||||
|
||||
$qrCodeUrl = $authcode->getQRCodeGoogleUrl($name, $secret, $title);
|
||||
?>
|
||||
|
||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||
<p>以下の二次元コードより二段階認証をセットアップしてください。</p>
|
||||
<p>セットアップが完了したら入力ボックスにコードを入力して「次へ」ボタンを押してください!<br>注意:まだ二段階認証の設定は終わっていません。次へを押すと設定が完了します。</p>
|
||||
<div class="authzone">
|
||||
<img src="<?php echo $qrCodeUrl;?>">
|
||||
</div>
|
||||
<div>
|
||||
<p>二段階認証コード</p>
|
||||
<div class="p2">先程セットアップして出力された6桁のコードを入力してください。</div>
|
||||
<input id="profile" type="text" placeholder="123456" class="inbox" name="usercode" value="">
|
||||
</div>
|
||||
<input type="submit" class = "irobutton" name="btn_submit" value="次へ">
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php require('../require/rightbox.php');?>
|
||||
<?php require('../require/botbox.php');?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
+64
-3
@@ -25,8 +25,8 @@ $option = null;
|
||||
|
||||
session_start();
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
$username = $_SESSION['username'];
|
||||
$userid = htmlentities($_SESSION['userid']);
|
||||
$username = htmlentities($_SESSION['username']);
|
||||
|
||||
try {
|
||||
|
||||
@@ -128,7 +128,7 @@ if( !empty($pdo) ) {
|
||||
|
||||
$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, iconcontent, icontype, iconsize, headname, headcontent, headtype, headsize, role, datetime FROM account WHERE userid = :userid");
|
||||
$rerole = $dbh->prepare("SELECT username, userid, password, mailadds, profile, iconname, iconcontent, icontype, iconsize, headname, headcontent, headtype, headsize, role, datetime, authcode FROM account WHERE userid = :userid");
|
||||
|
||||
$rerole->bindValue(':userid', $userid);
|
||||
// SQL実行
|
||||
@@ -580,6 +580,57 @@ if( !empty($_POST['logout']) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if( !empty($_POST['auth_on_submit']) ) {
|
||||
$_SESSION['userid'] = $userid;
|
||||
// リダイレクト先のURLへ転送する
|
||||
$url = 'addauthcode.php';
|
||||
header('Location: ' . $url, true, 303);
|
||||
|
||||
// すべての出力を終了
|
||||
exit;
|
||||
}
|
||||
|
||||
if( !empty($_POST['auth_off_submit']) ) {
|
||||
if( empty($error_message) ) {
|
||||
$secret = "";
|
||||
// トランザクション開始
|
||||
$pdo->beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
// SQL作成
|
||||
$stmt = $pdo->prepare("UPDATE account SET authcode = :authcode WHERE userid = :userid");
|
||||
|
||||
$stmt->bindValue(':authcode', $secret, PDO::PARAM_STR);
|
||||
|
||||
// ユーザーIDのバインド(WHERE句に必要)
|
||||
$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'];
|
||||
header("Location:".$url."");
|
||||
exit;
|
||||
} else {
|
||||
$error_message[] = '更新に失敗しました。';
|
||||
}
|
||||
|
||||
// プリペアドステートメントを削除
|
||||
$stmt = null;
|
||||
}
|
||||
}
|
||||
|
||||
// データベースの接続を閉じる
|
||||
$pdo = null;
|
||||
@@ -647,6 +698,7 @@ $pdo = null;
|
||||
|
||||
<input type="submit" class = "irobutton" name="btn_submit" value="情報更新">
|
||||
|
||||
<hr>
|
||||
<div>
|
||||
<p>パスワード</p>
|
||||
<input id="password" type="text" class="inbox" name="password" oncopy="return false" onpaste="return false" oncontextmenu="return false" style="-webkit-text-security:disc;" value="">
|
||||
@@ -654,6 +706,15 @@ $pdo = null;
|
||||
|
||||
<input type="submit" class = "irobutton" name="pass_submit" value="パスワード更新">
|
||||
|
||||
<hr>
|
||||
<?php
|
||||
if(empty($userdata['authcode'])){
|
||||
?>
|
||||
<input type="submit" class = "irobutton" name="auth_on_submit" value="二段階認証の設定">
|
||||
<?php }else{ ?>
|
||||
<p>下のボタンを押すとすぐに解除されます。確認などはありません。気をつけてください。</p>
|
||||
<input type="submit" class = "irobutton" name="auth_off_submit" value="二段階認証の解除">
|
||||
<?php } ?>
|
||||
|
||||
</form>
|
||||
</main>
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
|
||||
require('../db.php');
|
||||
|
||||
|
||||
$onlyuserfile = "../server/onlyuser.txt";
|
||||
$onlyuser = file_get_contents($onlyuserfile);
|
||||
|
||||
session_start();
|
||||
|
||||
// 変数の初期化
|
||||
$current_date = null;
|
||||
$message_array = array();
|
||||
$error_message = array();
|
||||
$authcode = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
|
||||
|
||||
|
||||
try {
|
||||
|
||||
$option = array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||
);
|
||||
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
} catch(PDOException $e) {
|
||||
|
||||
// 接続エラーのときエラー内容を取得する
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
|
||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', $_SESSION['userid']);
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
if(empty($res["userid"])){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}elseif($_SESSION['loginid'] === $res["loginid"]){
|
||||
// セッションに値をセット
|
||||
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
|
||||
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
|
||||
$_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);
|
||||
}else{
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', $_COOKIE['userid']);
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
if(empty($res["userid"])){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}elseif($_COOKIE['loginid'] === $res["loginid"]){
|
||||
// セッションに値をセット
|
||||
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
|
||||
$username = $_COOKIE['username']; // クッキーから取得した値をセット
|
||||
$_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);
|
||||
}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;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title>設定 - <?php echo file_get_contents($servernamefile);?></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="emojibox">
|
||||
<h1>二段階認証登録完了</h1>
|
||||
<?php if( !empty($error_message) ): ?>
|
||||
<ul class="errmsg">
|
||||
<?php foreach( $error_message as $value ): ?>
|
||||
<p>・ <?php echo $value; ?></p>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<p>登録完了!セキュリティの強化にご協力いただきありがとうございます!<br>(≧∇≦)</p>
|
||||
|
||||
<a href="index" class="irobutton">戻る</a>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php require('../require/rightbox.php');?>
|
||||
<?php require('../require/botbox.php');?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
+37
-13
@@ -28,8 +28,8 @@ $option = null;
|
||||
|
||||
session_start();
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
$username = $_SESSION['username'];
|
||||
$userid = htmlentities($_SESSION['userid']);
|
||||
$username = htmlentities($_SESSION['username']);
|
||||
|
||||
try {
|
||||
|
||||
@@ -113,19 +113,19 @@ if(empty($username)){
|
||||
exit;
|
||||
}
|
||||
|
||||
$ueuseid = str_replace('!', '', $_GET['ueuseid']);
|
||||
$touserid = str_replace('~', '', $_GET['touser']);
|
||||
$ueuseid = htmlentities(str_replace('!', '', $_GET['ueuseid']));
|
||||
$touserid = htmlentities(str_replace('~', '', $_GET['touser']));
|
||||
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
$ueuse = $_POST['ueuse'];
|
||||
|
||||
$ueuse = htmlentities($_POST['ueuse']);
|
||||
|
||||
// メッセージの入力チェック
|
||||
if( empty($ueuse) ) {
|
||||
$error_message[] = '内容を入力してください。';
|
||||
} else {
|
||||
|
||||
// 文字数を確認
|
||||
if( 1024 < mb_strlen($ueuse, 'UTF-8') ) {
|
||||
$error_message[] = '内容は1024文字以内で入力してください。';
|
||||
@@ -154,7 +154,15 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
if ($result) {
|
||||
$photo1 = $uploadedPath; // 保存されたファイルのパスを使用
|
||||
} else {
|
||||
$error_message[] = 'アップロード失敗!(1)エラーコード:' . $uploadedFile['error'].'<br>'.var_dump($_FILES['upload_images']);
|
||||
$errnum = $uploadedFile['error'];
|
||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,11 +194,18 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
if ($result2) {
|
||||
$photo2 = $uploadedPath2; // 保存されたファイルのパスを使用
|
||||
} else {
|
||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' . $uploadedFile2['error'].'<br>'.var_dump($_FILES['upload_images']);
|
||||
$errnum = $uploadedFile2['error'];
|
||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (empty($_FILES['upload_videos1']['name'])) {
|
||||
$video1 = "none";
|
||||
} else {
|
||||
@@ -215,13 +230,22 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
if ($result3) {
|
||||
$video1 = $uploadedPath3; // 保存されたファイルのパスを使用
|
||||
} else {
|
||||
$error_message[] = 'アップロード失敗!エラーコード:' . $uploadedFile3['error'];
|
||||
$errnum = $uploadedFile3['error'];
|
||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
|
||||
}
|
||||
} else {
|
||||
$error_message[] = '対応していないファイル形式です!';
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if( empty($error_message) ) {
|
||||
@@ -334,7 +358,7 @@ $pdo = null;
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<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>ID <?php echo htmlspecialchars($ueuseid, ENT_QUOTES, 'UTF-8'); ?> のユーズ - uwuzu</title>
|
||||
<title>ID <?php echo htmlentities($ueuseid, ENT_QUOTES, 'UTF-8'); ?> のユーズ - uwuzu</title>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -355,7 +379,7 @@ $pdo = null;
|
||||
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
<div class="sendbox">
|
||||
<textarea id="ueuse" placeholder="へんし~ん!!!" name="ueuse"><?php if( !empty($_SESSION['ueuse']) ){ echo htmlspecialchars( $_SESSION['ueuse'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
||||
<textarea id="ueuse" placeholder="へんし~ん!!!" name="ueuse"><?php if( !empty($_SESSION['ueuse']) ){ echo htmlentities( $_SESSION['ueuse'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
||||
<p>画像のEXIF情報(位置情報など)は削除されません。<br>情報漏洩に気をつけてくださいね…</p>
|
||||
<div class="fxbox">
|
||||
<label for="upload_images" id="images">
|
||||
@@ -433,7 +457,7 @@ $pdo = null;
|
||||
<p>ユーズに追記しますか?</p>
|
||||
<p>※追記は削除出来ません。</p>
|
||||
<form method="post" id="AbiForm">
|
||||
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlspecialchars( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
||||
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlentities( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
||||
<div class="btn_area">
|
||||
<input type="submit" id="AbiAddButton" class="fbtn_no" name="abi" value="追記">
|
||||
<input type="button" id="AbiCancelButton" class="fbtn" value="キャンセル">
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ $pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER,
|
||||
|
||||
//$row['userid'] = "daichimarukn";
|
||||
|
||||
$userid = $_GET['account'];
|
||||
$userid = htmlentities($_GET['account']);
|
||||
|
||||
|
||||
$options = array(
|
||||
|
||||
+10
-10
@@ -26,8 +26,8 @@ $option = null;
|
||||
|
||||
session_start();
|
||||
|
||||
$userid = $_SESSION['userid'];
|
||||
$username = $_SESSION['username'];
|
||||
$userid = htmlentities($_SESSION['userid']);
|
||||
$username = htmlentities($_SESSION['username']);
|
||||
|
||||
|
||||
try {
|
||||
@@ -129,7 +129,7 @@ if( !empty($pdo) ) {
|
||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||
));
|
||||
|
||||
$uwuzuid = str_replace('@', '', $_GET['uwuzuid']);
|
||||
$uwuzuid = htmlentities(str_replace('@', '', $_GET['uwuzuid']));
|
||||
|
||||
// ユーズ内の絵文字を画像に置き換える
|
||||
function replaceEmojisWithImages($postText) {
|
||||
@@ -213,7 +213,7 @@ if( !empty($pdo) ) {
|
||||
$followerIds = explode(',', $follower);
|
||||
$followerCount = count($followerIds)-1;
|
||||
|
||||
$profileText = htmlspecialchars($userData['profile'], ENT_QUOTES, 'UTF-8');
|
||||
$profileText = htmlentities($userData['profile'], ENT_QUOTES, 'UTF-8');
|
||||
|
||||
}else{
|
||||
$userData["userid"] = "none";
|
||||
@@ -320,7 +320,7 @@ $pdo = null;
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title><?php echo htmlspecialchars($userData['username'], ENT_QUOTES, 'UTF-8'); ?> さんのプロフィール - <?php echo file_get_contents($servernamefile);?></title>
|
||||
<title><?php echo htmlentities($userData['username'], ENT_QUOTES, 'UTF-8'); ?> さんのプロフィール - <?php echo file_get_contents($servernamefile);?></title>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -345,8 +345,8 @@ $pdo = null;
|
||||
</div>
|
||||
<div class="icon">
|
||||
<img src="../home/tlimage.php?account=<?php echo urlencode($userData['userid']); ?>">
|
||||
<h2><?php echo htmlspecialchars($userData['username'], ENT_QUOTES, 'UTF-8'); ?></h2>
|
||||
<p>@<?php echo htmlspecialchars($userData['userid'], ENT_QUOTES, 'UTF-8'); ?></p>
|
||||
<h2><?php echo htmlentities($userData['username'], ENT_QUOTES, 'UTF-8'); ?></h2>
|
||||
<p>@<?php echo htmlentities($userData['userid'], ENT_QUOTES, 'UTF-8'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="roleboxes">
|
||||
@@ -354,7 +354,7 @@ $pdo = null;
|
||||
<?php $roleData = $roleDataArray[$roleId]; ?>
|
||||
<div class="rolebox" style="border: 1px solid <?php echo '#' . $roleData["rolecolor"]; ?>;">
|
||||
<p style="color: <?php echo '#' . $roleData["rolecolor"]; ?>;">
|
||||
<?php if (!empty($roleData["rolename"])) { echo htmlspecialchars($roleData["rolename"], ENT_QUOTES, 'UTF-8'); } ?>
|
||||
<?php if (!empty($roleData["rolename"])) { echo htmlentities($roleData["rolename"], ENT_QUOTES, 'UTF-8'); } ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
@@ -400,7 +400,7 @@ $pdo = null;
|
||||
|
||||
<div id="myModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<p><?php echo htmlspecialchars($userData['username'], ENT_QUOTES, 'UTF-8'); ?>さんをフォロー解除しますか?</p>
|
||||
<p><?php echo htmlentities($userData['username'], ENT_QUOTES, 'UTF-8'); ?>さんをフォロー解除しますか?</p>
|
||||
<form class="btn_area" method="post">
|
||||
<input type="submit" id="openModalButton" class="fbtn_no" name="unfollow" value="フォロー解除">
|
||||
<input type="button" id="closeModal" class="fbtn" value="キャンセル">
|
||||
@@ -436,7 +436,7 @@ $pdo = null;
|
||||
<p>ユーズに追記しますか?</p>
|
||||
<p>※追記は削除出来ません。</p>
|
||||
<form method="post" id="AbiForm">
|
||||
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlspecialchars( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
||||
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlentities( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
|
||||
<div class="btn_area">
|
||||
<input type="submit" id="AbiAddButton" class="fbtn_no" name="abi" value="追記">
|
||||
<input type="button" id="AbiCancelButton" class="fbtn" value="キャンセル">
|
||||
|
||||
Reference in New Issue
Block a user