mirror of
https://github.com/danpros/htmly.git
synced 2026-04-17 11:16:00 +05:30
Added config option to disable MFA globally
Added an option to disable MFA for all users and hide it from the login page and admin menu.
This commit is contained in:
parent
9d57e7849a
commit
26d31f25da
5 changed files with 37 additions and 5 deletions
|
|
@ -298,4 +298,7 @@ disablemfa = "Disable MFA"
|
|||
enable_auto_save = "Enable Auto Save to Drafts"
|
||||
explain_autosave = "When enabled, new posts or pages will automatically be saved as a draft every 60 seconds after you start writing."
|
||||
login_protect_system = "Login protection system"
|
||||
cloudflare_info = "Review Cloudflare's Turnstile documentation: "
|
||||
cloudflare_info = "Review Cloudflare's Turnstile documentation: "
|
||||
mfa_config = "Multi Factor Authentication (MFA)"
|
||||
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."
|
||||
|
|
@ -288,6 +288,30 @@
|
|||
<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>
|
||||
|
|
|
|||
|
|
@ -243,6 +243,7 @@ if (isset($_GET['search'])) {
|
|||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php if (config('mfa.state') === 'true'): ?>
|
||||
<li class="nav-item">
|
||||
<a href="<?php echo site_url();?>edit/mfa" class="nav-link">
|
||||
<p>
|
||||
|
|
@ -250,6 +251,7 @@ if (isset($_GET['search'])) {
|
|||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif;?>
|
||||
<li class="nav-item">
|
||||
<a href="<?php echo site_url();?>edit/profile" class="nav-link">
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -21,9 +21,11 @@
|
|||
} ?>" name="password" placeholder="<?php echo i18n('Password'); ?>"/>
|
||||
<br>
|
||||
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
|
||||
<label><?php echo i18n('MFACode');?></label>
|
||||
<input type="text" class="form-control" name="mfacode" placeholder="<?php echo i18n('verify_code'); ?>"/>
|
||||
<br>
|
||||
<?php if (config('mfa.state') === 'true'): ?>
|
||||
<label><?php echo i18n('MFACode');?></label>
|
||||
<input type="text" class="form-control" name="mfacode" placeholder="<?php echo i18n('verify_code'); ?>"/>
|
||||
<br>
|
||||
<?php endif; ?>
|
||||
<?php if (config('login.protect.system') === 'google'): ?>
|
||||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||
<div class="g-recaptcha" data-sitekey="<?php echo config("login.protect.public"); ?>"></div>
|
||||
|
|
|
|||
|
|
@ -87,5 +87,6 @@
|
|||
"favicon.image",
|
||||
"views.root",
|
||||
"views.layout",
|
||||
"autosave.enable"
|
||||
"autosave.enable",
|
||||
"mfa.state"
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue