- Fixed. The missing controls now appear at:
Plans & Platform > Plans, Prices & Entitlements > Groups Available for each tier. Config > Feature Availability > Groups Enabled as the global master switch.
This commit is contained in:
+19
-3
@@ -6,11 +6,25 @@ sendCorsHeaders();
|
||||
$user = authRequired();
|
||||
$action = $_POST['action'] ?? $_GET['action'] ?? 'list';
|
||||
|
||||
if (!groupsEnabled()) {
|
||||
$planGroupsEnabled = (bool)featureValue($user, 'groups_available', true);
|
||||
if (!groupsAvailableForUser($user)) {
|
||||
$error = groupsEnabled()
|
||||
? 'Private groups are not available on your tier'
|
||||
: 'Private groups are currently disabled';
|
||||
if ($action === 'list') {
|
||||
jsonResponse(['groups' => [], 'member_limit' => 0, 'enabled' => false]);
|
||||
jsonResponse([
|
||||
'groups' => [],
|
||||
'member_limit' => 0,
|
||||
'enabled' => false,
|
||||
'platform_enabled' => groupsEnabled(),
|
||||
'plan_enabled' => $planGroupsEnabled,
|
||||
]);
|
||||
}
|
||||
jsonResponse(['error' => 'Private groups are currently disabled', 'groups_enabled' => false], 403);
|
||||
jsonResponse([
|
||||
'error' => $error,
|
||||
'groups_enabled' => false,
|
||||
'groups_platform_enabled' => groupsEnabled(),
|
||||
], 403);
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
@@ -19,6 +33,8 @@ switch ($action) {
|
||||
'groups' => userGroups((int)$user['id']),
|
||||
'member_limit' => (int)featureValue($user, 'group_member_limit', 2),
|
||||
'enabled' => true,
|
||||
'platform_enabled' => true,
|
||||
'plan_enabled' => true,
|
||||
]);
|
||||
|
||||
case 'create':
|
||||
|
||||
Reference in New Issue
Block a user