RMM Providers - one provider's window: Add (no id) or Edit. Which RMM it is is * picked when it is added and stays; each kind brings its own fields (rmmProviderKinds() in * functions/rmm.php) - addresses, a key, a secret. A key or secret is never put back into the * page, so left empty it stays. A kind that has alerts can have them open tickets, from the * level picked, in a category. Desktops, laptops, servers and virtual machines each come in as * the asset type picked for them (rmmProviderAssetTypes()). Save asks first (check_rmm_provider, admin/post/rmm.php): what * is wrong shows beside each field and the window stays open; once all is right it saves, and * tries the connection. A network platform's window (family=network, or one being edited) * offers the network kinds - UniFi - in its words. */ require_once '../../includes/modal_header.php'; $provider_id = intval($_GET['id'] ?? 0); $row = $provider_id ? rmmProviderRow($provider_id) : null; if ($provider_id && !$row) { echo json_encode(['error' => 'That provider or platform no longer exists.']); exit; } if ($row && !rmmKind($row)) { echo json_encode(['error' => 'This ITFlow doesn\'t know that provider\'s kind of RMM.']); exit; } $family = $row ? rmmFamily($row) : (($_GET['family'] ?? '') === 'network' && rmmNetworkReady() ? 'network' : 'rmm'); $words = rmmFamilyWords($family); $kinds = rmmProviderKinds($family); $kind_key = $row ? (string) $row['rmm_provider_kind'] : (string) array_key_first($kinds); $kind = $kinds[$kind_key]; // What the window's script needs of each kind - its name, to follow the kind picked, and whether it has alerts $kinds_js = array_map(function ($info) { return ['name' => $info['default_name'] ?? $info['name'], 'alerts' => isset($info['alerts'], $info['alert']), 'alertsHelp' => (string) ($info['alerts_help'] ?? '')]; }, $kinds); // Alerts open tickets - once the 3.6.8 database update is in, with ticketing on $alerts_offered = rmmAlertsReady() && !empty($config_module_enable_ticketing); $alert_level = (string) ($row['rmm_provider_alert_level'] ?? ''); $alert_category_id = intval($row['rmm_provider_alert_category_id'] ?? 0); // Where what is wrong with a field shows $error_for = function ($field) { return '
'; }; ob_start(); ?>