Back to index

lightdm  1.3.2
Classes | Defines | Typedefs | Functions
accounts.h File Reference
#include <glib-object.h>
#include <gio/gio.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  User
struct  UserClass

Defines

#define USER_TYPE   (user_get_type())
#define USER(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), USER_TYPE, User));

Typedefs

typedef struct UserPrivate

Functions

Useraccounts_get_user_by_name (const gchar *username)
Useraccounts_get_user_by_uid (uid_t uid)
Useraccounts_get_current_user (void)
GType user_get_type (void)
const gchar * user_get_name (User *user)
uid_t user_get_uid (User *user)
gid_t user_get_gid (User *user)
const gchar * user_get_gecos (User *user)
const gchar * user_get_home_directory (User *user)
const gchar * user_get_shell (User *user)
const gchar * user_get_xsession (User *user)
void user_set_xsession (User *user, const gchar *session)
const gchar * user_get_locale (User *user)
void user_set_language (User *user, const gchar *language)

Class Documentation

struct User

Definition at line 26 of file accounts.h.

Collaboration diagram for User:
Class Members
GObject parent_instance
UserPrivate * priv
struct UserClass

Definition at line 32 of file accounts.h.

Class Members
GObjectClass parent_class

Define Documentation

#define USER (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), USER_TYPE, User));

Definition at line 22 of file accounts.h.

#define USER_TYPE   (user_get_type())

Definition at line 21 of file accounts.h.


Typedef Documentation

typedef struct UserPrivate

Definition at line 24 of file accounts.h.


Function Documentation

Definition at line 288 of file accounts.c.

{
    return user_from_passwd (getpwuid (getuid ()));
}

Here is the call graph for this function:

Here is the caller graph for this function:

User* accounts_get_user_by_name ( const gchar *  username)

Definition at line 251 of file accounts.c.

{
    struct passwd *user_info;
    User *user = NULL;

    g_return_val_if_fail (username != NULL, NULL);

    errno = 0;
    user_info = getpwnam (username);
    if (user_info)
        user = user_from_passwd (user_info);

    if (!user && errno != 0)
        g_warning ("Unable to get information on user %s: %s", username, strerror (errno));

    return user;
}

Here is the call graph for this function:

Here is the caller graph for this function:

User* accounts_get_user_by_uid ( uid_t  uid)

Definition at line 270 of file accounts.c.

{
    User *user = NULL;

    errno = 0;
    struct passwd *user_info;

    user_info = getpwuid (uid);
    if (user_info)
        user = user_from_passwd (user_info);

    if (!user && errno != 0)
        g_warning ("Unable to get information on user %d: %s", uid, strerror (errno));

    return user;
}

Here is the call graph for this function:

const gchar* user_get_gecos ( User user)

Definition at line 315 of file accounts.c.

{
    g_return_val_if_fail (user != NULL, NULL);
    return user->priv->gecos;
}
gid_t user_get_gid ( User user)

Definition at line 308 of file accounts.c.

{
    g_return_val_if_fail (user != NULL, 0);
    return user->priv->gid;
}

Here is the caller graph for this function:

const gchar* user_get_home_directory ( User user)

Definition at line 322 of file accounts.c.

{
    g_return_val_if_fail (user != NULL, NULL);
    return user->priv->home_directory;
}

Here is the caller graph for this function:

const gchar* user_get_locale ( User user)

Definition at line 336 of file accounts.c.

{
    g_return_val_if_fail (user != NULL, NULL);

    g_free (user->priv->locale);
    if (user->priv->proxy)
        user->priv->locale = NULL;
    else
        user->priv->locale = get_string_from_dmrc (user->priv->name, "Desktop", "Language");

    /* Treat a blank locale as unset */
    if (g_strcmp0 (user->priv->locale, "") == 0)
    {
        g_free (user->priv->locale);
        user->priv->locale = NULL;
    }

    return user->priv->locale;
}

Here is the call graph for this function:

const gchar* user_get_name ( User user)

Definition at line 294 of file accounts.c.

{
    g_return_val_if_fail (user != NULL, NULL);
    return user->priv->name;
}

Here is the caller graph for this function:

const gchar* user_get_shell ( User user)

Definition at line 329 of file accounts.c.

{
    g_return_val_if_fail (user != NULL, NULL);
    return user->priv->shell;
}

Here is the caller graph for this function:

GType user_get_type ( void  )
uid_t user_get_uid ( User user)

Definition at line 301 of file accounts.c.

{
    g_return_val_if_fail (user != NULL, 0);
    return user->priv->uid;
}

Here is the caller graph for this function:

const gchar* user_get_xsession ( User user)

Definition at line 377 of file accounts.c.

{
    GVariant *result;

    g_return_val_if_fail (user != NULL, NULL);

    g_free (user->priv->xsession);
    if (user->priv->proxy)
    {
        if (get_property (user->priv->proxy, "XSession", "s", &result))
        {
            g_variant_get (result, "s", &user->priv->xsession);
            g_variant_unref (result);
        }
        else
            user->priv->xsession = NULL;
    }
    else
        user->priv->xsession = get_string_from_dmrc (user->priv->name, "Desktop", "Session");

    if (g_strcmp0 (user->priv->xsession, "") == 0)
    {
        g_free (user->priv->xsession);
        user->priv->xsession = NULL;
    }

    return user->priv->xsession;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void user_set_language ( User user,
const gchar *  language 
)

Definition at line 357 of file accounts.c.

{
    g_return_if_fail (user != NULL);

    if (user->priv->proxy)
        call_method (user->priv->proxy, "SetLanguage", g_variant_new ("(s)", language), "()", NULL);
    else
        save_string_to_dmrc (user->priv->name, "Desktop", "Language", language);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void user_set_xsession ( User user,
const gchar *  session 
)

Definition at line 368 of file accounts.c.

{
    g_return_if_fail (user != NULL);

    call_method (user->priv->proxy, "SetXSession", g_variant_new ("(s)", xsession), "()", NULL);
    save_string_to_dmrc (user->priv->name, "Desktop", "Session", xsession);
}

Here is the call graph for this function:

Here is the caller graph for this function: