Skip to content

Commit

Permalink
New security config tab
Browse files Browse the repository at this point in the history
  • Loading branch information
danpros committed Jun 3, 2024
1 parent 08ea4e0 commit ce60dfd
Show file tree
Hide file tree
Showing 36 changed files with 221 additions and 67 deletions.
2 changes: 2 additions & 0 deletions lang/ar_AR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/da_DK.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/de_DE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/de_DE_gender_doppelpunkt.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/de_DE_gender_dudenkonform.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/el_GR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 3 additions & 1 deletion lang/en_US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/es_ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/fa_IR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/fr_FR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/gu_GU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/hi_HI.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/hr_HR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/hu_HU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/id_ID.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/it_IT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/ko_KO.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/ms_MY.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/nl_NL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/pl_PL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/pt_BR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/ru_RU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/sv_SE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/tr_TR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/uk_UA.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/zh_CN.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions lang/zh_TW.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions system/admin/views/config-custom.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions system/admin/views/config-metatags.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,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 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>
Expand Down
1 change: 1 addition & 0 deletions system/admin/views/config-performance.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions system/admin/views/config-reading.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
88 changes: 88 additions & 0 deletions system/admin/views/config-security.html.php
Original file line number Diff line number Diff line change
@@ -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>
Loading

0 comments on commit ce60dfd

Please sign in to comment.