From 092416b9e623c674055a5030075ade72aef22729 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 25 Aug 2022 14:02:40 +1000 Subject: [PATCH 1/2] Toggle sms verification based on domain --- app/Jobs/Account/CreateAccount.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/Jobs/Account/CreateAccount.php b/app/Jobs/Account/CreateAccount.php index 70fe64a260..bef43ff33d 100644 --- a/app/Jobs/Account/CreateAccount.php +++ b/app/Jobs/Account/CreateAccount.php @@ -85,6 +85,11 @@ class CreateAccount $sp794f3f->hosted_client_count = config('ninja.quotas.free.clients'); $sp794f3f->hosted_company_count = config('ninja.quotas.free.max_companies'); $sp794f3f->account_sms_verified = true; + + if(in_array($this->getDomain($this->request['email']), ['gmail.com', 'hotmail.com', 'outlook.com', 'yahoo.com'])){ + $sp794f3f->account_sms_verified = false; + } + // $sp794f3f->trial_started = now(); // $sp794f3f->trial_plan = 'pro'; } @@ -155,4 +160,19 @@ class CreateAccount return $sp794f3f; } + + private function getDomain($email) + { + if( filter_var( $email, FILTER_VALIDATE_EMAIL ) ) { + // split on @ and return last value of array (the domain) + $domain = explode('@', $email); + + $domain_name = end($domain); + + return $domain_name; + } + + return 'gmail.com'; + } + } From 06da9054c46a451e9e8f325595278399d59b5709 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 25 Aug 2022 15:01:57 +1000 Subject: [PATCH 2/2] Remove ssl config --- config/database.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/config/database.php b/config/database.php index 9a5e95716a..68d2b6a069 100644 --- a/config/database.php +++ b/config/database.php @@ -95,12 +95,6 @@ return [ 'strict' => env('DB_STRICT', false), 'engine' => 'InnoDB ROW_FORMAT=DYNAMIC', 'options' => [], - // 'options' => [ - // PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false, - // PDO::MYSQL_ATTR_SSL_KEY => env("DB_CLIENT_KEY", ''), - // PDO::MYSQL_ATTR_SSL_CERT => env("DB_CLIENT_CERT", ''), - // PDO::MYSQL_ATTR_SSL_CA => env("DB_CA_CERT", ''), - // ], ], 'db-ninja-01a' => [