forked from FriendsOfSymfony/FOSUserBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FOSUserEvents.php
321 lines (286 loc) · 11.7 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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<?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")
*/
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")
*/
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")
*/
const CHANGE_PASSWORD_COMPLETED = 'fos_user.change_password.edit.completed';
/**
* The GROUP_CREATE_INITIALIZE event occurs when the group creation process is initialized.
*
* This event allows you to modify the default values of the user before binding the form.
*
* @Event("FOS\UserBundle\Event\GroupEvent")
*/
const GROUP_CREATE_INITIALIZE = 'fos_user.group.create.initialize';
/**
* The GROUP_CREATE_SUCCESS event occurs when the group creation form is submitted successfully.
*
* This event allows you to set the response instead of using the default one.
*
* @Event("FOS\UserBundle\Event\FormEvent")
*/
const GROUP_CREATE_SUCCESS = 'fos_user.group.create.success';
/**
* The GROUP_CREATE_COMPLETED event occurs after saving the group in the group creation process.
*
* This event allows you to access the response which will be sent.
*
* @Event("FOS\UserBundle\Event\FilterGroupResponseEvent")
*/
const GROUP_CREATE_COMPLETED = 'fos_user.group.create.completed';
/**
* The GROUP_DELETE_COMPLETED event occurs after deleting the group.
*
* This event allows you to access the response which will be sent.
*
* @Event("FOS\UserBundle\Event\FilterGroupResponseEvent")
*/
const GROUP_DELETE_COMPLETED = 'fos_user.group.delete.completed';
/**
* The GROUP_EDIT_INITIALIZE event occurs when the group editing process is initialized.
*
* This event allows you to modify the default values of the user before binding the form.
*
* @Event("FOS\UserBundle\Event\GetResponseGroupEvent")
*/
const GROUP_EDIT_INITIALIZE = 'fos_user.group.edit.initialize';
/**
* The GROUP_EDIT_SUCCESS event occurs when the group edit form is submitted successfully.
*
* This event allows you to set the response instead of using the default one.
*
* @Event("FOS\UserBundle\Event\FormEvent")
*/
const GROUP_EDIT_SUCCESS = 'fos_user.group.edit.success';
/**
* The GROUP_EDIT_COMPLETED event occurs after saving the group in the group edit process.
*
* This event allows you to access the response which will be sent.
*
* @Event("FOS\UserBundle\Event\FilterGroupResponseEvent")
*/
const GROUP_EDIT_COMPLETED = 'fos_user.group.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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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 ")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
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")
*/
const USER_DEMOTED = 'fos_user.user.demoted';
}