Greenbone Vulnerability Manager  9.0.0
manage_sql_tickets.h
1 /* GVM
2  * $Id$
3  * Description: GVM management layer SQL: Ticket headers
4  *
5  * Authors:
6  * Matthew Mundell <matthew.mundell@greenbone.net>
7  *
8  * Copyright:
9  * Copyright (C) 2019 Greenbone Networks GmbH
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25 
26 #ifndef _GVMD_MANAGE_SQL_TICKETS_H
27 #define _GVMD_MANAGE_SQL_TICKETS_H
28 
29 #include "manage.h"
30 
34 #define TICKET_SQL_RESULT_MAY_HAVE_TICKETS \
35  "(SELECT EXISTS (SELECT * FROM tickets" \
36  " WHERE id IN (SELECT ticket FROM ticket_results" \
37  " WHERE result = results.id" \
38  " AND result_location" \
39  " = " G_STRINGIFY (LOCATION_TABLE) ")))"
40 
41 user_t
42 ticket_owner (ticket_t);
43 
44 user_t
45 ticket_assigned_to (ticket_t);
46 
47 gchar *
48 ticket_nvt_name (ticket_t);
49 
50 int
51 delete_ticket (const char *, int);
52 
53 int
54 restore_ticket (const char *);
55 
56 void
58 
59 void
60 check_tickets ();
61 
62 void
63 delete_tickets_user (user_t);
64 
65 void
66 inherit_tickets (user_t, user_t);
67 
68 void
69 tickets_remove_task (task_t);
70 
71 void
72 tickets_remove_report (report_t);
73 
74 void
76 
77 void
78 tickets_trash_task (task_t);
79 
80 void
81 tickets_restore_task (task_t);
82 
83 #endif /* not _GVMD_MANAGE_SQL_TICKETS_H */
restore_ticket
int restore_ticket(const char *ticket_id)
Try restore a ticket.
Definition: manage_sql_tickets.c:854
ticket_owner
user_t ticket_owner(ticket_t ticket)
Return owner of ticket.
Definition: manage_sql_tickets.c:603
ticket_nvt_name
gchar * ticket_nvt_name(ticket_t ticket)
Return NVT name of ticket.
Definition: manage_sql_tickets.c:631
delete_tickets_user
void delete_tickets_user(user_t user)
Delete all tickets owner by a user.
Definition: manage_sql_tickets.c:1549
tickets_remove_task
void tickets_remove_task(task_t task)
Remove a task from all tickets.
Definition: manage_sql_tickets.c:1604
tickets_trash_task
void tickets_trash_task(task_t task)
Adjust tickets for task being moved to trash.
Definition: manage_sql_tickets.c:1655
delete_ticket
int delete_ticket(const char *ticket_id, int ultimate)
Delete a ticket.
Definition: manage_sql_tickets.c:713
tickets_restore_task
void tickets_restore_task(task_t task)
Adjust tickets for task being restored.
Definition: manage_sql_tickets.c:1685
tickets_remove_tasks_user
void tickets_remove_tasks_user(user_t user)
Remove all of a user's tasks from all tickets.
Definition: manage_sql_tickets.c:1637
tickets_remove_report
void tickets_remove_report(report_t report)
Remove a report from all tickets.
Definition: manage_sql_tickets.c:1616
check_tickets
void check_tickets(task_t task)
Check if tickets have been resolved.
Definition: manage_sql_tickets.c:1468
inherit_tickets
void inherit_tickets(user_t user, user_t inheritor)
Change ownership of tickets, for user deletion.
Definition: manage_sql_tickets.c:1581
ticket_assigned_to
user_t ticket_assigned_to(ticket_t ticket)
Return user that ticket is assigned to.
Definition: manage_sql_tickets.c:617
empty_trashcan_tickets
void empty_trashcan_tickets()
Empty ticket trashcans.
Definition: manage_sql_tickets.c:1433