Skip to content

Commit

Permalink
check pre register username
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Aug 28, 2023
1 parent f6e35d7 commit 8776f70
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/constants.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.7');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-08-28');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-08-29');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
Expand Down
3 changes: 3 additions & 0 deletions public/takeinvite.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ function bark($msg) {
if (empty($preRegisterUsername)) {
bark(nexus_trans("invite.require_pre_register_username"));
}
if (!validusername($preRegisterUsername)) {
bark(nexus_trans("user.username_invalid", ["username" => $preRegisterUsername]));
}
$exists = \App\Models\User::query()->where('username', $preRegisterUsername)->exists();
if ($exists) {
bark(nexus_trans("user.username_already_exists", ["username" => $preRegisterUsername]));
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@
],
],
'username_already_exists' => 'Username::username already exists',
'username_invalid' => 'Username::username invalid',
];
1 change: 1 addition & 0 deletions resources/lang/zh_CN/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@
],
],
'username_already_exists' => '用户名::username 已经存在',
'username_invalid' => '用户名::username 无效',
];
1 change: 1 addition & 0 deletions resources/lang/zh_TW/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@
],
],
'username_already_exists' => '用戶名::username 已經存在',
'username_invalid' => '用戶名::username 無效',
];

0 comments on commit 8776f70

Please sign in to comment.