mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-05 03:24:41 +00:00
uwuzu version 1.2.16
This commit is contained in:
@@ -0,0 +1,570 @@
|
||||
<?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_name('uwuzu_s_id');
|
||||
session_start();
|
||||
|
||||
// 変数の初期化
|
||||
$current_date = null;
|
||||
$message_array = array();
|
||||
$error_message = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
$aduser = "yes";
|
||||
|
||||
$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);
|
||||
|
||||
$query = $dbh->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1');
|
||||
|
||||
$query->execute(array(':adminuser' => $aduser));
|
||||
|
||||
$result2 = $query->fetch();
|
||||
|
||||
if($result2 > 0){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
|
||||
//$row['userid'] = "daichimarukn";
|
||||
|
||||
// 空白除去
|
||||
$username = $_POST['username'];
|
||||
$userid = $_POST['userid'];
|
||||
|
||||
$password = $_POST['password'];
|
||||
$chkpass = $_POST['chkpass'];
|
||||
$mailadds = $_POST['mailadds'];
|
||||
|
||||
$profile = $_POST['profile'];
|
||||
|
||||
if($onlyuser === "true"){
|
||||
$invitationcode = $_POST['invitationcode'];
|
||||
}
|
||||
|
||||
//cookieに保存
|
||||
setcookie("username",$username,time()+60*60*24*14);
|
||||
setcookie("userid",$userid,time()+60*60*24*14);
|
||||
|
||||
setcookie("password",$password,time()+60*60*24*14);
|
||||
setcookie("mailadds",$mailadds,time()+60*60*24*14);
|
||||
|
||||
setcookie("profile",$profile,time()+60*60*24*14);
|
||||
|
||||
//----------------[icon image]-------------------------------
|
||||
if (empty($_FILES['image']['name'])) {
|
||||
$localFilePathhead = '../img/deficon/icon.png';
|
||||
|
||||
// 新しいファイル名を生成(uniqid + 拡張子)
|
||||
$newFilename = uniqid() . '-'.$userid.'.png';
|
||||
|
||||
// 保存先のパスを生成
|
||||
$uploadedPath = 'usericons/' . $newFilename;
|
||||
|
||||
// ファイルを移動
|
||||
$result = copy($localFilePathhead, '../'.$uploadedPath);
|
||||
|
||||
if ($result) {
|
||||
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
||||
} else {
|
||||
$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[] = 'アップロード失敗!(1)エラーコード:' .$uploadedFile['error'].'';
|
||||
}
|
||||
|
||||
} else {
|
||||
// アップロードされたファイル情報
|
||||
$uploadedFile = $_FILES['image'];
|
||||
|
||||
// アップロードされたファイルの拡張子を取得
|
||||
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
|
||||
|
||||
// 新しいファイル名を生成(uniqid + 拡張子)
|
||||
$newFilename = uniqid() . '-'.$userid.'.' . $extension;
|
||||
|
||||
// 保存先のパスを生成
|
||||
$uploadedPath = 'usericons/' . $newFilename;
|
||||
|
||||
// ファイルを移動
|
||||
$result = move_uploaded_file($uploadedFile['tmp_name'], '../'.$uploadedPath);
|
||||
|
||||
if ($result) {
|
||||
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
||||
} else {
|
||||
$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[] = 'アップロード失敗!(1)エラーコード:' .$uploadedFile['error'].'';
|
||||
}
|
||||
}
|
||||
|
||||
//----------------[header image]-------------------------------
|
||||
$localFilePathhead = '../img/defhead/head.png';
|
||||
|
||||
// 新しいファイル名を生成(uniqid + 拡張子)
|
||||
$newFilename = uniqid() . '-'.$userid.'.png';
|
||||
|
||||
// 保存先のパスを生成
|
||||
$uploadedPath = 'userheads/' . $newFilename;
|
||||
|
||||
// ファイルを移動
|
||||
$result = copy($localFilePathhead, '../'.$uploadedPath);
|
||||
|
||||
if ($result) {
|
||||
$headName = $uploadedPath; // 保存されたファイルのパスを使用
|
||||
} else {
|
||||
$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)エラーコード:' .$uploadedFile['error'].'';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$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);
|
||||
|
||||
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');
|
||||
|
||||
$query->execute(array(':userid' => $userid));
|
||||
|
||||
$result = $query->fetch();
|
||||
|
||||
|
||||
// ユーザーネームの入力チェック
|
||||
if( empty($username) ) {
|
||||
$error_message[] = '表示名を入力してください。';
|
||||
} else {
|
||||
// 文字数を確認
|
||||
if( 25 < mb_strlen($username, 'UTF-8') ) {
|
||||
$error_message[] = 'ユーザーネームは25文字以内で入力してください。';
|
||||
}
|
||||
}
|
||||
|
||||
// IDの入力チェック
|
||||
if( empty($userid) ) {
|
||||
$error_message[] = 'ユーザーIDを入力してください。';
|
||||
} else {
|
||||
|
||||
// 文字数を確認
|
||||
if( 20 < mb_strlen($userid, 'UTF-8') ) {
|
||||
$error_message[] = 'IDは20文字以内で入力してください。';
|
||||
}
|
||||
|
||||
if($result > 0){
|
||||
$error_message[] = 'このID('.$userid.')は既に使用されています。他のIDを作成してください。'; //このE-mailは既に使用されています。
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// パスワードの入力チェック
|
||||
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 ($chkpass == $password ){
|
||||
|
||||
}else{
|
||||
$error_message[] = '確認用パスワードが違います。';
|
||||
}
|
||||
|
||||
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();
|
||||
$datetime = date("Y-m-d H:i:s");
|
||||
|
||||
try {
|
||||
|
||||
$role = "official";
|
||||
$admin = "yes";
|
||||
$hashpassword = password_hash($password, PASSWORD_DEFAULT);
|
||||
$loginid = sha1(uniqid(mt_rand(), true));
|
||||
|
||||
// SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO account (username, userid, password, loginid, mailadds, profile, iconname, headname, role, datetime, admin) VALUES (:username, :userid, :password, :loginid, :mailadds, :profile, :iconname, :headname, :role, :datetime, :admin )");
|
||||
|
||||
// アイコン画像
|
||||
$stmt->bindValue(':iconname', $iconName, PDO::PARAM_STR);
|
||||
|
||||
// ヘッダー画像
|
||||
$stmt->bindValue(':headname', $headName, PDO::PARAM_STR);
|
||||
|
||||
// 他の値をセット
|
||||
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':userid', $userid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':password', $hashpassword, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':loginid', $loginid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':mailadds', $mailadds, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':profile', $profile, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':role', $role, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':admin', $admin, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$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) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
if ($res) {
|
||||
// リダイレクト先のURLへ転送する
|
||||
$_SESSION['userid'] = $userid;
|
||||
$url = 'success';
|
||||
header('Location: ' . $url, true, 303);
|
||||
|
||||
// すべての出力を終了
|
||||
exit;
|
||||
} 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>
|
||||
<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 id="wrap">
|
||||
<div class="iconimg">
|
||||
<img src="../img/deficon/icon.png">
|
||||
</div>
|
||||
<label class="irobutton" for="file_upload">ファイル選択
|
||||
<input type="file" id="file_upload" name="image" accept="image/*">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="js/back.js"></script>
|
||||
<!--ユーザーネーム関係-->
|
||||
<div>
|
||||
<p>ユーザーネーム *</p>
|
||||
<div class="p2">プロフィールページに掲載され公開されます。<br>※サービス管理者が確認できます。</div>
|
||||
<input id="username" placeholder="" class="inbox" type="text" name="username" value="<?php if( !empty($_SESSION['username']) ){ echo htmlspecialchars( $_SESSION['username'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
<div>
|
||||
<p>ユーザーID *</p>
|
||||
<div class="p2">後から変更はできません。<br>プロフィールページに掲載され公開されます。<br>※サービス管理者が確認できます。</div>
|
||||
<input onInput="checkForm(this)" placeholder="" class="inbox" id="userid" type="text" name="userid" value="<?php if( !empty($_SESSION['userid']) ){ echo htmlspecialchars( $_SESSION['userid'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
<!--アカウント関連-->
|
||||
<div>
|
||||
<p>パスワード *</p>
|
||||
<div class="p2">ログイン時に必要となります。<br>※サービス管理者が確認できません。</div>
|
||||
<input onInput="checkForm(this)" placeholder="" class="inbox" id="password" type="text" name="password" value="<?php if( !empty($_SESSION['password']) ){ echo htmlspecialchars( $_SESSION['password'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>パスワード再確認 *</p>
|
||||
<input onInput="checkForm(this)" placeholder="" class="inbox" oncopy="return false" onpaste="return false" oncontextmenu="return false" id="chkpass" type="text" style="-webkit-text-security:disc;" name="chkpass" value="<?php if( !empty($_SESSION['chkpass']) ){ echo htmlspecialchars( $_SESSION['chkpass'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>メールアドレス</p>
|
||||
<div class="p2">設定しておくとアカウント復旧に利用できます。<br>※サービス管理者が確認できます。</div>
|
||||
<input id="mailadds" type="text" placeholder="" class="inbox" name="mailadds" value="<?php if( !empty($_SESSION['mailadds']) ){ echo htmlspecialchars( $_SESSION['mailadds'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
<!--プロフィール関連-->
|
||||
<div>
|
||||
<p>プロフィール</p>
|
||||
<div class="p2">プロフィールページに掲載され公開されます。<br>※サービス管理者が確認できます。</div>
|
||||
<input id="profile" type="text" placeholder="" class="inbox" name="profile" value="<?php if( !empty($_SESSION['profile']) ){ echo htmlspecialchars( $_SESSION['profile'], ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
<?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">
|
||||
<a href="index.php" class="sirobutton">戻る</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function checkForm(inputElement) {
|
||||
var str = inputElement.value;
|
||||
while (str.match(/[^A-Za-z\d_]/)) {
|
||||
str = str.replace(/[^A-Za-z\d_]/, "");
|
||||
}
|
||||
inputElement.value = str;
|
||||
}
|
||||
|
||||
|
||||
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>
|
||||
@@ -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)";
|
||||
}
|
||||
+162
@@ -0,0 +1,162 @@
|
||||
<?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');
|
||||
|
||||
$softwarefile = "../server/uwuzuinfo.txt";
|
||||
$softwaredata = file_get_contents($softwarefile);
|
||||
|
||||
$softwaredata = explode( "\n", $softwaredata );
|
||||
$cnt = count( $softwaredata );
|
||||
for( $i=0;$i<$cnt;$i++ ){
|
||||
$uwuzuinfo[$i] = ($softwaredata[$i]);
|
||||
}
|
||||
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
$onlyuserfile = "../server/onlyuser.txt";
|
||||
$onlyuser = file_get_contents($onlyuserfile);
|
||||
|
||||
session_name('uwuzu_s_id');
|
||||
session_start();
|
||||
|
||||
// 変数の初期化
|
||||
$current_date = null;
|
||||
$message_array = array();
|
||||
$error_message = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
$aduser = "yes";
|
||||
|
||||
$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);
|
||||
|
||||
$query = $dbh->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1');
|
||||
|
||||
$query->execute(array(':adminuser' => $aduser));
|
||||
|
||||
$result2 = $query->fetch();
|
||||
|
||||
if($result2 > 0){
|
||||
header("Location: ../login.php");
|
||||
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>uwuzuへようこそ!!! - <?php echo file_get_contents($servernamefile);?></title>
|
||||
</head>
|
||||
|
||||
|
||||
<script src="../js/back.js"></script>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="leftbox2">
|
||||
<div class="logo">
|
||||
<img src="../img/uwuzulogo.svg">
|
||||
</div>
|
||||
|
||||
<div class="textbox">
|
||||
<h1>uwuzuへようこそ!!!</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; ?>
|
||||
<script src="back.js"></script>
|
||||
|
||||
<p>おめでとうございます!!!</p>
|
||||
<p>uwuzuの導入が完了しました!</p>
|
||||
<p>これより管理者アカウントの登録を行います。<br>userロールとofficialロールの設定はお済みですか?<br>userロールとofficialロールがないとuwuzuは正しく動作しないので設定をしていない方は一度このページを閉じて設定してください!<br>また、php.iniよりGDの有効化または導入はお済みですか?GDがないとuwuzuは二段階認証が正しく動作しないため絶対に設定してください!</p>
|
||||
|
||||
<p>uwuzu<br>Version : <?php echo $uwuzuinfo[1]?></p>
|
||||
<div class="btnbox">
|
||||
<a href="addadmin.php" class="irobutton">次へ</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function checkForm(inputElement) {
|
||||
var str = inputElement.value;
|
||||
while (str.match(/[^A-Za-z\d_]/)) {
|
||||
str = str.replace(/[^A-Za-z\d_]/, "");
|
||||
}
|
||||
inputElement.value = str;
|
||||
}
|
||||
|
||||
|
||||
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>
|
||||
@@ -0,0 +1,114 @@
|
||||
<?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_name('uwuzu_s_id');
|
||||
session_start();
|
||||
|
||||
// 変数の初期化
|
||||
$current_date = null;
|
||||
$message_array = array();
|
||||
$error_message = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
$aduser = "yes";
|
||||
|
||||
$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);
|
||||
|
||||
$query = $dbh->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1');
|
||||
|
||||
$query->execute(array(':adminuser' => $aduser));
|
||||
|
||||
$result2 = $query->fetch();
|
||||
|
||||
if($result2 > 0){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$servernamefile = "../server/servername.txt";
|
||||
if(!(empty($_SESSION['backupcode']))){
|
||||
$backupcode = $_SESSION['backupcode'];
|
||||
}else{
|
||||
$backupcode = 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="leftbox2">
|
||||
<div class="logo">
|
||||
<img src="../img/uwuzulogo.svg">
|
||||
</div>
|
||||
|
||||
<div class="textbox">
|
||||
<h1>アカウント作成完了!</h1>
|
||||
<p><br>いぇ~い!</p>
|
||||
<p>88888888888</p>
|
||||
<p>管理者アカウントの登録が完了しました!</p>
|
||||
<p>以下のログインボタンよりログインしてください!<br>ログイン後は画面左側メニューの「サーバー設定」よりサーバーの情報を設定することをおすすめします!<br>また、左側メニューの「設定」から二段階認証の設定をすることもおすすめします。</p>
|
||||
|
||||
<div class="btnbox">
|
||||
<a href="../login.php" class="sirobutton">ログイン</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
+121
-1
@@ -2189,8 +2189,19 @@ label>input {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.terms .err404{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.terms .err404 img{
|
||||
height: 25dvh;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.terms .err404 h1{
|
||||
margin-top: 256px;
|
||||
margin-top: 64px;
|
||||
line-height:64px;
|
||||
font-family: 'BIZ UDPGothic', sans-serif;
|
||||
font-weight: bold;
|
||||
@@ -2935,6 +2946,91 @@ hr{
|
||||
font-weight: normal;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.switch_input {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 64%;
|
||||
height: 64%;
|
||||
z-index: 5;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
.switch_label {
|
||||
width: 48px;
|
||||
height: 24px;
|
||||
background: #ccc;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
border-radius: 25px;
|
||||
transition: 0.4s;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.switch_label:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
margin-top: 2px;
|
||||
margin-left: 2px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
background: #fff;
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
transition: 0.2s;
|
||||
}
|
||||
.switch_input:checked + .switch_label {
|
||||
background-color: #FFC832;
|
||||
}
|
||||
.switch_input:checked + .switch_label:after {
|
||||
left: 24px;
|
||||
}
|
||||
.switch_button {
|
||||
position: relative;
|
||||
width: 75px;
|
||||
height: 35px;
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.server_code{
|
||||
animation: slideInY 0.5s cubic-bezier(0.25, 1, 0.5, 1) 1 forwards;
|
||||
margin-top: 12px;
|
||||
margin-bottom: 12px;
|
||||
border-radius: 10px;
|
||||
padding-left: 12px;
|
||||
padding-right: 12px;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
background-color: #F5F5F5;
|
||||
border: 1px solid #EEE;
|
||||
width: auto;
|
||||
}
|
||||
.server_code h1{
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
text-align: left;
|
||||
color:#252525;
|
||||
font-family: 'BIZ UDGothic', sans-serif;
|
||||
word-wrap: break-word;
|
||||
font-size: 22px;
|
||||
line-height: 22px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.server_code p{
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
text-align: left;
|
||||
color:#252525;
|
||||
font-family: 'BIZ UDGothic', sans-serif;
|
||||
word-wrap: break-word;
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------------------------------------*/
|
||||
/*--------------------------------------------------スマホ向け--------------------------------------------------*/
|
||||
/*--------------------------------------------------ここから--------------------------------------------------*/
|
||||
@@ -3052,6 +3148,9 @@ hr{
|
||||
}
|
||||
|
||||
.sendbox label{
|
||||
display: block;
|
||||
flex-shrink: 0;
|
||||
text-align: center;
|
||||
width:10%;
|
||||
padding: 8px auto;
|
||||
margin-left: 6px;
|
||||
@@ -4425,6 +4524,27 @@ hr{
|
||||
color:#FF4444;
|
||||
}
|
||||
|
||||
|
||||
.server_code{
|
||||
animation: slideInY 0.5s cubic-bezier(0.25, 1, 0.5, 1) 1 forwards;
|
||||
margin-top: 12px;
|
||||
margin-bottom: 12px;
|
||||
border-radius: 10px;
|
||||
padding-left: 12px;
|
||||
padding-right: 12px;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
background-color: #0c0c0c;
|
||||
border: 1px solid #EEE;
|
||||
width: auto;
|
||||
}
|
||||
.server_code h1{
|
||||
color: #CCC;
|
||||
}
|
||||
.server_code p{
|
||||
color: #CCC;
|
||||
}
|
||||
|
||||
|
||||
.terms{
|
||||
background-color: #0c0c0c;
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<?php
|
||||
$custom404file = "../server/404imagepath.txt";
|
||||
|
||||
//------------------------
|
||||
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
//-------------------------------------
|
||||
@@ -38,6 +42,9 @@ $termsdata = file_get_contents($termsfile);
|
||||
<div class="p2c"><?php echo $domain;?></div>
|
||||
|
||||
<div class="err404">
|
||||
<?php if(!(empty($custom404file))){?>
|
||||
<img src="<?php echo file_get_contents($custom404file);?>">
|
||||
<?php }?>
|
||||
<h1>404 Not found</h1>
|
||||
<p>申し訳ございませんがお探しのページは見つかりませんでした!<br>ページの移動や削除が行われた可能性がございます。</p>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<?php
|
||||
|
||||
$custom503file = "../server/503imagepath.txt";
|
||||
|
||||
//-------------------------
|
||||
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
//-------------------------------------
|
||||
@@ -38,6 +43,9 @@ $termsdata = file_get_contents($termsfile);
|
||||
<div class="p2c"><?php echo $domain;?></div>
|
||||
|
||||
<div class="err404">
|
||||
<?php if(!(empty($custom503file))){?>
|
||||
<img src="<?php echo file_get_contents($custom503file);?>">
|
||||
<?php }?>
|
||||
<h1>503 Service Unavailable</h1>
|
||||
<p>(´。_。`;)< サーバーに過負荷がかかっているようです...<br>時間をおいてから再度アクセスしてください!</p>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<svg version="1.1" id="server" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1024 1024" style="fill-rule:evenodd;stroke:none" xml:space="preserve">
|
||||
<g>
|
||||
<path d="M 76.0 253.74638 C 76.0 270.80435 76.0 287.61078 76.0 304.4 C 75.27057 316.30206 75.99194 328.80856 83.29525 338.90503 C 92.11438 353.9812 109.83434 362.04654 126.88691 361.0 C 145.68481 361.0 164.48273 361.0 183.28064 361.0 C 328.0645 361.0 472.84842 361.0 617.6323 361.0 C 690.22424 361.0 762.81616 361.0 835.4081 361.0 C 853.6279 361.0 871.79816 361.0 890.002 361.0 C 902.3682 361.007 915.6736 362.4736 926.90186 356.03677 C 943.7456 348.5697 953.4615 330.38086 953.6823 312.58557 C 954.522 292.5478 953.5839 272.4664 954.0 252.423 C 953.859 234.21152 954.1724 216.02579 953.9057 197.82697 C 953.7232 183.05801 949.0092 167.51312 937.01624 157.83081 C 925.66974 147.59935 910.281 145.08527 895.6223 146.0 C 658.2486 146.0 420.88287 146.0 183.52518 146.0 C 166.33356 146.0 149.10826 146.0 131.93263 146.0 C 120.08126 145.237 108.04283 146.9879 97.98537 153.72632 C 83.68445 162.6528 74.89377 179.30917 76.0 196.16174 C 76.0 215.28062 76.0 234.3821 76.0 253.74638 Z M 76.0 515.747 C 76.0 533.004 76.0 550.011 76.0 567.0 C 75.311905 578.8501 76.14479 591.3651 83.591934 601.30756 C 92.54537 615.7855 109.424965 623.9886 126.26561 622.9998 C 145.26971 623.00037 164.25435 622.9997 183.25427 623.0 C 327.61176 623.0 472.0029 623.0 616.34436 623.0 C 688.7201 623.0 761.1295 623.0 833.48926 623.0 C 851.69855 623.0 869.86615 623.0 888.07544 623.0 C 900.9223 623.12616 914.5106 624.406 926.36127 618.286 C 943.0149 610.8798 953.3255 593.0422 953.6347 575.1856 C 954.57745 555.07324 953.5443 534.93866 954.0 514.81885 C 953.8889 496.64117 954.13574 478.47205 953.92596 460.30838 C 953.911 445.02997 948.8579 429.2461 936.54706 419.2861 C 925.2696 409.31195 910.08514 407.13165 895.635 408.0 C 658.12537 408.0 420.6237 408.0 183.13004 408.0 C 166.13707 408.0 149.1441 408.0 132.15115 408.0 C 120.379555 407.56815 107.959 408.58014 97.93872 415.5586 C 83.49397 424.46808 74.826645 441.1983 76.0 458.1619 C 76.0 477.28058 76.0 496.38367 76.0 515.747 Z M 76.0 777.2962 C 76.0 794.5176 76.0 811.52045 76.0 828.5 C 75.30375 840.5096 76.019226 853.22 83.591934 863.30756 C 92.80086 878.0986 110.328835 886.1263 127.489105 885.0 C 146.29707 885.0 165.0634 885.0 183.87138 885.0 C 328.234 885.0 472.58865 885.0 616.9353 885.0 C 689.29865 885.0 761.7037 885.0 834.0671 885.0 C 852.26135 885.0 870.4556 885.0 888.6499 885.0 C 901.4239 885.0999 915.05066 886.33887 926.78394 880.0558 C 943.5927 871.99335 953.7279 854.0645 953.74146 835.67615 C 954.44037 815.59625 953.6458 795.4643 954.0 775.38245 C 953.8451 757.43994 954.19 739.5233 953.89465 721.59625 C 953.7319 706.3821 948.4644 690.73334 936.16394 680.9458 C 923.33136 669.63104 909.2142 669.51996 894.3163 670.0 C 657.16187 670.0 420.0572 670.0 182.91881 670.0 C 165.92365 670.0 148.92848 670.0 131.93332 670.0 C 120.1362 669.4402 107.6214 670.2861 97.69241 677.5919 C 83.30177 686.6182 74.842995 703.4823 76.0 720.35706 C 76.0 739.27014 76.0 758.1647 76.0 777.2962 Z M 132.00552 260.23706 C 131.5036 288.3045 156.96925 313.62515 184.88303 311.99414 C 213.26517 312.93765 236.85686 286.405 235.6454 258.9262 C 235.42346 231.10242 209.69429 206.48074 181.67693 209.00853 C 167.82706 208.33914 155.00917 215.11423 146.12994 225.37006 C 136.70596 234.16145 131.79443 247.12006 132.00552 260.23706 Z M 132.0129 521.23566 C 131.5274 535.995 137.6076 549.9209 148.32753 559.58435 C 158.4196 569.26746 171.97783 574.7692 186.08351 573.5497 C 214.17819 572.98224 237.48758 546.6391 235.4699 518.9368 C 235.19351 490.69714 208.20709 467.80826 180.69316 470.0741 C 154.343 470.97736 131.94522 494.8324 132.0129 521.23566 Z M 132.00552 783.23706 C 131.39201 811.5346 157.04424 836.3964 184.99419 834.98553 C 213.51115 835.4979 237.04463 809.36127 235.59027 781.4786 C 235.2065 753.2923 209.46771 730.1908 181.77516 731.48016 C 154.4867 731.50635 131.66637 756.2344 132.00552 783.23706 Z " />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.0 KiB |
@@ -20,6 +20,7 @@
|
||||
<hr>
|
||||
<a href="/emoji/addemoji" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/addemoji.svg#addemoji"></use></svg>絵文字登録</a>
|
||||
<a href="/notice/addnotice" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/addnotice.svg#addnotice"></use></svg>お知らせ配信</a>
|
||||
<a href="/settings/serveradmin" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/server.svg#server"></use></svg>サーバー設定</a>
|
||||
<?php }?>
|
||||
<hr>
|
||||
<form method="post">
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
TEST/@test
|
||||
@@ -1 +0,0 @@
|
||||
test@test.com
|
||||
@@ -1,3 +0,0 @@
|
||||
XXXXへようこそ!
|
||||
XXXXはuwuzu~~~~~~~~~
|
||||
とりあえず適当に書いてみよう!
|
||||
@@ -1 +0,0 @@
|
||||
ここもしっかり書こう
|
||||
@@ -1 +0,0 @@
|
||||
tesutoさば
|
||||
+13
-4
@@ -28,13 +28,16 @@ uwuzuはPHPとJS、HTML(プログラミング言語じゃないか)、CSSで作
|
||||
ライブラリはjQueryを導入しています!
|
||||
|
||||
## 5. サーバーの建て方
|
||||
※MySQLの設定結構めんどいです。
|
||||
まず、Apache2とPHP 8とmysql Ver 15が導入されているサーバーを準備します!
|
||||
PHP 8では事前にGDを有効化しておいてください!(QRコードの生成に必要です。)
|
||||
次にSQLを設定します。(InnoDB)
|
||||
まず、お好きな名前でDBを作成し、その中に、account,emoji,notice,role,ueuse,notificationとテーブルを作成します。
|
||||
テーブルの中身は以下のとおりです。
|
||||
照合順序は全て標準でutf8mb4_general_ciです。
|
||||
|
||||
## 簡単に構築できるようSQLの構造ファイルがリリースに添付されています!そちらをインポートしていただけますと大幅に簡単に導入できます!
|
||||
(userロールとofficialロールの設定は別途必要です。お手数ですがそこの設定だけよろしくお願いいたします。)
|
||||
|
||||
### account
|
||||
- sysid(INT)(AUTO_INCREMENT ) アカウントが追加されるとカウントされるシステム用ID
|
||||
- username(varchar(500)) ユーザーネーム保存用
|
||||
@@ -104,11 +107,17 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
|
||||
- used(varchar(25)) 使用済みかそうでないか
|
||||
- datetime(datetime) 招待コード仕様日時更新用
|
||||
|
||||
すべて作成完了したらGithubよりuwuzuのファイルをDLし、解凍し、それをサーバーの動作ディレクトリに置き、Apacheのhttpd.confからその動作ディレクトリを指定し、あとはApacheとphpとMy SQLを起動するだけ!
|
||||
すべて作成完了したらGithubよりuwuzuのファイルをDLし、解凍し、それをサーバーの動作ディレクトリに置き、Apacheのhttpd.confからその動作ディレクトリを指定し、動作ディレクトリ内のdb.phpにDBのログイン情報を書き込んであとはApacheとphpとMy SQLを起動するだけ!
|
||||
起動したらまずDBのroleにphpmyadminから「user」ロールと「official」ロールを追加、権限は「user」と「official」でOK。ロール名はとりあえず「一般ユーザー」ロールの色はHEXコード(#を除く)で000000のように指定。(この2つのロールがないとエラーが発生します。)
|
||||
そしたら普通にuwuzuにアクセスして自分のアカウントを登録。
|
||||
## 管理者アカウント登録機能が追加されました。【[domain]/admin/】より設定できるのでそちらをご利用ください。
|
||||
なお、管理者アカウントを導入後に登録した場合サーバーを止めてuwuzu動作ディレクトリ内のserverフォルダ内のファイルを設定する必要はございません。
|
||||
|
||||
それが終わったら一度サーバーを止め、uwuzuの動作ディレクトリ内のserverフォルダ内のファイルを各自設定
|
||||
ファイルの機能は以下の通り!
|
||||
|
||||
## 管理者アカウント作成後にログインし、サーバー設定より以下の項目が簡単に設定できます。
|
||||
|
||||
- admininfo.txt : 管理者名(てすとまる/@sampledayo)
|
||||
- contact.txt : 管理者への連絡用メアド(sample@test.com)
|
||||
- info.txt : サーバー登録時に表示されるメッセージ(好きな内容)
|
||||
@@ -121,7 +130,7 @@ PHP 8では事前にGDを有効化しておいてください!(QRコードの
|
||||
- onlyuser.txt : 招待コード機能をオンにするかどうか、「true」でオン、「false」でオフ。招待コードはDBに直接追加。
|
||||
|
||||
### これでサーバーは完成!!!
|
||||
もう一度サーバーを起動してみんなに公開しよう!!!
|
||||
もう一度サーバーを起動してみんなに公開しよう!!!(まだ脆弱性は残っていると思われます。公開する際は気をつけてください。私だいちまる及びPutonfpsは一切責任を負いません。)
|
||||
|
||||
## 6. Android、iOS、その他OS向けのアプリについて
|
||||
残念ですが今現在は公式アプリ等はなく、Webブラウザからお楽しみいただけます。
|
||||
@@ -143,4 +152,4 @@ daichimarukanaと一緒に開発したいよ~って人は私のHPからメー
|
||||
|
||||
|
||||
編集者 : daichimarukana
|
||||
最終更新日 : 2023/08/18 12:44
|
||||
最終更新日 : 2023/09/05 0:36
|
||||
@@ -1,4 +1,4 @@
|
||||
uwuzu
|
||||
1.2.15
|
||||
2023/09/03
|
||||
1.2.16
|
||||
2023/09/05
|
||||
daichimarukana,putonfps
|
||||
@@ -1,6 +1,13 @@
|
||||
## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
|
||||
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
|
||||
|
||||
## Version 1.2.16
|
||||
リリース日:2023/09/05
|
||||
サーバー設定項目を追加しました。
|
||||
サーバー初期設定を楽にするため、サーバー構築後に管理者アカウント登録画面へいけるようにしました。
|
||||
(uwuzu環境構築後サーバーを起動し「[domain]/admin/」でいけます。)
|
||||
PC向けUIを一部変更しました。
|
||||
|
||||
## Version 1.2.15
|
||||
リリース日:2023/09/03
|
||||
ログインできないという致命的なバグを修正しました。
|
||||
|
||||
@@ -0,0 +1,442 @@
|
||||
<?php
|
||||
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
$serverinfofile = '../server/info.txt';
|
||||
$serverinfo = file_get_contents($serverinfofile);
|
||||
|
||||
$servertermsfile = '../server/terms.txt';
|
||||
$serverterms = file_get_contents($servertermsfile);
|
||||
|
||||
$serverprvfile = '../server/privacypolicy.txt';
|
||||
$serverprv = file_get_contents($serverprvfile);
|
||||
|
||||
$contactfile = "../server/contact.txt";
|
||||
|
||||
$adminfile = "../server/admininfo.txt";
|
||||
|
||||
$serverstopfile = "../server/serverstop.txt";
|
||||
|
||||
$onlyuserfile = "../server/onlyuser.txt";
|
||||
|
||||
$err404imagefile = "../server/404imagepath.txt";
|
||||
|
||||
function createUniqId(){
|
||||
list($msec, $sec) = explode(" ", microtime());
|
||||
$hashCreateTime = $sec.floor($msec*1000000);
|
||||
|
||||
$hashCreateTime = strrev($hashCreateTime);
|
||||
|
||||
return base_convert($hashCreateTime,10,36);
|
||||
}
|
||||
function random_code($length = 8){
|
||||
return substr(str_shuffle('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, $length);
|
||||
}
|
||||
|
||||
require('../db.php');
|
||||
|
||||
// 変数の初期化
|
||||
$datetime = array();
|
||||
$user_name = null;
|
||||
$message = array();
|
||||
$message_data = null;
|
||||
$error_message = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
session_name('uwuzu_s_id');
|
||||
session_start();
|
||||
session_regenerate_id(true);
|
||||
|
||||
$userid = htmlentities($_SESSION['userid']);
|
||||
$username = htmlentities($_SESSION['username']);
|
||||
|
||||
try {
|
||||
|
||||
$option = array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||
);
|
||||
$pdo = new PDO('mysql:charset=UTF8;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,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('username', $username,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('loginid', $res["loginid"],[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('admin_login', true,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
}else{
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
} 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,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('username', $username,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('loginid', $res["loginid"],[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('admin_login', true,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
}else{
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
// ログインが許可されていない場合、ログインページにリダイレクト
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
if(empty($userid)){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
if(empty($username)){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!($res["admin"] === "yes")){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||
$notiQuery->bindValue(':userid', $userid);
|
||||
$notiQuery->execute();
|
||||
$notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$notificationcount = $notiData['notification_count'];
|
||||
|
||||
if( !empty($pdo) ) {
|
||||
|
||||
// データベース接続の設定
|
||||
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||
));
|
||||
|
||||
$userQuery = $dbh->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid");
|
||||
$userQuery->bindValue(':userid', $userid);
|
||||
$userQuery->execute();
|
||||
$userData = $userQuery->fetch();
|
||||
|
||||
$role = $userData["role"];
|
||||
|
||||
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
$rerole = $dbh->prepare("SELECT username, userid, password, mailadds, profile, iconname, headname, role, datetime FROM account WHERE userid = :userid");
|
||||
|
||||
$rerole->bindValue(':userid', $userid);
|
||||
// SQL実行
|
||||
$rerole->execute();
|
||||
|
||||
$userdata = $rerole->fetch(); // ここでデータベースから取得した値を $role に代入する
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!empty($pdo)) {
|
||||
|
||||
$sql = "SELECT code,used,datetime FROM invitation ORDER BY datetime DESC";
|
||||
$invcode = $pdo->query($sql);
|
||||
|
||||
while ($row = $invcode->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$codes[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
// 空白除去
|
||||
$servername = $_POST['servername'];
|
||||
|
||||
$serverinfo = $_POST['serverinfo'];
|
||||
|
||||
$serveradminname = $_POST['serveradminname'];
|
||||
|
||||
$servermailadds = $_POST['servermailadds'];
|
||||
|
||||
$onlyuser = $_POST['onlyuser'];
|
||||
|
||||
if($onlyuser === "true"){
|
||||
$saveonlyuser = "true";
|
||||
}else{
|
||||
$saveonlyuser = "false";
|
||||
}
|
||||
$serverterms = $_POST['serverterms'];
|
||||
|
||||
$serverprv = $_POST['serverprv'];
|
||||
|
||||
$serverstop = $_POST['serverstop'];
|
||||
|
||||
//鯖名
|
||||
$file = fopen($servernamefile, 'w');
|
||||
$data = $servername;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
//鯖紹介
|
||||
$file = fopen($serverinfofile, 'w');
|
||||
$data = $serverinfo;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
//鯖管理者名
|
||||
$file = fopen($adminfile, 'w');
|
||||
$data = $serveradminname;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
//鯖管理者メアド
|
||||
$file = fopen($contactfile, 'w');
|
||||
$data = $servermailadds;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
//招待制にするか
|
||||
$file = fopen($onlyuserfile, 'w');
|
||||
$data = $saveonlyuser;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
//利用規約
|
||||
$file = fopen($servertermsfile, 'w');
|
||||
$data = $serverterms;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
//プライバシーポリシー
|
||||
$file = fopen($serverprvfile, 'w');
|
||||
$data = $serverprv;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
//鯖停止
|
||||
$file = fopen($serverstopfile, 'w');
|
||||
$data = $serverstop;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
header("Location:".$url."");
|
||||
exit;
|
||||
}
|
||||
|
||||
if( !empty($_POST['code_btn_submit']) ) {
|
||||
|
||||
$pdo->beginTransaction();
|
||||
$datetime = date("Y-m-d H:i:s");
|
||||
|
||||
try {
|
||||
|
||||
$new_invcode = random_code();
|
||||
$used = "none";
|
||||
|
||||
// SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO invitation (code, used, datetime) VALUES (:code, :used, :datetime)");
|
||||
|
||||
$stmt->bindParam(':code', $new_invcode, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':used', $used, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':datetime', $datetime, 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;
|
||||
}
|
||||
|
||||
?>
|
||||
<!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; ?>
|
||||
|
||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||
<h1>サーバー設定</h1>
|
||||
<div>
|
||||
<p>サーバー名</p>
|
||||
<input id="servername" placeholder="uwuzuさ~ば~" class="inbox" type="text" name="servername" value="<?php if( !empty(file_get_contents($servernamefile)) ){ echo htmlspecialchars(file_get_contents($servernamefile), ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>サーバー紹介メッセージ</p>
|
||||
<textarea id="serverinfo" placeholder="たのしいさーばーです" class="inbox" type="text" name="serverinfo"><?php $sinfo = explode("\n", $serverinfo); foreach ($sinfo as $info) { echo $info; }?></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>サーバー管理者の名前</p>
|
||||
<input id="serveradminname" placeholder="わたし" class="inbox" type="text" name="serveradminname" value="<?php if( !empty(file_get_contents($adminfile)) ){ echo htmlspecialchars(file_get_contents($adminfile), ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>サーバーへのお問い合わせ用メールアドレス</p>
|
||||
<input id="servermailadds" placeholder="" class="inbox" type="text" name="servermailadds" value="<?php if( !empty(file_get_contents($contactfile)) ){ echo htmlspecialchars(file_get_contents($contactfile), ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>招待制にするかどうか</p>
|
||||
<div class="switch_button">
|
||||
<?php if(file_get_contents($onlyuserfile) === "true"){?>
|
||||
<input id="onlyuser" class="switch_input" type='checkbox' name="onlyuser" value="true" checked/>
|
||||
<label for="onlyuser" class="switch_label"></label>
|
||||
<?php }else{?>
|
||||
<input id="onlyuser" class="switch_input" type='checkbox' name="onlyuser" value="true" />
|
||||
<label for="onlyuser" class="switch_label"></label>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>利用規約</p>
|
||||
<textarea id="serverterms" placeholder="しっかり書きましょう" class="inbox" type="text" name="serverterms"><?php $sinfo = explode("\n", $serverterms); foreach ($sinfo as $info) { echo $info; }?></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<p>プライバシーポリシー</p>
|
||||
<textarea id="serverprv" placeholder="しっかり書きましょう" class="inbox" type="text" name="serverprv"><?php $sinfo = explode("\n", $serverprv); foreach ($sinfo as $info) { echo $info; }?></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>サーバー停止時表示メッセージ</p>
|
||||
<input id="serverstop" placeholder="現在サーバーは止まっておりません。" class="inbox" type="text" name="serverstop" value="<?php if( !empty(file_get_contents($serverstopfile)) ){ echo htmlspecialchars(file_get_contents($serverstopfile), ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
|
||||
<input type="submit" class = "irobutton" name="btn_submit" value="保存&更新">
|
||||
|
||||
<hr>
|
||||
<h1>招待コード発行所</h1>
|
||||
<?php if(file_get_contents($onlyuserfile) === "true"){?>
|
||||
<p>下の発行ボタンで新しくコードを発行できます!<br>なお、コードは一回限り有効です。</p>
|
||||
<input type="submit" class = "irobutton" name="code_btn_submit" value="発行!">
|
||||
<?php foreach ($codes as $value) {?>
|
||||
<div class="server_code">
|
||||
<h1>コード:<?php if( !empty($value["code"]) ){ echo htmlentities($value["code"]); }?></h1>
|
||||
<p>使用状況:<?php if( !empty($value["used"]) ){
|
||||
if($value["used"] === "none"){
|
||||
echo "未使用";
|
||||
}elseif($value["used"] === "true"){
|
||||
echo "使用済み";
|
||||
}?></p>
|
||||
<p>発行日時:<?php if( !empty($value["datetime"]) ){ echo htmlentities($value["datetime"]); }?></p>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
<?php }else{?>
|
||||
<p>サーバーは招待制にされていないため招待コードは利用できません。</p>
|
||||
<?php }?>
|
||||
|
||||
</form>
|
||||
</main>
|
||||
|
||||
<?php require('../require/rightbox.php');?>
|
||||
<?php require('../require/botbox.php');?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user