DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: vBulletin connect

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Herbert Roider
Changed:2011-11-26T11:18:16
Email:herbert.roider@utanet.at

EXT: vBulletin connect

Extension Key: hr_vbulletin_connect

Copyright 2000-2011, Herbert Roider <herbert.roider@utanet.at>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.TYPO3.com

Table of Contents

EXT: vBulletin connect 1

Introduction 1

What does it do? 1

Administration 1

Backend Module (info->vBulletin_user) 2

Backend (list Module) 2

Programmers API (advanced) 2

FAQ 4

Configuration 5

Installation 5

Frontend User Administration 5

FAQ 5

Known problems 6

To-Do list 6

Changelog 6

Introduction

What does it do?

It sync the user table of vBulletin and the fe_users of TYPO3 and allows single sign on.

The master system is TYPO3 , which handles the frontend users. You can easy edit, delete and create frontend user from the backend of TYPO3. This extension handles the equivalent vBulletin users. Only overlapping fields are syncronized: usernamen , password , email, www . and usergroups .

Frontendusers can also created and edited by frontenduser, with the extensions: “feuser_admin” and “ sr_feuser_register ”.

This extension comes with a vBulletin Plugin , which handles the update of the TYPO3 fe_users, when a user is updated or deleted from vBulletin. But not if a user is created from vBulletin.

If you have already vBulletin user, you should import this in TYPO3, but these users have to ask for a new password with the “password forgotten” link from the newloginbox, because the password from vBulletin is a md5 hash which cannot converted into the typo3 password.

This extension is experimental but it should work! If you have troubles, please send me an email: herbert.roider@utanet.at

I have developed and tested the extension with TYPO3 version 3.8.1, 4.0.1, 4.4.4, 4.6.0 and vBulletin version 3.6.1, 3.6.4 and 4.1.7

Administration

TYPO3 handles the default user groups for vBulletin. If there are custom user groups in vBulletin, this groups will be untouched by TYPO3, but these groups are only append after the default groups in the membergroup field.

You can also edit a user in the backend of vBulletin. But if you create a new user, this is not automatic created for TYPO3! Create new user only in TYPO3.

Don't edit user groups from in the backend of vBulletin , because TYPO3 overrides this group at the next editing with TYPO3. This feature will add in the future. Edit the groups of a user only with TYPO3!

If a TYPO3 user is “disable” then the extension override the vBulletin maingroup to 1 (unregistered).

Backend Module (info->vBulletin_user)

“not connected TYPO3 users”: Show the TYPO3 users where no equivalent vBulletin users exists. It allows to create equivalent vBulletin users to allow single sign on.

not connected TYPO3 users

Function

not connected TYPO3 users

Description

Show the TYPO3 users where no equivalent vBulletin users exists. It allows to create equivalent vBulletin users to allow single sign on by clicking this icon:

img-1

connected users

Function

connected users

Description

Show all TYPO3 users with an existing VBbulletin user.

img-2 red icon marked users: can only loggin at the VBulletin board. These users have to ask for a new password with the “forgotten password” link.

You can create the equivalent vBulletin users by clicking the icon beside the userid.

not connected vBulletin users

Function

not connected vBulletin users

Description

Shows all vBulletin users without a equivalent TYPO3 user.

img-1 click this icon to import vBulletin users, but they must ask for a new password by clicking the “forgotten password” link.

Backend (list Module)

You can input in the password field plain text, it will be converted into md5 hash. But there is no way to restore the password. The equivalent vBulletin user will be also updated, and if no vBulletin user exists, it will be created.

Programmers API (advanced)

The extension provides a API e.g. for programmers to extend the edit forms for frontendusers. Refer the script: class.user_vbulletin_feAdmin.php, The API encapsulate the vBulletin data managers. Refer the vBulletin manual for details.

Include this files:

require_once(t3lib_extMgm::extPath('hr_vbulletin_connect')."user_vBulletin_global.php");
require_once(t3lib_extMgm::extPath('hr_vbulletin_connect').'class.user_feuser_vbulletinuser_sync.php');

The object of the class user_feuser_vbulletinuser_synccan be a class member:

$this->vBulletin_sync = t3lib_div::makeInstance('user_feuser_vbulletinuser_sync');

Test if email is valid. $email is called by reference, so maybe vBulletin change this value! If a vBulletin user already exists , then you must call set_existing . Because vBulletin test if a email address is unique for a new user.

$vb_user = fetch_userinfo($TYPO3_fe_user['tx_hrvbulletinconnect_vbulletin_user_id']);
if(is_array($vb_user)){
    $this->vBulletin_sync->vBulletin_userdata->set_existing($vb_user);
}

$email="herbert.roider@utanet.at";
if(!$this->vBulletin_sync->vBulletin_userdata->verify_useremail($email)){
    echo 'You must enter a valid email address';
}

Use this for all equivalent userdata like email, www and username. You can use this also for the password, but vBulletin converts the password in a hash! This is maybe not usable.

create a new user:

