Add trusted browsers user setting module

- Add trusted browsers help section
This commit is contained in:
Hypolite Petovan 2021-01-19 23:44:19 -05:00
commit 5a949911ba
6 changed files with 174 additions and 1 deletions

View file

@ -30,6 +30,7 @@
{{if $has_secret && $verified}}
<p><button type="submit" name="action" id="confirm-submit-button" class="btn btn-primary confirm-button" value="recovery">{{$recovery_codes_label}}</button></p>
<p><button type="submit" name="action" id="confirm-submit-button" class="btn btn-primary confirm-button" value="app_specific">{{$app_specific_passwords_label}}</button></p>
<p><button type="submit" name="action" id="confirm-submit-button" class="btn btn-primary confirm-button" value="trusted">{{$trusted_browsers_label}}</button></p>
{{/if}}
{{if $has_secret && !$verified}}
<p><button type="submit" name="action" id="confirm-submit-button" class="btn btn-primary confirm-button" value="configure">{{$configure_label}}</button></p>

View file

@ -0,0 +1,48 @@
<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>
<form action="settings/2fa/trusted?t={{$password_security_token}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table class="trusted-passwords table table-hover table-condensed table-striped">
<thead>
<tr>
<th>{{$device_label}}</th>
<th>{{$os_label}}</th>
<th>{{$browser_label}}</th>
<th>{{$created_label}}</th>
<th>{{$last_used_label}}</th>
<th><button type="submit" name="action" class="btn btn-primary btn-small" value="remove_all">{{$remove_all_label}}</button></th>
</tr>
</thead>
<tbody>
{{foreach $trusted_browsers as $trusted_browser}}
<tr{{if $generated_trusted_browser && $trusted_browser.id == $generated_trusted_browser.id}} class="success"{{/if}}>
<td>
{{$trusted_browser.device}}
</td>
<td>
{{$trusted_browser.os}}
</td>
<td>
{{$trusted_browser.browser}}
</td>
<td>
<span class="time" title="{{$trusted_browser.created}}" data-toggle="tooltip">
<time datetime="{{$trusted_browser.created}}">{{$trusted_browser.created_ago}}</time>
</span>
</td>
<td>
<span class="time" title="{{$trusted_browser.last_used}}" data-toggle="tooltip">
<time datetime="{{$trusted_browser.last_used}}">{{$trusted_browser.last_used_ago}}</time>
</span>
</td>
<td>
<button type="submit" name="remove_id" class="btn btn-default btn-small" value="{{$trusted_browser.cookie_hash}}">{{$remove_label}}</button>
</td>
</tr>
{{/foreach}}
</tbody>
</table>
</form>
</div>