NewsFeaturesDownloadsDevelopmentSupportAbout Us

User data providers

From LifeType Wiki


LifeType's user data provider let's you easily set up userintegration with other applications. It does not provide single sign-on support (this would involve sharing session data between applications), but it allows to synchronize the user data of LifeType with any external application which either is running mysql or has a proper API to handle user data (i.e. provides access to user authentication and user management methods).

Read on to learn what user data providers are already available, how you configure them properly and how to create your own user data provider for LifeType!

Contents

Configuration

This is a generic configuration step that needs to be performed when configuring any user data provider other than LifeType's own.

Provider configuration data is located in a file called userdata.properties.php located in the config folder. This file is a basic PHP array called $config that must have at least one key called provider. By default when using LifeType's own user data provider, the $config array should look like this:

  $config = Array( 
    "provider" => "LifeTypeUserDataProvider",
  );

The provider key identifies the class name that is going to be used as the data provider. Provider classes are located in folder class/dao/userdata, and therefore a value of LifeTypeUserDataProvider as the value of the provider parameter refers to class file class/dao/userdata/lifetypeuserdataprovider.class.php.

The default LifeType 1.1 package includes two additional user data providers:

Additionally, each one of these providers may require a set of parameters that must be specified as part of the $config array such as database connection data, path to external classes, etc. Please refer to the documentation of each provider for more information.

It is strongly advised not to change from one provider to another when there is a lot of data loaded in the system. LifeType uses numeric identifiers to link blogs and users (as foreign keys), so user identifiers as specified in the blogs table will certainly not match if we switch from LifeType's own provider to the phpBB2's one. The most advisable way to work with user data providers is to install LifeType using the provider that we will needed, instead of changing things afterwards. This means that the file config/userdata.properties.php should be modified even before the installation process is started.

There are obviously way to synchronize the user ids between for example a phpBB2 installation and a LifeType installation, and then switch providers. However, these are per-site specific cases and will not be covered in this documentation.

phpBB2 User data provider

This provider integrates a phpBB2 userbase with LifeType.

This provider requires an additional database table in the LifeType installation called lt_phpbb2_users. This table is needed to store certain user information that is required by LifeType and that cannot be stored anywhere in the phpBB2 database. In any case, this table is automatically handled by the provider so there should be no need to mess around with it.

This provider requires the following parameters:

  • provider: the value should be PhpBB2UserDataProvider.
  • createBlogIfNotExisting: this is a boolean value that tells the provider whether existing users in phpBB2 who do not have a blog in LifeType yet should get one created automatically. If set to true, a blog will be created for this users while if set to false, only users who register after this provider is switched on will get their blog created.
  • database: Name of the database where to find the phpBB2 user data.
  • user: Name of the user used to connect to the phpBB2 database.
  • password: Password required by the user above.
  • prefix: Prefix used in all the tables in the database.

Postnuke User data provider

This provider integrates a Postnuke userbase with LifeType.

This provider requires the following parameters:

  • provider: the value should be SimplePostNukeUserDataProvider.
  • createBlogIfNotExisting: same as in the phpBB2 user data provider.
  • host: host where to find the postnuke database.
  • database: database where the postnuke user data is stored.
  • user: name of the user used to connect to the postnuke database.
  • password: password required by the user above.
  • prefix: prefix used in all the tables in the database.
  • blogtitle_postfix: default value that will be appended to create the name of new blogs.

Vbb user data provider

not contain in lifetype 1.1 version

This provider integrates a vBulletin forum(vbb) userbase with LifeType.

This provider reuse an additional database table in the LifeType installation called lt_phpbb2_users(alreay in the standard lifetype 1.1 install) . This table is needed to store certain user information that is required by LifeType and that cannot be stored anywhere in the vbb database.