For the function user_create the $TYPO3_fe_user should contains username , password (md5 or plaintext ->vBulletin has no problems with both) and email . For the post_user_create it is necessary, that the array contains the field “uid”, but all of the other fields are not used.

$vBulletin_userdata = $this->vBulletin_sync->user_create($TYPO3_fe_user);
if (!empty($vBulletin_userdata->errors))
{
    foreach ($vBulletin_userdata->errors AS $index => $error)
    {
            echo $error;
    }
    return;
}

//Save the fe_user:
user_feAdmin::save();
if(!$this->saved){
    /* Save of the fe_user fails, but a vBulletinuser is created,
     but no equivalent TYPO3 user, so
     delete the vBulletin user.
    */
    $vBulletin_userdata->delete();
}else{
    $this->vBulletin_sync->post_user_create($TYPO3_fe_user);
}

There are 2 functions to create a vBulletin user:

user_create($fe_user) and post_user_create($fe_user). Both functions must be called!. The second function must called after the fe_user is saved, because this function change the record in the fe_user table!

The same way to update a fe_user. There are also 2 functions:

user_update($fe_user) and post_user_update($fe_user). The second function must also called after the fe_user database operation.

/* Save the TYPO3 fe_user */
user_feAdmin::save();
$vBulletin_userdata = $this->vBulletin_sync->user_update($TYPO3_fe_user);
if($vBulletin_userdata == false){
    return;
}
if (!empty($vBulletin_userdata->errors))
{
    foreach ($vBulletin_userdata->errors AS $index => $error)
    {
            echo $error;
    }
    return;
}

//debug("postupdate");
$this->vBulletin_sync->post_user_update($TYPO3_fe_user);

In the array: $vBulletin_userdata->errors are the errormessages. If no error, this array is empty.

each function: user_create, post_user_create, user_update, post_user_update returns the userdata. Refer the vBulletin API for details. But in the error array there are also custom error messages from the class user_feuser_vbulletinuser_sync.The custom messages are in English, but the vBulletin error messages in the default language.of VBulletin

Delete a user:

$this->vBulletin_sync->user_delete($TYPO3_user_uid);

There are 3 fields username, email and www, which should have the same value. 3 new fields are added in fe_users:

tx_hrvbulletinconnect_vbulletin_user_id

New fields in fe_users

tx_hrvbulletinconnect_vbulletin_user_id

Description

The userid of the vBulletin user

tx_hrvbulletinconnect_vbulletin_user_password

New fields in fe_users

tx_hrvbulletinconnect_vbulletin_user_password

Description

This value is no more usec since version 1.0.0. The same value as the vBulletin password

tx_hrvbulletinconnect_vbulletin_user_salt

New fields in fe_users

tx_hrvbulletinconnect_vbulletin_user_salt

Description

This value is no more usec since version 1.0.0 . The same value as the vBulletin salt

The following graphic shows the classes of the extension. Blue classes run in the Vbulletin space and orange classes run in the TYPO3 space. The main script of Vbulletin is included in TYPO3 by the extension, so the Vbulletin datamanager run also in the TYPO3 space and can called directly. This decrease the speed but makes easy to modify userdata of the vbulletin user. Before the vBulletin Script is included the GET Vars are stored in a variable and the $_GET array is deleted to avoid influence of TYPO3 parameter in Vbulletin. After include of the script the GET Vars are written back.

img-3 FAQ

- no questions at the moment

Configuration

Installation

Require:

curl support must be enabled.Check if php curl support is enabled in php. Check phpinfo and search for curl.

For TYPO3 version < 4.2.0 the extension “newloginbox” is requiered. For newer TYPO3 versions this extension is replaced by felogin . Both classes are extend by hr_vbulletin_connect because of the “forgot Password” function.

The extension “ feuser_admin” is requiered only if frontenduser should able to edit their data and register users (which is usual wanted).

The extension “kb_md5fepw” is requiered, because the passwordfield in the database must be a md5 value. kb_md5fepw must installed before hr_vbulletin_connect will be installed. If you get an errormessage about php-version and TYPO3 Version, click the checkboxes “ignore”. It doesn't work with “saltedpasswords” and “rsaauth”.

The extension “static_info_tables” is recommmended if typo3 should recognize the selected language from vbulletin. Instead of this extension you can input in the field “Language” (Website Language Record) the official ISO code for the Language like “de” for german or “en” for english. Otherwise the language recognizion won't work.

Don't install TYPO3 inside the directory of vBulletin, because a script try to determine if the referer is vBulletin. If TYPO3 is installed inside vBulletin, every TYPO3 page is matching. But it is allowed to install vBulletin inside of the TYPO3 directory.

