sent invite check pre username if exists

This commit is contained in:
xiaomlove
2023-08-24 03:09:51 +08:00
parent 4c0a9698ec
commit b41a08fd59
4 changed files with 11 additions and 2 deletions
+8 -2
View File
@@ -35,8 +35,14 @@ $body = str_replace("<br />", "<br />", nl2br(trim(strip_tags($_POST["body"]))))
if(!$body)
bark($lang_takeinvite['std_must_enter_personal_message']);
if ($isPreRegisterEmailAndUsername && empty($preRegisterUsername)) {
bark(nexus_trans("invite.require_pre_register_username"));
if ($isPreRegisterEmailAndUsername) {
if (empty($preRegisterUsername)) {
bark(nexus_trans("invite.require_pre_register_username"));
}
$exists = \App\Models\User::query()->where('username', $preRegisterUsername)->exists();
if ($exists) {
bark(nexus_trans("user.username_already_exists", ["username" => $preRegisterUsername]));
}
}
+1
View File
@@ -54,4 +54,5 @@ return [
'body' => 'You had been :action to :new_class, administrator: :operator, reason: :reason.',
],
],
'username_already_exists' => 'Username::username already exists',
];
+1
View File
@@ -54,4 +54,5 @@ return [
'body' => '你被:action为:new_class,管理员::operator, 原因::reason。',
],
],
'username_already_exists' => '用户名::username 已经存在',
];
+1
View File
@@ -54,4 +54,5 @@ return [
'body' => '你被:action為:new_class,管理員::operator, 原因::reason。',
],
],
'username_already_exists' => '用戶名::username 已經存在',
];