Greenbone Security Assistant  8.0.0
gsad_user.c File Reference

GSAD user handling. More...

#include "gsad_user.h"
#include "gsad_base.h"
#include "gsad_gmp_auth.h"
#include "gsad_session.h"
#include "gsad_settings.h"
#include "utils.h"
#include <assert.h>
#include <gvm/util/uuidutils.h>
#include <string.h>
Include dependency graph for gsad_user.c:

Go to the source code of this file.

Data Structures

struct  user
 User information structure, for sessions. More...
 

Macros

#define BROWSER_LANGUAGE   "Browser Language"
 

Functions

void user_renew_session (user_t *user)
 
user_t * user_new ()
 
user_t * user_new_with_data (const gchar *username, const gchar *password, const gchar *timezone, const gchar *severity, const gchar *role, const gchar *capabilities, const gchar *language, const gchar *pw_warning, const gchar *address, const gboolean guest)
 
void user_free (user_t *user)
 
user_t * user_copy (user_t *user)
 
gboolean user_session_expired (user_t *user)
 
const gchar * user_get_username (user_t *user)
 
const gchar * user_get_language (user_t *user)
 
const gchar * user_get_cookie (user_t *user)
 
const gchar * user_get_token (user_t *user)
 
const gchar * user_get_capabilities (user_t *user)
 
const gchar * user_get_password_warning (user_t *user)
 
const gchar * user_get_timezone (user_t *user)
 
const gchar * user_get_client_address (user_t *user)
 
const gchar * user_get_severity (user_t *user)
 
const gchar * user_get_role (user_t *user)
 
const gchar * user_get_password (user_t *user)
 
gboolean user_get_guest (user_t *user)
 
const time_t user_get_session_timeout (user_t *user)
 
void user_set_timezone (user_t *user, const gchar *timezone)
 Set timezone of user. More...
 
void user_set_password (user_t *user, const gchar *password)
 Set password of user. More...
 
void user_set_severity (user_t *user, const gchar *severity)
 Set severity class of user. More...
 
void user_set_language (user_t *user, const gchar *language)
 Set language of user. More...
 
void user_set_username (user_t *user, const gchar *username)
 Set username of user. More...
 
int user_logout (user_t *user)
 Logout a user. More...
 
user_t * user_add (const gchar *username, const gchar *password, const gchar *timezone, const gchar *severity, const gchar *role, const gchar *capabilities, const gchar *language, const gchar *pw_warning, const char *address)
 Add a user. More...
 
int user_find (const gchar *cookie, const gchar *token, const char *address, user_t **user_return)
 Find a user, given a token and cookie. More...
 

Detailed Description

GSAD user handling.

Definition in file gsad_user.c.

Macro Definition Documentation

◆ BROWSER_LANGUAGE

#define BROWSER_LANGUAGE   "Browser Language"

Definition at line 37 of file gsad_user.c.

Function Documentation

◆ user_add()

user_t* user_add ( const gchar *  username,
const gchar *  password,
const gchar *  timezone,
const gchar *  severity,
const gchar *  role,
const gchar *  capabilities,
const gchar *  language,
const gchar *  pw_warning,
const char *  address 
)

Add a user.

Creates and initializes a user object with given parameters

It's up to the caller to free the returned user.

Parameters
[in]usernameName of user.
[in]passwordPassword for user.
[in]timezoneTimezone of user.
[in]severitySeverity class setting of user.
[in]roleRole of user.
[in]capabilitiesCapabilities of manager.
[in]languageUser Interface Language (language name or code)
[in]pw_warningPassword policy warning.
[in]addressClient's IP address.
Returns
Added user.

Definition at line 359 of file gsad_user.c.

