| @@ -23,59 +23,9 @@ | ||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public static function appendFromRequest(string $content, array $request): string |
| 26 | 26 | { |
| 27 | - $dashboardLines = self::collectDashboardLines($request); | |
| 28 | - $hostPanelLines = self::collectHostPanelLines($request); | |
| 29 | - | |
| 30 | - if (empty($dashboardLines) && empty($hostPanelLines)) { | |
| 31 | - return trim($content); | |
| 32 | - } | |
| 33 | - | |
| 34 | - $sections = [trim($content)]; | |
| 35 | - | |
| 36 | - if (!empty($dashboardLines)) { | |
| 37 | - $sections[] = "اطلاعات پیشخوان:\n" . implode("\n", $dashboardLines); | |
| 38 | - } | |
| 39 | - | |
| 40 | - if (!empty($hostPanelLines)) { | |
| 41 | - $sections[] = "کنترل پنل هاست:\n" . implode("\n", $hostPanelLines); | |
| 42 | - } | |
| 43 | - | |
| 44 | - return trim(implode("\n\n", array_filter($sections))); | |
| 45 | - } | |
| 46 | - | |
| 47 | - private static function collectDashboardLines(array $request): array | |
| 48 | - { | |
| 49 | - $lines = []; | |
| 50 | - | |
| 51 | - $dashboardLoginUrl = self::sanitize($request['dashboard_login_url'] ?? ''); | |
| 52 | - $dashboardUsername = self::sanitize($request['dashboard_username'] ?? ''); | |
| 53 | - $dashboardPassword = self::sanitize($request['dashboard_password'] ?? ''); | |
| 54 | - | |
| 55 | - if ($dashboardLoginUrl !== '') $lines[] = 'آدرس لاگین پیشخوان: ' . $dashboardLoginUrl; | |
| 56 | - if ($dashboardUsername !== '') $lines[] = 'نام کاربری پیشخوان: ' . $dashboardUsername; | |
| 57 | - if ($dashboardPassword !== '') $lines[] = 'رمز عبور پیشخوان: ' . $dashboardPassword; | |
| 58 | - | |
| 59 | - return $lines; | |
| 60 | - } | |
| 61 | - | |
| 62 | - private static function collectHostPanelLines(array $request): array | |
| 63 | - { | |
| 64 | - $lines = []; | |
| 65 | - | |
| 66 | - $hostPanelLoginUrl = self::sanitize($request['host_panel_login_url'] ?? ''); | |
| 67 | - $hostPanelUsername = self::sanitize($request['host_panel_username'] ?? ''); | |
| 68 | - $hostPanelPassword = self::sanitize($request['host_panel_password'] ?? ''); | |
| 69 | - | |
| 70 | - if ($hostPanelLoginUrl !== '') $lines[] = 'آدرس لاگین کنترل پنل هاست: ' . $hostPanelLoginUrl; | |
| 71 | - if ($hostPanelUsername !== '') $lines[] = 'نام کاربری کنترل پنل هاست: ' . $hostPanelUsername; | |
| 72 | - if ($hostPanelPassword !== '') $lines[] = 'رمز عبور کنترل پنل هاست: ' . $hostPanelPassword; | |
| 73 | - | |
| 74 | - return $lines; | |
| 75 | - } | |
| 76 | - | |
| 77 | - private static function sanitize($value): string | |
| 78 | - { | |
| 79 | - return preg_replace('/\s+/', ' ', self::sanitizeContent($value)); | |
| 27 | + // Kept as a compatibility shim for third-party callers. Access data is | |
| 28 | + // intentionally ignored and must be sent with TicketAccessData instead. | |
| 29 | + return trim($content); | |
| 80 | 30 | } |
| 81 | 31 | } |