قرینه از
https://github.com/matomo-org/matomo.git
synced 2025-08-21 22:47:43 +00:00

* 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
37 خطوط
747 B
PHP
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);
|
|
}
|
|
}
|