System Status
Ziti CLI Status
Router Service
Configuration
getSystemStatus(); echo json_encode($status); exit; } if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'enroll') { // Handle enrollment request AuthManager::requireCSRF(); $hashKey = sanitizeInput($_POST['hashKey'] ?? ''); $apiEndpoint = sanitizeInput($_POST['apiEndpoint'] ?? DEFAULT_API_ENDPOINT); // Validate inputs if (!ApiClient::validateHashKey($hashKey)) { echo json_encode(['success' => false, 'error' => 'Invalid hash key format']); exit; } if (!ApiClient::validateApiEndpoint($apiEndpoint)) { echo json_encode(['success' => false, 'error' => 'Invalid API endpoint format']); exit; } // Start enrollment $result = $enrollmentManager->enrollRouter($hashKey, $apiEndpoint); echo json_encode($result); exit; } if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'cleanup') { // Handle cleanup request AuthManager::requireCSRF(); // Start cleanup $result = $enrollmentManager->cleanupRouter(); echo json_encode($result); exit; } if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'change_credentials') { // Handle credentials change request AuthManager::requireCSRF(); $currentPassword = $_POST['current_password'] ?? ''; $newUsername = $_POST['new_username'] ?? ''; $newPassword = $_POST['new_password'] ?? ''; $result = AuthManager::changeCredentials($currentPassword, $newUsername, $newPassword); echo json_encode($result); exit; } } // Get system status for initial page load $systemStatus = $enrollmentManager->getSystemStatus(); ?>