TlmAccountPlugin

TlmAccountPlugin — an interface for implementing tlm account plugins

Synopsis

#include <tlm-account-plugin.h>

struct              TlmAccountPluginInterface;
gboolean            tlm_account_plugin_cleanup_guest_user
                                                        (TlmAccountPlugin *self,
                                                         const gchar *user_name,
                                                         gboolean delete_account);
gboolean            tlm_account_plugin_is_valid_user    (TlmAccountPlugin *self,
                                                         const gchar *user_name);
gboolean            tlm_account_plugin_setup_guest_user_account
                                                        (TlmAccountPlugin *self,
                                                         const gchar *user_name);

Description

TlmAccountPlugin is an interface for implementing tlm account plugins.

The plugin API

Tlm account plugins provide an API for system-specific account operations: setting up and cleaning up guest user account, and checking username validity. They should implement the plugin interface specified here.

Example plugins

See example plugin implementation here: https://github.com/01org/tlm/tree/master/src/plugins/default and here: https://github.com/01org/tlm/tree/master/src/plugins/gumd.

Details

struct TlmAccountPluginInterface

struct TlmAccountPluginInterface {
   GTypeInterface parent;

    gboolean (*setup_guest_user_account) (TlmAccountPlugin *self,
                                          const gchar *user_name);
    gboolean (*is_valid_user) (TlmAccountPlugin *self,
                               const gchar *user_name);

   gboolean  (*cleanup_guest_user) (TlmAccountPlugin *self,
                                    const gchar *guest_user,
                                    gboolean delete_account);
};

TlmAccountPluginInterface interface containing pointers to methods that all plugin implementations should provide.

GTypeInterface parent;

parent interface type.

setup_guest_user_account ()

implementation of tlm_account_plugin_setup_guest_user_account()

is_valid_user ()

implementation of tlm_account_plugin_is_valid_user()

cleanup_guest_user ()

implementation of tlm_account_plugin_cleanup_guest_user()

tlm_account_plugin_cleanup_guest_user ()

gboolean            tlm_account_plugin_cleanup_guest_user
                                                        (TlmAccountPlugin *self,
                                                         const gchar *user_name,
                                                         gboolean delete_account);

When a guest user logs out, this method is called. It should clean up the home directory of the user, and, if delete_user is set, delete the user account.

self :

plugin instance

user_name :

user name to clean up

delete_account :

whether the user account should be deleted

tlm_account_plugin_is_valid_user ()

gboolean            tlm_account_plugin_is_valid_user    (TlmAccountPlugin *self,
                                                         const gchar *user_name);

Checks if the user with a given user_name exists.

self :

plugin instance

user_name :

user name to check

tlm_account_plugin_setup_guest_user_account ()

gboolean            tlm_account_plugin_setup_guest_user_account
                                                        (TlmAccountPlugin *self,
                                                         const gchar *user_name);

This method creates and sets up a guest user account with a provided user_name.

self :

plugin instance

user_name :

the user name

Returns :

whether the operation succeeded.