diff --git a/app/DataMapper/Analytics/AccountPlatform.php b/app/DataMapper/Analytics/AccountPlatform.php new file mode 100644 index 000000000000..b495601d421b --- /dev/null +++ b/app/DataMapper/Analytics/AccountPlatform.php @@ -0,0 +1,61 @@ +string_metric5 = $string_metric5; + $this->string_metric6 = $string_metric6; + $this->string_metric7 = $string_metric7; + } +} diff --git a/app/Jobs/Account/CreateAccount.php b/app/Jobs/Account/CreateAccount.php index 75b230298e06..3277c08479ea 100644 --- a/app/Jobs/Account/CreateAccount.php +++ b/app/Jobs/Account/CreateAccount.php @@ -12,6 +12,7 @@ namespace App\Jobs\Account; use App\DataMapper\Analytics\AccountCreated as AnalyticsAccountCreated; +use App\DataMapper\Analytics\AccountPlatform; use App\Events\Account\AccountCreated; use App\Jobs\Company\CreateCompany; use App\Jobs\Company\CreateCompanyPaymentTerms; @@ -137,52 +138,55 @@ class CreateAccount LightLogs::create(new AnalyticsAccountCreated()) ->increment() ->queue(); + + $ip = request()->hasHeader('Cf-Connecting-Ip') ? request()->header('Cf-Connecting-Ip') : request()->getClientIp(); + $platform = request()->has('platform') ? request()->input('platform') : 'www'; - - + LightLogs::create(new AccountPlatform($platform, request()->server('HTTP_USER_AGENT'), $ip)) + ->queue(); return $sp794f3f; } - private function processSettings($settings) - { - if(Ninja::isHosted() && Cache::get('currencies')) - { + // private function processSettings($settings) + // { + // if(Ninja::isHosted() && Cache::get('currencies')) + // { - $currency = Cache::get('currencies')->filter(function ($item) use ($currency_code) { - return strtolower($item->code) == $currency_code; - })->first(); + // $currency = Cache::get('currencies')->filter(function ($item) use ($currency_code) { + // return strtolower($item->code) == $currency_code; + // })->first(); - if ($currency) { - $settings->currency_id = (string)$currency->id; - } + // if ($currency) { + // $settings->currency_id = (string)$currency->id; + // } - $country = Cache::get('countries')->filter(function ($item) use ($country_code) { - return strtolower($item->iso_3166_2) == $country_code || strtolower($item->iso_3166_3) == $country_code; - })->first(); + // $country = Cache::get('countries')->filter(function ($item) use ($country_code) { + // return strtolower($item->iso_3166_2) == $country_code || strtolower($item->iso_3166_3) == $country_code; + // })->first(); - if ($country) { - $settings->country_id = (string)$country->id; - } + // if ($country) { + // $settings->country_id = (string)$country->id; + // } - $language = Cache::get('languages')->filter(function ($item) use ($currency_code) { - return strtolower($item->locale) == $currency_code; - })->first(); + // $language = Cache::get('languages')->filter(function ($item) use ($currency_code) { + // return strtolower($item->locale) == $currency_code; + // })->first(); - if ($language) { - $settings->language_id = (string)$language->id; - } + // if ($language) { + // $settings->language_id = (string)$language->id; + // } - if($timezone) { - $settings->timezone_id = (string)$timezone->id; - } + // if($timezone) { + // $settings->timezone_id = (string)$timezone->id; + // } - return $settings; - } + // return $settings; + // } - return $settings; - } + // return $settings; + // } }