diff --git a/.env b/.env index 5359d6b9a7..14f064bc6e 100644 --- a/.env +++ b/.env @@ -4,6 +4,7 @@ _APP_WORKER_PER_CORE=6 _APP_CONSOLE_WHITELIST_ROOT=disabled _APP_CONSOLE_WHITELIST_EMAILS= _APP_CONSOLE_WHITELIST_IPS= +_APP_CONSOLE_INVITES=enabled _APP_SYSTEM_EMAIL_NAME=Appwrite _APP_SYSTEM_EMAIL_ADDRESS=team@appwrite.io _APP_SYSTEM_SECURITY_EMAIL_ADDRESS=security@appwrite.io diff --git a/app/cli.php b/app/cli.php index 4d64867ed3..9857261b47 100644 --- a/app/cli.php +++ b/app/cli.php @@ -181,7 +181,7 @@ $cli try { $pools->get('console')->reclaim(); - + // Prepare database connection $dbAdapter = $pools ->get('console') diff --git a/app/config/variables.php b/app/config/variables.php index 5fe1bc35c4..ba39e01a2f 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -203,7 +203,16 @@ return [ 'required' => false, 'question' => '', 'filter' => '' - ] + ], + [ + 'name' => '_APP_CONSOLE_INVITES', + 'description' => 'This option allows you to disable the invitation of new users on the Appwrite console. When enabled, console users are allowed to invite new users to a project. By default this option is enabled.', + 'introduction' => '1.2.0', + 'default' => 'enabled', + 'required' => false, + 'question' => '', + 'filter' => '' + ], ], ], [ diff --git a/app/init.php b/app/init.php index f77d82697e..5e66cd5872 100644 --- a/app/init.php +++ b/app/init.php @@ -1028,7 +1028,7 @@ App::setResource('console', function () { 'legalAddress' => '', 'legalTaxId' => '', 'auths' => [ - 'invites' => false, + 'invites' => App::getEnv('_APP_CONSOLE_INVITES', 'enabled') === 'enabled', 'limit' => (App::getEnv('_APP_CONSOLE_WHITELIST_ROOT', 'enabled') === 'enabled') ? 1 : 0, // limit signup to 1 user 'duration' => Auth::TOKEN_EXPIRATION_LOGIN_LONG, // 1 Year in seconds ], diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index bac07e8415..dc7549aa3f 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -88,6 +88,7 @@ services: - _APP_CONSOLE_WHITELIST_ROOT - _APP_CONSOLE_WHITELIST_EMAILS - _APP_CONSOLE_WHITELIST_IPS + - _APP_CONSOLE_INVITES - _APP_SYSTEM_EMAIL_NAME - _APP_SYSTEM_EMAIL_ADDRESS - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS diff --git a/app/workers/messaging.php b/app/workers/messaging.php index 4c82a1abff..5732c8c00b 100644 --- a/app/workers/messaging.php +++ b/app/workers/messaging.php @@ -1,16 +1,17 @@ args['recipient']; - $message = $this->args['message']; + $message = new SMS( + to: [$this->args['recipient']], + content: $this->args['message'], + from: $this->from, + ); try { - $this->sms->send($this->from, $recipient, $message); + $this->sms->send($message); } catch (\Exception $error) { throw new Exception('Error sending message: ' . $error->getMessage(), 500); } diff --git a/docker-compose.yml b/docker-compose.yml index 854e9cd167..1834330f8c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -109,6 +109,7 @@ services: - _APP_CONSOLE_WHITELIST_ROOT - _APP_CONSOLE_WHITELIST_EMAILS - _APP_CONSOLE_WHITELIST_IPS + - _APP_CONSOLE_INVITES - _APP_SYSTEM_EMAIL_NAME - _APP_SYSTEM_EMAIL_ADDRESS - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS