mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 05:14:30 -04:00
Merge pull request #5953 from turbo124/v5-develop
Assign public property to $message
This commit is contained in:
commit
330a26ee78
@ -208,10 +208,12 @@ class CompanyImport implements ShouldQueue
|
|||||||
|
|
||||||
if(count($backup_users) > 1){
|
if(count($backup_users) > 1){
|
||||||
$this->message = 'Only one user can be in the import for a Free Account';
|
$this->message = 'Only one user can be in the import for a Free Account';
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($backup_users) == 1 && $company_owner->email != $backup_users[0]->email) {
|
if(count($backup_users) == 1 && $company_owner->email != $backup_users[0]->email) {
|
||||||
$this->message = 'Account emails do not match. Account owner email must match backup user email';
|
$this->message = 'Account emails do not match. Account owner email must match backup user email';
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$backup_users_emails = array_column($backup_users, 'email');
|
$backup_users_emails = array_column($backup_users, 'email');
|
||||||
@ -222,8 +224,10 @@ class CompanyImport implements ShouldQueue
|
|||||||
|
|
||||||
if($existing_user_count > 1){
|
if($existing_user_count > 1){
|
||||||
|
|
||||||
if($this->account->plan == 'pro')
|
if($this->account->plan == 'pro'){
|
||||||
$this->message = 'Pro plan is limited to one user, you have multiple users in the backup file';
|
$this->message = 'Pro plan is limited to one user, you have multiple users in the backup file';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if($this->account->plan == 'enterprise'){
|
if($this->account->plan == 'enterprise'){
|
||||||
|
|
||||||
@ -232,8 +236,8 @@ class CompanyImport implements ShouldQueue
|
|||||||
$account_plan_num_user = $this->account->num_users;
|
$account_plan_num_user = $this->account->num_users;
|
||||||
|
|
||||||
if($total_import_users > $account_plan_num_user){
|
if($total_import_users > $account_plan_num_user){
|
||||||
|
|
||||||
$this->message = "Total user count ({$total_import_users}) greater than your plan allows ({$account_plan_num_user})";
|
$this->message = "Total user count ({$total_import_users}) greater than your plan allows ({$account_plan_num_user})";
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -284,7 +288,7 @@ class CompanyImport implements ShouldQueue
|
|||||||
$nmo->to_user = $this->company->owner();
|
$nmo->to_user = $this->company->owner();
|
||||||
NinjaMailerJob::dispatchNow($nmo);
|
NinjaMailerJob::dispatchNow($nmo);
|
||||||
|
|
||||||
throw new \Exception('Company import check failed');
|
throw new \Exception($this->message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user