User
Object Hierarchy:
Description:
Represents a user account on the system.
Namespace: Act
Package: accountsservice
Content:
Properties:
- public int account_type { get; }
- public bool automatic_login { get; }
- public string email { get; }
- public string home_directory { owned get; }
- public string icon_file { get; }
- public bool is_loaded { get; }
- public string language { get; }
The user’s locale, in the format `language[_territory][.
- public bool local_account { get; }
- public string location { get; }
- public bool locked { get; }
- public int login_frequency { get; }
- public Variant login_history { get; }
- public int64 login_time { get; }
- public bool nonexistent { get; }
- public string password_hint { get; }
- public int password_mode { get; }
- public string real_name { get; }
- public string shell { get; }
- public bool system_account { get; }
- public int uid { get; }
- public string user_name { get; }
- public string x_session { get; }
Creation methods:
- protected User ()
Methods:
- public int collate (User user2)
Organize the user by login frequency and names.
- public UserAccountType get_account_type ()
Retrieves the account type of this.
- public bool get_automatic_login ()
Returns whether or not User is automatically logged in at boot time.
- public unowned string get_email ()
Retrieves the email address set by this.
- public unowned string get_home_dir ()
Retrieves the home directory for this.
- public unowned string get_icon_file ()
Returns the path to the account icon belonging to this.
- public unowned string? get_language ()
Returns the value of language.
- public unowned string[]? get_languages ()
Returns the value of languages.
- public unowned string get_location ()
Retrieves the location set by this.
- public bool get_locked ()
Returns whether or not the User account is locked.
- public int get_login_frequency ()
Returns the number of times this has logged in.
- public unowned Variant get_login_history ()
Returns the login history for this.
- public int64 get_login_time ()
Returns the last login time for this.
- public uint get_num_sessions ()
Get the number of sessions for a user that are graphical and on the same seat as the session of the calling process.
- public uint get_num_sessions_anywhere ()
Get the number of sessions for a user on any seat of any type.
- public unowned string get_object_path ()
Returns the user accounts service object path of this, or
null
if this doesn't have an object path associated with it. - public void get_password_expiration_policy (out int64 expiration_time, out int64 last_change_time, out int64 min_days_between_changes, out int64 max_days_between_changes, out int64 days_to_warn, out int64 days_after_expiration_until_lock)
Get the password expiration policy for a user.
- public unowned string get_password_hint ()
Retrieves the password hint set by this.
- public UserPasswordMode get_password_mode ()
Retrieves the password mode of this.
- public unowned string get_primary_session_id ()
Returns the id of the primary session of this , or
null
if this has no primary session. - public unowned string get_real_name ()
Retrieves the display name of this.
- public bool get_saved ()
Returns whether or not the User account has retained state in accountsservice.
- public unowned string get_session ()
Returns the path to the configured session for this.
- public unowned string get_session_type ()
Returns the type of the configured session for this.
- public unowned string get_shell ()
Retrieves the shell assigned to this.
- public uint get_uid ()
Retrieves the ID of this.
- public unowned string get_user_name ()
Retrieves the login name of this.
- public unowned string get_x_session ()
Returns the path to the configured X session for this.
- public bool is_local_account ()
Retrieves whether the user is a local account or not.
- public bool is_logged_in ()
Returns whether or not User is currently graphically logged in on the same seat as the seat of the session of the calling process.
- public bool is_logged_in_anywhere ()
Returns whether or not User is currently logged in in any way whatsoever.
- public bool is_nonexistent ()
Retrieves whether the user is nonexistent or not.
- public bool is_system_account ()
Returns whether or not User represents a 'system account' like 'root' or 'nobody'.
- public void set_account_type (UserAccountType account_type)
Changes the account type of this.
- public void set_automatic_login (bool enabled)
If enabled is set to
true
then this user will automatically be logged in at boot up time. - public void set_email (string email)
Assigns a new email to this.
- public void set_icon_file (string icon_file)
Assigns a new icon for this.
- public void set_language (string language)
Assigns a new locale for this, setting language.
- public void set_languages (string[] languages)
- public void set_location (string location)
Assigns a new location for this.
- public void set_locked (bool locked)
Note this function is synchronous and ignores errors.
- public void set_password (string password, string hint)
Changes the password of this to
password
. - public void set_password_expiration_policy (int64 min_days_between_changes, int64 max_days_between_changes, int64 days_to_warn, int64 days_after_expiration_until_lock)
Set the password expiration policy for a user.
- public void set_password_hint (string hint)
- public void set_password_mode (UserPasswordMode password_mode)
Changes the password of this.
- public void set_real_name (string real_name)
Assigns a new name for this.
- public void set_session (string session)
Assigns a new session for this.
- public void set_session_type (string session_type)
Assigns a type to the session for this.
- public void set_user_expiration_policy (int64 expiration_time)
Set the user expiration policy for a user.
- public void set_user_name (string user_name)
Assigns a new username for this.
- public void set_x_session (string x_session)
Assigns a new x session for this.
Signals:
- public signal void changed ()
Emitted when the user accounts changes in some way.
- public signal void sessions_changed ()
Emitted when the list of sessions for this user changes.
Inherited Members:
All known members inherited from class GLib.Object