username)) { touch("/tmp/http_snap_in_progress"); $fileName = tempnam("/tmp", "sc_snapshot") . ".tar"; @capture_state($user, $fileName, true); if (file_exists($fileName)) { $size = filesize($fileName); header("Pragma: "); header("Cache-Control: "); header("Content-Type: application/bin"); header("Content-Length: $size"); header('Content-Disposition: attachment; filename="' . basename($fileName) . '"'); header("Content-Location: $fileName"); header("Cache-Control: private"); $handle = fopen($fileName, "r"); fpassthru($handle); unlink($fileName); return; } else { error_log("Capture snapshot failed\n"); } } else { error_log("Login failed, reason: $user->reason\n"); } header("Status: 500 Server Error"); return; ?>