1
0
mirror of https://github.com/Daichimarukana/uwuzu.git synced 2026-06-05 03:24:41 +00:00

uwuzu v1.3.2 new_planet

This commit is contained in:
Daichimarukana
2024-03-05 21:25:13 +09:00
parent 15758bf040
commit 3e37062d80
17 changed files with 853 additions and 626 deletions
+39
View File
@@ -4,6 +4,9 @@ $serversettings = parse_ini_file($serversettings_file, true);
require('db.php');
//hCaptcha--------------------------------------------
require('settings_admin/hCaptcha_settings/hCaptcha_settings.php');
//----------------------------------------------------
// 変数の初期化
@@ -93,6 +96,33 @@ if( !empty($_POST['btn_submit']) ) {
$userid = htmlentities($_POST['userid']);
$password = htmlentities($_POST['password']);
if(!empty(CAPTCHA && CAPTCHA == "true")){
if(isset($_POST['h-captcha-response'])){
$hcaptcha_token = htmlentities($_POST['h-captcha-response']);
if($hcaptcha_token){
$captcha_data = [
'secret' => htmlentities(SEAC_KEY),
'response' => $hcaptcha_token,
'sitekey' => htmlentities(SITE_KEY)
];
$options = [
'http' => [
'method'=> 'POST',
'header'=> 'Content-Type: application/x-www-form-urlencoded',
'content' => http_build_query($captcha_data, '', '&')
]
];
$hCaptcha_result = json_decode(file_get_contents('https://hcaptcha.com/siteverify', false, stream_context_create($options)),true);
if(!($hCaptcha_result["success"] == true)){
$error_message[] = "あなたが人間である確認ができませんでした。(ERROR)";
}
}else{
$error_message[] = "あなたが人間である確認ができませんでした。(ERROR)";
}
}else{
$error_message[] = "あなたが人間である確認ができませんでした。(ERROR)";
}
}
$options = array(
// SQL実行失敗時に例外をスルー
@@ -190,6 +220,9 @@ $pdo = null;
<!--OGPここまで-->
<link rel="stylesheet" href="css/style.css">
<script src="js/unsupported.js"></script>
<?php if(!empty(CAPTCHA && CAPTCHA == "true")){?>
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
<?php }?>
<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">
@@ -232,6 +265,12 @@ $pdo = null;
<label for="password">パスワード</label>
<input id="password" class="inbox" type="password" name="password" maxlength="32" value="<?php if( !empty($_SESSION['password']) ){ echo htmlentities( $_SESSION['password'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<?php if(!empty(CAPTCHA && CAPTCHA == "true")){?>
<div class="captcha_zone">
<div class="p2">人間だと思いますが一応お伺いします...<br>人間ですか?<br>人間の場合はチェックボックスにチェックしてください!</div>
<div class="h-captcha" data-sitekey="<?php echo htmlentities(SITE_KEY);?>"></div>
</div>
<?php }?>
<input type="submit" name="btn_submit" class="irobutton" value="ログイン">
</form>