362 {
363  const gchar *guest_username = get_guest_username ();
364 
366 
367  if (user && user_session_expired (user))
368  {
370  user_free (user);
371  }
372 
373  gboolean guest = 0;
374 
375  if (guest_username)
376  {
377  guest = str_equal (username, guest_username) ? 1 : 0;
378  }
379 
380  user =
381  user_new_with_data (username, password, timezone, severity, role,
382  capabilities, language, pw_warning, address, guest);
383 
385 
386  return user;
387 }
void session_remove_user(const gchar *id)
Remove a user from the session "database".
Definition: gsad_session.c:164
gboolean str_equal(const gchar *str1, const gchar *str2)
Check if two strings are equal.
Definition: utils.c:35
user_t * session_get_user_by_username(const gchar *username)
Definition: gsad_session.c:116
void user_free(user_t *user)
Definition: gsad_user.c:102
gboolean user_session_expired(user_t *user)
Definition: gsad_user.c:151
gchar * token
Request session token.
Definition: gsad_user.c:45
const gchar * get_guest_username()
void session_add_user(const gchar *id, user_t *user)
Add user to the session "database".
Definition: gsad_session.c:147
user_t * user_new_with_data(const gchar *username, const gchar *password, const gchar *timezone, const gchar *severity, const gchar *role, const gchar *capabilities, const gchar *language, const gchar *pw_warning, const gchar *address, const gboolean guest)
Definition: gsad_user.c:73
User information structure, for sessions.
Definition: gsad_user.c:42
gchar * guest_username
Guest username.
Definition: gsad_settings.c:37

References get_guest_username(), guest_username, session_add_user(), session_get_user_by_username(), session_remove_user(), str_equal(), user::token, user_free(), user_new_with_data(), and user_session_expired().

Referenced by login().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ user_copy()

user_t* user_copy ( user_t *  user)

Definition at line 124 of file gsad_user.c.

125 {
126  if (!user)
127  {
128  return NULL;
129  }
130 
131  user_t *copy = user_new ();
132 
133  copy->cookie = g_strdup (user->cookie);
134  copy->token = g_strdup (user->token);
135  copy->username = g_strdup (user->username);
136  copy->password = g_strdup (user->password);
137  copy->role = g_strdup (user->role);
138  copy->timezone = g_strdup (user->timezone);
139  copy->severity = g_strdup (user->severity);
140  copy->capabilities = g_strdup (user->capabilities);
141  copy->language = g_strdup (user->language);
142  copy->pw_warning = g_strdup (user->pw_warning);
143  copy->address = g_strdup (user->address);
144  copy->time = user->time;
145  copy->guest = user->guest;
146 
147  return copy;
148 }
gchar * pw_warning
Password policy warning.
Definition: gsad_user.c:53
time_t time
Login time.
Definition: gsad_user.c:55
gchar * language
User Interface Language.
Definition: gsad_user.c:52
gchar * capabilities
Capabilities.
Definition: gsad_user.c:51
gchar * severity
Severity class.
Definition: gsad_user.c:50
gchar * timezone
Timezone.
Definition: gsad_user.c:49
gchar * token
Request session token.
Definition: gsad_user.c:45
gchar * cookie
Cookie token.
Definition: gsad_user.c:44
gchar * username
Login name.
Definition: gsad_user.c:46
gboolean guest
Whether the user is a guest.
Definition: gsad_user.c:56
user_t * user_new()
Definition: gsad_user.c:66
User information structure, for sessions.
Definition: gsad_user.c:42
gchar * password
Password.
Definition: gsad_user.c:47
gchar * role
Role.
Definition: gsad_user.c:48
gchar * address
Client's IP address.
Definition: gsad_user.c:54

References user::address, user::capabilities, user::cookie, user::guest, user::language, user::password, user::pw_warning, user::role, user::severity, user::time, user::timezone, user::token, user_new(), and user::username.

Referenced by credentials_new(), session_add_user_internal(), session_get_user_by_id(), and session_get_user_by_username().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ user_find()

int user_find ( const gchar *  cookie,
const gchar *  token,
const char *  address,
user_t **  user_return 
)

Find a user, given a token and cookie.

If a user is returned, the session of the user is renewed and it's up to the caller to free the user.

Parameters
[in]cookieToken in cookie.
[in]tokenToken request parameter.
[in]addressClient's IP address.
[out]user_returnCopy of the User or NULL in error cases.
Returns
0 ok (user in user_return), 1 bad token, 2 expired token, 3 bad/missing cookie, 4 bad/missing token, 5 guest login failed, 6 GMP down for guest login, 7 IP address mismatch, -1 error during guest login.

Definition at line 411 of file gsad_user.c.

