diff --git a/app/config/version.php b/app/config/version.php index 08e454745d..b5532f8430 100644 --- a/app/config/version.php +++ b/app/config/version.php @@ -1,5 +1,5 @@ 'v1.2.6.1-66', - 'hash_version' => 'v1.2.6.1-66-g0ffb5df', + 'app_version' => 'v1.2.6.1-67', + 'hash_version' => 'v1.2.6.1-67-g3da6522', ); \ No newline at end of file diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index ae3ba2df41..0074f69be7 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -881,7 +881,7 @@ class AssetsController extends AdminController public function getDatatable($status = null) { - $assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog','model','model.category')->Hardware(); + $assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog','model','model.category','sentryThrottle')->Hardware(); switch ($status) { diff --git a/app/controllers/admin/UsersController.php b/app/controllers/admin/UsersController.php index bc21ca3dbc..e0d9fb9874 100755 --- a/app/controllers/admin/UsersController.php +++ b/app/controllers/admin/UsersController.php @@ -678,7 +678,7 @@ class UsersController extends AdminController public function getDatatable($status = null) { - $users = User::with('assets','licenses','manager'); + $users = User::with('assets','licenses','manager','sentryThrottle'); switch ($status) { case 'deleted': diff --git a/app/models/Throttle.php b/app/models/Throttle.php new file mode 100644 index 0000000000..9d348391ea --- /dev/null +++ b/app/models/Throttle.php @@ -0,0 +1,12 @@ +belongsTo('User', 'user_id'); + } + + +} diff --git a/app/models/User.php b/app/models/User.php index bc80091977..a3549aa805 100755 --- a/app/models/User.php +++ b/app/models/User.php @@ -77,18 +77,23 @@ class User extends SentryUserModel { return $this->belongsTo('User','manager_id')->withTrashed(); } - + + public function accountStatus() { - $throttle = Sentry::findThrottlerByUserId($this->id); - - if ($throttle->isBanned()) { - return 'banned'; - } elseif ($throttle->isSuspended()) { - return 'suspended'; - } else { - return ''; - } + if ($this->sentryThrottle->suspended==1) { + return 'suspended'; + } elseif ($this->sentryThrottle->banned==1) { + return 'banned'; + } else { + return false; + } + + + } + + public function sentryThrottle() { + return $this->hasOne('Throttle'); } public function scopeGetDeleted($query)