1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace terabytesoft\events\user; |
4
|
|
|
|
5
|
|
|
use yii\base\Event; |
6
|
|
|
use yii\base\Model; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class ResetPasswordEvent |
10
|
|
|
* |
11
|
|
|
* resetPassword events applications |
12
|
|
|
*/ |
13
|
|
|
class ResetPasswordEvent extends Event |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* event is triggered before validating recovery token |
17
|
|
|
* triggered with \terabytesoft\events\user\ResetPasswordEvent. May not have $form property set |
18
|
|
|
*/ |
19
|
|
|
const BEFORE_TOKEN_VALIDATE = '\terabytesoft\events\user\ResetPasswordEvent::BEFORE_TOKEN_VALIDATE'; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* event is triggered after validating recovery token |
23
|
|
|
* triggered with \terabytesoft\events\user\ResetPasswordEvent. May not have $form property set |
24
|
|
|
*/ |
25
|
|
|
const AFTER_TOKEN_VALIDATE = '\terabytesoft\events\user\ResetPasswordEvent::AFTER_TOKEN_VALIDATE'; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* event is triggered token fails recovery token |
29
|
|
|
* triggered with \terabytesoft\events\user\ResetPasswordEvent. May not have $form property set |
30
|
|
|
*/ |
31
|
|
|
const TOKEN_FAILS = '\terabytesoft\events\user\ResetPasswordEvent::TOKEN_FAILS'; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* event is triggered before resetting password |
35
|
|
|
* triggered with \terabytesoft\events\user\ResetPasswordEvent |
36
|
|
|
*/ |
37
|
|
|
const BEFORE_RESET = '\terabytesoft\events\user\ResetPasswordEvent::BEFORE_RESET'; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* event is triggered after resetting password |
41
|
|
|
* triggered with \terabytesoft\events\user\ResetPasswordEvent |
42
|
|
|
*/ |
43
|
|
|
const AFTER_RESET = '\terabytesoft\events\user\ResetPasswordEvent::AFTER_RESET'; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* event is triggered fails resetting password |
47
|
|
|
* triggered with \terabytesoft\events\user\ResetPasswordEvent |
48
|
|
|
*/ |
49
|
|
|
const RESET_FAILS = '\terabytesoft\events\user\ResetPasswordEvent::RESET_FAILS'; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* event is triggered resetting password module disable |
53
|
|
|
* triggered with \terabytesoft\events\user\ResetPasswordEvent |
54
|
|
|
*/ |
55
|
|
|
const RESET_MODULE_DISABLE = '\terabytesoft\events\user\ResetPasswordEvent::RESET_MODULE_DISABLE'; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var object $form |
59
|
|
|
*/ |
60
|
|
|
private $form; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* getForm |
64
|
|
|
*/ |
65
|
1 |
|
public function getForm(): object |
66
|
|
|
{ |
67
|
1 |
|
return $this->form; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @param Model $form |
72
|
|
|
*/ |
73
|
1 |
|
public function setForm(object $form): void |
74
|
|
|
{ |
75
|
1 |
|
$this->form = $form; |
76
|
1 |
|
} |
77
|
|
|
} |
78
|
|
|
|