diff --git a/app/Http/Controllers/TwilioController.php b/app/Http/Controllers/TwilioController.php index 2baddfa239..1968edcfc5 100644 --- a/app/Http/Controllers/TwilioController.php +++ b/app/Http/Controllers/TwilioController.php @@ -165,8 +165,11 @@ class TwilioController extends BaseController if($verification_check->status == 'approved'){ - if($request->query('validate_only') == 'true') + if($request->query('validate_only') == 'true'){ + $user->verified_phone_number = true; + $user->save(); return response()->json(['message' => 'SMS verified'], 200); + } $user->google_2fa_secret = ''; $user->sms_verification_code = ''; diff --git a/app/Http/Requests/Account/UpdateAccountRequest.php b/app/Http/Requests/Account/UpdateAccountRequest.php index 1ac2534ea6..1a64e626e7 100644 --- a/app/Http/Requests/Account/UpdateAccountRequest.php +++ b/app/Http/Requests/Account/UpdateAccountRequest.php @@ -26,7 +26,7 @@ class UpdateAccountRequest extends Request */ public function authorize() { - return (auth()->user()->isAdmin() || auth()->user()->isOwner()) && ($this->account->id == auth()->user()->account_id); + return (auth()->user()->isAdmin() || auth()->user()->isOwner()) && ($this->account->id == auth()->user()->token()->account_id); } /** diff --git a/app/Http/ValidationRules/Account/BlackListRule.php b/app/Http/ValidationRules/Account/BlackListRule.php index 1735708800..a612808e25 100644 --- a/app/Http/ValidationRules/Account/BlackListRule.php +++ b/app/Http/ValidationRules/Account/BlackListRule.php @@ -27,6 +27,7 @@ class BlackListRule implements Rule 'superhostforumla.com', 'wnpop.com', 'dataservices.space', + 'karenkey.com', ]; /** diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index 071e4106a4..9f1674055b 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -251,6 +251,13 @@ class NinjaMailerJob implements ShouldQueue ], ]); + if(env($this->company->id . '_MAIL_FROM_ADDRESS')) + { + $this->nmo + ->mailable + ->from(env($this->company->id . '_MAIL_FROM_ADDRESS', env('MAIL_FROM_ADDRESS')), env($this->company->id . '_MAIL_FROM_NAME', env('MAIL_FROM_NAME'))); + } + } } diff --git a/app/Services/Invoice/HandleCancellation.php b/app/Services/Invoice/HandleCancellation.php index 76b7545229..903c5edec4 100644 --- a/app/Services/Invoice/HandleCancellation.php +++ b/app/Services/Invoice/HandleCancellation.php @@ -57,6 +57,8 @@ class HandleCancellation extends AbstractService event(new InvoiceWasCancelled($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); + event('eloquent.updated: App\Models\Invoice', $this->invoice); + $transaction = [ 'invoice' => $this->invoice->transaction_event(), 'payment' => [], diff --git a/app/Services/Invoice/TriggeredActions.php b/app/Services/Invoice/TriggeredActions.php index 76d9a0623a..5f52483ad0 100644 --- a/app/Services/Invoice/TriggeredActions.php +++ b/app/Services/Invoice/TriggeredActions.php @@ -67,6 +67,22 @@ class TriggeredActions extends AbstractService $this->updated = false; } + if($this->request->has('save_default_footer') && $this->request->input('save_default_footer') == 'true') { + $company = $this->invoice->company; + $settings = $company->settings; + $settings->invoice_footer = $this->invoice->footer; + $company->settings = $settings; + $company->save(); + } + + if($this->request->has('save_default_terms') && $this->request->input('save_default_terms') == 'true') { + $company = $this->invoice->company; + $settings = $company->settings; + $settings->invoice_terms = $this->invoice->terms; + $company->settings = $settings; + $company->save(); + } + if($this->updated) event('eloquent.updated: App\Models\Invoice', $this->invoice);