Add two-factor authentication settings
- Add settings aside menu entry - Add two-factor authentication documentation
This commit is contained in:
parent
d7e9b91181
commit
8e885f5b97
10 changed files with 600 additions and 0 deletions
39
view/templates/settings/twofactor/index.tpl
Normal file
39
view/templates/settings/twofactor/index.tpl
Normal file
|
@ -0,0 +1,39 @@
|
|||
<div class="generic-page-wrapper">
|
||||
<h1>{{$title}} <a href="help/Two-Factor-Authentication" title="{{$help_label}}" class="btn btn-default btn-sm"><i aria-hidden="true" class="fa fa-question fa-2x"></i></a></h1>
|
||||
<div>{{$message nofilter}}</div>
|
||||
<h2>{{$status_title}}</h2>
|
||||
<p><strong>{{$auth_app_label}}</strong>: {{$app_status}} </p>
|
||||
{{if $has_secret && $verified}}
|
||||
<div>{{$configured_message nofilter}}</div>
|
||||
{{/if}}
|
||||
{{if $has_secret && !$verified}}
|
||||
<div>{{$not_configured_message nofilter}}</div>
|
||||
{{/if}}
|
||||
|
||||
{{if $has_secret && $verified}}
|
||||
<h2>{{$recovery_codes_title}}</h2>
|
||||
<p><strong>{{$recovery_codes_remaining}}</strong>: {{$recovery_codes_count}}</p>
|
||||
<div>{{$recovery_codes_message nofilter}}</div>
|
||||
{{/if}}
|
||||
|
||||
<form action="settings/2fa" method="post">
|
||||
<h2>{{$action_title}}</h2>
|
||||
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
|
||||
|
||||
{{include file="field_password.tpl" field=$password}}
|
||||
|
||||
<div class="form-group settings-submit-wrapper" >
|
||||
{{if !$has_secret}}
|
||||
<button type="submit" name="action" id="confirm-submit-button" class="btn btn-primary confirm-button" value="enable">{{$enable_label}}</button>
|
||||
{{else}}
|
||||
<button type="submit" name="action" id="confirm-submit-button" class="btn btn-primary confirm-button" value="disable">{{$disable_label}}</button>
|
||||
{{/if}}
|
||||
{{if $has_secret && $verified}}
|
||||
<button type="submit" name="action" id="confirm-submit-button" class="btn btn-primary confirm-button" value="recovery">{{$recovery_codes_label}}</button>
|
||||
{{/if}}
|
||||
{{if $has_secret && !$verified}}
|
||||
<button type="submit" name="action" id="confirm-submit-button" class="btn btn-primary confirm-button" value="configure">{{$configure_label}}</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
28
view/templates/settings/twofactor/recovery.tpl
Normal file
28
view/templates/settings/twofactor/recovery.tpl
Normal file
|
@ -0,0 +1,28 @@
|
|||
<div class="generic-page-wrapper">
|
||||
<h1>{{$title}} <a href="help/Two-Factor-Authentication" title="{{$help_label}}" class="btn btn-default btn-sm"><i aria-hidden="true" class="fa fa-question fa-2x"></i></a></h1>
|
||||
<div>{{$message nofilter}}</div>
|
||||
|
||||
<ul class="recovery-codes">
|
||||
{{foreach $recovery_codes as $recovery_code}}
|
||||
<li>
|
||||
{{if $recovery_code.used}}<s>{{/if}}
|
||||
{{$recovery_code.code}}
|
||||
{{if $recovery_code.used}}</s>{{/if}}
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
|
||||
{{if $verified}}
|
||||
<form action="settings/2fa/recovery?t={{$password_security_token}}" method="post">
|
||||
<h2>{{$regenerate_label}}</h2>
|
||||
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
|
||||
<div>{{$regenerate_message}}</div>
|
||||
|
||||
<div class="form-group pull-right settings-submit-wrapper" >
|
||||
<button type="submit" name="action" id="confirm-submit-button" class="btn btn-primary confirm-button" value="regenerate">{{$regenerate_label}}</button>
|
||||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
<p class="text-right"><a href="settings/2fa/verify?t={{$password_security_token}}" class="btn btn-primary">{{$verify_label}}</a></p>
|
||||
{{/if}}
|
||||
</div>
|
22
view/templates/settings/twofactor/verify.tpl
Normal file
22
view/templates/settings/twofactor/verify.tpl
Normal file
|
@ -0,0 +1,22 @@
|
|||
<div class="generic-page-wrapper">
|
||||
<h1>{{$title}} <a href="help/Two-Factor-Authentication" title="{{$help_label}}" class="btn btn-default btn-sm"><i aria-hidden="true" class="fa fa-question fa-2x"></i></a></h1>
|
||||
<div>{{$message nofilter}}</div>
|
||||
|
||||
<div class="text-center">
|
||||
{{$qrcode_image nofilter}}
|
||||
</div>
|
||||
|
||||
<form action="settings/2fa/verify?t={{$password_security_token}}" method="post">
|
||||
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
|
||||
|
||||
{{include file="field_input.tpl" field=$verify_code}}
|
||||
|
||||
<div class="form-group settings-submit-wrapper" >
|
||||
<button type="submit" name="action" id="confirm-submit-button" class="btn btn-primary confirm-button" value="verify">{{$verify_label}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div>{{$qrcode_url_message nofilter}}</div>
|
||||
|
||||
<div>{{$manual_message nofilter}}</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue