Greenbone Security Assistant
gsad_session.h
Go to the documentation of this file.
1 /* Copyright (C) 2018-2021 Greenbone Networks GmbH
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 
24 #ifndef _GSAD_SESSION_H
25 #define _GSAD_SESSION_H
26 
27 #include "gsad_user.h"
28 
29 #include <glib.h>
30 
31 void
32 session_add_user (const gchar *id, user_t *user);
33 
34 void
35 session_remove_user (const gchar *id);
36 
37 user_t *
38 session_get_user_by_id (const gchar *id);
39 
40 user_t *
41 session_get_user_by_username (const gchar *username);
42 
43 void
44 session_remove_other_sessions (const gchar *id, user_t *user);
45 
46 void
47 session_init ();
48 
49 #endif
void session_remove_user(const gchar *id)
Remove a user from the session "database".
Definition: gsad_session.c:163
void session_add_user(const gchar *id, user_t *user)
Add user to the session "database".
Definition: gsad_session.c:146
void session_remove_other_sessions(const gchar *id, user_t *user)
Removes all session of the user, except the one with the passed id.
Definition: gsad_session.c:180
void session_init()
Definition: gsad_session.c:83
user_t * session_get_user_by_id(const gchar *id)
Definition: gsad_session.c:96
user_t * session_get_user_by_username(const gchar *username)
Definition: gsad_session.c:115
GSAD user handling.
User information structure, for sessions.
Definition: gsad_user.c:42