mirror of
https://github.com/danpros/htmly.git
synced 2026-04-17 19:26:08 +05:30
New security config tab
This commit is contained in:
parent
08ea4e032d
commit
ce60dfdae1
36 changed files with 221 additions and 67 deletions
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -314,3 +314,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -304,4 +304,6 @@ set_mfa_globally = "Set the status of MFA"
|
|||
explain_mfa = "When enabled, MFA is optional for all users. When disabled, no users can use it and it hides the field on the login page."
|
||||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -305,3 +305,5 @@ explain_mfa = "Una volta abilitata, la MFA è facoltativa per tutti gli utenti.
|
|||
set_version_publicly = "Visibilità della versione"
|
||||
explain_version = "Per impostazione predefinita la versione di HTMLy è visibile a tutti nel codice sorgente, alcuni amministratori preferirebbero nasconderla."
|
||||
focus_mode = "Cambia visuale"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -304,3 +304,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -304,3 +304,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -315,3 +315,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -303,3 +303,5 @@ explain_mfa = "When enabled, MFA is optional for all users. When disabled, no us
|
|||
set_version_publicly = "Version Visibility"
|
||||
explain_version = "By default the version of HTMLy is visible publicly in the source code, some admins may prefer to hide this."
|
||||
focus_mode = "Toggle Focus"
|
||||
security = "Security"
|
||||
security_settings = "Security Settings"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<a class="nav-item nav-link" id="nav-writing-tab" href="<?php echo site_url();?>admin/config/writing"><?php echo i18n('Writing');?></a>
|
||||
<a class="nav-item nav-link" id="nav-widget-tab" href="<?php echo site_url();?>admin/config/widget"><?php echo i18n('Widget');?></a>
|
||||
<a class="nav-item nav-link" id="nav-metatags-tab" href="<?php echo site_url();?>admin/config/metatags"><?php echo i18n('Metatags');?></a>
|
||||
<a class="nav-item nav-link" id="nav-security-tab" href="<?php echo site_url();?>admin/config/security"><?php echo i18n('Security');?></a>
|
||||
<a class="nav-item nav-link" id="nav-performance-tab" href="<?php echo site_url();?>admin/config/performance"><?php echo i18n('Performance');?></a>
|
||||
<a class="nav-item nav-link active" id="nav-custom-tab" href="<?php echo site_url();?>admin/config/custom"><?php echo i18n('Custom');?></a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ if (empty($defaultFormat)) {
|
|||
<a class="nav-item nav-link" id="nav-writing-tab" href="<?php echo site_url();?>admin/config/writing"><?php echo i18n('Writing');?></a>
|
||||
<a class="nav-item nav-link" id="nav-widget-tab" href="<?php echo site_url();?>admin/config/widget"><?php echo i18n('Widget');?></a>
|
||||
<a class="nav-item nav-link active" id="nav-metatags-tab" href="<?php echo site_url();?>admin/config/metatags"><?php echo i18n('Metatags');?></a>
|
||||
<a class="nav-item nav-link" id="nav-security-tab" href="<?php echo site_url();?>admin/config/security"><?php echo i18n('Security');?></a>
|
||||
<a class="nav-item nav-link" id="nav-performance-tab" href="<?php echo site_url();?>admin/config/performance"><?php echo i18n('Performance');?></a>
|
||||
<a class="nav-item nav-link" id="nav-custom-tab" href="<?php echo site_url();?>admin/config/custom"><?php echo i18n('Custom');?></a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<a class="nav-item nav-link" id="nav-writing-tab" href="<?php echo site_url();?>admin/config/writing"><?php echo i18n('Writing');?></a>
|
||||
<a class="nav-item nav-link" id="nav-widget-tab" href="<?php echo site_url();?>admin/config/widget"><?php echo i18n('Widget');?></a>
|
||||
<a class="nav-item nav-link" id="nav-metatags-tab" href="<?php echo site_url();?>admin/config/metatags"><?php echo i18n('Metatags');?></a>
|
||||
<a class="nav-item nav-link" id="nav-security-tab" href="<?php echo site_url();?>admin/config/security"><?php echo i18n('Security');?></a>
|
||||
<a class="nav-item nav-link active" id="nav-performance-tab" href="<?php echo site_url();?>admin/config/performance"><?php echo i18n('Performance');?></a>
|
||||
<a class="nav-item nav-link" id="nav-custom-tab" href="<?php echo site_url();?>admin/config/custom"><?php echo i18n('Custom');?></a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<a class="nav-item nav-link" id="nav-writing-tab" href="<?php echo site_url();?>admin/config/writing"><?php echo i18n('Writing');?></a>
|
||||
<a class="nav-item nav-link" id="nav-widget-tab" href="<?php echo site_url();?>admin/config/widget"><?php echo i18n('Widget');?></a>
|
||||
<a class="nav-item nav-link" id="nav-metatags-tab" href="<?php echo site_url();?>admin/config/metatags"><?php echo i18n('Metatags');?></a>
|
||||
<a class="nav-item nav-link" id="nav-security-tab" href="<?php echo site_url();?>admin/config/security"><?php echo i18n('Security');?></a>
|
||||
<a class="nav-item nav-link" id="nav-performance-tab" href="<?php echo site_url();?>admin/config/performance"><?php echo i18n('Performance');?></a>
|
||||
<a class="nav-item nav-link" id="nav-custom-tab" href="<?php echo site_url();?>admin/config/custom"><?php echo i18n('Custom');?></a>
|
||||
</div>
|
||||
|
|
|
|||
88
system/admin/views/config-security.html.php
Normal file
88
system/admin/views/config-security.html.php
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
<?php if (!defined('HTMLY')) die('HTMLy'); ?>
|
||||
<h2><?php echo i18n('Security_Settings');?></h2>
|
||||
<br>
|
||||
<nav>
|
||||
<div class="nav nav-tabs" id="nav-tab">
|
||||
<a class="nav-item nav-link" id="nav-general-tab" href="<?php echo site_url();?>admin/config"><?php echo i18n('General');?></a>
|
||||
<a class="nav-item nav-link" id="nav-profile-tab" href="<?php echo site_url();?>admin/config/reading"><?php echo i18n('Reading');?></a>
|
||||
<a class="nav-item nav-link" id="nav-writing-tab" href="<?php echo site_url();?>admin/config/writing"><?php echo i18n('Writing');?></a>
|
||||
<a class="nav-item nav-link" id="nav-widget-tab" href="<?php echo site_url();?>admin/config/widget"><?php echo i18n('Widget');?></a>
|
||||
<a class="nav-item nav-link" id="nav-metatags-tab" href="<?php echo site_url();?>admin/config/metatags"><?php echo i18n('Metatags');?></a>
|
||||
<a class="nav-item nav-link active" id="nav-security-tab" href="<?php echo site_url();?>admin/config/security"><?php echo i18n('Security');?></a>
|
||||
<a class="nav-item nav-link" id="nav-performance-tab" href="<?php echo site_url();?>admin/config/performance"><?php echo i18n('Performance');?></a>
|
||||
<a class="nav-item nav-link" id="nav-custom-tab" href="<?php echo site_url();?>admin/config/custom"><?php echo i18n('Custom');?></a>
|
||||
</div>
|
||||
</nav>
|
||||
<br><br>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo get_csrf(); ?>">
|
||||
<h4><?php echo i18n('Recaptcha');?></h4>
|
||||
<hr>
|
||||
<p><?php echo i18n('Get_one_here');?> <a target="_blank" href="https://www.google.com/recaptcha/admin">https://www.google.com/recaptcha/admin</a>
|
||||
<p><?php echo i18n('Cloudflare_info');?> <a target="_blank" href="https://developers.cloudflare.com/turnstile/">https://developers.cloudflare.com/turnstile/</a>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><?php echo i18n('Recaptcha');?></label>
|
||||
<div class="col-sm-10">
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="-config-login.protect.system" id="login.protect.system1" value="disable" <?php if (config('login.protect.system') === 'disable'):?>checked<?php endif;?>>
|
||||
<label class="form-check-label" for="login.protect.system1">
|
||||
<?php echo i18n('Disabled');?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="-config-login.protect.system" id="login.protect.system2" value="google" <?php if (config('login.protect.system') === 'google'):?>checked<?php endif;?>>
|
||||
<label class="form-check-label" for="login.protect.system2">
|
||||
Google reCaptcha
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="-config-login.protect.system" id="login.protect.system3" value="cloudflare" <?php if (config('login.protect.system') === 'cloudflare'):?>checked<?php endif;?>>
|
||||
<label class="form-check-label" for="login.protect.system3">
|
||||
Cloudflare Turnstile
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="login.protect.public" class="col-sm-2 col-form-label"><?php echo i18n('Site_Key');?></label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="-config-login.protect.public" class="form-control" id="login.protect.public" value="<?php echo valueMaker(config('login.protect.public'));?>" placeholder="<?php echo i18n('widget_key_placeholder');?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="login.protect.private" class="col-sm-2 col-form-label"><?php echo i18n('Secret_Key');?></label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="-config-login.protect.private" class="form-control" id="login.protect.private" value="<?php echo valueMaker(config('login.protect.private'));?>" placeholder="<?php echo i18n('widget_key_placeholder');?>">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<h4><?php echo i18n('mfa_config');?></h4>
|
||||
<hr>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><?php echo i18n('set_mfa_globally');?></label>
|
||||
<div class="col-sm-10">
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="-config-mfa.state" id="mfa.state1" value="true" <?php if (config('mfa.state') === 'true'):?>checked<?php endif;?>>
|
||||
<label class="form-check-label" for="mfa.state1">
|
||||
<?php echo i18n('Enable');?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="-config-mfa.state" id="mfa.state2" value="false" <?php if (config('mfa.state') === 'false'):?>checked<?php endif;?>>
|
||||
<label class="form-check-label" for="mfa.state2">
|
||||
<?php echo i18n('Disable');?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<small><em><?php echo i18n('explain_mfa');?></em></small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-10">
|
||||
<button type="submit" class="btn btn-primary"><?php echo i18n('Save_Config');?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
<a class="nav-item nav-link" id="nav-writing-tab" href="<?php echo site_url();?>admin/config/writing"><?php echo i18n('Writing');?></a>
|
||||
<a class="nav-item nav-link active" id="nav-widget-tab" href="<?php echo site_url();?>admin/config/widget"><?php echo i18n('Widget');?></a>
|
||||
<a class="nav-item nav-link" id="nav-metatags-tab" href="<?php echo site_url();?>admin/config/metatags"><?php echo i18n('Metatags');?></a>
|
||||
<a class="nav-item nav-link" id="nav-security-tab" href="<?php echo site_url();?>admin/config/security"><?php echo i18n('Security');?></a>
|
||||
<a class="nav-item nav-link" id="nav-performance-tab" href="<?php echo site_url();?>admin/config/performance"><?php echo i18n('Performance');?></a>
|
||||
<a class="nav-item nav-link" id="nav-custom-tab" href="<?php echo site_url();?>admin/config/custom"><?php echo i18n('Custom');?></a>
|
||||
</div>
|
||||
|
|
@ -173,48 +174,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<h4><?php echo i18n('Recaptcha');?></h4>
|
||||
<hr>
|
||||
<p><?php echo i18n('Get_one_here');?> <a target="_blank" href="https://www.google.com/recaptcha/admin">https://www.google.com/recaptcha/admin</a>
|
||||
<p><?php echo i18n('Cloudflare_info');?> <a target="_blank" href="https://developers.cloudflare.com/turnstile/">https://developers.cloudflare.com/turnstile/</a>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><?php echo i18n('Recaptcha');?></label>
|
||||
<div class="col-sm-10">
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="-config-login.protect.system" id="login.protect.system1" value="disable" <?php if (config('login.protect.system') === 'disable'):?>checked<?php endif;?>>
|
||||
<label class="form-check-label" for="login.protect.system1">
|
||||
<?php echo i18n('Disabled');?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="-config-login.protect.system" id="login.protect.system2" value="google" <?php if (config('login.protect.system') === 'google'):?>checked<?php endif;?>>
|
||||
<label class="form-check-label" for="login.protect.system2">
|
||||
Google reCaptcha
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="-config-login.protect.system" id="login.protect.system3" value="cloudflare" <?php if (config('login.protect.system') === 'cloudflare'):?>checked<?php endif;?>>
|
||||
<label class="form-check-label" for="login.protect.system3">
|
||||
Cloudflare Turnstile
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="login.protect.public" class="col-sm-2 col-form-label"><?php echo i18n('Site_Key');?></label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="-config-login.protect.public" class="form-control" id="login.protect.public" value="<?php echo valueMaker(config('login.protect.public'));?>" placeholder="<?php echo i18n('widget_key_placeholder');?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="login.protect.private" class="col-sm-2 col-form-label"><?php echo i18n('Secret_Key');?></label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="-config-login.protect.private" class="form-control" id="login.protect.private" value="<?php echo valueMaker(config('login.protect.private'));?>" placeholder="<?php echo i18n('widget_key_placeholder');?>">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<h4><?php echo i18n('Google_Analytics');?></h4>
|
||||
<hr>
|
||||
<div class="form-group row">
|
||||
|
|
@ -288,30 +247,6 @@
|
|||
<input type="text" name="-config-social.youtube" class="form-control" id="social.youtube" value="<?php echo config('social.youtube');?>" placeholder="https://www.youtube.com/user/username">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<h4><?php echo i18n('mfa_config');?></h4>
|
||||
<hr>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><?php echo i18n('set_mfa_globally');?></label>
|
||||
<div class="col-sm-10">
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="-config-mfa.state" id="mfa.state1" value="true" <?php if (config('mfa.state') === 'true'):?>checked<?php endif;?>>
|
||||
<label class="form-check-label" for="mfa.state1">
|
||||
<?php echo i18n('Enable');?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="-config-mfa.state" id="mfa.state2" value="false" <?php if (config('mfa.state') === 'false'):?>checked<?php endif;?>>
|
||||
<label class="form-check-label" for="mfa.state2">
|
||||
<?php echo i18n('Disable');?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<small><em><?php echo i18n('explain_mfa');?></em></small>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-10">
|
||||
<button type="submit" class="btn btn-primary"><?php echo i18n('Save_Config');?></button>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<a class="nav-item nav-link active" id="nav-writing-tab" href="<?php echo site_url();?>admin/config/writing"><?php echo i18n('Writing');?></a>
|
||||
<a class="nav-item nav-link" id="nav-widget-tab" href="<?php echo site_url();?>admin/config/widget"><?php echo i18n('Widget');?></a>
|
||||
<a class="nav-item nav-link" id="nav-metatags-tab" href="<?php echo site_url();?>admin/config/metatags"><?php echo i18n('Metatags');?></a>
|
||||
<a class="nav-item nav-link" id="nav-security-tab" href="<?php echo site_url();?>admin/config/security"><?php echo i18n('Security');?></a>
|
||||
<a class="nav-item nav-link" id="nav-performance-tab" href="<?php echo site_url();?>admin/config/performance"><?php echo i18n('Performance');?></a>
|
||||
<a class="nav-item nav-link" id="nav-custom-tab" href="<?php echo site_url();?>admin/config/custom"><?php echo i18n('Custom');?></a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ Please install and enable the INTL extension to format the date format to your l
|
|||
<a class="nav-item nav-link" id="nav-writing-tab" href="<?php echo site_url();?>admin/config/writing"><?php echo i18n('Writing');?></a>
|
||||
<a class="nav-item nav-link" id="nav-widget-tab" href="<?php echo site_url();?>admin/config/widget"><?php echo i18n('Widget');?></a>
|
||||
<a class="nav-item nav-link" id="nav-metatags-tab" href="<?php echo site_url();?>admin/config/metatags"><?php echo i18n('Metatags');?></a>
|
||||
<a class="nav-item nav-link" id="nav-security-tab" href="<?php echo site_url();?>admin/config/security"><?php echo i18n('Security');?></a>
|
||||
<a class="nav-item nav-link" id="nav-performance-tab" href="<?php echo site_url();?>admin/config/performance"><?php echo i18n('Performance');?></a>
|
||||
<a class="nav-item nav-link" id="nav-custom-tab" href="<?php echo site_url();?>admin/config/custom"><?php echo i18n('Custom');?></a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2074,6 +2074,77 @@ post('/admin/config/metatags', function () {
|
|||
}
|
||||
});
|
||||
|
||||
// Show Config page
|
||||
get('/admin/config/security', function () {
|
||||
|
||||
$user = $_SESSION[site_url()]['user'];
|
||||
$role = user('role', $user);
|
||||
|
||||
if (login()) {
|
||||
config('views.root', 'system/admin/views');
|
||||
if ($role === 'admin') {
|
||||
render('config-security', array(
|
||||
'title' => generate_title('is_default', i18n('Config')),
|
||||
'description' => safe_html(strip_tags(blog_description())),
|
||||
'canonical' => site_url(),
|
||||
'metatags' => generate_meta(null, null),
|
||||
'type' => 'is_admin-config',
|
||||
'is_admin' => true,
|
||||
'bodyclass' => 'admin-config',
|
||||
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » ' . i18n('Config')
|
||||
));
|
||||
} else {
|
||||
render('denied', array(
|
||||
'title' => generate_title('is_default', i18n('Config')),
|
||||
'description' => safe_html(strip_tags(blog_description())),
|
||||
'canonical' => site_url(),
|
||||
'metatags' => generate_meta(null, null),
|
||||
'type' => 'is_admin-config',
|
||||
'is_admin' => true,
|
||||
'bodyclass' => 'denied',
|
||||
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » ' . i18n('Config')
|
||||
));
|
||||
}
|
||||
} else {
|
||||
$login = site_url() . 'login';
|
||||
header("location: $login");
|
||||
}
|
||||
});
|
||||
|
||||
// Submitted Config page data
|
||||
post('/admin/config/security', function () {
|
||||
|
||||
$proper = is_csrf_proper(from($_REQUEST, 'csrf_token'));
|
||||
if (login() && $proper) {
|
||||
$new_config = array();
|
||||
$new_Keys = array();
|
||||
$user = $_SESSION[site_url()]['user'];
|
||||
$role = user('role', $user);
|
||||
if ($role === 'admin') {
|
||||
foreach ($_POST as $name => $value) {
|
||||
if (substr($name, 0, 8) == "-config-") {
|
||||
$name = str_replace("_", ".", substr($name, 8));
|
||||
if(!is_null(config($name))) {
|
||||
$new_config[$name] = $value;
|
||||
} else {
|
||||
$new_Keys[$name] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
save_config($new_config, $new_Keys);
|
||||
$redir = site_url() . 'admin/config/security';
|
||||
header("location: $redir");
|
||||
} else {
|
||||
$redir = site_url();
|
||||
header("location: $redir");
|
||||
}
|
||||
} else {
|
||||
$login = site_url() . 'login';
|
||||
header("location: $login");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Show Config page
|
||||
get('/admin/config/performance', function () {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue