## ActUser ActUser — information about a user account |

## Synopsis

                        ActUser;
    enum                ActUserAccountType;
    enum                ActUserPasswordMode;
    gint                act_user_collate                    (ActUser *user1,
                                                             ActUser *user2);
    ActUserAccountType  act_user_get_account_type           (ActUser *user);
    gboolean            act_user_get_automatic_login        (ActUser *user);
    const char *        act_user_get_email                  (ActUser *user);
    const char *        act_user_get_home_dir               (ActUser *user);
    const char *        act_user_get_icon_file              (ActUser *user);
    const char *        act_user_get_language               (ActUser *user);
    const char *        act_user_get_location               (ActUser *user);
    gboolean            act_user_get_locked                 (ActUser *user);
    int                 act_user_get_login_frequency        (ActUser *user);
    const GVariant *    act_user_get_login_history          (ActUser *user);
    gint64              act_user_get_login_time             (ActUser *user);
    guint               act_user_get_num_sessions           (ActUser *user);
    const char *        act_user_get_object_path            (ActUser *user);
    const char *        act_user_get_password_hint          (ActUser *user);
    ActUserPasswordMode act_user_get_password_mode          (ActUser *user);
    const char *        act_user_get_primary_session_id     (ActUser *user);
    const char *        act_user_get_real_name              (ActUser *user);
    const char *        act_user_get_shell                  (ActUser *user);
    uid_t               act_user_get_uid                    (ActUser *user);
    const char *        act_user_get_user_name              (ActUser *user);
    const char *        act_user_get_x_session              (ActUser *user);
    gboolean            act_user_is_loaded                  (ActUser *user);
    gboolean            act_user_is_local_account           (ActUser *user);
    gboolean            act_user_is_logged_in               (ActUser *user);
    gboolean            act_user_is_system_account          (ActUser *user);
    void                act_user_set_account_type           (ActUser *user,
                                                             ActUserAccountType account_type);
    void                act_user_set_automatic_login        (ActUser *user,
                                                             gboolean enabled);
    void                act_user_set_email                  (ActUser *user,
                                                             const char *email);
    void                act_user_set_icon_file              (ActUser *user,
                                                             const char *icon_file);
    void                act_user_set_language               (ActUser *user,
                                                             const char *language);
    void                act_user_set_location               (ActUser *user,
                                                             const char *location);
    void                act_user_set_locked                 (ActUser *user,
                                                             gboolean locked);
    void                act_user_set_password               (ActUser *user,
                                                             const gchar *password,
                                                             const gchar *hint);
    void                act_user_set_password_mode          (ActUser *user,
                                                             ActUserPasswordMode password_mode);
    void                act_user_set_real_name              (ActUser *user,
                                                             const char *real_name);
    void                act_user_set_user_name              (ActUser *user,
                                                             const char *user_name);
    void                act_user_set_x_session              (ActUser *user,
                                                             const char *x_session);

## Object Hierarchy

      GObject
       +----ActUser

## Properties

      "account-type"             gint                  : Read
      "automatic-login"          gboolean              : Read
      "email"                    gchar*                : Read
      "home-directory"           gchar*                : Read
      "icon-file"                gchar*                : Read
      "is-loaded"                gboolean              : Read
      "language"                 gchar*                : Read
      "local-account"            gboolean              : Read
      "location"                 gchar*                : Read
      "locked"                   gboolean              : Read
      "login-frequency"          gint                  : Read
      "login-history"            GVariant*             : Read
      "login-time"               gint64                : Read
      "password-hint"            gchar*                : Read
      "password-mode"            gint                  : Read
      "real-name"                gchar*                : Read
      "shell"                    gchar*                : Read
      "system-account"           gboolean              : Read
      "uid"                      gint                  : Read
      "user-name"                gchar*                : Read
      "x-session"                gchar*                : Read

## Signals

      "changed"                                        : Run Last
      "sessions-changed"                               : Run Last

## Description

An ActUser object represents a user account on the system.

## Details

### ActUser

    typedef struct _ActUser ActUser;

Represents a user account on the system.

### enum ActUserAccountType

    typedef enum {
            ACT_USER_ACCOUNT_TYPE_STANDARD,
            ACT_USER_ACCOUNT_TYPE_ADMINISTRATOR,
    } ActUserAccountType;

Type of user account

`ACT_USER_ACCOUNT_TYPE_STANDARD` | Normal non-administrative user
`ACT_USER_ACCOUNT_TYPE_ADMINISTRATOR` | Administrative user

