diff --git a/Dockerfile b/Dockerfile index e6f1334206..4f8192427d 100755 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ ENV DEBUG=$DEBUG ENV PHP_REDIS_VERSION=5.3.5 \ PHP_MONGODB_VERSION=1.9.1 \ PHP_SWOOLE_VERSION=v4.8.5 \ - PHP_IMAGICK_VERSION=3.5.1 \ + PHP_IMAGICK_VERSION=3.7.0 \ PHP_YAML_VERSION=2.2.2 \ PHP_MAXMINDDB_VERSION=v1.11.0 diff --git a/app/config/collections.php b/app/config/collections.php index c0a5b476e5..abcdec9c1d 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -2209,6 +2209,7 @@ $collections = [ ], ], ], + 'stats' => [ '$collection' => Database::METADATA, '$id' => 'stats', @@ -2294,6 +2295,7 @@ $collections = [ ], ], ], + 'realtime' => [ '$collection' => Database::METADATA, '$id' => 'realtime', diff --git a/app/config/providers.php b/app/config/providers.php index c415405b6d..12c7f59288 100644 --- a/app/config/providers.php +++ b/app/config/providers.php @@ -131,6 +131,16 @@ return [ // Ordered by ABC. 'beta' => false, 'mock' => false, ], + 'notion' => [ + 'name' => 'Notion', + 'developers' => 'https://developers.notion.com/docs', + 'icon' => 'icon-notion', + 'enabled' => true, + 'sandbox' => false, + 'form' => false, + 'beta' => false, + 'mock' => false, + ], 'paypal' => [ 'name' => 'PayPal', 'developers' => 'https://developer.paypal.com/docs/api/overview/', diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 5316ba6ef1..2ff087b725 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -479,7 +479,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $limit = $project->getAttribute('auths', [])['limit'] ?? 0; if ($limit !== 0) { - $sum = $dbForProject->count('users', [ new Query('deleted', Query::TYPE_EQUAL, [false]),], APP_LIMIT_COUNT); + $sum = $dbForProject->count('users', [ new Query('deleted', Query::TYPE_EQUAL, [false]),], APP_LIMIT_USERS); if ($sum >= $limit) { throw new Exception('Project registration is restricted. Contact your administrator for more information.', 501); @@ -652,7 +652,7 @@ App::post('/v1/account/sessions/magic-url') if ($limit !== 0) { $sum = $dbForProject->count('users', [ new Query('deleted', Query::TYPE_EQUAL, [false]), - ], APP_LIMIT_COUNT); + ], APP_LIMIT_USERS); if ($sum >= $limit) { throw new Exception('Project registration is restricted. Contact your administrator for more information.', 501); @@ -924,7 +924,7 @@ App::post('/v1/account/sessions/anonymous') if ($limit !== 0) { $sum = $dbForProject->count('users', [ new Query('deleted', Query::TYPE_EQUAL, [false]), - ], APP_LIMIT_COUNT); + ], APP_LIMIT_USERS); if ($sum >= $limit) { throw new Exception('Project registration is restricted. Contact your administrator for more information.', 501); diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 9c4f9bc9bf..1ef711e6fe 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -461,7 +461,7 @@ App::patch('/v1/projects/:projectId/auth/limit') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_PROJECT) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('limit', false, new Integer(true), 'Set the max number of users allowed in this project. Use 0 for unlimited.') + ->param('limit', false, new Range(0, APP_LIMIT_USERS), 'Set the max number of users allowed in this project. Use 0 for unlimited.') ->inject('response') ->inject('dbForConsole') ->action(function ($projectId, $limit, $response, $dbForConsole) { diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 61a9e24a41..ff64259409 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -725,6 +725,11 @@ App::delete('/v1/users/:userId') throw new Exception('User not found', 404); } + /** + * DO NOT DELETE THE USER RECORD ITSELF. + * WE RETAIN THE USER RECORD TO RESERVE THE USER ID AND ENSURE THAT THE USER ID IS NOT REUSED. + */ + // clone user object to send to workers $clone = clone $user; @@ -733,6 +738,8 @@ App::delete('/v1/users/:userId') ->setAttribute("email", null) ->setAttribute("password", null) ->setAttribute("deleted", true) + ->setAttribute("tokens", []) + ->setAttribute("search", null) ; $dbForProject->updateDocument('users', $userId, $user); diff --git a/app/views/console/settings/index.phtml b/app/views/console/settings/index.phtml index 8ea42f2f6a..e4ad543b2b 100644 --- a/app/views/console/settings/index.phtml +++ b/app/views/console/settings/index.phtml @@ -453,7 +453,7 @@ $smtpEnabled = $this->getParam('smtpEnabled', false);