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

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]));
}
}