| Conditions | 5 |
| Paths | 6 |
| Total Lines | 25 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 7 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 6 | public function actionIndex() |
||
| 7 | { |
||
| 8 | Yii::app()->session->open(); |
||
| 9 | if (isset(Yii::app()->session['uid'])) { |
||
| 10 | $this->redirect(['/site']); |
||
| 11 | } |
||
| 12 | $model=new Account('login'); |
||
| 13 | |||
| 14 | // collect user input data |
||
| 15 | if (isset($_POST['Account'])) { |
||
| 16 | $model->attributes=$_POST['Account']; |
||
| 17 | // validate user input and redirect to the previous page if valid |
||
| 18 | if ($model->validate() && $model->login()) { |
||
| 19 | $this->incrementLoginDays(Yii::app()->session['uid']); |
||
| 20 | |||
| 21 | $b = new CommonBadgeActivator; |
||
| 22 | $b->uid = Yii::app()->session['uid']; |
||
| 23 | $b->triggerLoginDays(); |
||
| 24 | |||
| 25 | $this->redirect('/site'); |
||
| 26 | } |
||
| 27 | } |
||
| 28 | // display the login form |
||
| 29 | $this->render('/account/login', ['model'=>$model]); |
||
| 30 | } |
||
| 31 | |||
| 51 |
This check looks for improperly formatted assignments.
Every assignment must have exactly one space before and one space after the equals operator.
To illustrate:
will have no issues, while
will report issues in lines 1 and 2.