Fix UI configuration block for local agent users
This commit is contained in:
@@ -26,7 +26,16 @@ class BiometricAttendanceController extends Controller
|
||||
$isZktecoSync = !empty($company_setting['isZktecoSync']) && $company_setting['isZktecoSync'] == '1';
|
||||
|
||||
$isDirectIP = filter_var($api_urls, FILTER_VALIDATE_IP);
|
||||
|
||||
// Check if any branches are configured for local IP (which the agent uses)
|
||||
$branches = \App\Models\Branch::whereNotNull('zkteco_ip')->whereIn('created_by', getCompanyAndUsersId())->get();
|
||||
|
||||
$configurationMissing = empty($api_urls) || (!$isDirectIP && (empty($username) || empty($password) || empty($token) || !$isZktecoSync));
|
||||
|
||||
// If branches have IPs configured, we don't need the global API settings
|
||||
if ($branches->isNotEmpty()) {
|
||||
$configurationMissing = false;
|
||||
}
|
||||
|
||||
if (!empty($request->start_date) && !empty($request->end_date)) {
|
||||
$start_date = date('Y-m-d H:i:s', strtotime($request->start_date));
|
||||
|
||||
Reference in New Issue
Block a user