Conditions | 4 |
Paths | 4 |
Total Lines | 23 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function run() |
||
26 | { |
||
27 | $passwordResetRequestFormClass = Yii::$app->get('auth')->modelMap['passwordResetRequestForm']['class']; |
||
28 | $model = new $passwordResetRequestFormClass($this->scenario); |
||
29 | |||
30 | $isLoad = $model->load(Yii::$app->request->post()); |
||
31 | |||
32 | Event::trigger(self::class, static::EVENT_BEFORE_REQUEST_PASSWORD_RESET, new RequestPasswordResetEvent($this, $model, ['sender' => $this])); |
||
33 | |||
34 | if ($isLoad) { |
||
35 | if ($model->validate()) { |
||
36 | if ($model->resetPassword()) { |
||
37 | Event::trigger(self::class, static::EVENT_AFTER_REQUEST_PASSWORD_RESET, new RequestPasswordResetEvent($this, $model, ['sender' => $this])); |
||
38 | } else { |
||
39 | Event::trigger(self::class, static::EVENT_ERROR_REQUEST_PASSWORD_RESET, new RequestPasswordResetEvent($this, $model, ['sender' => $this])); |
||
40 | } |
||
41 | } |
||
42 | } |
||
43 | |||
44 | return $this->controller->render($this->view, [ |
||
45 | 'model' => $model, |
||
46 | ]); |
||
47 | } |
||
48 | } |
||
49 |