Fix: lint-errors

This commit is contained in:
Jan Schuppik 2025-08-12 00:47:04 +02:00
parent 690f94f3db
commit b8ea4c4c5d
4 changed files with 12 additions and 13 deletions

View File

@ -73,7 +73,7 @@ class AccountController extends Controller
// form to add, remove, enable & disable 2FA via TOTP
if ( $user->can('user/two-factor-authentication') ) {
if ($user->can('user/two-factor-authentication')) {
if (isset($_POST['enabled_2fa'])) {
Session::getSession()->set('enabled_2fa', $_POST['enabled_2fa'] == 1);
}

View File

@ -105,7 +105,8 @@ class TotpForm extends PreferenceForm
'label' => $this->translate('TOTP Secret:'),
'value' => $this->totp->getSecret() ?? $this->translate('No Secret set'),
'description' => $this->translate(
'If you generate a new TOTP secret, you will need to configure your TOTP application with this secret. '
'If you generate a new TOTP secret,
you will need to configure your TOTP application with this secret. '
),
'disabled' => true,
]
@ -305,7 +306,6 @@ class TotpForm extends PreferenceForm
]
]
);
}
/**
@ -409,8 +409,7 @@ class TotpForm extends PreferenceForm
public function isSubmitted()
{
if (
($this->getElement('btn_generate_totp') && $this->getElement('btn_generate_totp')->isChecked())
if (($this->getElement('btn_generate_totp') && $this->getElement('btn_generate_totp')->isChecked())
|| ($this->getElement('btn_renew_totp') && $this->getElement('btn_renew_totp')->isChecked())
|| ($this->getElement('btn_delete_totp') && $this->getElement('btn_delete_totp')->isChecked())
|| ($this->getElement('btn_verify_totp') && $this->getElement('btn_verify_totp')->isChecked())

View File

@ -168,8 +168,7 @@ class LoginForm extends Form
if ($user->getTwoFactorEnabled() && ! $user->getTwoFactorSuccessful()) {
$redirect = $this->getElement('redirect');
$redirect->setValue(
Url::fromPath('authentication/login',
['redirect' => $redirect->getValue()])->getRelativeUrl()
Url::fromPath('authentication/login', ['redirect' => $redirect->getValue()])->getRelativeUrl()
);
Session::getSession()->set('must_challenge_2fa_token', true);

View File

@ -325,7 +325,9 @@ class Totp
'Failed to persist TOTP state for user %s: %s',
$this->username,
$e->getMessage()
), 0, $e
),
0,
$e
);
}
@ -615,5 +617,4 @@ class Totp
return $this;
}
}