| @@ 99-115 (lines=17) @@ | ||
| 96 | * @return \Magento\Framework\Controller\ResultInterface|ResponseInterface |
|
| 97 | * @throws \Magento\Framework\Exception\NotFoundException |
|
| 98 | */ |
|
| 99 | public function execute() |
|
| 100 | { |
|
| 101 | if ($this->shouldActionBeRun() === false) { |
|
| 102 | return $this->getRedirectAction(); |
|
| 103 | } |
|
| 104 | ||
| 105 | $secret = $this->getRequest()->getParam('secret'); |
|
| 106 | $adminUser = $this->getAdminUser(); |
|
| 107 | ||
| 108 | $verificationPassed = $this->verifySecret($adminUser, $secret); |
|
| 109 | ||
| 110 | if ($verificationPassed === false) { |
|
| 111 | return $this->handleError(); |
|
| 112 | } |
|
| 113 | ||
| 114 | return $this->handleSuccess(); |
|
| 115 | } |
|
| 116 | ||
| 117 | private function verifySecret($adminUser, $postedSecret) |
|
| 118 | { |
|
| @@ 99-114 (lines=16) @@ | ||
| 96 | * @return \Magento\Framework\Controller\ResultInterface|ResponseInterface |
|
| 97 | * @throws \Magento\Framework\Exception\NotFoundException |
|
| 98 | */ |
|
| 99 | public function execute() |
|
| 100 | { |
|
| 101 | if ($this->shouldActionBeRun() === false) { |
|
| 102 | return $this->getRedirectAction(); |
|
| 103 | } |
|
| 104 | ||
| 105 | $secret = $this->getRequest()->getParam('secret'); |
|
| 106 | $customer = $this->getCustomer(); |
|
| 107 | $verificationPassed = $this->verifySecret($customer, $secret); |
|
| 108 | ||
| 109 | if ($verificationPassed === false) { |
|
| 110 | return $this->handleError(); |
|
| 111 | } |
|
| 112 | ||
| 113 | return $this->handleSuccess(); |
|
| 114 | } |
|
| 115 | ||
| 116 | private function verifySecret(CustomerInterface $customer, $postedSecret) |
|
| 117 | { |
|