Steps:
  • Install vBulletin on the same server. I installed this in a directory “forums” in the typo3 root folder.
  • Install the extension with the extension manager. The extension manager ask for all required values like the usergroup mapping and the language mapping and much more. It is important to create for each vBulletin usergroup a TYPO3 usergroup. Be careful by setting the path to vBulletin. If you get an Error Message read “ Known Problems ” for a solution.
  • Install the vBulletin Plugin. You can found this in the folder “vBulletin_plugin”. Copy the file: update_typo3_user_hook.phpin the vBulletin includes directory and edit the the config section on the top of the file. See the comments in the file.
  • Import the TYPO3 fe_user to vBulletin:Info -> “vBulletin_user” -> “not connected typo3 user”.See: Backend Module for details.
  • You must set this in the localconf.php (or with the Install tool):$TYPO3_CONF_VARS["FE"]["debug"]= '0';to avoid debug output comments, which makes troubles if you want to edit a user in vBulletin. A hook calls the typo3 site and parse the returned xml- data. The html-comments make troubles. Maybe there is another solution to avoid this, but I havn't found it.
  • See Frontend User Administration with feuser_admin or :underline:`Frontend User Administration with sr\_feuser\_register <#0.0.0.Frontend%20User%20Administration%20with%20sr_feuser_register|o utline>`_

If you want to debug this extension install the “rlmp_filedevlog” from Robert Lemke and set the value in the localconf.php or in the install tool of the parameter: $TYPO3_CONF_VARS["SYS"]["enable_DLOG"]= '1';

Frontend User Administration with feuser_admin

A skript where frontend user can register or edit their data is added. This script: class.user_vbulletin_feAdmin.php is based on the user_feAdmin (feuser_admin) and ux_feadminLib.php from the extension “kb_md5fepw”. The configuration is mostly the same, but with additional features for disblay errormessages and sync the vBulletin users. Ensure that the static Template “fe_admin(hr_vbulletin_connect” is included.

  • install the plugin: Frontend User administration (feuser_admin) and place it on a page (Page Module). The fields “Startingpoint” and “CODE” are ignored by this plugin.
  • Insert the static template “Include static (from extensions)” fe_admin (hr_vbulletin_connect).
  • Edit the Constants for PLUGIN.FEADMIN.FE_USERS in the Constant Editor:insert the page id of the page which contains the fe_users in the the Record PID – fieldandset the Usergroup override to the usergroup for registered users.
  • Ensure that the pid of the page is the same as in the file update_typo3_user_hook.phpin the vBulletin includes directory.

The file fe_admin_fe_users.tmpl is mostly the same as the original from feuser_admin. Only the the code to show errormessages if the “www” is added.

Frontend User Administration with sr_feuser_register

  • Install the extension: “ sr_feuser_register ” as described in the manual of the extension.
  • Insert on the three pages which contains “sr_feuser_register” the static Typoscript template: “sr_feuser_register (hr_vbulletin_connect)”

FAQ

- no questions at the moment

Known problems

  • This extension cannot import the password from vBulletin users, because this are saved as a md5 hash like:md5(md5(“plain_password”).salt)Typo3 need the passwords like:md5(“plain_password”).Therefore users can only login from vBulletin, or ask for a new password (“forgotten password” link).
  • Attention if you set the wrong path to vBulletin in the Extension Manager than you get a errormessage like this: Fatal error : main() [ function.chdir ]: Failed opening required './global.php' (include_path='.:') in /home/herbert/htdocs /dummy-4.0.1/typo3conf/temp_CACHED_psfd96_ext_localconf.php on line 416 **Solution:**

Open localconf.php and delete the extension key entry “hr_vbulletin_connect” in the variable (This should be the last entry): $TYPO3_CONF_VARS['EXT']['extList']='css_styled_content,tsc onfig_help,context_help,extra_page_cm_options,impexp,sys_note,ts template,tstemplate_ceditor,tstemplate_info,tstemplate_objbrowser,t stemplate_analyzer,func_wizards,wizard_crpages,wizard_sortpages,lo wlevel,install,belog,beuser,aboutmodules,setup,taskcenter,info_pagets config,viewpage,rtehtmlarea,t3skin,calendar,calendar_ext,tt_news,feu ser_admin,hr_vbulletin_connect';

Delete the two cache files in folder “typo3conf” temp_CACHED_xxxxx_ext_localconf.php and temp_CACHED_xxxxx_ext_tables.php and try again to set the path. It can be relative or absolute path like “/home/herbert/htdocs/forums” or “forums” (relative from the root folder of the TYPO3.

  • For usernames and passwords only ascii characters are allowed. This is not only a problem of this extension, also kb_md5fepw cannot handle non ascii characters in the username. The extension can check this for the username, but not for the password, because it comes as md5 hash.
  • running theTemplaVoilàWizard won't work because of a errormessage. Deinstall hr_vbulletin_connect before running the wizard.
  • do not run with saltedpasswords, because it is necessary that the passwords are stored as md5 hash in Database. If a user change the password in vBulletin, the password comes as md5 hash.

To-Do list

  • Error messages are only in English.
  • When change the usergroups or membergroups from vBulletin, TYPO3 will override this groups at the next update of the user. So change the groups for a user only from TYPO3 backend! This is a missing feature at the moment.
  • TYPO3 try to set the same language as vbulletin, but vbulletin doesn't do the same with the typo3 language.

Changelog

The version 1.1.x does not include the vbulletin files on every page. Only when it is required. This increase the speed.

img-4 EXT: vBulletin connect - 7