1
0
قرینه از https://github.com/matomo-org/matomo.git synced 2025-08-21 22:47:43 +00:00
Files
matomo/plugins/TwoFactorAuth/API.php
Stefan Giehl 158e45a5a9 Use #[\SensitiveParameter] php attribute to hide sensitive parameters from strack traces (#23324)
* Use #[\SensitiveParameter] php attribute to hide sensitive parameters from strack traces

* also hide database config parameters

* also hide 2fa codes and secrets

* hide some more parameters

* add attribute to remaining sensitive parameters

* update matomo-org/matomo-coding-standards
2025-05-30 14:24:53 +02:00

37 خطوط
747 B
PHP

<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\TwoFactorAuth;
use Piwik\Piwik;
class API extends \Piwik\Plugin\API
{
/**
* @var TwoFactorAuthentication
*/
private $twoFa;
public function __construct(TwoFactorAuthentication $twoFa)
{
$this->twoFa = $twoFa;
}
public function resetTwoFactorAuth(
$userLogin,
#[\SensitiveParameter]
$passwordConfirmation = ''
) {
Piwik::checkUserHasSuperUserAccess();
$this->confirmCurrentUserPassword($passwordConfirmation);
$this->twoFa->disable2FAforUser($userLogin);
}
}