Greenbone Vulnerability Manager 22.5.2
manage_sql_tickets.h
1/* Copyright (C) 2019-2022 Greenbone AG
2 *
3 * SPDX-License-Identifier: AGPL-3.0-or-later
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as
7 * published by the Free Software Foundation, either version 3 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef _GVMD_MANAGE_SQL_TICKETS_H
20#define _GVMD_MANAGE_SQL_TICKETS_H
21
22#include "manage.h"
23
27#define TICKET_SQL_RESULT_MAY_HAVE_TICKETS \
28 "(SELECT EXISTS (SELECT * FROM tickets" \
29 " WHERE id IN (SELECT ticket FROM ticket_results" \
30 " WHERE result = results.id" \
31 " AND result_location" \
32 " = " G_STRINGIFY (LOCATION_TABLE) ")))"
33
34user_t
35ticket_owner (ticket_t);
36
37user_t
38ticket_assigned_to (ticket_t);
39
40gchar *
41ticket_nvt_name (ticket_t);
42
43int
44delete_ticket (const char *, int);
45
46int
47restore_ticket (const char *);
48
49void
51
52void
54
55void
56delete_tickets_user (user_t);
57
58void
59inherit_tickets (user_t, user_t);
60
61void
62tickets_remove_task (task_t);
63
64void
65tickets_remove_report (report_t);
66
67void
69
70void
71tickets_trash_task (task_t);
72
73void
75
76#endif /* not _GVMD_MANAGE_SQL_TICKETS_H */
user_t ticket_owner(ticket_t ticket)
Return owner of ticket.
Definition: manage_sql_tickets.c:593
int delete_ticket(const char *ticket_id, int ultimate)
Delete a ticket.
Definition: manage_sql_tickets.c:703
int restore_ticket(const char *ticket_id)
Try restore a ticket.
Definition: manage_sql_tickets.c:844
void check_tickets(task_t task)
Check if tickets have been resolved.
Definition: manage_sql_tickets.c:1464
void tickets_trash_task(task_t task)
Adjust tickets for task being moved to trash.
Definition: manage_sql_tickets.c:1651
void tickets_remove_report(report_t report)
Remove a report from all tickets.
Definition: manage_sql_tickets.c:1612
user_t ticket_assigned_to(ticket_t ticket)
Return user that ticket is assigned to.
Definition: manage_sql_tickets.c:607
void tickets_restore_task(task_t task)
Adjust tickets for task being restored.
Definition: manage_sql_tickets.c:1681
void empty_trashcan_tickets()
Empty ticket trashcans.
Definition: manage_sql_tickets.c:1429
void tickets_remove_task(task_t task)
Remove a task from all tickets.
Definition: manage_sql_tickets.c:1600
void tickets_remove_tasks_user(user_t user)
Remove all of a user's tasks from all tickets.
Definition: manage_sql_tickets.c:1633
gchar * ticket_nvt_name(ticket_t ticket)
Return NVT name of ticket.
Definition: manage_sql_tickets.c:621
void inherit_tickets(user_t user, user_t inheritor)
Change ownership of tickets, for user deletion.
Definition: manage_sql_tickets.c:1577
void delete_tickets_user(user_t user)
Delete all tickets owner by a user.
Definition: manage_sql_tickets.c:1545