|
Greenbone Security Assistant
8.0.0
|
GSAD user session handling. More...

Go to the source code of this file.
Macros | |
| #define | G_LOG_DOMAIN "gsad session" |
| GLib log domain. More... | |
Functions | |
| user_t * | session_get_user_by_id_internal (const gchar *id) |
| void | session_remove_user_internal (const gchar *id) |
| void | session_add_user_internal (user_t *user) |
| void | session_init () |
| user_t * | session_get_user_by_id (const gchar *id) |
| user_t * | session_get_user_by_username (const gchar *username) |
| void | session_add_user (const gchar *id, user_t *user) |
| Add user to the session "database". More... | |
| void | session_remove_user (const gchar *id) |
| Remove a user from the session "database". More... | |
| void | session_remove_other_sessions (const gchar *id, user_t *user) |
| Removes all session of the user, except the one with the passed id. More... | |
Variables | |
| GPtrArray * | users = NULL |
| User session data. More... | |
| static GMutex * | mutex = NULL |
| Mutex to prevent concurrent access to the session. More... | |
GSAD user session handling.
Definition in file gsad_session.c.
| #define G_LOG_DOMAIN "gsad session" |
GLib log domain.
Definition at line 34 of file gsad_session.c.
| void session_add_user | ( | const gchar * | id, |
| user_t * | user | ||
| ) |
Add user to the session "database".
| [in] | id | Unique identifier. |
| [in] | user | User. |
Definition at line 147 of file gsad_session.c.
References mutex, session_add_user_internal(), and session_remove_user_internal().
Referenced by renew_session_gmp(), save_my_settings_gmp(), user_add(), and user_find().


| void session_add_user_internal | ( | user_t * | user | ) |
Definition at line 78 of file gsad_session.c.
References user_copy(), and users.
Referenced by session_add_user().


| user_t* session_get_user_by_id | ( | const gchar * | id | ) |
Find a user by a session identifier
Definition at line 97 of file gsad_session.c.
References mutex, session_get_user_by_id_internal(), and user_copy().
Referenced by user_find(), and user_logout().


| user_t* session_get_user_by_id_internal | ( | const gchar * | id | ) |
Definition at line 47 of file gsad_session.c.
References str_equal(), user_get_token(), and users.
Referenced by session_get_user_by_id(), and session_remove_user_internal().


| user_t* session_get_user_by_username | ( | const gchar * | username | ) |
Find the first user with the username
Definition at line 116 of file gsad_session.c.
References mutex, str_equal(), user_copy(), user_get_username(), and users.
Referenced by save_user_gmp(), and user_add().


| void session_init | ( | ) |
Definition at line 84 of file gsad_session.c.
| void session_remove_other_sessions | ( | const gchar * | id, |
| user_t * | user | ||
| ) |
Removes all session of the user, except the one with the passed id.
| [in] | id | ID of the session to keep |
| [in] | user | The user to logout. |
Definition at line 181 of file gsad_session.c.
References mutex, str_equal(), user_free(), user_get_token(), user_get_username(), and users.
Referenced by save_my_settings_gmp(), and save_user_gmp().


| void session_remove_user | ( | const gchar * | id | ) |
Remove a user from the session "database".
| [in] | id | Unique identifier. |
Definition at line 164 of file gsad_session.c.
References mutex, and session_remove_user_internal().
Referenced by user_add(), user_find(), and user_logout().


| void session_remove_user_internal | ( | const gchar * | id | ) |
Definition at line 65 of file gsad_session.c.
References session_get_user_by_id_internal(), user_free(), and users.
Referenced by session_add_user(), and session_remove_user().


|
static |
Mutex to prevent concurrent access to the session.
Definition at line 44 of file gsad_session.c.
Referenced by session_add_user(), session_get_user_by_id(), session_get_user_by_username(), session_init(), session_remove_other_sessions(), and session_remove_user().
| GPtrArray* users = NULL |
User session data.
Definition at line 39 of file gsad_session.c.
Referenced by create_group_gmp(), create_role_gmp(), save_group_gmp(), save_role_gmp(), session_add_user_internal(), session_get_user_by_id_internal(), session_get_user_by_username(), session_init(), session_remove_other_sessions(), and session_remove_user_internal().