This provider requires the following parameters:

  • provider: the value should be vbb3UserDataProvider.
  • createBlogIfNotExisting:this is a boolean value that tells the provider whether existing users in vbb who do not have a blog in LifeType yet should get one created automatically. If set to true, a blog will be created for this users while if set to false, only users who register after this provider is switched on will get their blog created.
  • database: Name of the database where to find the vbb user data.
  • user: Name of the user used to connect to the vbb database.
  • password: Password required by the user above.
  • prefix: Prefix used in vbb tables in the database.
  • usesalt: New version of vbb use password salt to store the password in the base . If vbb version > 3 , set the value to true .
  • allowgroup: User's group in allowgroup could log in lifetype as active user.
  • denygroup: User's group in denygroup could not log in lifetype , useless in current version .
  • admingroup: User's group in admingroup will log in lifetype as site admin .
  • adminuser: User's id in adminuser will log in lifetype as site admin

Wbb2 User data provider

not contained in lifetype 1.1 version

This provider integrates a woltlab burning board2(wbb2) userbase with LifeType.

For additional userinfo the internal database-table lt_phpbb2_users(which alreay comes with lifetype 1.1 install) is used. This table is needed to store certain user information that is required by LifeType and that cannot be stored anywhere in the wbb2 database.

The provider is activated editing config/userdata.config.php by adding the following code (and eliminating the standard code for lifetype-internal provider):

#
# WBB2 user data provider
#
$config = Array(
  // general
  "provider" => "WBBUserDataProvider",
  "createBlogIfNotExisting" => true,
 
  // wbb2 db connection
  "host" => "localhost",                       //database server default: localhost
  "database" => "",                            //database name
  "user" => "",                                //database user
  "password" => "",                            //user-password
  "prefix" => "bb1_",                          //wbb2-prefix default: bb1_
  "admingroup"  => Array('1','11','42'),       //groupcombinationIDs for Admin default: 1,11,42
  "blogtitle_postfix" => "'s Blog"              // This string gets appended to the username in blogtitle: "Username's Blog"
);

Herein the parameters are as follows:

  • provider: the value should be WBBUserDataProvider.
  • createBlogIfNotExisting:this is a boolean value that tells the provider whether existing users in wbb2 who do not have a blog in LifeType yet should get one created automatically. If set to true, a blog will be created for this users while if set to false, only users who register after this provider is switched on will get their blog created.
  • host: Name of the wbb's database-host, usually localhost.
  • database: Name of the database where to find the wbb2 user data.
  • user: Name of the user used to connect to the wbb2 database.
  • password: Password required by the user above.
  • prefix: Prefix used in wbb2 tables in the database, usually bb1_.
  • admingroup: wbb2-users within these groupcombinations will log in lifetype as site admin, just as they do in forum . By default groubcombinations for Admins are 1, 11 and 42
  • blogtitle_postfix: This string will be appended to the username for blogtitle when creating a new blog.

The provider-class, which is to be stored in class/dao/userdata/ can be obtained here.

Joomla User data provider

This provider provides integration between LifeType and a working Joomla integration.

Before configuring the provider, please run the following SQL query in your database server, as this table is needed by the provider code to store certain information that is not provided by Joomla:

CREATE TABLE `lt_joomla_users` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `joomla_id` int(10) unsigned NOT NULL,
  `about` text,
  `properties` text NOT NULL,
  `resource_picture_id` int(10) NOT NULL default '0',
  `blog_site_admin` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `joomla_id` (`joomla_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;

In order to activate the provider, edit the file config/userdata.properties.php, comment the lines that reference the currently active provider and comment out the following ones:

$config = Array( 
  // general
  "provider" => "JoomlaUserDataProvider",
  "createBlogIfNotExisting" => true,

  // Joomla db connection
  "host" => "mysql_host",
  "database" => "joomla_db",
  "user" => "joomla_db_user",
  "password" => "joomla_db_pass",
  "prefix" => "jos_",

  // This string gets appended to the username and results
  // in "Username's Weblog"
  "blogtitle_postfix" => "'s Weblog"
);

The following parameters must be provided:

  • provider: Name of the provider class. Do not change.
  • createBlogIfNotExisting: If the user does not have a blog, one will be created the first time the user is loaded.
  • host: Name of the host where your Joomla database is located.
  • database: Name of your Joomla database.
  • user: Name of the user used to access the Joomla database.
  • password: Password for the Joomla user.
  • prefix: Prefix used in the Joomla tables.
  • blogtitle_postfix: A string that will be used as a postfix for all the new blogs automatically created.

Developing custom providers

Please see Developing User Data Providers.