### enum ActUserPasswordMode

    typedef enum {
            ACT_USER_PASSWORD_MODE_REGULAR,
            ACT_USER_PASSWORD_MODE_SET_AT_LOGIN,
            ACT_USER_PASSWORD_MODE_NONE,
    } ActUserPasswordMode;

Mode for setting the user's password.

`ACT_USER_PASSWORD_MODE_REGULAR` | Password set normally
`ACT_USER_PASSWORD_MODE_SET_AT_LOGIN` | Password will be chosen at next login
`ACT_USER_PASSWORD_MODE_NONE` | No password set

### act_user_collate ()

    gint                act_user_collate                    (ActUser *user1,
                                                             ActUser *user2);

Organize the user by login frequency and names.

`user1` : | a user
`user2` : | a user
Returns : | negative if `user1` is before `user2`, zero if equal or positive if `user1` is after `user2`

### act_user_get_account_type ()

    ActUserAccountType  act_user_get_account_type           (ActUser *user);

Retrieves the account type of `user`.

`user` : | the user object to examine.
Returns : | a ActUserAccountType

### act_user_get_automatic_login ()

    gboolean            act_user_get_automatic_login        (ActUser *user);

Returns whether or not ActUser is automatically logged in at boot time.

`user` : | a ActUser
Returns : | `TRUE` or `FALSE`

### act_user_get_email ()

    const char *        act_user_get_email                  (ActUser *user);

Retrieves the email address set by `user`.

`user` : | the user object to examine.
Returns : | a pointer to an array of characters which must not be modified or freed, or `NULL`. [transfer none]

### act_user_get_home_dir ()

    const char *        act_user_get_home_dir               (ActUser *user);

Retrieves the home directory for `user`.

`user` : | the user object to examine.
Returns : | a pointer to an array of characters which must not be modified or freed, or `NULL`. [transfer none]

### act_user_get_icon_file ()

    const char *        act_user_get_icon_file              (ActUser *user);

Returns the path to the account icon belonging to `user`.

`user` : | a ActUser
Returns : | a path to an icon. [transfer none]

### act_user_get_language ()

    const char *        act_user_get_language               (ActUser *user);

Returns the path to the configured locale of `user`.

`user` : | a ActUser
Returns : | a path to an icon. [transfer none]

### act_user_get_location ()

    const char *        act_user_get_location               (ActUser *user);

Retrieves the location set by `user`.

`user` : | the user object to examine.
Returns : | a pointer to an array of characters which must not be modified or freed, or `NULL`. [transfer none]

### act_user_get_locked ()

    gboolean            act_user_get_locked                 (ActUser *user);

Returns whether or not the ActUser account is locked.

`user` : | a ActUser
Returns : | `TRUE` or `FALSE`

### act_user_get_login_frequency ()

    int                 act_user_get_login_frequency        (ActUser *user);

Returns the number of times `user` has logged in.

`user` : | a ActUser
Returns : | the login frequency

### act_user_get_login_history ()

    const GVariant *    act_user_get_login_history          (ActUser *user);

### act_user_get_login_time ()

    gint64              act_user_get_login_time             (ActUser *user);

### act_user_get_num_sessions ()

    guint               act_user_get_num_sessions           (ActUser *user);

Get the number of sessions for a user that are graphical and on the same seat as the session of the calling process.

`user` : | a user
Returns : | the number of sessions

### act_user_get_object_path ()

    const char *        act_user_get_object_path            (ActUser *user);

Returns the user accounts service object path of `user`, or `NULL` if `user` doesn't have an object path associated with it.

`user` : | a ActUser
Returns : | the object path of the user. [transfer none]

### act_user_get_password_hint ()

    const char *        act_user_get_password_hint          (ActUser *user);

Retrieves the password hint set by `user`.

`user` : | the user object to examine.
Returns : | a pointer to an array of characters which must not be modified or freed, or `NULL`. [transfer none]

### act_user_get_password_mode ()

    ActUserPasswordMode act_user_get_password_mode          (ActUser *user);

Retrieves the password mode of `user`.

`user` : | the user object to examine.
Returns : | a ActUserPasswordMode

### act_user_get_primary_session_id ()

    const char *        act_user_get_primary_session_id     (ActUser *user);

Returns the id of the primary session of `user`, or `NULL` if `user` has no primary session. The primary session will always be graphical and will be chosen from the sessions on the same seat as the seat of the session of the calling process.