413 {
414  user_t *user = NULL;
415  if (token == NULL)
416  return USER_BAD_MISSING_TOKEN;
417 
418  user = session_get_user_by_id (token);
419 
420  if (user)
421  {
423  {
425  user_free (user);
426  return USER_EXPIRED_TOKEN;
427  }
428 
429  else if ((cookie == NULL) || !str_equal (user->cookie, cookie))
430  {
431  user_free (user);
433  }
434 
435  /* Verify that the user address matches the client's address. */
436  else if (address == NULL || !str_equal (address, user->address))
437  {
438  user_free (user);
440  }
441  else
442  {
444 
445  *user_return = user;
446  return USER_OK;
447  }
448  }
449 
450  /* should it be really USER_EXPIRED_TOKEN?
451  * No user has been found therefore the token couldn't even expire */
452  return USER_EXPIRED_TOKEN;
453 }
void session_remove_user(const gchar *id)
Remove a user from the session "database".
Definition: gsad_session.c:164
gboolean str_equal(const gchar *str1, const gchar *str2)
Check if two strings are equal.
Definition: utils.c:35
void user_free(user_t *user)
Definition: gsad_user.c:102
#define USER_BAD_MISSING_COOKIE
Definition: gsad_user.h:35
user_t * session_get_user_by_id(const gchar *id)
Definition: gsad_session.c:97
gboolean user_session_expired(user_t *user)
Definition: gsad_user.c:151
gchar * token
Request session token.
Definition: gsad_user.c:45
void session_add_user(const gchar *id, user_t *user)
Add user to the session "database".
Definition: gsad_session.c:147
gchar * cookie
Cookie token.
Definition: gsad_user.c:44
#define USER_IP_ADDRESS_MISSMATCH
Definition: gsad_user.h:39
User information structure, for sessions.
Definition: gsad_user.c:42
#define USER_BAD_MISSING_TOKEN
Definition: gsad_user.h:36
#define USER_EXPIRED_TOKEN
Definition: gsad_user.h:34
gchar * address
Client's IP address.
Definition: gsad_user.c:54
#define USER_OK
Definition: gsad_user.h:32

References user::address, user::cookie, session_add_user(), session_get_user_by_id(), session_remove_user(), str_equal(), user::token, USER_BAD_MISSING_COOKIE, USER_BAD_MISSING_TOKEN, USER_EXPIRED_TOKEN, user_free(), USER_IP_ADDRESS_MISSMATCH, USER_OK, and user_session_expired().

Referenced by get_user_from_connection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ user_free()

void user_free ( user_t *  user)

Definition at line 102 of file gsad_user.c.

103 {
104  if (!user)
105  {
106  return;
107  }
108 
109  g_free (user->cookie);
110  g_free (user->token);
111  g_free (user->username);
112  g_free (user->password);
113  g_free (user->role);
114  g_free (user->timezone);
115  g_free (user->severity);
116  g_free (user->capabilities);
117  g_free (user->language);
118  g_free (user->pw_warning);
119  g_free (user->address);
120  g_free (user);
121 }
gchar * pw_warning
Password policy warning.
Definition: gsad_user.c:53
gchar * language
User Interface Language.
Definition: gsad_user.c:52
gchar * capabilities
Capabilities.
Definition: gsad_user.c:51
gchar * severity
Severity class.
Definition: gsad_user.c:50
gchar * timezone
Timezone.
Definition: gsad_user.c:49
gchar * token
Request session token.
Definition: gsad_user.c:45
gchar * cookie
Cookie token.
Definition: gsad_user.c:44
gchar * username
Login name.
Definition: gsad_user.c:46
User information structure, for sessions.
Definition: gsad_user.c:42
gchar * password
Password.
Definition: gsad_user.c:47
gchar * role
Role.
Definition: gsad_user.c:48
gchar * address
Client's IP address.
Definition: gsad_user.c:54

References user::address, user::capabilities, user::cookie, user::language, user::password, user::pw_warning, user::role, user::severity, user::timezone, user::token, and user::username.

Referenced by credentials_free(), handle_logout(), handle_setup_credentials(), login(), session_remove_other_sessions(), session_remove_user_internal(), user_add(), user_find(), and user_logout().

Here is the caller graph for this function:

◆ user_get_capabilities()

const gchar* user_get_capabilities ( user_t *  user)

Definition at line 181 of file gsad_user.c.

182 {
183  return user->capabilities;
184 }
gchar * capabilities
Capabilities.
Definition: gsad_user.c:51
User information structure, for sessions.
Definition: gsad_user.c:42

References user::capabilities.

