Greenbone Security Assistant
Functions
gsad_session.h File Reference

GSAD user session handling. More...

#include "gsad_user.h"
#include <glib.h>

Go to the source code of this file.

Functions

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...
 
user_tsession_get_user_by_id (const gchar *id)
 
user_tsession_get_user_by_username (const gchar *username)
 
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...
 
void session_init ()
 

Detailed Description

GSAD user session handling.

Function Documentation

◆ session_add_user()

void session_add_user ( const gchar *  id,
user_t user 
)

Add user to the session "database".

Parameters
[in]idUnique identifier.
[in]userUser.

◆ session_get_user_by_id()

user_t* session_get_user_by_id ( const gchar *  id)

Find a user by a session identifier

Returns
Return a copy of the user or NULL if not found

◆ session_get_user_by_username()

user_t* session_get_user_by_username ( const gchar *  username)

Find the first user with the username

Returns
Return a copy of the user or NULL if not found

◆ session_init()

void session_init ( )

◆ session_remove_other_sessions()

void session_remove_other_sessions ( const gchar *  id,
user_t user 
)

Removes all session of the user, except the one with the passed id.

Parameters
[in]idID of the session to keep
[in]userThe user to logout.

◆ session_remove_user()

void session_remove_user ( const gchar *  id)

Remove a user from the session "database".

Parameters
[in]idUnique identifier.