<?php
declare(strict_types=1);
require_once __DIR__ . '/includes/console_shell.php';
require_login();

$dashboardUser = current_user() ?: [];
$dashboardIdentity = strtolower(trim(implode(' ', [
    (string)($dashboardUser['username'] ?? ''),
    (string)($dashboardUser['role'] ?? ''),
    (string)($dashboardUser['role_name'] ?? ''),
])));
if (strpos($dashboardIdentity, 'crmadmin') !== false
    || strpos($dashboardIdentity, 'crm admin') !== false
    || strpos($dashboardIdentity, 'crm administrator') !== false) {
    redirect('/modules/crm/dashboard.php');
}

require __DIR__ . '/dashboard_hr.php';
