|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace terabytesoft\events\user; |
|
4
|
|
|
|
|
5
|
|
|
use yii\base\Event; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Class FormEvent |
|
9
|
|
|
* |
|
10
|
|
|
* Form events applications |
|
11
|
|
|
**/ |
|
12
|
|
|
class FormEvent extends Event |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* event is triggered after creating RegistrationForm class |
|
16
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
17
|
|
|
**/ |
|
18
|
|
|
const BEFORE_REGISTER = '\terabytesoft\events\user\FormEvent::BEFORE_REGISTER'; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* event is triggered after successful registration Form class |
|
22
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
23
|
|
|
**/ |
|
24
|
|
|
const AFTER_REGISTER = '\terabytesoft\events\user\FormEvent::AFTER_REGISTER'; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* event is triggered fails registration Form class |
|
28
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
29
|
|
|
**/ |
|
30
|
|
|
const REGISTER_FAILS = '\terabytesoft\events\user\FormEvent::REGISTER_FAILS'; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* event is triggered module registration user is disable |
|
34
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
35
|
|
|
**/ |
|
36
|
|
|
const REGISTER_MODULE_DISABLE = '\terabytesoft\events\user\FormEvent::REGISTER_MODULE_DISABLE'; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* event is triggered after creating ResendForm class |
|
40
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
41
|
|
|
**/ |
|
42
|
|
|
const BEFORE_RESEND = '\terabytesoft\events\user\FormEvent::BEFORE_RESEND'; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* event is triggered after successful resending of confirmation email |
|
46
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
47
|
|
|
**/ |
|
48
|
|
|
const AFTER_RESEND = '\terabytesoft\events\user\FormEvent::AFTER_RESEND'; |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* event is triggered fails resending of confirmation email |
|
52
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
53
|
|
|
**/ |
|
54
|
|
|
const RESEND_FAILS = '\terabytesoft\events\user\FormEvent::RESEND_FAILS'; |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* event is triggered before logging user in |
|
58
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
59
|
|
|
**/ |
|
60
|
|
|
const BEFORE_LOGIN = '\terabytesoft\events\user\FormEvent::BEFORE_LOGIN'; |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* event is triggered after logging user in |
|
64
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
65
|
|
|
**/ |
|
66
|
|
|
const AFTER_LOGIN = '\terabytesoft\events\user\FormEvent::AFTER_LOGIN'; |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* event is triggered before logging user out |
|
70
|
|
|
* triggered with \terabytesoft\events\user\UserEvent |
|
71
|
|
|
**/ |
|
72
|
|
|
const BEFORE_LOGOUT = '\terabytesoft\events\user\FormEvent::BEFORE_LOGOUT'; |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* event is triggered after logging user out |
|
76
|
|
|
* triggered with \terabytesoft\events\user\UserEvent |
|
77
|
|
|
**/ |
|
78
|
|
|
const AFTER_LOGOUT = '\terabytesoft\events\user\FormEvent::AFTER_LOGOUT'; |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* event is triggered before requesting password reset |
|
82
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
83
|
|
|
**/ |
|
84
|
|
|
const BEFORE_REQUEST = '\terabytesoft\events\user\FormEvent::BEFORE_REQUEST'; |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* event is triggered after requesting password reset |
|
88
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
89
|
|
|
**/ |
|
90
|
|
|
const AFTER_REQUEST = '\terabytesoft\events\user\FormEvent::AFTER_REQUEST'; |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* event is triggered requesting password is module disabled |
|
94
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
95
|
|
|
**/ |
|
96
|
|
|
const REQUEST_MODULE_DISABLE = '\terabytesoft\events\user\FormEvent::REQUEST_MODULE_DISABLE'; |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* event is triggered fails requesting password reset |
|
100
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
101
|
|
|
**/ |
|
102
|
|
|
const REQUEST_FAILS = '\terabytesoft\events\user\FormEvent::REQUEST_FAILS'; |
|
103
|
|
|
|
|
104
|
|
|
/** |
|
105
|
|
|
* event is triggered before updating user's account settings |
|
106
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
107
|
|
|
**/ |
|
108
|
|
|
const BEFORE_ACCOUNT_UPDATE = '\terabytesoft\events\user\FormEvent::BEFORE_ACCOUNT_UPDATE'; |
|
109
|
|
|
|
|
110
|
|
|
/** |
|
111
|
|
|
* event is triggered after updating user's account settings |
|
112
|
|
|
* triggered with \terabytesoft\events\user\FormEvent |
|
113
|
|
|
**/ |
|
114
|
|
|
const AFTER_ACCOUNT_UPDATE = '\terabytesoft\events\user\FormEvent::AFTER_ACCOUNT_UPDATE'; |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* @var object $form |
|
118
|
|
|
*/ |
|
119
|
|
|
private $form; |
|
120
|
|
|
|
|
121
|
|
|
/** |
|
122
|
|
|
* getForm |
|
123
|
|
|
*/ |
|
124
|
6 |
|
public function getForm(): object |
|
125
|
|
|
{ |
|
126
|
6 |
|
return $this->form; |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
/** |
|
130
|
|
|
* setForm |
|
131
|
|
|
*/ |
|
132
|
6 |
|
public function setForm(object $form): void |
|
133
|
|
|
{ |
|
134
|
6 |
|
$this->form = $form; |
|
135
|
6 |
|
} |
|
136
|
|
|
} |
|
137
|
|
|
|