1 | <?php |
||
3 | class ActivationForm extends CFormModel |
||
|
|||
4 | { |
||
5 | /** |
||
6 | * The password provided by the user |
||
7 | * @var string $password |
||
8 | */ |
||
9 | public $password; |
||
10 | |||
11 | /** |
||
12 | * The activation key originally sent to the user's email |
||
13 | * @var string $activationKey |
||
14 | */ |
||
15 | public $activationKey; |
||
16 | |||
17 | /** |
||
18 | * The user model |
||
19 | * @var Users $_user |
||
20 | */ |
||
21 | private $_user; |
||
22 | |||
23 | /** |
||
24 | * The activation key metadata model. This is loaded to ensure it gets cleaned up properly |
||
25 | * @var UserMetadata $_meta |
||
26 | */ |
||
27 | private $_meta; |
||
28 | |||
29 | /** |
||
30 | * Validation rules |
||
31 | * @return array |
||
32 | */ |
||
33 | public function rules() |
||
42 | |||
43 | /** |
||
44 | * Attribute labels |
||
45 | * @return array |
||
46 | */ |
||
47 | public function attributeLabels() |
||
54 | |||
55 | /** |
||
56 | * Validates that the activation key belongs to a user and is valid |
||
57 | * @param array $attributes |
||
58 | * @param array $params |
||
59 | * return array |
||
60 | */ |
||
61 | public function validateKey($attributes=array(), $params=array()) |
||
73 | |||
74 | /** |
||
75 | * Ensures that the password entered matches the one provided during registration |
||
76 | * @param array $attributes |
||
77 | * @param array $params |
||
78 | * return array |
||
79 | */ |
||
80 | public function validateUserPassword($attributes, $params) |
||
98 | |||
99 | /** |
||
100 | * Makes the user an active user in the database, and deletes their activation token |
||
101 | * @return boolean |
||
102 | */ |
||
103 | public function save() |
||
118 | } |
||
119 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.