Issue 13812: Public groups with manual request approval

This commit is contained in:
Michael 2024-04-07 16:32:50 +00:00
parent 02d8cc2f71
commit 69fc2c04e4
18 changed files with 179 additions and 157 deletions

View file

@ -314,7 +314,7 @@ class Account extends BaseSettings
$page_flags = User::PAGE_FLAGS_SOAPBOX;
} elseif ($account_type == User::ACCOUNT_TYPE_NEWS && $page_flags != User::PAGE_FLAGS_SOAPBOX) {
$page_flags = User::PAGE_FLAGS_SOAPBOX;
} elseif ($account_type == User::ACCOUNT_TYPE_COMMUNITY && !in_array($page_flags, [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])) {
} elseif ($account_type == User::ACCOUNT_TYPE_COMMUNITY && !in_array($page_flags, [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP, User::PAGE_FLAGS_COMM_MAN])) {
$page_flags = User::PAGE_FLAGS_COMMUNITY;
} elseif ($account_type == User::ACCOUNT_TYPE_RELAY && $page_flags != User::PAGE_FLAGS_SOAPBOX) {
$page_flags = User::PAGE_FLAGS_SOAPBOX;
@ -419,7 +419,7 @@ class Account extends BaseSettings
// Set the account type to "Community" when the page is a community page but the account type doesn't fit
// This is only happening on the first visit after the update
if (
in_array($user['page-flags'], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])
in_array($user['page-flags'], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP, User::PAGE_FLAGS_COMM_MAN])
&& $user['account-type'] != User::ACCOUNT_TYPE_COMMUNITY
) {
$user['account-type'] = User::ACCOUNT_TYPE_COMMUNITY;
@ -498,6 +498,13 @@ class Account extends BaseSettings
DI::l10n()->t('Automatically approves all contact requests.'),
$user['page-flags'] == User::PAGE_FLAGS_COMMUNITY
],
'$page_community_manually' => [
'page-flags',
DI::l10n()->t('Public Group - Restricted'),
User::PAGE_FLAGS_COMM_MAN,
DI::l10n()->t('Contact requests have to be manually approved.'),
$user['page-flags'] == User::PAGE_FLAGS_COMM_MAN
],
'$page_freelove' => [
'page-flags',
DI::l10n()->t('Automatic Friend Page'),