mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 23:47:03 +03:00
Enhancement to Two Factor Auth (Closes #131)
This commit is contained in:
parent
e211899c7b
commit
365a79049e
30 changed files with 359 additions and 208 deletions
|
|
@ -4721,6 +4721,28 @@ class Actions
|
|||
$this->getTwoFactorInfo($sEmail));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function DoShowTwoFactorSecret()
|
||||
{
|
||||
if (!$this->TwoFactorAuthProvider()->IsActive())
|
||||
{
|
||||
return $this->FalseResponse(__FUNCTION__);
|
||||
}
|
||||
|
||||
$oAccount = $this->getAccountFromToken();
|
||||
$sEmail = $oAccount->ParentEmailHelper();
|
||||
|
||||
$aResult = $this->getTwoFactorInfo($sEmail);
|
||||
if (\is_array($aResult))
|
||||
{
|
||||
unset($aResult['BackupCodes']);
|
||||
}
|
||||
|
||||
return $this->DefaultResponse(__FUNCTION__, $aResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
<div class="modal-body">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#mailbox-shortcuts-id" data-toggle="tab">Mailbox</a></li>
|
||||
<li><a href="#message-list-shortcuts-id" data-toggle="tab">Message list (focused)</a></li>
|
||||
<li><a href="#message-view-shortcuts-id" data-toggle="tab">Message view (focused)</a></li>
|
||||
<li><a href="#message-list-shortcuts-id" data-toggle="tab">Message list</a></li>
|
||||
<li><a href="#message-view-shortcuts-id" data-toggle="tab">Message view</a></li>
|
||||
<li><a href="#compose-shortcuts-id" data-toggle="tab">Compose</a></li>
|
||||
</ul>
|
||||
<br />
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
<strong><span data-bind="text: viewUser"></span></strong>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="control-group">
|
||||
<label class="control-label">
|
||||
<span class="i18n" data-i18n-text="SETTINGS_SECURITY/LABEL_TWO_FACTOR_STATUS"></span>
|
||||
|
|
@ -29,6 +30,7 @@
|
|||
<strong data-bind="visible: processing()">...</strong>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<a class="btn" data-bind="click: clearTwoFactor, visible: twoFactorStatus">
|
||||
|
|
@ -50,12 +52,21 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" data-bind="visible: '' === viewSecret() && twoFactorStatus() && !clearing()">
|
||||
<div class="controls" style="padding-top: 5px;">
|
||||
<strong data-bind="visible: secreting">...</strong>
|
||||
<span class="g-ui-link i18n" data-bind="click: showSecret, visible: !secreting()"
|
||||
data-i18n-text="SETTINGS_SECURITY/BUTTON_SHOW_SECRET"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" data-bind="visible: '' !== viewSecret()">
|
||||
<label class="control-label">
|
||||
<span class="i18n" data-i18n-text="SETTINGS_SECURITY/LABEL_TWO_FACTOR_SECRET"></span>
|
||||
</label>
|
||||
<div class="controls" style="padding-top: 5px;">
|
||||
<strong data-bind="text: viewSecret"></strong>
|
||||
|
||||
<span class="g-ui-link i18n" data-bind="click: hideSecret" data-i18n-text="SETTINGS_SECURITY/BUTTON_HIDE_SECRET"></span>
|
||||
<br />
|
||||
<br />
|
||||
<blockquote>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue