return isset(self::$_companyNames[$id]) ? self::$_companyNames[$id] : $id;
}
+ public function isDisabled()
+ {
+ return parent::isDisabled() || $this->isCompanyAccessDisabled();
+ }
+
+ protected function isCompanyAccessDisabled()
+ {
+ $company = Company::find($this->company);
+ if (null === $company || !$company->toolbox_access) {
+ return true;
+ }
+ return false;
+ }
+
public function getManagedUsers()
{
if (null === $this->_managedUsers) {
{
set_time_limit(0);
/** @var User $user */
- $user = User::where('id', $id)->where('enabled', '1')->first();
+ $user = User::where('id', $id)->first();
if (null === $user) {
abort(404);
}
- $company = Company::find($user->company);
- if (null === $company || !$company->toolbox_access) {
+ if($user->isDisabled()){
abort(404);
}
if (!$this->canLoginas($user)) {