forked from FriendsOfSymfony/FOSUserBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FOSUserEvents.php
258 lines (230 loc) · 9.59 KB
/
FOSUserEvents.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<?php
/*
* This file is part of the FOSUserBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FOS\UserBundle;
/**
* Contains all events thrown in the FOSUserBundle.
*/
final class FOSUserEvents
{
/**
* The CHANGE_PASSWORD_INITIALIZE event occurs when the change password process is initialized.
*
* This event allows you to modify the default values of the user before binding the form.
*
* @Event("FOS\UserBundle\Event\GetResponseUserEvent")
*/
public const CHANGE_PASSWORD_INITIALIZE = 'fos_user.change_password.edit.initialize';
/**
* The CHANGE_PASSWORD_SUCCESS event occurs when the change password form is submitted successfully.
*
* This event allows you to set the response instead of using the default one.
*
* @Event("FOS\UserBundle\Event\FormEvent")
*/
public const CHANGE_PASSWORD_SUCCESS = 'fos_user.change_password.edit.success';
/**
* The CHANGE_PASSWORD_COMPLETED event occurs after saving the user in the change password process.
*
* This event allows you to access the response which will be sent.
*
* @Event("FOS\UserBundle\Event\FilterUserResponseEvent")
*/
public const CHANGE_PASSWORD_COMPLETED = 'fos_user.change_password.edit.completed';
/**
* The PROFILE_EDIT_INITIALIZE event occurs when the profile editing process is initialized.
*
* This event allows you to modify the default values of the user before binding the form.
*
* @Event("FOS\UserBundle\Event\GetResponseUserEvent")
*/
public const PROFILE_EDIT_INITIALIZE = 'fos_user.profile.edit.initialize';
/**
* The PROFILE_EDIT_SUCCESS event occurs when the profile edit form is submitted successfully.
*
* This event allows you to set the response instead of using the default one.
*
* @Event("FOS\UserBundle\Event\FormEvent")
*/
public const PROFILE_EDIT_SUCCESS = 'fos_user.profile.edit.success';
/**
* The PROFILE_EDIT_COMPLETED event occurs after saving the user in the profile edit process.
*
* This event allows you to access the response which will be sent.
*
* @Event("FOS\UserBundle\Event\FilterUserResponseEvent")
*/
public const PROFILE_EDIT_COMPLETED = 'fos_user.profile.edit.completed';
/**
* The REGISTRATION_INITIALIZE event occurs when the registration process is initialized.
*
* This event allows you to modify the default values of the user before binding the form.
*
* @Event("FOS\UserBundle\Event\UserEvent")
*/
public const REGISTRATION_INITIALIZE = 'fos_user.registration.initialize';
/**
* The REGISTRATION_SUCCESS event occurs when the registration form is submitted successfully.
*
* This event allows you to set the response instead of using the default one.
*
* @Event("FOS\UserBundle\Event\FormEvent")
*/
public const REGISTRATION_SUCCESS = 'fos_user.registration.success';
/**
* The REGISTRATION_FAILURE event occurs when the registration form is not valid.
*
* This event allows you to set the response instead of using the default one.
* The event listener method receives a FOS\UserBundle\Event\FormEvent instance.
*
* @Event("FOS\UserBundle\Event\FormEvent")
*/
public const REGISTRATION_FAILURE = 'fos_user.registration.failure';
/**
* The REGISTRATION_COMPLETED event occurs after saving the user in the registration process.
*
* This event allows you to access the response which will be sent.
*
* @Event("FOS\UserBundle\Event\FilterUserResponseEvent")
*/
public const REGISTRATION_COMPLETED = 'fos_user.registration.completed';
/**
* The REGISTRATION_CONFIRM event occurs just before confirming the account.
*
* This event allows you to access the user which will be confirmed.
*
* @Event("FOS\UserBundle\Event\GetResponseUserEvent")
*/
public const REGISTRATION_CONFIRM = 'fos_user.registration.confirm';
/**
* The REGISTRATION_CONFIRMED event occurs after confirming the account.
*
* This event allows you to access the response which will be sent.
*
* @Event("FOS\UserBundle\Event\FilterUserResponseEvent")
*/
public const REGISTRATION_CONFIRMED = 'fos_user.registration.confirmed';
/**
* The RESETTING_RESET_REQUEST event occurs when a user requests a password reset of the account.
*
* This event allows you to check if a user is locked out before requesting a password.
* The event listener method receives a FOS\UserBundle\Event\GetResponseUserEvent instance.
*
* @Event("FOS\UserBundle\Event\GetResponseUserEvent")
*/
public const RESETTING_RESET_REQUEST = 'fos_user.resetting.reset.request';
/**
* The RESETTING_RESET_INITIALIZE event occurs when the resetting process is initialized.
*
* This event allows you to set the response to bypass the processing.
*
* @Event("FOS\UserBundle\Event\GetResponseUserEvent")
*/
public const RESETTING_RESET_INITIALIZE = 'fos_user.resetting.reset.initialize';
/**
* The RESETTING_RESET_SUCCESS event occurs when the resetting form is submitted successfully.
*
* This event allows you to set the response instead of using the default one.
*
* @Event("FOS\UserBundle\Event\FormEvent ")
*/
public const RESETTING_RESET_SUCCESS = 'fos_user.resetting.reset.success';
/**
* The RESETTING_RESET_COMPLETED event occurs after saving the user in the resetting process.
*
* This event allows you to access the response which will be sent.
*
* @Event("FOS\UserBundle\Event\FilterUserResponseEvent")
*/
public const RESETTING_RESET_COMPLETED = 'fos_user.resetting.reset.completed';
/**
* The SECURITY_IMPLICIT_LOGIN event occurs when the user is logged in programmatically.
*
* This event allows you to access the response which will be sent.
*
* @Event("FOS\UserBundle\Event\UserEvent")
*/
public const SECURITY_IMPLICIT_LOGIN = 'fos_user.security.implicit_login';
/**
* The RESETTING_SEND_EMAIL_INITIALIZE event occurs when the send email process is initialized.
*
* This event allows you to set the response to bypass the email confirmation processing.
* The event listener method receives a FOS\UserBundle\Event\GetResponseNullableUserEvent instance.
*
* @Event("FOS\UserBundle\Event\GetResponseNullableUserEvent")
*/
public const RESETTING_SEND_EMAIL_INITIALIZE = 'fos_user.resetting.send_email.initialize';
/**
* The RESETTING_SEND_EMAIL_CONFIRM event occurs when all prerequisites to send email are
* confirmed and before the mail is sent.
*
* This event allows you to set the response to bypass the email sending.
* The event listener method receives a FOS\UserBundle\Event\GetResponseUserEvent instance.
*
* @Event("FOS\UserBundle\Event\GetResponseUserEvent")
*/
public const RESETTING_SEND_EMAIL_CONFIRM = 'fos_user.resetting.send_email.confirm';
/**
* The RESETTING_SEND_EMAIL_COMPLETED event occurs after the email is sent.
*
* This event allows you to set the response to bypass the the redirection after the email is sent.
* The event listener method receives a FOS\UserBundle\Event\GetResponseUserEvent instance.
*
* @Event("FOS\UserBundle\Event\GetResponseUserEvent")
*/
public const RESETTING_SEND_EMAIL_COMPLETED = 'fos_user.resetting.send_email.completed';
/**
* The USER_CREATED event occurs when the user is created with UserManipulator.
*
* This event allows you to access the created user and to add some behaviour after the creation.
*
* @Event("FOS\UserBundle\Event\UserEvent")
*/
public const USER_CREATED = 'fos_user.user.created';
/**
* The USER_PASSWORD_CHANGED event occurs when the user is created with UserManipulator.
*
* This event allows you to access the created user and to add some behaviour after the password change.
*
* @Event("FOS\UserBundle\Event\UserEvent")
*/
public const USER_PASSWORD_CHANGED = 'fos_user.user.password_changed';
/**
* The USER_ACTIVATED event occurs when the user is created with UserManipulator.
*
* This event allows you to access the activated user and to add some behaviour after the activation.
*
* @Event("FOS\UserBundle\Event\UserEvent")
*/
public const USER_ACTIVATED = 'fos_user.user.activated';
/**
* The USER_DEACTIVATED event occurs when the user is created with UserManipulator.
*
* This event allows you to access the deactivated user and to add some behaviour after the deactivation.
*
* @Event("FOS\UserBundle\Event\UserEvent")
*/
public const USER_DEACTIVATED = 'fos_user.user.deactivated';
/**
* The USER_PROMOTED event occurs when the user is created with UserManipulator.
*
* This event allows you to access the promoted user and to add some behaviour after the promotion.
*
* @Event("FOS\UserBundle\Event\UserEvent")
*/
public const USER_PROMOTED = 'fos_user.user.promoted';
/**
* The USER_DEMOTED event occurs when the user is created with UserManipulator.
*
* This event allows you to access the demoted user and to add some behaviour after the demotion.
*
* @Event("FOS\UserBundle\Event\UserEvent")
*/
public const USER_DEMOTED = 'fos_user.user.demoted';
}