mirror of
https://github.com/openvk/openvk
synced 2025-01-09 17:29:42 +03:00
Fixup "Users: Add two-factor authentication"
Make the background of the QR code white, correct the text of the enable message and remove audios from the left menu
This commit is contained in:
parent
e433e83c5d
commit
b4c6061a9a
2 changed files with 5 additions and 14 deletions
|
@ -11,7 +11,7 @@ use openvk\Web\Models\Repositories\Notes;
|
||||||
use openvk\Web\Models\Repositories\Vouchers;
|
use openvk\Web\Models\Repositories\Vouchers;
|
||||||
use Chandler\Security\Authenticator;
|
use Chandler\Security\Authenticator;
|
||||||
use lfkeitel\phptotp\{Base32, Totp};
|
use lfkeitel\phptotp\{Base32, Totp};
|
||||||
use chillerlan\QRCode\QRCode;
|
use chillerlan\QRCode\{QRCode, QROptions};
|
||||||
|
|
||||||
final class UserPresenter extends OpenVKPresenter
|
final class UserPresenter extends OpenVKPresenter
|
||||||
{
|
{
|
||||||
|
@ -418,7 +418,7 @@ final class UserPresenter extends OpenVKPresenter
|
||||||
$this->user->identity->set2fa_secret($secret);
|
$this->user->identity->set2fa_secret($secret);
|
||||||
$this->user->identity->save();
|
$this->user->identity->save();
|
||||||
|
|
||||||
$this->flash("succ", tr("two_factor_authentication_enabled"), tr("two_factor_authentication_enabled_description"));
|
$this->flash("succ", tr("two_factor_authentication_enabled_message"), tr("two_factor_authentication_enabled_message_description"));
|
||||||
$this->redirect("/settings");
|
$this->redirect("/settings");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -430,7 +430,9 @@ final class UserPresenter extends OpenVKPresenter
|
||||||
|
|
||||||
$issuer = OPENVK_ROOT_CONF["openvk"]["appearance"]["name"];
|
$issuer = OPENVK_ROOT_CONF["openvk"]["appearance"]["name"];
|
||||||
$email = $this->user->identity->getEmail();
|
$email = $this->user->identity->getEmail();
|
||||||
$this->template->qrCode = substr((new QRCode)->render("otpauth://totp/$issuer:$email?secret=$secret&issuer=$issuer"), 22);
|
$this->template->qrCode = substr((new QRCode(new QROptions([
|
||||||
|
"imageTransparent" => false
|
||||||
|
])))->render("otpauth://totp/$issuer:$email?secret=$secret&issuer=$issuer"), 22);
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderDisableTwoFactorAuth(): void
|
function renderDisableTwoFactorAuth(): void
|
||||||
|
|
|
@ -464,17 +464,6 @@
|
||||||
<span class="nobold">{_my_videos}</span>
|
<span class="nobold">{_my_videos}</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td width="120" valign="top" align="right">
|
|
||||||
<input
|
|
||||||
n:attr="checked => $user->getLeftMenuItemStatus('audios')"
|
|
||||||
type="checkbox"
|
|
||||||
name="menu_audioj" />
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="nobold">{_my_audios}</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td width="120" valign="top" align="right">
|
<td width="120" valign="top" align="right">
|
||||||
<input
|
<input
|
||||||
|
|
Loading…
Reference in a new issue