Skip to content

Commit 9907990

Browse files
author
Vadim Zubovich
committed
Merge branch 'spm-131-PRs-stabilization' into 'PR2'
Spm 131 p rs stabilization See merge request !180
2 parents bf44554 + db4eba5 commit 9907990

File tree

17 files changed

+295
-544
lines changed

17 files changed

+295
-544
lines changed

app/code/Magento/Customer/Api/PasswordStrengthInterface.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

app/code/Magento/Customer/Block/Account/Resetpassword.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@
55
*/
66
namespace Magento\Customer\Block\Account;
77

8-
use Magento\Customer\Helper\Config as CustomerConfigHelper;
8+
use Magento\Customer\Helper\AccountManagement as AccountManagementHelper;
99

1010
/**
1111
* Customer reset password form
1212
*/
1313
class Resetpassword extends \Magento\Framework\View\Element\Template
1414
{
1515
/**
16-
* @var CustomerConfigHelper
16+
* @var AccountManagementHelper
1717
*/
18-
protected $customerConfigHelper;
18+
protected $accountManagementHelper;
1919

2020
/**
2121
* Constructor
2222
*
2323
* @param \Magento\Framework\View\Element\Template\Context $context
24-
* @param CustomerConfigHelper $customerConfigHelper
24+
* @param AccountManagementHelper $accountManagementHelper
2525
* @param array $data
2626
*/
2727
public function __construct(
2828
\Magento\Framework\View\Element\Template\Context $context,
29-
CustomerConfigHelper $customerConfigHelper,
29+
AccountManagementHelper $accountManagementHelper,
3030
array $data = []
3131
) {
32-
$this->customerConfigHelper = $customerConfigHelper;
32+
$this->accountManagementHelper = $accountManagementHelper;
3333
parent::__construct($context, $data);
3434
}
3535

@@ -55,7 +55,7 @@ public function isAutocompleteDisabled()
5555
*/
5656
public function getMinimumPasswordLength()
5757
{
58-
return $this->customerConfigHelper->getMinimumPasswordLength();
58+
return $this->accountManagementHelper->getMinimumPasswordLength();
5959
}
6060

6161
/**
@@ -65,6 +65,6 @@ public function getMinimumPasswordLength()
6565
*/
6666
public function getRequiredCharacterClassesNumber()
6767
{
68-
return $this->customerConfigHelper->getRequiredCharacterClassesNumber();
68+
return $this->accountManagementHelper->getRequiredCharacterClassesNumber();
6969
}
7070
}

app/code/Magento/Customer/Block/Form/Edit.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
use Magento\Customer\Api\AccountManagementInterface;
99
use Magento\Customer\Api\CustomerRepositoryInterface;
10-
use Magento\Customer\Helper\Config as CustomerConfigHelper;
10+
use Magento\Customer\Helper\AccountManagement as AccountManagementHelper;
1111

1212
/**
1313
* Customer edit form block
@@ -17,9 +17,9 @@
1717
class Edit extends \Magento\Customer\Block\Account\Dashboard
1818
{
1919
/**
20-
* @var CustomerConfigHelper
20+
* @var AccountManagementHelper
2121
*/
22-
protected $customerConfigHelper;
22+
protected $accountManagementHelper;
2323

