Tul xxx Tul
User / IP
:
216.73.217.33
Host / Server
:
45.84.207.204 / aircan.me
System
:
Linux lt-bnk-web1726.main-hosting.eu 5.14.0-611.36.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 3 11:23:52 EST 2026 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
u931257429
/
domains
/
aircan.me
/
public_html
/
siscaps
/
controllers
/
Viewing: CustomerTicketsController.php
<?php require_once __DIR__ . '/BaseController.php'; class CustomerTicketsController extends BaseController { public function index(): void { $filters = [ 'q' => trim((string)($_GET['q'] ?? '')), 'status' => (string)($_GET['status'] ?? ''), 'type' => (string)($_GET['type'] ?? ''), ]; $tickets = CustomerTicket::getAll($filters); $statuses = ['Abierto','En proceso','Cerrado']; $types = ['Averia','Queja','Consulta','Otro']; $pageTitle = 'Mensajes de Clientes'; $csrf = $this->generateCsrf(); $this->renderView('tickets/index', [ 'tickets' => $tickets, 'filters' => $filters, 'statuses' => $statuses, 'types' => $types, 'announcements' => GlobalAnnouncement::getAll(), 'csrf' => $csrf, 'pageTitle' => $pageTitle, ]); } public function announcementsStore(): void { if ($_SERVER['REQUEST_METHOD'] !== 'POST') { redirect('tickets.index'); } if (!$this->validateCsrf()) { $this->redirectWithMessage('tickets.index', 'error', 'Sesión inválida. Intenta nuevamente.'); } $title = trim((string)($_POST['title'] ?? '')); $body = trim((string)($_POST['body'] ?? '')); if ($title === '' || $body === '') { setFlashMessage('error', 'Título y mensaje son obligatorios.'); header('Location: ' . BASE_URL . '?route=tickets.index'); exit; } if (mb_strlen($title) > 150) { setFlashMessage('error', 'El título no puede exceder 150 caracteres.'); header('Location: ' . BASE_URL . '?route=tickets.index'); exit; } if (mb_strlen($body) > 5000) { setFlashMessage('error', 'El mensaje no puede exceder 5000 caracteres.'); header('Location: ' . BASE_URL . '?route=tickets.index'); exit; } $user = getCurrentUser(); $uid = (int)($user['id'] ?? 0); try { GlobalAnnouncement::create($title, $body, $uid > 0 ? $uid : null, true); setFlashMessage('success', 'Comunicado enviado a todos los clientes.'); } catch (Throwable $e) { setFlashMessage('error', 'No se pudo guardar el comunicado.'); } header('Location: ' . BASE_URL . '?route=tickets.index'); exit; } public function announcementsUpdate(): void { if ($_SERVER['REQUEST_METHOD'] !== 'POST') { redirect('tickets.index'); } if (!$this->validateCsrf()) { $this->redirectWithMessage('tickets.index', 'error', 'Sesión inválida. Intenta nuevamente.'); } $id = (int)($_POST['id'] ?? 0); $title = trim((string)($_POST['title'] ?? '')); $body = trim((string)($_POST['body'] ?? '')); if ($id <= 0) { $this->redirectWithMessage('tickets.index', 'error', 'Comunicado inválido.'); } if ($title === '' || $body === '') { setFlashMessage('error', 'Título y mensaje son obligatorios.'); header('Location: ' . BASE_URL . '?route=tickets.index'); exit; } if (mb_strlen($title) > 150) { setFlashMessage('error', 'El título no puede exceder 150 caracteres.'); header('Location: ' . BASE_URL . '?route=tickets.index'); exit; } if (mb_strlen($body) > 5000) { setFlashMessage('error', 'El mensaje no puede exceder 5000 caracteres.'); header('Location: ' . BASE_URL . '?route=tickets.index'); exit; } try { GlobalAnnouncement::update($id, $title, $body, true); setFlashMessage('success', 'Comunicado actualizado.'); } catch (Throwable $e) { setFlashMessage('error', 'No se pudo actualizar el comunicado.'); } header('Location: ' . BASE_URL . '?route=tickets.index'); exit; } public function announcementsDelete(): void { if ($_SERVER['REQUEST_METHOD'] !== 'POST') { redirect('tickets.index'); } if (!$this->validateCsrf()) { $this->redirectWithMessage('tickets.index', 'error', 'Sesión inválida. Intenta nuevamente.'); } $id = (int)($_POST['id'] ?? 0); if ($id <= 0) { $this->redirectWithMessage('tickets.index', 'error', 'Comunicado inválido.'); } try { GlobalAnnouncement::delete($id); setFlashMessage('success', 'Comunicado eliminado.'); } catch (Throwable $e) { setFlashMessage('error', 'No se pudo eliminar el comunicado.'); } header('Location: ' . BASE_URL . '?route=tickets.index'); exit; } public function show(): void { $id = (int)($_GET['id'] ?? 0); if ($id <= 0) { http_response_code(400); echo 'ID inválido'; return; } $ticket = CustomerTicket::findWithCustomer($id); if (!$ticket) { http_response_code(404); echo 'Ticket no encontrado'; return; } $messages = CustomerTicket::getMessages($id); $csrf = $this->generateCsrf(); $statuses = ['Abierto','En proceso','Cerrado']; $pageTitle = 'Ticket #' . $ticket['id']; $this->renderView('tickets/show', [ 'ticket' => $ticket, 'messages' => $messages, 'statuses' => $statuses, 'csrf' => $csrf, 'pageTitle' => $pageTitle, ]); } public function reply(): void { if ($_SERVER['REQUEST_METHOD'] !== 'POST') { redirect('tickets.index'); } if (!$this->validateCsrf()) { $this->redirectWithMessage('tickets.index', 'error', 'Sesión inválida. Intenta nuevamente.'); } $id = (int)($_POST['ticket_id'] ?? 0); if ($id <= 0) { $this->redirectWithMessage('tickets.index', 'error', 'Ticket inválido.'); } $ticket = CustomerTicket::findWithCustomer($id); if (!$ticket) { $this->redirectWithMessage('tickets.index', 'error', 'Ticket no encontrado.'); } $body = trim((string)($_POST['body'] ?? '')); $status = (string)($_POST['status'] ?? ''); $allowedStatuses = ['Abierto','En proceso','Cerrado']; if (!in_array($status, $allowedStatuses, true)) { $status = (string)($ticket['status'] ?? 'Abierto'); } if ($body === '') { setFlashMessage('error', 'El mensaje no puede estar vacío.'); header('Location: ' . BASE_URL . '?route=tickets.show&id=' . $id); exit; } if (mb_strlen($body) > 4000) { setFlashMessage('error', 'El mensaje no puede exceder 4000 caracteres.'); header('Location: ' . BASE_URL . '?route=tickets.show&id=' . $id); exit; } $user = getCurrentUser(); $uid = (int)($user['id'] ?? 0); try { CustomerTicket::addMessage($id, 'ADMIN', $uid > 0 ? $uid : null, $body); if ($status !== (string)($ticket['status'] ?? '')) { CustomerTicket::updateStatus($id, $status); } setFlashMessage('success', 'Respuesta enviada al cliente.'); } catch (Throwable $e) { setFlashMessage('error', 'No se pudo enviar la respuesta.'); } header('Location: ' . BASE_URL . '?route=tickets.show&id=' . $id); exit; } }
Coded With 💗 by
0x6ick