Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AccountManagement.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Customer\Model\AccountManagement as AccountManagementOriginal;
14 
19 {
23  protected $request;
24 
28  protected $securityManager;
29 
34 
38  private $scope;
39 
48  public function __construct(
49  \Magento\Framework\App\RequestInterface $request,
52  ScopeInterface $scope = null
53  ) {
54  $this->request = $request;
55  $this->securityManager = $securityManager;
56  $this->passwordRequestEvent = $passwordRequestEvent;
57  $this->scope = $scope ?: ObjectManager::getInstance()->get(ScopeInterface::class);
58  }
59 
70  public function beforeInitiatePasswordReset(
71  AccountManagementOriginal $accountManagement,
72  $email,
73  $template,
74  $websiteId = null
75  ) {
76  if ($this->scope->getCurrentScope() == \Magento\Framework\App\Area::AREA_FRONTEND
77  || $this->passwordRequestEvent == PasswordResetRequestEvent::ADMIN_PASSWORD_RESET_REQUEST) {
78  $this->securityManager->performSecurityCheck(
79  $this->passwordRequestEvent,
80  $email
81  );
82  }
83 
84  return [$email, $template, $websiteId];
85  }
86 }
$email
Definition: details.phtml:13
beforeInitiatePasswordReset(AccountManagementOriginal $accountManagement, $email, $template, $websiteId=null)
__construct(\Magento\Framework\App\RequestInterface $request, \Magento\Security\Model\SecurityManager $securityManager, $passwordRequestEvent=PasswordResetRequestEvent::CUSTOMER_PASSWORD_RESET_REQUEST, ScopeInterface $scope=null)
$accountManagement
$template
Definition: export.php:12