fuc/storage/framework/smarty/compile/14b46c67c8ae19870398c5cedaf26b4c92952e8c_0.file_captcha.tpl.php
2025-03-13 17:13:42 +08:00

268 lines
16 KiB
PHP
Executable File

<?php
/* Smarty version 5.3.1, created on 2025-02-13 14:56:24
from 'file:admin/setting/captcha.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.3.1',
'unifunc' => 'content_67ad9798e12fe0_99062520',
'has_nocache_code' => false,
'file_dependency' =>
array (
'14b46c67c8ae19870398c5cedaf26b4c92952e8c' =>
array (
0 => 'admin/setting/captcha.tpl',
1 => 1712762115,
2 => 'file',
),
),
'includes' =>
array (
'file:admin/header.tpl' => 1,
'file:admin/footer.tpl' => 1,
),
))) {
function content_67ad9798e12fe0_99062520 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/admin/setting';
$_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
?>
<div class="page-wrapper">
<div class="container-xl">
<div class="page-header d-print-none text-white">
<div class="row align-items-center">
<div class="col">
<h2 class="page-title">
<span class="home-title">人机验证设置</span>
</h2>
<div class="page-pretitle my-3">
<span class="home-subtitle">设置站点的人机验证系统</span>
</div>
</div>
<div class="col-auto ms-auto d-print-none">
<div class="btn-list">
<a id="save-setting" href="#" class="btn btn-primary">
<i class="icon ti ti-device-floppy"></i>
保存
</a>
</div>
</div>
</div>
</div>
</div>
<div class="page-body">
<div class="container-xl">
<div class="row row-deck row-cards">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs" data-bs-toggle="tabs">
<li class="nav-item">
<a href="#captcha" class="nav-link active" data-bs-toggle="tab">验证设置</a>
</li>
<li class="nav-item">
<a href="#turnstile" class="nav-link" data-bs-toggle="tab">Turnstile</a>
</li>
<li class="nav-item">
<a href="#geetest" class="nav-link" data-bs-toggle="tab">Geetest</a>
</li>
<li class="nav-item">
<a href="#hcaptcha" class="nav-link" data-bs-toggle="tab">hCaptcha</a>
</li>
</ul>
</div>
<div class="card-body">
<div class="tab-content">
<div class="tab-pane active show" id="captcha">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">验证码提供商</label>
<div class="col">
<select id="captcha_provider" class="col form-select"
value="<?php echo $_smarty_tpl->getValue('settings')['captcha_provider'];?>
">
<option value="turnstile"
<?php if ($_smarty_tpl->getValue('settings')['captcha_provider'] === "turnstile") {?>selected<?php }?>>
Turnstile
</option>
<option value="geetest"
<?php if ($_smarty_tpl->getValue('settings')['captcha_provider'] === "geetest") {?>selected<?php }?>>
Geetest
</option>
<option value="hcaptcha"
<?php if ($_smarty_tpl->getValue('settings')['captcha_provider'] === "hcaptcha") {?>selected<?php }?>>
hCaptcha
</option>
</select>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">注册验证码</label>
<div class="col">
<select id="enable_reg_captcha" class="col form-select"
value="<?php echo $_smarty_tpl->getValue('settings')['enable_reg_captcha'];?>
">
<option value="0"
<?php if (!$_smarty_tpl->getValue('settings')['enable_reg_captcha']) {?>selected<?php }?>>关闭
</option>
<option value="1" <?php if ($_smarty_tpl->getValue('settings')['enable_reg_captcha']) {?>selected<?php }?>>
开启
</option>
</select>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">登录验证码</label>
<div class="col">
<select id="enable_login_captcha" class="col form-select"
value="<?php echo $_smarty_tpl->getValue('settings')['enable_login_captcha'];?>
">
<option value="0"
<?php if (!$_smarty_tpl->getValue('settings')['enable_login_captcha']) {?>selected<?php }?>>关闭
</option>
<option value="1"
<?php if ($_smarty_tpl->getValue('settings')['enable_login_captcha']) {?>selected<?php }?>>开启
</option>
</select>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">签到验证码</label>
<div class="col">
<select id="enable_checkin_captcha" class="col form-select"
value="<?php echo $_smarty_tpl->getValue('settings')['enable_checkin_captcha'];?>
">
<option value="0"
<?php if (!$_smarty_tpl->getValue('settings')['enable_checkin_captcha']) {?>selected<?php }?>>关闭
</option>
<option value="1"
<?php if ($_smarty_tpl->getValue('settings')['enable_checkin_captcha']) {?>selected<?php }?>>开启
</option>
</select>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">重置密码验证码</label>
<div class="col">
<select id="enable_reset_password_captcha" class="col form-select"
value="<?php echo $_smarty_tpl->getValue('settings')['enable_reset_password_captcha'];?>
">
<option value="0"
<?php if (!$_smarty_tpl->getValue('settings')['enable_reset_password_captcha']) {?>selected<?php }?>>
关闭
</option>
<option value="1"
<?php if ($_smarty_tpl->getValue('settings')['enable_reset_password_captcha']) {?>selected<?php }?>>
开启
</option>
</select>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="turnstile">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Turnstile Site Key</label>
<div class="col">
<input id="turnstile_sitekey" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['turnstile_sitekey'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Turnstile Secret</label>
<div class="col">
<input id="turnstile_secret" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['turnstile_secret'];?>
">
</div>
</div>
</div>
</div>
<div class="tab-pane" id="geetest">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Geetest ID</label>
<div class="col">
<input id="geetest_id" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['geetest_id'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">Geetest Key</label>
<div class="col">
<input id="geetest_key" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['geetest_key'];?>
">
</div>
</div>
</div>
</div>
<div class="tab-pane" id="hcaptcha">
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">hCaptcha Site Key</label>
<div class="col">
<input id="hcaptcha_sitekey" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['hcaptcha_sitekey'];?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">hCaptcha Secret</label>
<div class="col">
<input id="hcaptcha_secret" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('settings')['hcaptcha_secret'];?>
">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo '<script'; ?>
>
$("#save-setting").click(function () {
$.ajax({
url: '/admin/setting/captcha',
type: 'POST',
dataType: "json",
data: {
<?php
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('update_field'), 'key');
$foreach0DoElse = true;
foreach ($_from ?? [] as $_smarty_tpl->getVariable('key')->value) {
$foreach0DoElse = false;
?>
<?php echo $_smarty_tpl->getValue('key');?>
: $('#<?php echo $_smarty_tpl->getValue('key');?>
').val(),
<?php
}
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
},
success: function (data) {
if (data.ret === 1) {
$('#success-message').text(data.msg);
$('#success-dialog').modal('show');
} else {
$('#fail-message').text(data.msg);
$('#fail-dialog').modal('show');
}
}
})
});
<?php echo '</script'; ?>
>
<?php $_smarty_tpl->renderSubTemplate('file:admin/footer.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
}
}