TlmAccountPlugin

TlmAccountPlugin — an interface for implementing tlm account plugins

Functions

Properties

GHashTable * config Read / Write / Construct Only

Types and Values

Object Hierarchy

    GInterface
    ╰── TlmAccountPlugin

Includes

#include <tlm-account-plugin.h>

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.

Functions

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 .

Parameters

self

plugin instance

 

user_name

the user name

 

Returns

whether the operation succeeded.


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.

Parameters

self

plugin instance

 

user_name

user name to check

 

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.

Parameters

self

plugin instance

 

user_name

user name to clean up

 

delete_account

whether the user account should be deleted

 

Types and Values

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.

Members

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()

 

TlmAccountPlugin

typedef struct _TlmAccountPlugin TlmAccountPlugin;

Opaque TlmAccountPlugin data structure.

Property Details

The “config” property

  “config”                   GHashTable *

This property holds a list of key-value pairs of plugin configuration taken from tlm.conf configuration file.

Flags: Read / Write / Construct Only