mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 17:31:49 +08:00 
			
		
		
		
	update: language more
This commit is contained in:
		| @@ -24,7 +24,7 @@ class AuthController extends Controller | ||||
|             $recaptcha = new ReCaptcha(config('v2board.recaptcha_key')); | ||||
|             $recaptchaResp = $recaptcha->verify($request->input('recaptcha_data')); | ||||
|             if (!$recaptchaResp->isSuccess()) { | ||||
|                 abort(500, '验证码有误'); | ||||
|                 abort(500, __('Invalid code is incorrect')); | ||||
|             } | ||||
|         } | ||||
|         if ((int)config('v2board.email_whitelist_enable', 0)) { | ||||
| @@ -32,36 +32,36 @@ class AuthController extends Controller | ||||
|                 $request->input('email'), | ||||
|                 config('v2board.email_whitelist_suffix', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT)) | ||||
|             ) { | ||||
|                 abort(500, '邮箱后缀不处于白名单中'); | ||||
|                 abort(500, __('Email suffix is not in the Whitelist')); | ||||
|             } | ||||
|         } | ||||
|         if ((int)config('v2board.email_gmail_limit_enable', 0)) { | ||||
|             $prefix = explode('@', $request->input('email'))[0]; | ||||
|             if (strpos($prefix, '.') !== false || strpos($prefix, '+') !== false) { | ||||
|                 abort(500, '不支持Gmail别名邮箱'); | ||||
|                 abort(500, __('Gmail alias is not supported')); | ||||
|             } | ||||
|         } | ||||
|         if ((int)config('v2board.stop_register', 0)) { | ||||
|             abort(500, '本站已关闭注册'); | ||||
|             abort(500, __('Registration has closed')); | ||||
|         } | ||||
|         if ((int)config('v2board.invite_force', 0)) { | ||||
|             if (empty($request->input('invite_code'))) { | ||||
|                 abort(500, '必须使用邀请码才可以注册'); | ||||
|                 abort(500, __('You must use the invitation code to register')); | ||||
|             } | ||||
|         } | ||||
|         if ((int)config('v2board.email_verify', 0)) { | ||||
|             if (empty($request->input('email_code'))) { | ||||
|                 abort(500, '邮箱验证码不能为空'); | ||||
|                 abort(500, __('Email verification code cannot be empty')); | ||||
|             } | ||||
|             if (Cache::get(CacheKey::get('EMAIL_VERIFY_CODE', $request->input('email'))) !== $request->input('email_code')) { | ||||
|                 abort(500, '邮箱验证码有误'); | ||||
|                 abort(500, __('Incorrect email verification code')); | ||||
|             } | ||||
|         } | ||||
|         $email = $request->input('email'); | ||||
|         $password = $request->input('password'); | ||||
|         $exist = User::where('email', $email)->first(); | ||||
|         if ($exist) { | ||||
|             abort(500, '邮箱已存在系统中'); | ||||
|             abort(500, __('Email already exists')); | ||||
|         } | ||||
|         $user = new User(); | ||||
|         $user->email = $email; | ||||
| @@ -74,7 +74,7 @@ class AuthController extends Controller | ||||
|                 ->first(); | ||||
|             if (!$inviteCode) { | ||||
|                 if ((int)config('v2board.invite_force', 0)) { | ||||
|                     abort(500, '邀请码无效'); | ||||
|                     abort(500, __('Invalid invitation code')); | ||||
|                 } | ||||
|             } else { | ||||
|                 $user->invite_user_id = $inviteCode->user_id ? $inviteCode->user_id : null; | ||||
| @@ -97,7 +97,7 @@ class AuthController extends Controller | ||||
|         } | ||||
|  | ||||
|         if (!$user->save()) { | ||||
|             abort(500, '注册失败'); | ||||
|             abort(500, __('Register failed')); | ||||
|         } | ||||
|         if ((int)config('v2board.email_verify', 0)) { | ||||
|             Cache::forget(CacheKey::get('EMAIL_VERIFY_CODE', $request->input('email'))); | ||||
| @@ -116,18 +116,18 @@ class AuthController extends Controller | ||||
|  | ||||
|         $user = User::where('email', $email)->first(); | ||||
|         if (!$user) { | ||||
|             abort(500, '用户名或密码错误'); | ||||
|             abort(500, __('Incorrect email or password')); | ||||
|         } | ||||
|         if (!Helper::multiPasswordVerify( | ||||
|             $user->password_algo, | ||||
|             $password, | ||||
|             $user->password) | ||||
|         ) { | ||||
|             abort(500, '用户名或密码错误'); | ||||
|             abort(500, __('Incorrect email or password')); | ||||
|         } | ||||
|  | ||||
|         if ($user->banned) { | ||||
|             abort(500, '该账户已被停止使用'); | ||||
|             abort(500, __('Your account has been suspended')); | ||||
|         } | ||||
|  | ||||
|         $data = [ | ||||
| @@ -165,14 +165,14 @@ class AuthController extends Controller | ||||
|             $key =  CacheKey::get('TEMP_TOKEN', $request->input('verify')); | ||||
|             $userId = Cache::get($key); | ||||
|             if (!$userId) { | ||||
|                 abort(500, '令牌有误'); | ||||
|                 abort(500, __('Token error')); | ||||
|             } | ||||
|             $user = User::find($userId); | ||||
|             if (!$user) { | ||||
|                 abort(500, '用户不存在'); | ||||
|                 abort(500, __('The user does not ')); | ||||
|             } | ||||
|             if ($user->banned) { | ||||
|                 abort(500, '该账户已被停止使用'); | ||||
|                 abort(500, __('Your account has been suspended')); | ||||
|             } | ||||
|             $request->session()->put('email', $user->email); | ||||
|             $request->session()->put('id', $user->id); | ||||
| @@ -190,7 +190,7 @@ class AuthController extends Controller | ||||
|     { | ||||
|         $user = User::where('token', $request->input('token'))->first(); | ||||
|         if (!$user) { | ||||
|             abort(500, '令牌有误'); | ||||
|             abort(500, __('Token error')); | ||||
|         } | ||||
|  | ||||
|         $code = Helper::guid(); | ||||
| @@ -208,7 +208,7 @@ class AuthController extends Controller | ||||
|             ->where('password', $authData[1]) | ||||
|             ->first(); | ||||
|         if (!$user) { | ||||
|             abort(500, '令牌有误'); | ||||
|             abort(500, __('Token error')); | ||||
|         } | ||||
|  | ||||
|         $code = Helper::guid(); | ||||
| @@ -241,16 +241,16 @@ class AuthController extends Controller | ||||
|     public function forget(AuthForget $request) | ||||
|     { | ||||
|         if (Cache::get(CacheKey::get('EMAIL_VERIFY_CODE', $request->input('email'))) !== $request->input('email_code')) { | ||||
|             abort(500, '邮箱验证码有误'); | ||||
|             abort(500, __('Incorrect email verification code')); | ||||
|         } | ||||
|         $user = User::where('email', $request->input('email'))->first(); | ||||
|         if (!$user) { | ||||
|             abort(500, '该邮箱不存在系统中'); | ||||
|             abort(500, __('This email is not registered in the system')); | ||||
|         } | ||||
|         $user->password = password_hash($request->input('password'), PASSWORD_DEFAULT); | ||||
|         $user->password_algo = NULL; | ||||
|         if (!$user->save()) { | ||||
|             abort(500, '重置失败'); | ||||
|             abort(500, __('Reset failed')); | ||||
|         } | ||||
|         Cache::forget(CacheKey::get('EMAIL_VERIFY_CODE', $request->input('email'))); | ||||
|         return response([ | ||||
|   | ||||
| @@ -47,15 +47,15 @@ class CommController extends Controller | ||||
|             $recaptcha = new ReCaptcha(config('v2board.recaptcha_key')); | ||||
|             $recaptchaResp = $recaptcha->verify($request->input('recaptcha_data')); | ||||
|             if (!$recaptchaResp->isSuccess()) { | ||||
|                 abort(500, '验证码有误'); | ||||
|                 abort(500, __('Invalid code is incorrect')); | ||||
|             } | ||||
|         } | ||||
|         $email = $request->input('email'); | ||||
|         if (Cache::get(CacheKey::get('LAST_SEND_EMAIL_VERIFY_TIMESTAMP', $email))) { | ||||
|             abort(500, '验证码已发送,请过一会再请求'); | ||||
|             abort(500, __('Email verification code has been sent, please request again later')); | ||||
|         } | ||||
|         $code = rand(100000, 999999); | ||||
|         $subject = config('v2board.app_name', 'V2Board') . '邮箱验证码'; | ||||
|         $subject = config('v2board.app_name', 'V2Board') . __('Email verification code'); | ||||
|  | ||||
|         SendEmailJob::dispatch([ | ||||
|             'email' => $email, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user