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));
|
||||
|
||||
@@ -12,8 +12,8 @@ use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets;
|
||||
|
||||
return Application::configure(basePath: dirname(__DIR__))
|
||||
->withRouting(
|
||||
web: __DIR__.'/../routes/web.php',
|
||||
commands: __DIR__.'/../routes/console.php',
|
||||
web: __DIR__ . '/../routes/web.php',
|
||||
commands: __DIR__ . '/../routes/console.php',
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
@@ -51,6 +51,8 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
'payments/aamarpay/success',
|
||||
'payments/aamarpay/callback',
|
||||
'payments/tap/success',
|
||||
'api/zkteco/sync', // <-- ADD THIS LINE
|
||||
|
||||
'payments/tap/callback',
|
||||
'payments/benefit/success',
|
||||
'payments/benefit/callback',
|
||||
|
||||
Reference in New Issue
Block a user