@@ -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 | ], |
@@ -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('user', '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 | /** |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | if ($user->load(Yii::$app->request->post()) && $user->createUser()) { |
| 130 | 130 | $account->connect($user); |
| 131 | - Yii::$app->user->login($user, Yii::$app->settings->get('rememberFor','user')); |
|
| 131 | + Yii::$app->user->login($user, Yii::$app->settings->get('rememberFor', 'user')); |
|
| 132 | 132 | return $this->goBack(); |
| 133 | 133 | } |
| 134 | 134 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | public function actionConfirm($id, $code) |
| 150 | 150 | { |
| 151 | 151 | $user = User::findOne($id); |
| 152 | - if ($user === null || Yii::$app->settings->get('enableConfirmation','user') == false) { |
|
| 152 | + if ($user === null || Yii::$app->settings->get('enableConfirmation', 'user') == false) { |
|
| 153 | 153 | return $this->goBack(); |
| 154 | 154 | } |
| 155 | 155 | $user->attemptConfirmation($code); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | public function actionResend() |
| 165 | 165 | { |
| 166 | - if (Yii::$app->settings->get('enableConfirmation','user') == false) { |
|
| 166 | + if (Yii::$app->settings->get('enableConfirmation', 'user') == false) { |
|
| 167 | 167 | return $this->goBack(); |
| 168 | 168 | } |
| 169 | 169 | /** @var ResendForm $model */ |