Referenced by command_enabled(), envelope_gmp(), and gsad_message().

Here is the caller graph for this function:

◆ user_get_client_address()

const gchar* user_get_client_address ( user_t *  user)

Definition at line 199 of file gsad_user.c.

200 {
201  return user->address;
202 }
User information structure, for sessions.
Definition: gsad_user.c:42
gchar * address
Client's IP address.
Definition: gsad_user.c:54

References user::address.

Referenced by envelope_gmp(), and gsad_message().

Here is the caller graph for this function:

◆ user_get_cookie()

const gchar* user_get_cookie ( user_t *  user)

Definition at line 169 of file gsad_user.c.

170 {
171  return user->cookie;
172 }
gchar * cookie
Cookie token.
Definition: gsad_user.c:44
User information structure, for sessions.
Definition: gsad_user.c:42

References user::cookie.

Referenced by login().

Here is the caller graph for this function:

◆ user_get_guest()

gboolean user_get_guest ( user_t *  user)

Definition at line 223 of file gsad_user.c.

224 {
225  return user->guest;
226 }
gboolean guest
Whether the user is a guest.
Definition: gsad_user.c:56
User information structure, for sessions.
Definition: gsad_user.c:42

References user::guest.

Referenced by envelope_gmp().

Here is the caller graph for this function:

◆ user_get_language()

const gchar* user_get_language ( user_t *  user)

Definition at line 163 of file gsad_user.c.

164 {
165  return user->language;
166 }
gchar * language
User Interface Language.
Definition: gsad_user.c:52
User information structure, for sessions.
Definition: gsad_user.c:42

References user::language.

Referenced by handle_setup_credentials().

Here is the caller graph for this function:

◆ user_get_password()

const gchar* user_get_password ( user_t *  user)

Definition at line 217 of file gsad_user.c.

218 {
219  return user->password;
220 }
User information structure, for sessions.
Definition: gsad_user.c:42
gchar * password
Password.
Definition: gsad_user.c:47

References user::password.

Referenced by manager_connect().

Here is the caller graph for this function:

◆ user_get_password_warning()

const gchar* user_get_password_warning ( user_t *  user)

Definition at line 187 of file gsad_user.c.

188 {
189  return user->pw_warning;
190 }
gchar * pw_warning
Password policy warning.
Definition: gsad_user.c:53
User information structure, for sessions.
Definition: gsad_user.c:42

References user::pw_warning.

Referenced by envelope_gmp().

Here is the caller graph for this function:

◆ user_get_role()

const gchar* user_get_role ( user_t *  user)

Definition at line 211 of file gsad_user.c.

212 {
213  return user->role;
214 }
User information structure, for sessions.
Definition: gsad_user.c:42
gchar * role
Role.
Definition: gsad_user.c:48

References user::role.

Referenced by envelope_gmp(), and gsad_message().

Here is the caller graph for this function:

◆ user_get_session_timeout()

const time_t user_get_session_timeout ( user_t *  user)

Definition at line 229 of file gsad_user.c.

230 {
231  return user->time + (get_session_timeout () * 60);
232 }
time_t time
Login time.
Definition: gsad_user.c:55
int get_session_timeout()
User information structure, for sessions.
Definition: gsad_user.c:42

References get_session_timeout(), and user::time.

Referenced by envelope_gmp(), and renew_session_gmp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ user_get_severity()

const gchar* user_get_severity ( user_t *  user)

Definition at line 205 of file gsad_user.c.

206 {
207  return user->severity;
208 }
gchar * severity
Severity class.
Definition: gsad_user.c:50
User information structure, for sessions.
Definition: gsad_user.c:42

References user::severity.

Referenced by envelope_gmp().

Here is the caller graph for this function:

◆ user_get_timezone()

const gchar* user_get_timezone ( user_t *  user)

Definition at line 193 of file gsad_user.c.

194 {
195  return user->timezone;
196 }
gchar * timezone
Timezone.
Definition: gsad_user.c:49
User information structure, for sessions.
Definition: gsad_user.c:42

References user::timezone.

Referenced by envelope_gmp().

Here is the caller graph for this function:

◆ user_get_token()

const gchar* user_get_token ( user_t *  user)

Definition at line 175 of file gsad_user.c.

176 {
177  return user->token;
178 }
gchar * token
Request session token.
Definition: gsad_user.c:45
User information structure, for sessions.
Definition: gsad_user.c:42

