=')) { foreach (mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT config_module_enable_purchasing, config_module_enable_bookkeeping, config_module_enable_dispatch, config_module_enable_trips, config_module_enable_calendar FROM settings WHERE company_id = 1")) ?: [] as $module_column => $module_on) { $$module_column = intval($module_on); } } // The Knowledge Base - from database 3.9.5, and its public help center from 3.9.6 if (version_compare((string) ($row['config_current_database_version'] ?? '0'), '3.9.5', '>=')) { $config_module_enable_kb = intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT config_module_enable_kb FROM settings WHERE company_id = 1"))[0] ?? 1); } if (version_compare((string) ($row['config_current_database_version'] ?? '0'), '3.9.6', '>=')) { $config_kb_public_enable = intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT config_kb_public_enable FROM settings WHERE company_id = 1"))[0] ?? 0); } $config_client_portal_require_mfa = intval($row['config_client_portal_require_mfa']); // The client record that represents this MSP's own company, or 0 for none $config_internal_client_id = intval($row['config_internal_client_id']); // Login $config_login_message = $row['config_login_message']; $config_login_key_required = $row['config_login_key_required']; $config_login_key_secret = $row['config_login_key_secret']; $config_login_remember_me_expire = intval($row['config_login_remember_me_expire']); $config_log_retention = intval($row['config_log_retention']); // Shared links - the longest one may last, and whether a password or secure // note has to have a passphrase or an emailed code (functions/share.php) $config_share_max_hours = intval($row['config_share_max_hours']) ?: 720; $config_share_require_protection = intval($row['config_share_require_protection']); // Locale $config_currency_format = "US_en"; $config_timezone = $row['config_timezone']; $config_date_format = "M d, Y"; $config_time_format = "g:i A"; // Theme $config_theme = $row['config_theme']; // Telemetry $config_telemetry = intval($row['config_telemetry']); // Destructive Deletes $config_destructive_deletes_enable = intval($row['config_destructive_deletes_enable']); // White label $config_whitelabel_enabled = intval($row['config_whitelabel_enabled']); $config_whitelabel_key = $row['config_whitelabel_key']; // Select Arrays $colors_array = array ( 'lightblue', 'blue', 'green', 'cyan', 'yellow', 'red', 'black', 'gray-dark', 'gray', 'light', 'indigo', 'navy', 'purple', 'fuchsia', 'pink', 'maroon', 'orange', 'lime', 'teal', 'olive' ); $records_per_page_array = array ('5','10','15','20','30','50','100'); include_once "settings_localization_array.php"; // Type => icon - the asset types, in order (ASSET_TYPES in functions/asset_type.php) $asset_types_array = function_exists('assetTypeIcons') ? assetTypeIcons() : []; // A managed instance its manager has made read-only or suspended (functions/managed.php). The // pages anyone can open - guest links, signing up, joining, password resets - are checked here, // as nearly all of them load this file. Client portal pages that load it before functions.php // are checked by client/includes/check_login.php instead if (PHP_SAPI !== 'cli' && function_exists('managedRequestGuard')) { managedRequestGuard(str_starts_with((string) ($_SERVER['SCRIPT_NAME'] ?? ''), '/api/') ? 'api' : 'public'); } // The demo - links that open without signing in open only for someone signed in to it (functions/demo.php) if (PHP_SAPI !== 'cli' && function_exists('demoModeGuestGuard')) { demoModeGuestGuard(); }