1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00

Merge pull request #7943 from turbo124/v5-develop

General improvements
This commit is contained in:
David Bomba 2022-11-15 13:53:27 +11:00 committed by GitHub
commit 1f1e366903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 2 deletions

View File

@ -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 = '';

View File

@ -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);
}
/**

View File

@ -27,6 +27,7 @@ class BlackListRule implements Rule
'superhostforumla.com',
'wnpop.com',
'dataservices.space',
'karenkey.com',
];
/**

View File

@ -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')));
}
}
}

View File

@ -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' => [],

View File

@ -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);