diff --git a/app/Http/Controllers/Auth/ContactLoginController.php b/app/Http/Controllers/Auth/ContactLoginController.php index 328fb8698b8f..fad924f812a6 100644 --- a/app/Http/Controllers/Auth/ContactLoginController.php +++ b/app/Http/Controllers/Auth/ContactLoginController.php @@ -96,7 +96,7 @@ class ContactLoginController extends Controller return $this->sendLockoutResponse($request); } - if(Ninja::isHosted() && $company = Company::where('company_key', $request->input('company_key'))->first()){ + if(Ninja::isHosted() && $request->has('password') && $company = Company::where('company_key', $request->input('company_key'))->first()){ $contact = ClientContact::where(['email' => $request->input('email'), 'company_id' => $company->id])->first(); @@ -132,7 +132,6 @@ class ContactLoginController extends Controller public function authenticated(Request $request, ClientContact $client) { - // Auth::guard('contact')->loginUsingId($client->id, true); auth()->guard('contact')->loginUsingId($client->id, true); event(new ContactLoggedIn($client, $client->company, Ninja::eventVars())); diff --git a/app/Http/Middleware/ContactRegister.php b/app/Http/Middleware/ContactRegister.php index 2b3a72e1653b..6c8922ff65ba 100644 --- a/app/Http/Middleware/ContactRegister.php +++ b/app/Http/Middleware/ContactRegister.php @@ -37,15 +37,14 @@ class ContactRegister if(! $company->client_can_register) abort(400, 'Registration disabled'); - // $request->merge(['key' => $company->company_key]); - session()->put('key', $company->company_key); + session()->put('key', $company->company_key); return $next($request); } } - $query = [ + $query = [ 'portal_domain' => $request->getSchemeAndHttpHost(), 'portal_mode' => 'domain', ]; diff --git a/app/Jobs/Company/CompanyImport.php b/app/Jobs/Company/CompanyImport.php index 605614b36367..d14b042dc778 100644 --- a/app/Jobs/Company/CompanyImport.php +++ b/app/Jobs/Company/CompanyImport.php @@ -1332,15 +1332,17 @@ class CompanyImport implements ShouldQueue if(array_key_exists('deleted_at', $obj_array) && $obj_array['deleted_at'] > 1){ $obj_array['deleted_at'] = now(); } - + /* New to convert product ids from old hashes to new hashes*/ if($class == 'App\Models\Subscription'){ - //$obj_array['product_ids'] = $this->recordProductIds($obj_array['product_ids']); - //$obj_array['recurring_product_ids'] = $this->recordProductIds($obj_array['recurring_product_ids']); - // $obj_array['webhook_configuration'] = json_encode($obj_array['webhook_configuration']); - $obj_array['webhook_configuration'] = ''; + + if(array_key_exists('company', $obj_array)) + unset($obj_array['company']); + + $obj_array['webhook_configuration'] = (array)$obj_array['webhook_configuration']; $obj_array['recurring_product_ids'] = ''; $obj_array['product_ids'] = ''; + nlog($obj_array); } /* Expenses that don't have a number will not be inserted - so need to override here*/ diff --git a/app/Services/Client/Statement.php b/app/Services/Client/Statement.php index daafb5bb4973..7c2525204721 100644 --- a/app/Services/Client/Statement.php +++ b/app/Services/Client/Statement.php @@ -172,7 +172,7 @@ class Statement $item->tax_rate1 = 5; } - $product = Product::all()->random(); + $product = Product::first(); $item->cost = (float) $product->cost; $item->product_key = $product->product_key; diff --git a/resources/views/portal/ninja2020/auth/register.blade.php b/resources/views/portal/ninja2020/auth/register.blade.php index 8396864c1d94..a3fa0befc8ce 100644 --- a/resources/views/portal/ninja2020/auth/register.blade.php +++ b/resources/views/portal/ninja2020/auth/register.blade.php @@ -11,6 +11,10 @@

{{ ctrans('texts.register_label') }}

+ @if($company) + + @endif + @csrf