@@ -68,92 +68,104 @@ class AccountManagement implements AccountManagementInterface
68
68
/**
69
69
* Configuration paths for create account email template
70
70
*
71
- * @deprecated
71
+ * @deprecated Get rid of Helpers in Password Security Management
72
+ * @see EmailNotification::XML_PATH_REGISTER_EMAIL_TEMPLATE
72
73
*/
73
74
const XML_PATH_REGISTER_EMAIL_TEMPLATE = 'customer/create_account/email_template ' ;
74
75
75
76
/**
76
77
* Configuration paths for register no password email template
77
78
*
78
- * @deprecated
79
+ * @deprecated Get rid of Helpers in Password Security Management
80
+ * @see EmailNotification::XML_PATH_REGISTER_EMAIL_TEMPLATE
79
81
*/
80
82
const XML_PATH_REGISTER_NO_PASSWORD_EMAIL_TEMPLATE = 'customer/create_account/email_no_password_template ' ;
81
83
82
84
/**
83
85
* Configuration paths for remind email identity
84
86
*
85
- * @deprecated
87
+ * @deprecated Get rid of Helpers in Password Security Management
88
+ * @see EmailNotification::XML_PATH_REGISTER_EMAIL_TEMPLATE
86
89
*/
87
90
const XML_PATH_REGISTER_EMAIL_IDENTITY = 'customer/create_account/email_identity ' ;
88
91
89
92
/**
90
93
* Configuration paths for remind email template
91
94
*
92
- * @deprecated
95
+ * @deprecated Get rid of Helpers in Password Security Management
96
+ * @see EmailNotification::XML_PATH_REGISTER_EMAIL_TEMPLATE
93
97
*/
94
98
const XML_PATH_REMIND_EMAIL_TEMPLATE = 'customer/password/remind_email_template ' ;
95
99
96
100
/**
97
101
* Configuration paths for forgot email email template
98
102
*
99
- * @deprecated
103
+ * @deprecated Get rid of Helpers in Password Security Management
104
+ * @see EmailNotification::XML_PATH_REGISTER_EMAIL_TEMPLATE
100
105
*/
101
106
const XML_PATH_FORGOT_EMAIL_TEMPLATE = 'customer/password/forgot_email_template ' ;
102
107
103
108
/**
104
109
* Configuration paths for forgot email identity
105
110
*
106
- * @deprecated
111
+ * @deprecated Get rid of Helpers in Password Security Management
112
+ * @see EmailNotification::XML_PATH_REGISTER_EMAIL_TEMPLATE
107
113
*/
108
114
const XML_PATH_FORGOT_EMAIL_IDENTITY = 'customer/password/forgot_email_identity ' ;
109
115
110
116
/**
111
117
* Configuration paths for account confirmation required
112
118
*
113
- * @deprecated
119
+ * @deprecated Get rid of Helpers in Password Security Management
114
120
* @see AccountConfirmation::XML_PATH_IS_CONFIRM
115
121
*/
116
122
const XML_PATH_IS_CONFIRM = 'customer/create_account/confirm ' ;
117
123
118
124
/**
119
125
* Configuration paths for account confirmation email template
120
126
*
121
- * @deprecated
127
+ * @deprecated Get rid of Helpers in Password Security Management
128
+ * @see EmailNotification::XML_PATH_REGISTER_EMAIL_TEMPLATE
122
129
*/
123
130
const XML_PATH_CONFIRM_EMAIL_TEMPLATE = 'customer/create_account/email_confirmation_template ' ;
124
131
125
132
/**
126
133
* Configuration paths for confirmation confirmed email template
127
134
*
128
- * @deprecated
135
+ * @deprecated Get rid of Helpers in Password Security Management
136
+ * @see EmailNotification::XML_PATH_REGISTER_EMAIL_TEMPLATE
129
137
*/
130
138
const XML_PATH_CONFIRMED_EMAIL_TEMPLATE = 'customer/create_account/email_confirmed_template ' ;
131
139
132
140
/**
133
141
* Constants for the type of new account email to be sent
134
142
*
135
- * @deprecated
143
+ * @deprecated Get rid of Helpers in Password Security Management
144
+ * @see EmailNotificationInterface::NEW_ACCOUNT_EMAIL_REGISTERED
136
145
*/
137
146
const NEW_ACCOUNT_EMAIL_REGISTERED = 'registered ' ;
138
147
139
148
/**
140
149
* Welcome email, when password setting is required
141
150
*
142
- * @deprecated
151
+ * @deprecated Get rid of Helpers in Password Security Management
152
+ * @see EmailNotificationInterface::NEW_ACCOUNT_EMAIL_REGISTERED
143
153
*/
144
154
const NEW_ACCOUNT_EMAIL_REGISTERED_NO_PASSWORD = 'registered_no_password ' ;
145
155
146
156
/**
147
157
* Welcome email, when confirmation is enabled
148
158
*
149
- * @deprecated
159
+ * @deprecated Get rid of Helpers in Password Security Management
160
+ * @see EmailNotificationInterface::NEW_ACCOUNT_EMAIL_REGISTERED
150
161
*/
151
162
const NEW_ACCOUNT_EMAIL_CONFIRMATION = 'confirmation ' ;
152
163
153
164
/**
154
165
* Confirmation email, when account is confirmed
155
166
*
156
- * @deprecated
167
+ * @deprecated Get rid of Helpers in Password Security Management
168
+ * @see EmailNotificationInterface::NEW_ACCOUNT_EMAIL_REGISTERED
157
169
*/
158
170
const NEW_ACCOUNT_EMAIL_CONFIRMED = 'confirmed ' ;
159
171
@@ -179,14 +191,15 @@ class AccountManagement implements AccountManagementInterface
179
191
/**
180
192
* Configuration path to customer reset password email template
181
193
*
182
- * @deprecated
194
+ * @deprecated Get rid of Helpers in Password Security Management
195
+ * @see Magento/Customer/Model/EmailNotification::XML_PATH_REGISTER_EMAIL_TEMPLATE
183
196
*/
184
197
const XML_PATH_RESET_PASSWORD_TEMPLATE = 'customer/password/reset_password_template ' ;
185
198
186
199
/**
187
200
* Minimum password length
188
201
*
189
- * @deprecated
202
+ * @deprecated Get rid of Helpers in Password Security Management
190
203
*/
191
204
const MIN_PASSWORD_LENGTH = 6 ;
192
205
@@ -526,6 +539,7 @@ public function resendConfirmation($email, $websiteId = null, $redirectUrl = '')
526
539
// If we are not able to send a new account email, this should be ignored
527
540
$ this ->logger ->critical ($ e );
528
541
}
542
+ return true ;
529
543
}
530
544
531
545
/**
@@ -671,17 +685,16 @@ public function initiatePasswordReset($email, $template, $websiteId = null)
671
685
*/
672
686
private function handleUnknownTemplate ($ template )
673
687
{
674
- throw new InputException (
675
- __ (
676
- 'Invalid value of "%value" provided for the %fieldName field. Possible values: %template1 or %template2. ' ,
677
- [
678
- 'value ' => $ template ,
679
- 'fieldName ' => 'template ' ,
680
- 'template1 ' => AccountManagement::EMAIL_REMINDER ,
681
- 'template2 ' => AccountManagement::EMAIL_RESET
682
- ]
683
- )
688
+ $ phrase = __ (
689
+ 'Invalid value of "%value" provided for the %fieldName field. Possible values: %template1 or %template2. ' ,
690
+ [
691
+ 'value ' => $ template ,
692
+ 'fieldName ' => 'template ' ,
693
+ 'template1 ' => AccountManagement::EMAIL_REMINDER ,
694
+ 'template2 ' => AccountManagement::EMAIL_RESET
695
+ ]
684
696
);
697
+ throw new InputException ($ phrase );
685
698
}
686
699
687
700
/**
@@ -713,12 +726,6 @@ public function resetPassword($email, $resetToken, $newPassword)
713
726
$ customerSecure ->setRpTokenCreatedAt (null );
714
727
$ customerSecure ->setPasswordHash ($ this ->createPasswordHash ($ newPassword ));
715
728
$ this ->destroyCustomerSessions ($ customer ->getId ());
716
- if ($ this ->sessionManager ->isSessionExists ()) {
717
- //delete old session and move data to the new session
718
- //use this instead of $this->sessionManager->regenerateId because last one doesn't delete old session
719
- // phpcs:ignore Magento2.Functions.DiscouragedFunction
720
- session_regenerate_id (true );
721
- }
722
729
$ this ->customerRepository ->save ($ customer );
723
730
724
731
return true ;
0 commit comments