|
@@ -58,6 +58,22 @@ class Company extends Save
|
|
|
} else {
|
|
|
$company_id = false;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ $auth = $this->getAuth();
|
|
|
+ if ($auth) {
|
|
|
+ if (is_string($auth)) {
|
|
|
+ $auth = explode(',', $auth);
|
|
|
+ }
|
|
|
+ if (!in_array($company_id, $auth)) {
|
|
|
+ $company = $this->getData();
|
|
|
+ if ($company) {
|
|
|
+ $company_id = $company[0]['id'];
|
|
|
+ $this->set($company_id);
|
|
|
+ } else {
|
|
|
+ $company_id = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return $company_id;
|
|
|
}
|