References user::token.

Referenced by envelope_gmp(), gsad_message(), renew_session_gmp(), save_my_settings_gmp(), save_user_gmp(), session_get_user_by_id_internal(), and session_remove_other_sessions().

Here is the caller graph for this function:

◆ user_get_username()

const gchar* user_get_username ( user_t *  user)

Definition at line 157 of file gsad_user.c.

158 {
159  return user->username;
160 }
gchar * username
Login name.
Definition: gsad_user.c:46
User information structure, for sessions.
Definition: gsad_user.c:42

References user::username.

Referenced by edit_role(), envelope_gmp(), format_file_name(), gsad_message(), handle_logout(), handle_setup_user(), manager_connect(), save_my_settings_gmp(), save_user_gmp(), session_get_user_by_username(), and session_remove_other_sessions().

Here is the caller graph for this function:

◆ user_logout()

int user_logout ( user_t *  user)

Logout a user.

Parameters
[in]userUser.
Returns
0 success, -1 error.

Definition at line 325 of file gsad_user.c.

326 {
328 
329  if (fuser)
330  {
331  session_remove_user (fuser->token);
332  user_free (fuser);
333  return 0;
334  }
335 
336  return -1;
337 }
void session_remove_user(const gchar *id)
Remove a user from the session "database".
Definition: gsad_session.c:164
void user_free(user_t *user)
Definition: gsad_user.c:102
user_t * session_get_user_by_id(const gchar *id)
Definition: gsad_session.c:97
gchar * token
Request session token.
Definition: gsad_user.c:45
User information structure, for sessions.
Definition: gsad_user.c:42

References session_get_user_by_id(), session_remove_user(), user::token, and user_free().

Referenced by handle_logout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ user_new()

user_t* user_new ( )

Definition at line 66 of file gsad_user.c.

67 {
68  user_t *user = g_malloc0 (sizeof (user_t));
69  return user;
70 }
User information structure, for sessions.
Definition: gsad_user.c:42

Referenced by user_copy(), and user_new_with_data().

Here is the caller graph for this function:

◆ user_new_with_data()

user_t* user_new_with_data ( const gchar *  username,
const gchar *  password,
const gchar *  timezone,
const gchar *  severity,
const gchar *  role,
const gchar *  capabilities,
const gchar *  language,
const gchar *  pw_warning,
const gchar *  address,
const gboolean  guest 
)

Definition at line 73 of file gsad_user.c.

78 {
79  user_t *user = user_new ();
80 
81  user->cookie = gvm_uuid_make ();
82  user->token = gvm_uuid_make ();
83 
84  user->username = g_strdup (username);
85  user->password = g_strdup (password);
86  user->timezone = g_strdup (timezone);
87  user->severity = g_strdup (severity);
88  user->role = g_strdup (role);
89  user->capabilities = g_strdup (capabilities);
90  user->language = g_strdup (language);
91  user->pw_warning = g_strdup (pw_warning);
92  user->address = g_strdup (address);
93  user->guest = guest;
94 
95  user_set_language (user, language);
97 
98  return user;
99 }
gchar * pw_warning
Password policy warning.
Definition: gsad_user.c:53
void user_renew_session(user_t *user)
Definition: gsad_user.c:60
gchar * language
User Interface Language.
Definition: gsad_user.c:52
void user_set_language(user_t *user, const gchar *language)
Set language of user.
Definition: gsad_user.c:289
gchar * capabilities
Capabilities.
Definition: gsad_user.c:51
gchar * severity
Severity class.
Definition: gsad_user.c:50
gchar * timezone
Timezone.
Definition: gsad_user.c:49
gchar * token
Request session token.
Definition: gsad_user.c:45
gchar * cookie
Cookie token.
Definition: gsad_user.c:44
gchar * username
Login name.
Definition: gsad_user.c:46
gboolean guest
Whether the user is a guest.
Definition: gsad_user.c:56
user_t * user_new()
Definition: gsad_user.c:66
User information structure, for sessions.
Definition: gsad_user.c:42
gchar * password
Password.
Definition: gsad_user.c:47
gchar * role
Role.
Definition: gsad_user.c:48
gchar * address
Client's IP address.
Definition: gsad_user.c:54

