diff --git a/app/Repositories/SettingRepository.php b/app/Repositories/SettingRepository.php index c483fbc1..fe92bc93 100644 --- a/app/Repositories/SettingRepository.php +++ b/app/Repositories/SettingRepository.php @@ -52,6 +52,7 @@ class SettingRepository extends BaseRepository do_log("sql: $sql, result: $result"); NexusDB::cache_del("nexus_settings_in_laravel"); NexusDB::cache_del("nexus_settings_in_nexus"); + NexusDB::cache_del('setting_protected_forum'); return $result; } diff --git a/include/globalfunctions.php b/include/globalfunctions.php index 8d9d4d93..2206ffa4 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -1025,6 +1025,7 @@ function clear_setting_cache() do_log("clear_setting_cache"); \Nexus\Database\NexusDB::cache_del('nexus_settings_in_laravel'); \Nexus\Database\NexusDB::cache_del('nexus_settings_in_nexus'); + \Nexus\Database\NexusDB::cache_del('setting_protected_forum'); $channel = nexus_env("CHANNEL_NAME_SETTING"); if (!empty($channel)) { \Nexus\Database\NexusDB::redis()->publish($channel, "update"); diff --git a/lang/chs/lang_takeinvite.php b/lang/chs/lang_takeinvite.php index 605dddc9..c317024b 100644 --- a/lang/chs/lang_takeinvite.php +++ b/lang/chs/lang_takeinvite.php @@ -3,6 +3,7 @@ $lang_takeinvite = array ( 'head_invitation_failed' => "邀请失败!", + 'std_username_too_long' => "对不起,用户名过长(至多12个字符)", 'std_must_enter_email' => "你必须输入邮箱地址!", 'std_invalid_email_address' => "无效的邮箱地址!", 'std_must_enter_personal_message' => "请添加信件中的私人内容。", diff --git a/lang/cht/lang_takeinvite.php b/lang/cht/lang_takeinvite.php index e4c2e8f3..b5e13c59 100644 --- a/lang/cht/lang_takeinvite.php +++ b/lang/cht/lang_takeinvite.php @@ -3,6 +3,7 @@ $lang_takeinvite = array ( 'head_invitation_failed' => "邀請失敗!", + 'std_username_too_long' => "對不起,用戶名過長(至多12個字元)", 'std_must_enter_email' => "你必須輸入郵箱位址!", 'std_invalid_email_address' => "無效的郵箱地址!", 'std_must_enter_personal_message' => "請添加信件中的私人內容。", diff --git a/lang/en/lang_takeinvite.php b/lang/en/lang_takeinvite.php index ddbbf75c..03b6a0cc 100644 --- a/lang/en/lang_takeinvite.php +++ b/lang/en/lang_takeinvite.php @@ -3,6 +3,7 @@ $lang_takeinvite = array ( 'head_invitation_failed' => "Invitation failed!", + 'std_username_too_long' => "Sorry, the username is too long (up to 12 characters)", 'std_must_enter_email' => "You must enter an email address!", 'std_invalid_email_address' => "Invalid email address!", 'std_must_enter_personal_message' => "Please add a personal message.", diff --git a/public/takeinvite.php b/public/takeinvite.php index f65a1e41..8642839a 100644 --- a/public/takeinvite.php +++ b/public/takeinvite.php @@ -21,6 +21,8 @@ $email = unesc(htmlspecialchars(trim($_POST["email"]))); $email = safe_email($email); $preRegisterUsername = $_POST['pre_register_username'] ?? ''; $isPreRegisterEmailAndUsername = get_setting("system.is_invite_pre_email_and_username") == "yes"; +if (strlen($preRegisterUsername) > 12) + bark($lang_takeinvite['std_username_too_long']); if (!$email) bark($lang_takeinvite['std_must_enter_email']); if (!check_email($email))