diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 53950f1f108f..b4df8ca6b5a2 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -142,7 +142,7 @@ class AccountController extends BaseController */ public function store(CreateAccountRequest $request) { - $account = CreateAccount::dispatchNow($request->all()); + $account = CreateAccount::dispatchNow($request->all(), $request->getClientIp()); if (! ($account instanceof Account)) { return $account; diff --git a/app/Jobs/Account/CreateAccount.php b/app/Jobs/Account/CreateAccount.php index b175e4365e32..6b41005b229b 100644 --- a/app/Jobs/Account/CreateAccount.php +++ b/app/Jobs/Account/CreateAccount.php @@ -42,9 +42,12 @@ class CreateAccount protected $request; - public function __construct(array $sp660339) + protected $client_ip; + + public function __construct(array $sp660339, $client_ip) { $this->request = $sp660339; + $this->client_ip = $client_ip; } public function handle() @@ -113,7 +116,7 @@ class CreateAccount private function processSettings($settings) { - if(Ninja::isHosted() && Cache::get('currencies') && $data = unserialize(@file_get_contents('http://www.geoplugin.net/php.gp?ip=' . request()->getClientIp()))) + if(Ninja::isHosted() && Cache::get('currencies') && $data = unserialize(@file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $this->client_ip))) { $currency_code = strtolower($data['geoplugin_currencyCode']);