`user` : | a ActUser
Returns : | the id of the primary session of the user. [transfer none]

### act_user_get_real_name ()

    const char *        act_user_get_real_name              (ActUser *user);

Retrieves the display name of `user`.

`user` : | the user object to examine.
Returns : | a pointer to an array of characters which must not be modified or freed, or `NULL`. [transfer none]

### act_user_get_shell ()

    const char *        act_user_get_shell                  (ActUser *user);

Retrieves the shell assigned to `user`.

`user` : | the user object to examine.
Returns : | a pointer to an array of characters which must not be modified or freed, or `NULL`. [transfer none]

### act_user_get_uid ()

    uid_t               act_user_get_uid                    (ActUser *user);

Retrieves the ID of `user`.

`user` : | the user object to examine.
Returns : | a pointer to an array of characters which must not be modified or freed, or `NULL`. [transfer none]

### act_user_get_user_name ()

    const char *        act_user_get_user_name              (ActUser *user);

Retrieves the login name of `user`.

`user` : | the user object to examine.
Returns : | a pointer to an array of characters which must not be modified or freed, or `NULL`. [transfer none]

### act_user_get_x_session ()

    const char *        act_user_get_x_session              (ActUser *user);

Returns the path to the configured X session for `user`.

`user` : | a ActUser
Returns : | a path to an icon. [transfer none]

### act_user_is_loaded ()

    gboolean            act_user_is_loaded                  (ActUser *user);

Determines whether or not the user object is loaded and ready to read from. "is-loaded" property must be `TRUE` before calling `act_user_manager_list_users()`

`user` : | a ActUser
Returns : | `TRUE` or `FALSE`

### act_user_is_local_account ()

    gboolean            act_user_is_local_account           (ActUser *user);

### act_user_is_logged_in ()

    gboolean            act_user_is_logged_in               (ActUser *user);

Returns whether or not ActUser is currently graphically logged in on the same seat as the seat of the session of the calling process.

`user` : | a ActUser
Returns : | `TRUE` or `FALSE`

### act_user_is_system_account ()

    gboolean            act_user_is_system_account          (ActUser *user);

Returns whether or not ActUser represents a 'system account' like 'root' or 'nobody'.

`user` : | a ActUser
Returns : | `TRUE` or `FALSE`

### act_user_set_account_type ()

    void                act_user_set_account_type           (ActUser *user,
                                                             ActUserAccountType account_type);

Changes the account type of `user`.

Note this function is synchronous and ignores errors.

`user` : | the user object to alter.
`account_type` : | a ActUserAccountType

### act_user_set_automatic_login ()

    void                act_user_set_automatic_login        (ActUser *user,
                                                             gboolean enabled);

If enabled is set to `TRUE` then this user will automatically be logged in at boot up time. Only one user can be configured to auto login at any given time, so subsequent calls to `act_user_set_automatic_login()` override previous calls.

Note this function is synchronous and ignores errors.

`user` : | the user object to alter
`enabled` : | whether or not to autologin for user.

### act_user_set_email ()

    void                act_user_set_email                  (ActUser *user,
                                                             const char *email);

Assigns a new email to `user`.

Note this function is synchronous and ignores errors.

`user` : | the user object to alter.
`email` : | an email address

### act_user_set_icon_file ()

    void                act_user_set_icon_file              (ActUser *user,
                                                             const char *icon_file);

Assigns a new icon for `user`.

Note this function is synchronous and ignores errors.

`user` : | the user object to alter.
`icon_file` : | path to an icon

### act_user_set_language ()

    void                act_user_set_language               (ActUser *user,
                                                             const char *language);

Assigns a new locale for `user`.

Note this function is synchronous and ignores errors.

`user` : | the user object to alter.
`language` : | a locale (e.g. en_US.utf8)

### act_user_set_location ()

    void                act_user_set_location               (ActUser *user,
                                                             const char *location);

Assigns a new location for `user`.

Note this function is synchronous and ignores errors.

`user` : | the user object to alter.
`location` : | a location

### act_user_set_locked ()

    void                act_user_set_locked                 (ActUser *user,
                                                             gboolean locked);

Note this function is synchronous and ignores errors.

`user` : | the user object to alter.
`locked` : | whether or not the account is locked

### act_user_set_password ()

    void                act_user_set_password               (ActUser *user,
                                                             const gchar *password,
                                                             const gchar *hint);

Changes the password of `user` to `password`. `hint` is displayed to the user if they forget the password.

