@@ -4,7 +4,7 @@ |
||
| 4 | 4 | /* @var $this yii\web\View */ |
| 5 | 5 | /* @var $user mdm\admin\models\User */ |
| 6 | 6 | |
| 7 | -$resetLink = Url::to(['user/reset-password','token'=>$user->password_reset_token], true); |
|
| 7 | +$resetLink = Url::to(['user/reset-password', 'token'=>$user->password_reset_token], true); |
|
| 8 | 8 | ?> |
| 9 | 9 | Hello <?= $user->username ?>, |
| 10 | 10 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | 'attribute' => 'name', |
| 31 | 31 | 'label' => Yii::t('rbac-admin', 'Name'), |
| 32 | 32 | ], |
| 33 | - ['class' => 'yii\grid\ActionColumn',], |
|
| 33 | + ['class' => 'yii\grid\ActionColumn', ], |
|
| 34 | 34 | ], |
| 35 | 35 | ]); |
| 36 | 36 | ?> |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | echo Nav::widget([ |
| 39 | 39 | 'options' => ['class' => 'nav navbar-nav navbar-right'], |
| 40 | 40 | 'items' => $this->context->module->navbar, |
| 41 | - ]); |
|
| 41 | + ]); |
|
| 42 | 42 | NavBar::end(); |
| 43 | 43 | ?> |
| 44 | 44 | |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | /** |
| 112 | 112 | * Find role |
| 113 | 113 | * @param string $id |
| 114 | - * @return null|\self |
|
| 114 | + * @return AuthItem|null |
|
| 115 | 115 | */ |
| 116 | 116 | public static function find($id) |
| 117 | 117 | { |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | return [ |
| 62 | 62 | [['ruleName'], 'checkRule'], |
| 63 | 63 | [['name', 'type'], 'required'], |
| 64 | - [['name'], 'unique', 'when' => function () { |
|
| 64 | + [['name'], 'unique', 'when' => function() { |
|
| 65 | 65 | return $this->isNewRecord || ($this->_item->name != $this->name); |
| 66 | 66 | }], |
| 67 | 67 | [['type'], 'integer'], |
@@ -49,9 +49,9 @@ |
||
| 49 | 49 | |
| 50 | 50 | if ($user->save()) { |
| 51 | 51 | return Yii::$app->mailer->compose(['html' => 'passwordResetToken-html', 'text' => 'passwordResetToken-text'], ['user' => $user]) |
| 52 | - ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name . ' robot']) |
|
| 52 | + ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name.' robot']) |
|
| 53 | 53 | ->setTo($this->email) |
| 54 | - ->setSubject('Password reset for ' . Yii::$app->name) |
|
| 54 | + ->setSubject('Password reset for '.Yii::$app->name) |
|
| 55 | 55 | ->send(); |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | $expire = Yii::$app->params['user.passwordResetTokenExpire']; |
| 119 | 119 | $parts = explode('_', $token); |
| 120 | - $timestamp = (int) end($parts); |
|
| 120 | + $timestamp = (int)end($parts); |
|
| 121 | 121 | return $timestamp + $expire >= time(); |
| 122 | 122 | } |
| 123 | 123 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | public function generatePasswordResetToken() |
| 181 | 181 | { |
| 182 | - $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time(); |
|
| 182 | + $this->password_reset_token = Yii::$app->security->generateRandomString().'_'.time(); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | /** |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | public function getViewPath() |
| 151 | 151 | { |
| 152 | - return $this->module->getViewPath() . DIRECTORY_SEPARATOR . 'item'; |
|
| 152 | + return $this->module->getViewPath().DIRECTORY_SEPARATOR.'item'; |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | public function labels() |
| 160 | 160 | { |
| 161 | - throw new NotSupportedException(get_class($this) . ' does not support labels().'); |
|
| 161 | + throw new NotSupportedException(get_class($this).' does not support labels().'); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * Lists all AuthItem models. |
| 45 | - * @return mixed |
|
| 45 | + * @return string |
|
| 46 | 46 | */ |
| 47 | 47 | public function actionIndex() |
| 48 | 48 | { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | /** |
| 59 | 59 | * Displays a single AuthItem model. |
| 60 | 60 | * @param string $id |
| 61 | - * @return mixed |
|
| 61 | + * @return string |
|
| 62 | 62 | */ |
| 63 | 63 | public function actionView($id) |
| 64 | 64 | { |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * Deletes an existing AuthItem model. |
| 104 | 104 | * If deletion is successful, the browser will be redirected to the 'index' page. |
| 105 | 105 | * @param string $id |
| 106 | - * @return mixed |
|
| 106 | + * @return \yii\web\Response |
|
| 107 | 107 | */ |
| 108 | 108 | public function actionDelete($id) |
| 109 | 109 | { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | while (($pos = strrpos($r, '/')) > 0) { |
| 122 | 122 | $r = substr($r, 0, $pos); |
| 123 | - if ($user->can($r . '/*', $params)) { |
|
| 123 | + if ($user->can($r.'/*', $params)) { |
|
| 124 | 124 | return true; |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | while (($pos = strrpos($r, '/')) > 0) { |
| 134 | 134 | $r = substr($r, 0, $pos); |
| 135 | - if (isset($routes[$r . '/*'])) { |
|
| 135 | + if (isset($routes[$r.'/*'])) { |
|
| 136 | 136 | return true; |
| 137 | 137 | } |
| 138 | 138 | } |
@@ -143,15 +143,15 @@ discard block |
||
| 143 | 143 | protected static function normalizeRoute($route) |
| 144 | 144 | { |
| 145 | 145 | if ($route === '') { |
| 146 | - return '/' . Yii::$app->controller->getRoute(); |
|
| 146 | + return '/'.Yii::$app->controller->getRoute(); |
|
| 147 | 147 | } elseif (strncmp($route, '/', 1) === 0) { |
| 148 | 148 | return $route; |
| 149 | 149 | } elseif (strpos($route, '/') === false) { |
| 150 | - return '/' . Yii::$app->controller->getUniqueId() . '/' . $route; |
|
| 150 | + return '/'.Yii::$app->controller->getUniqueId().'/'.$route; |
|
| 151 | 151 | } elseif (($mid = Yii::$app->controller->module->getUniqueId()) !== '') { |
| 152 | - return '/' . $mid . '/' . $route; |
|
| 152 | + return '/'.$mid.'/'.$route; |
|
| 153 | 153 | } |
| 154 | - return '/' . $route; |
|
| 154 | + return '/'.$route; |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | return implode(' ', $result); |
| 222 | 222 | } |
| 223 | - return preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches) use ($user) { |
|
| 223 | + return preg_replace_callback('/\\{([\w\-\/]+)\\}/', function($matches) use ($user) { |
|
| 224 | 224 | return static::checkRoute($matches[1], [], $user) ? "{{$matches[1]}}" : ''; |
| 225 | 225 | }, $buttons); |
| 226 | 226 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | $this->params['breadcrumbs'][] = ['label' => Yii::t('rbac-admin', 'Users'), 'url' => ['index']]; |
| 12 | 12 | $this->params['breadcrumbs'][] = $this->title; |
| 13 | 13 | |
| 14 | -$controllerId = $this->context->uniqueId . '/'; |
|
| 14 | +$controllerId = $this->context->uniqueId.'/'; |
|
| 15 | 15 | ?> |
| 16 | 16 | <div class="user-view"> |
| 17 | 17 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | <p> |
| 21 | 21 | <?php |
| 22 | - if ($model->status == 0 && Helper::checkRoute($controllerId . 'activate')) { |
|
| 22 | + if ($model->status == 0 && Helper::checkRoute($controllerId.'activate')) { |
|
| 23 | 23 | echo Html::a(Yii::t('rbac-admin', 'Activate'), ['activate', 'id' => $model->id], [ |
| 24 | 24 | 'class' => 'btn btn-primary', |
| 25 | 25 | 'data' => [ |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | } |
| 31 | 31 | ?> |
| 32 | 32 | <?php |
| 33 | - if (Helper::checkRoute($controllerId . 'delete')) { |
|
| 33 | + if (Helper::checkRoute($controllerId.'delete')) { |
|
| 34 | 34 | echo Html::a(Yii::t('rbac-admin', 'Delete'), ['delete', 'id' => $model->id], [ |
| 35 | 35 | 'class' => 'btn btn-danger', |
| 36 | 36 | 'data' => [ |