@@ -34,7 +34,7 @@ |
||
| 34 | 34 | parent::init(); |
| 35 | 35 | if ($this->userClassName === null) { |
| 36 | 36 | $this->userClassName = Yii::$app->getUser()->identityClass; |
| 37 | - $this->userClassName ? : 'yuncms\admin\models\Admin'; |
|
| 37 | + $this->userClassName ?: 'yuncms\admin\models\Admin'; |
|
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | Yii::$app->session->setFlash('danger', Yii::t('yuncms', 'Your account has been blocked.')); |
| 133 | 133 | $this->action->successUrl = Url::to(['/user/security/login']); |
| 134 | 134 | } else { |
| 135 | - Yii::$app->user->login($account->user, Yii::$app->settings->get('rememberFor','user')); |
|
| 135 | + Yii::$app->user->login($account->user, Yii::$app->settings->get('rememberFor', 'user')); |
|
| 136 | 136 | $this->action->successUrl = Yii::$app->getUser()->getReturnUrl(); |
| 137 | 137 | } |
| 138 | 138 | } else { |
@@ -53,13 +53,13 @@ discard block |
||
| 53 | 53 | const GENDER_FEMALE = 0b10; |
| 54 | 54 | |
| 55 | 55 | //当前状态 |
| 56 | - const CURRENT_OTHER = 0b0;//其他 |
|
| 57 | - const CURRENT_WORK = 0b1;//正常工作 |
|
| 58 | - const CURRENT_FREELANCE = 0b10;//自由职业者 |
|
| 59 | - const CURRENT_START = 0b11;//创业 |
|
| 60 | - const CURRENT_OUTSOURCE = 0b100;//外包 |
|
| 61 | - const CURRENT_JOB = 0b101;//求职 |
|
| 62 | - const CURRENT_STUDENT = 0b110;//学生 |
|
| 56 | + const CURRENT_OTHER = 0b0; //其他 |
|
| 57 | + const CURRENT_WORK = 0b1; //正常工作 |
|
| 58 | + const CURRENT_FREELANCE = 0b10; //自由职业者 |
|
| 59 | + const CURRENT_START = 0b11; //创业 |
|
| 60 | + const CURRENT_OUTSOURCE = 0b100; //外包 |
|
| 61 | + const CURRENT_JOB = 0b101; //求职 |
|
| 62 | + const CURRENT_STUDENT = 0b110; //学生 |
|
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * @inheritdoc |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | [ |
| 102 | 102 | 'mobile', |
| 103 | 103 | MobileValidator::class, |
| 104 | - 'when' => function ($model) { |
|
| 104 | + 'when' => function($model) { |
|
| 105 | 105 | return $model->country == 'China'; |
| 106 | 106 | } |
| 107 | 107 | ], |
@@ -24,11 +24,11 @@ |
||
| 24 | 24 | 'autocomplete' => 'off', |
| 25 | 25 | 'autofocus' => 'autofocus', |
| 26 | 26 | 'tabindex' => '1', |
| 27 | - 'placeholder' => Yii::t('yuncms','Please enter your email address / phone number.'), |
|
| 27 | + 'placeholder' => Yii::t('yuncms', 'Please enter your email address / phone number.'), |
|
| 28 | 28 | 'required' => true, |
| 29 | 29 | ]]) ?> |
| 30 | 30 | |
| 31 | - <?= $form->field($model, 'password', ['inputOptions' => ['autocomplete' => 'off','required' => true, 'tabindex' => '2']])->passwordInput()->label(Yii::t('yuncms', 'Password') . (Yii::$app->settings->get('enablePasswordRecovery', 'user') ? ' (' . Html::a(Yii::t('yuncms', 'Forgot password?'), ['/user/recovery/request'], ['tabindex' => '5']) . ')' : '')) ?> |
|
| 31 | + <?= $form->field($model, 'password', ['inputOptions' => ['autocomplete' => 'off', 'required' => true, 'tabindex' => '2']])->passwordInput()->label(Yii::t('yuncms', 'Password') . (Yii::$app->settings->get('enablePasswordRecovery', 'user') ? ' (' . Html::a(Yii::t('yuncms', 'Forgot password?'), ['/user/recovery/request'], ['tabindex' => '5']) . ')' : '')) ?> |
|
| 32 | 32 | |
| 33 | 33 | <?= $form->field($model, 'rememberMe', [ |
| 34 | 34 | 'options' => [ |
@@ -45,8 +45,7 @@ |
||
| 45 | 45 | Html::a(Yii::t('yuncms', 'Disconnect'), $auth->createClientUrl($client), [ |
| 46 | 46 | 'class' => 'btn btn-danger btn-block', |
| 47 | 47 | 'data-method' => 'post', |
| 48 | - ]) : |
|
| 49 | - Html::a(Yii::t('yuncms', 'Connect'), $auth->createClientUrl($client), [ |
|
| 48 | + ]) : Html::a(Yii::t('yuncms', 'Connect'), $auth->createClientUrl($client), [ |
|
| 50 | 49 | 'class' => 'btn btn-success btn-block', |
| 51 | 50 | ]) |
| 52 | 51 | ?> |
@@ -59,20 +59,20 @@ discard block |
||
| 59 | 59 | 'emailUnique' => ['email', 'unique', 'targetClass' => User::class, 'message' => Yii::t('yuncms', 'This email address has already been taken')], |
| 60 | 60 | |
| 61 | 61 | // password rules |
| 62 | - 'passwordRequired' => ['password', 'required', 'skipOnEmpty' => Yii::$app->settings->get('enableGeneratingPassword','user')], |
|
| 62 | + 'passwordRequired' => ['password', 'required', 'skipOnEmpty' => Yii::$app->settings->get('enableGeneratingPassword', 'user')], |
|
| 63 | 63 | 'passwordLength' => ['password', 'string', 'min' => 6], |
| 64 | 64 | |
| 65 | 65 | // verifyCode needs to be entered correctly |
| 66 | 66 | 'verifyCodeRequired' => ['verifyCode', 'required', |
| 67 | - 'skipOnEmpty' => !Yii::$app->settings->get('enableRegistrationCaptcha','user')], |
|
| 67 | + 'skipOnEmpty' => !Yii::$app->settings->get('enableRegistrationCaptcha', 'user')], |
|
| 68 | 68 | |
| 69 | 69 | 'verifyCode' => ['verifyCode', 'captcha', |
| 70 | 70 | 'captchaAction' => '/user/registration/captcha', |
| 71 | - 'skipOnEmpty' => !Yii::$app->settings->get('enableRegistrationCaptcha','user') |
|
| 71 | + 'skipOnEmpty' => !Yii::$app->settings->get('enableRegistrationCaptcha', 'user') |
|
| 72 | 72 | ], |
| 73 | 73 | |
| 74 | 74 | 'registrationPolicyRequired' => ['registrationPolicy', 'required', 'skipOnEmpty' => false, 'requiredValue' => true, |
| 75 | - 'message' => Yii::t('yuncms', 'By registering you confirm that you accept the Service Agreement and Privacy Policy.'),], |
|
| 75 | + 'message' => Yii::t('yuncms', 'By registering you confirm that you accept the Service Agreement and Privacy Policy.'), ], |
|
| 76 | 76 | ]; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | return false; |
| 118 | 118 | } |
| 119 | 119 | Yii::$app->session->setFlash('info', Yii::t('yuncms', 'Your account has been created and a message with further instructions has been sent to your email')); |
| 120 | - return Yii::$app->getUser()->login($user, Yii::$app->settings->get('rememberFor','user')); |
|
| 120 | + return Yii::$app->getUser()->login($user, Yii::$app->settings->get('rememberFor', 'user')); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -15,9 +15,12 @@ |
||
| 15 | 15 | </a> |
| 16 | 16 | </li> |
| 17 | 17 | <?php endforeach; ?> |
| 18 | - <?php else: ?> |
|
| 18 | + <?php else { |
|
| 19 | + : ?> |
|
| 19 | 20 | <?= Yii::t('yuncms', 'No popular users') ?> |
| 20 | - <?php endif; ?> |
|
| 21 | + <?php endif; |
|
| 22 | +} |
|
| 23 | +?> |
|
| 21 | 24 | </ul> |
| 22 | 25 | </div> |
| 23 | 26 | </div> |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | <?= Yii::t('yuncms', 'Hello') ?>, |
| 8 | 8 | |
| 9 | 9 | <?= Yii::t('yuncms', 'Your account on {0} has been created.', Yii::$app->name) ?>. |
| 10 | -<?php if (Yii::$app->settings->get('enableGeneratingPassword','user')): ?> |
|
| 10 | +<?php if (Yii::$app->settings->get('enableGeneratingPassword', 'user')): ?> |
|
| 11 | 11 | <?= Yii::t('yuncms', 'We have generated a password for you') ?>: |
| 12 | 12 | <?= $user->password ?> |
| 13 | 13 | <?php endif ?> |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | <p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;"> |
| 15 | 15 | <?= Yii::t('yuncms', 'Your account on {0} has been created.', Yii::$app->name) ?>. |
| 16 | - <?php if ($showPassword || Yii::$app->settings->get('enableGeneratingPassword','user')): ?> |
|
| 16 | + <?php if ($showPassword || Yii::$app->settings->get('enableGeneratingPassword', 'user')): ?> |
|
| 17 | 17 | <?= Yii::t('yuncms', 'We have generated a password for you') ?>: <strong><?= $user->password ?></strong> |
| 18 | 18 | <?php endif ?> |
| 19 | 19 | |