2424
/**
2525
* Constructor
@@ -29,7 +29,7 @@ class Edit extends \Magento\Customer\Block\Account\Dashboard
2929
* @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory
3030
* @param CustomerRepositoryInterface $customerRepository
3131
* @param AccountManagementInterface $customerAccountManagement
32-
* @param CustomerConfigHelper $customerConfigHelper
32+
* @param AccountManagementHelper $accountManagementHelper
3333
* @param array $data
3434
*/
3535
public function __construct(
@@ -38,10 +38,10 @@ public function __construct(
3838
\Magento\Newsletter\Model\SubscriberFactory $subscriberFactory,
3939
CustomerRepositoryInterface $customerRepository,
4040
AccountManagementInterface $customerAccountManagement,
41-
CustomerConfigHelper $customerConfigHelper,
41+
AccountManagementHelper $accountManagementHelper,
4242
array $data = []
4343
) {
44-
$this->customerConfigHelper = $customerConfigHelper;
44+
$this->accountManagementHelper = $accountManagementHelper;
4545
parent::__construct(
4646
$context,
4747
$customerSession,
@@ -110,7 +110,7 @@ public function getChangePassword()
110110
*/
111111
public function getMinimumPasswordLength()
112112
{
113-
return $this->customerConfigHelper->getMinimumPasswordLength();
113+
return $this->accountManagementHelper->getMinimumPasswordLength();
114114
}
115115

116116
/**
@@ -120,6 +120,6 @@ public function getMinimumPasswordLength()
120120
*/
121121
public function getRequiredCharacterClassesNumber()
122122
{
123-
return $this->customerConfigHelper->getRequiredCharacterClassesNumber();
123+
return $this->accountManagementHelper->getRequiredCharacterClassesNumber();
124124
}
125125
}

app/code/Magento/Customer/Block/Form/Register.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\Customer\Block\Form;
77

8-
use Magento\Customer\Helper\Config as CustomerConfigHelper;
8+
use Magento\Customer\Helper\AccountManagement as AccountManagementHelper;
99

1010
/**
1111
* Customer register form block
@@ -30,9 +30,9 @@ class Register extends \Magento\Directory\Block\Data
3030
protected $_customerUrl;
3131

3232
/**
33-
* @var CustomerConfigHelper
33+
* @var AccountManagementHelper
3434
*/
35-
protected $customerConfigHelper;
35+
protected $accountManagementHelper;
3636

3737
/**
3838
* Constructor
@@ -46,7 +46,7 @@ class Register extends \Magento\Directory\Block\Data
4646
* @param \Magento\Framework\Module\Manager $moduleManager
4747
* @param \Magento\Customer\Model\Session $customerSession
4848
* @param \Magento\Customer\Model\Url $customerUrl
49-
* @param CustomerConfigHelper $customerConfigHelper
49+
* @param AccountManagementHelper $accountManagementHelper
5050
* @param array $data
5151
*
5252
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -61,13 +61,13 @@ public function __construct(
6161
\Magento\Framework\Module\Manager $moduleManager,
6262
\Magento\Customer\Model\Session $customerSession,
6363
\Magento\Customer\Model\Url $customerUrl,
64-
CustomerConfigHelper $customerConfigHelper,
64+
AccountManagementHelper $accountManagementHelper,
6565
array $data = []
6666
) {
6767
$this->_customerUrl = $customerUrl;
6868
$this->_moduleManager = $moduleManager;
6969
$this->_customerSession = $customerSession;
70-
$this->customerConfigHelper = $customerConfigHelper;
70+
$this->accountManagementHelper = $accountManagementHelper;
7171
parent::__construct(
7272
$context,
7373
$directoryHelper,
@@ -212,7 +212,7 @@ public function restoreSessionData(\Magento\Customer\Model\Metadata\Form $form,
212212
*/
213213
public function getMinimumPasswordLength()
214214
{
215-
return $this->customerConfigHelper->getMinimumPasswordLength();
215+
return $this->accountManagementHelper->getMinimumPasswordLength();
216216
}
217217

218218
/**
@@ -222,6 +222,6 @@ public function getMinimumPasswordLength()
222222
*/
223223
public function getRequiredCharacterClassesNumber()
224224
{
225-
return $this->customerConfigHelper->getRequiredCharacterClassesNumber();
225+
return $this->accountManagementHelper->getRequiredCharacterClassesNumber();
226226
}
227227
}

app/code/Magento/Customer/Helper/AccountManagement.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ class AccountManagement extends \Magento\Framework\App\Helper\AbstractHelper
3030
*/
3131
const MAX_FAILURES_PATH = 'customer/password/lockout_failures';
3232

33+
/**
34+
* Configuration path to customer password minimum length
35+
*/
36+
const XML_PATH_MINIMUM_PASSWORD_LENGTH = 'customer/password/minimum_password_length';
37+
38+
/**
39+
* Configuration path to customer password required character classes number
40+
*/
41+
const XML_PATH_REQUIRED_CHARACTER_CLASSES_NUMBER = 'customer/password/required_character_classes_number';
42+
3343
/**
3444
* @var CustomerRegistry
3545
*/
@@ -191,4 +201,24 @@ public function checkIfLocked(\Magento\Customer\Api\Data\CustomerInterface $cust
191201
);
192202
}
193203
}
204+
205+
/**
206+
* Get Email of a customer service
207+
*
208+
* @return string
209+
*/
210+
public function getMinimumPasswordLength()
211+
{
212+
return $this->scopeConfig->getValue(self::XML_PATH_MINIMUM_PASSWORD_LENGTH);
213+
}
214+
215+
/**
216+
* Get Email of a customer service
217+
*
218+
* @return string
219+
*/
220+
public function getRequiredCharacterClassesNumber()
221+
{
222+
return $this->scopeConfig->getValue(self::XML_PATH_REQUIRED_CHARACTER_CLASSES_NUMBER);
223+
}
194224
}

app/code/Magento/Customer/Helper/Config.php

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)