Note this function is synchronous and ignores errors.

`user` : | the user object to alter.
`password` : | a password
`hint` : | a hint to help user recall password

### act_user_set_password_mode ()

    void                act_user_set_password_mode          (ActUser *user,
                                                             ActUserPasswordMode password_mode);

Changes the password of `user`. If `password_mode` is ACT_USER_PASSWORD_MODE_SET_AT_LOGIN then the user will be asked for a new password at the next login. If `password_mode` is ACT_USER_PASSWORD_MODE_NONE then the user will not require a password to log in.

Note this function is synchronous and ignores errors.

`user` : | the user object to alter.
`password_mode` : | a ActUserPasswordMode

### act_user_set_real_name ()

    void                act_user_set_real_name              (ActUser *user,
                                                             const char *real_name);

Assigns a new name for `user`.

Note this function is synchronous and ignores errors.

`user` : | the user object to alter.
`real_name` : | a new name

### act_user_set_user_name ()

    void                act_user_set_user_name              (ActUser *user,
                                                             const char *user_name);

Assigns a new username for `user`.

Note this function is synchronous and ignores errors.

`user` : | the user object to alter.
`user_name` : | a new user name

### act_user_set_x_session ()

    void                act_user_set_x_session              (ActUser *user,
                                                             const char *x_session);

Assigns a new x session for `user`.

Note this function is synchronous and ignores errors.

`user` : | the user object to alter.
`x_session` : | an x session (e.g. gnome)

## Property Details

### The `"account-type"` property

      "account-type"             gint                  : Read

The account type for this user.

Allowed values: [0,1]

Default value: 0

### The `"automatic-login"` property

      "automatic-login"          gboolean              : Read

Automatic Login.

Default value: FALSE

### The `"email"` property

      "email"                    gchar*                : Read

The email address for this user.

Default value: NULL

### The `"home-directory"` property

      "home-directory"           gchar*                : Read

The home directory for this user.

Default value: NULL

### The `"icon-file"` property

      "icon-file"                gchar*                : Read

The path to an icon for this user.

Default value: NULL

### The `"is-loaded"` property

      "is-loaded"                gboolean              : Read

Determines whether or not the user object is loaded and ready to read from.

Default value: FALSE

### The `"language"` property

      "language"                 gchar*                : Read

User's locale.

Default value: NULL

### The `"local-account"` property

      "local-account"            gboolean              : Read

Local Account.

Default value: FALSE

### The `"location"` property

      "location"                 gchar*                : Read

The location of this user.

Default value: NULL

### The `"locked"` property

      "locked"                   gboolean              : Read

Locked.

Default value: FALSE

### The `"login-frequency"` property

      "login-frequency"          gint                  : Read

login frequency.

Allowed values: >= 0

Default value: 0

### The `"login-history"` property

      "login-history"            GVariant*             : Read

The login history for this user.

Allowed values: GVariant<a(xxa{sv})>

Default value: NULL

### The `"login-time"` property

      "login-time"               gint64                : Read

The last login time for this user.

Allowed values: >= 0

Default value: 0

### The `"password-hint"` property

      "password-hint"            gchar*                : Read

Hint to help this user remember his password.

Default value: NULL

### The `"password-mode"` property

      "password-mode"            gint                  : Read

The password mode for this user.

Allowed values: [0,2]

Default value: 0

### The `"real-name"` property

      "real-name"                gchar*                : Read

The real name to display for this user.

Default value: NULL

### The `"shell"` property

      "shell"                    gchar*                : Read

The shell for this user.

Default value: NULL

### The `"system-account"` property

      "system-account"           gboolean              : Read

System Account.

Default value: FALSE

### The `"uid"` property

      "uid"                      gint                  : Read

The UID for this user.

Allowed values: >= 0

Default value: 0

### The `"user-name"` property

      "user-name"                gchar*                : Read

The login name for this user.

Default value: NULL

### The `"x-session"` property

      "x-session"                gchar*                : Read

User's X session.

Default value: NULL

## Signal Details

### The `"changed"` signal

    void                user_function                      (ActUser *arg0,
                                                            gpointer user_data)      : Run Last

Emitted when the user accounts changes in some way.

`user_data` : | user data set when the signal handler was connected.

### The `"sessions-changed"` signal

    void                user_function                      (ActUser *arg0,
                                                            gpointer user_data)      : Run Last

Emitted when the list of sessions for this user changes.

`user_data` : | user data set when the signal handler was connected.