@@ -15,6 +15,7 @@ use App\Network\Drivers\Hisfocus\HisfocusOltDriver;
|
||||
use App\Network\Drivers\Hsgq\HsgqOltDriver;
|
||||
use App\Network\Drivers\Mikrotik\MikrotikDriver;
|
||||
use App\Network\Drivers\Zte\ZteC3xxDriver;
|
||||
use App\Services\LicenseEntitlementService;
|
||||
use App\Support\TenantContext;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
@@ -39,6 +40,11 @@ class SyncDeviceBaseCredential implements ShouldQueue
|
||||
$context->set($this->tenantId);
|
||||
setPermissionsTeamId($this->tenantId);
|
||||
try {
|
||||
if (! app(LicenseEntitlementService::class)->allowsUse($this->tenantId)) {
|
||||
Device::withoutGlobalScope('tenant')->whereKey($this->deviceId)->update(['base_sync_status' => 'pending', 'base_sync_error_code' => 'LICENSE_INACTIVE', 'base_sync_message' => 'Menunggu lisensi tenant aktif.']);
|
||||
|
||||
return;
|
||||
}
|
||||
$device = Device::with(['vendor', 'model', 'credentials'])->find($this->deviceId);
|
||||
$setting = TenantDeviceSetting::where('tenant_id', $this->tenantId)->first();
|
||||
if (! $device || ! $setting) {
|
||||
|
||||
@@ -15,6 +15,7 @@ use App\Network\Drivers\Hisfocus\HisfocusOltDriver;
|
||||
use App\Network\Drivers\Hsgq\HsgqOltDriver;
|
||||
use App\Network\Drivers\Mikrotik\MikrotikDriver;
|
||||
use App\Network\Drivers\Zte\ZteC3xxDriver;
|
||||
use App\Services\LicenseEntitlementService;
|
||||
use App\Support\TenantContext;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
@@ -33,6 +34,11 @@ class SyncDeviceUser implements ShouldQueue
|
||||
$context->set($this->tenantId);
|
||||
setPermissionsTeamId($this->tenantId);
|
||||
try {
|
||||
if (! app(LicenseEntitlementService::class)->allowsUse($this->tenantId)) {
|
||||
DeviceUserAssignment::withoutGlobalScope('tenant')->whereKey($this->assignmentId)->update(['sync_status' => 'pending', 'error_code' => 'LICENSE_INACTIVE', 'message' => 'Menunggu lisensi tenant aktif.']);
|
||||
|
||||
return;
|
||||
}
|
||||
$assignment = DeviceUserAssignment::with(['device.vendor', 'device.credentials', 'accessUser'])->find($this->assignmentId);
|
||||
if (! $assignment || $assignment->tenant_id !== $this->tenantId) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user