-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Files
/
Copy pathAccountManagement.php
1437 lines (1290 loc) · 47.5 KB
1
2
<?php
/**
3
* Copyright © Magento, Inc. All rights reserved.
4
* See COPYING.txt for license details.
5
6
7
8
9
*/
namespace Magento\Customer\Model;
use Magento\Customer\Api\AccountManagementInterface;
use Magento\Customer\Api\AddressRepositoryInterface;
10
use Magento\Customer\Api\CustomerMetadataInterface;
11
use Magento\Customer\Api\CustomerRepositoryInterface;
12
use Magento\Customer\Api\Data\AddressInterface;
13
use Magento\Customer\Api\Data\CustomerInterface;
14
use Magento\Customer\Api\Data\ValidationResultsInterfaceFactory;
15
use Magento\Customer\Helper\View as CustomerViewHelper;
16
17
use Magento\Customer\Model\Config\Share as ConfigShare;
use Magento\Customer\Model\Customer as CustomerModel;
18
use Magento\Customer\Model\Customer\CredentialsValidator;
19
use Magento\Customer\Model\Metadata\Validator;
20
use Magento\Eav\Model\Validator\Attribute\Backend;
21
use Magento\Framework\Api\ExtensibleDataObjectConverter;
22
use Magento\Framework\App\Area;
23
use Magento\Framework\App\Config\ScopeConfigInterface;
24
use Magento\Framework\App\ObjectManager;
25
use Magento\Framework\DataObjectFactory as ObjectFactory;
26
use Magento\Framework\Encryption\EncryptorInterface as Encryptor;
27
use Magento\Framework\Encryption\Helper\Security;
28
use Magento\Framework\Event\ManagerInterface;
29
use Magento\Framework\Exception\AlreadyExistsException;
30
31
32
use Magento\Framework\Exception\EmailNotConfirmedException;
use Magento\Framework\Exception\InputException;
use Magento\Framework\Exception\InvalidEmailOrPasswordException;
33
use Magento\Framework\Exception\LocalizedException;
34
use Magento\Framework\Exception\MailException;
35
36
37
38
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Exception\State\ExpiredException;
use Magento\Framework\Exception\State\InputMismatchException;
use Magento\Framework\Exception\State\InvalidTransitionException;
39
use Magento\Framework\Exception\State\UserLockedException;
40
use Magento\Framework\Intl\DateTimeFactory;
41
42
use Magento\Framework\Mail\Template\TransportBuilder;
use Magento\Framework\Math\Random;
43
use Magento\Framework\Reflection\DataObjectProcessor;
44
use Magento\Framework\Registry;
45
use Magento\Framework\Stdlib\DateTime;
46
use Magento\Framework\Stdlib\StringUtils as StringHelper;
47
use Magento\Store\Model\ScopeInterface;
48
use Magento\Store\Model\StoreManagerInterface;
49
use Psr\Log\LoggerInterface as PsrLogger;
50
51
52
use Magento\Framework\Session\SessionManagerInterface;
use Magento\Framework\Session\SaveHandlerInterface;
use Magento\Customer\Model\ResourceModel\Visitor\CollectionFactory;
53
54
55
56
57
58
59
60
61
62
63
64
/**
* Handle various customer account actions
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.TooManyFields)
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
*/
class AccountManagement implements AccountManagementInterface
{
/**
* Configuration paths for email templates and identities
65
66
*
* @deprecated
67
68
69
*/
const XML_PATH_REGISTER_EMAIL_TEMPLATE = 'customer/create_account/email_template';
70
71
72
/**
* @deprecated
*/
73
74
const XML_PATH_REGISTER_NO_PASSWORD_EMAIL_TEMPLATE = 'customer/create_account/email_no_password_template';
75
76
77
/**
* @deprecated
*/
78
79
const XML_PATH_REGISTER_EMAIL_IDENTITY = 'customer/create_account/email_identity';
80
81
82
/**
* @deprecated
*/
83
84
const XML_PATH_REMIND_EMAIL_TEMPLATE = 'customer/password/remind_email_template';
85
86
87
/**
* @deprecated
*/
88
89
const XML_PATH_FORGOT_EMAIL_TEMPLATE = 'customer/password/forgot_email_template';
90
91
92
/**
* @deprecated
*/
93
94
const XML_PATH_FORGOT_EMAIL_IDENTITY = 'customer/password/forgot_email_identity';
95
96
97
98
/**
* @deprecated
* @see AccountConfirmation::XML_PATH_IS_CONFIRM
*/
99
100
const XML_PATH_IS_CONFIRM = 'customer/create_account/confirm';
101
/**