References user::address, user::capabilities, user::cookie, user::guest, user::language, user::password, user::pw_warning, user::role, user::severity, user::timezone, user::token, user_new(), user_renew_session(), user_set_language(), and user::username.

Referenced by user_add().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ user_renew_session()

void user_renew_session ( user_t *  user)

Definition at line 60 of file gsad_user.c.

61 {
62  user->time = time (NULL);
63 }
time_t time
Login time.
Definition: gsad_user.c:55
User information structure, for sessions.
Definition: gsad_user.c:42

References user::time.

Referenced by renew_session_gmp(), and user_new_with_data().

Here is the caller graph for this function:

◆ user_session_expired()

gboolean user_session_expired ( user_t *  user)

Definition at line 151 of file gsad_user.c.

152 {
153  return (time (NULL) - user->time) > (get_session_timeout () * 60);
154 }
time_t time
Login time.
Definition: gsad_user.c:55
int get_session_timeout()
User information structure, for sessions.
Definition: gsad_user.c:42

References get_session_timeout(), and user::time.

Referenced by user_add(), and user_find().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ user_set_language()

void user_set_language ( user_t *  user,
const gchar *  language 
)

Set language of user.

Parameters
[in]userUser.
[in]languageLanguage.

Definition at line 289 of file gsad_user.c.

290 {
291  g_free (user->language);
292 
293  if (language == NULL || str_equal (language, BROWSER_LANGUAGE))
294  {
295  user->language = NULL;
296  }
297  else
298  {
299  user->language = g_strdup (language);
300  }
301 }
gboolean str_equal(const gchar *str1, const gchar *str2)
Check if two strings are equal.
Definition: utils.c:35
gchar * language
User Interface Language.
Definition: gsad_user.c:52
#define BROWSER_LANGUAGE
Definition: gsad_user.c:37
User information structure, for sessions.
Definition: gsad_user.c:42

References BROWSER_LANGUAGE, user::language, and str_equal().

Referenced by save_my_settings_gmp(), and user_new_with_data().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ user_set_password()

void user_set_password ( user_t *  user,
const gchar *  password 
)

Set password of user.

Parameters
[in]userUser.
[in]passwordPassword.

Definition at line 257 of file gsad_user.c.

258 {
259  g_free (user->password);
260  g_free (user->pw_warning);
261 
262  user->password = g_strdup (password);
263  user->pw_warning = NULL;
264 }
gchar * pw_warning
Password policy warning.
Definition: gsad_user.c:53
User information structure, for sessions.
Definition: gsad_user.c:42
gchar * password
Password.
Definition: gsad_user.c:47

References user::password, and user::pw_warning.

Referenced by save_my_settings_gmp(), and save_user_gmp().

Here is the caller graph for this function:

◆ user_set_severity()

void user_set_severity ( user_t *  user,
const gchar *  severity 
)

Set severity class of user.

Parameters
[in]userUser.
[in]severitySeverity class.

Definition at line 274 of file gsad_user.c.

275 {
276  g_free (user->severity);
277 
278  user->severity = g_strdup (severity);
279 }
gchar * severity
Severity class.
Definition: gsad_user.c:50
User information structure, for sessions.
Definition: gsad_user.c:42

References user::severity.

Referenced by save_my_settings_gmp().

Here is the caller graph for this function:

◆ user_set_timezone()

void user_set_timezone ( user_t *  user,
const gchar *  timezone 
)

Set timezone of user.

Parameters
[in]userUser.
[in]timezoneTimezone.

Definition at line 242 of file gsad_user.c.

243 {
244  g_free (user->timezone);
245 
246  user->timezone = g_strdup (timezone);
247 }
gchar * timezone
Timezone.
Definition: gsad_user.c:49
User information structure, for sessions.
Definition: gsad_user.c:42

References user::timezone.

Referenced by save_my_settings_gmp().

Here is the caller graph for this function:

◆ user_set_username()

void user_set_username ( user_t *  user,
const gchar *  username 
)

Set username of user.

Parameters
[in]userUser.
[in]usernameUsername.

Definition at line 311 of file gsad_user.c.

312 {
313  g_free (user->username);
314  user->username = g_strdup (username);
315 }
gchar * username
Login name.
Definition: gsad_user.c:46
User information structure, for sessions.
Definition: gsad_user.c:42

References user::username.

Referenced by save_user_gmp().

Here is the caller graph for this function: