| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function run() |
||
| 26 | { |
||
| 27 | $loginFormClass = Yii::$app->get('auth')->modelMap['loginForm']['class']; |
||
| 28 | $model = new $loginFormClass($this->scenario); |
||
| 29 | |||
| 30 | $isLoad = $model->load(Yii::$app->request->post()); |
||
| 31 | |||
| 32 | Event::trigger(self::class, static::EVENT_BEFORE_LOGIN, new LoginEvent($this, $model, ['sender' => $this])); |
||
| 33 | |||
| 34 | if ($isLoad) { |
||
| 35 | if ($model->login()) { |
||
| 36 | Event::trigger(self::class, static::EVENT_AFTER_LOGIN, new LoginEvent($this, $model, ['sender' => $this])); |
||
| 37 | } else { |
||
| 38 | Event::trigger(self::class, static::EVENT_ERROR_LOGIN, new LoginEvent($this, $model, ['sender' => $this])); |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | return $this->controller->render($this->view, [ |
||
| 43 | 'model' => $model, |
||
| 44 | ]); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |