@@ -46,6 +46,9 @@ |
||
46 | 46 | ]); |
47 | 47 | } |
48 | 48 | |
49 | + /** |
|
50 | + * @param string $name |
|
51 | + */ |
|
49 | 52 | public function trigger($name, Event $event = null) |
50 | 53 | { |
51 | 54 | Yii::$app->trigger(sprintf('yiicod.auth.actions.webUser.ResetPasswordAction.%s', $name), $event); |
@@ -86,9 +86,9 @@ |
||
86 | 86 | |
87 | 87 | Yii::$app->mailer->viewPath = '@yiicod/yii2-auth/mail'; |
88 | 88 | Yii::$app->mailer->compose('passwordResetToken', ['action' => $event->action, 'user' => $event->params['model']->findUser()]) |
89 | - ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name . ' robot']) |
|
89 | + ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name.' robot']) |
|
90 | 90 | ->setTo($event->params['model']->email) |
91 | - ->setSubject('Password reset for ' . Yii::$app->name); |
|
91 | + ->setSubject('Password reset for '.Yii::$app->name); |
|
92 | 92 | |
93 | 93 | Yii::$app->getSession()->setFlash('success', 'Check your email for further instructions.'); |
94 | 94 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | public function bootstrap($qpp) |
20 | 20 | { |
21 | 21 | //Merge main extension config with local extension config |
22 | - $config = include(dirname(__FILE__) . '/config/main.php'); |
|
22 | + $config = include(dirname(__FILE__).'/config/main.php'); |
|
23 | 23 | foreach ($config as $key => $value) { |
24 | 24 | if (is_array($value)) { |
25 | 25 | $this->{$key} = ArrayHelper::merge($value, $this->{$key}); |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | - Yii::setAlias('@yiicod', realpath(dirname(__FILE__) . '/..')); |
|
31 | + Yii::setAlias('@yiicod', realpath(dirname(__FILE__).'/..')); |
|
32 | 32 | // Namespace for migration |
33 | - Yii::setAlias('@yiicod_auth_migrations', realpath(dirname(__FILE__) . '/migrations')); |
|
33 | + Yii::setAlias('@yiicod_auth_migrations', realpath(dirname(__FILE__).'/migrations')); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | if (empty($token)) { |
105 | 105 | return false; |
106 | 106 | } |
107 | - $timestamp = (int)substr($token, strrpos($token, '_') + 1); |
|
107 | + $timestamp = (int) substr($token, strrpos($token, '_') + 1); |
|
108 | 108 | $expire = Yii::$app->params['user.passwordResetTokenExpire']; |
109 | 109 | return $timestamp + $expire >= time(); |
110 | 110 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function generatePasswordResetToken() |
182 | 182 | { |
183 | - $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time(); |
|
183 | + $this->password_reset_token = Yii::$app->security->generateRandomString().'_'.time(); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
@@ -14,15 +14,15 @@ |
||
14 | 14 | |
15 | 15 | $this->createTable('{{%user}}', [ |
16 | 16 | 'id' => Schema::TYPE_PK, |
17 | - 'username' => Schema::TYPE_STRING . ' NOT NULL', |
|
18 | - 'email' => Schema::TYPE_STRING . ' NOT NULL', |
|
17 | + 'username' => Schema::TYPE_STRING.' NOT NULL', |
|
18 | + 'email' => Schema::TYPE_STRING.' NOT NULL', |
|
19 | 19 | //'role' => Schema::TYPE_STRING . ' NOT NULL', |
20 | - 'auth_Key' => Schema::TYPE_STRING . '(32) NOT NULL', |
|
21 | - 'password_hash' => Schema::TYPE_STRING . ' NOT NULL', |
|
20 | + 'auth_Key' => Schema::TYPE_STRING.'(32) NOT NULL', |
|
21 | + 'password_hash' => Schema::TYPE_STRING.' NOT NULL', |
|
22 | 22 | 'password_reset_token' => Schema::TYPE_STRING, |
23 | 23 | //'status' => Schema::TYPE_SMALLINT . ' NOT NULL', |
24 | - 'created_date' => Schema::TYPE_DATETIME . ' NOT NULL', |
|
25 | - 'updated_date' => Schema::TYPE_DATETIME . ' NOT NULL', |
|
24 | + 'created_date' => Schema::TYPE_DATETIME.' NOT NULL', |
|
25 | + 'updated_date' => Schema::TYPE_DATETIME.' NOT NULL', |
|
26 | 26 | ], $tableOptions); |
27 | 27 | } |
28 | 28 |