Gallery2 + Typo3 user synchronization

henrik_479

Joined: 2008-01-15
Posts: 4
Posted: Wed, 2008-01-23 12:54

Hi,

Been trying for a while now to synchronize the users from our Typo3 site with the user table in Gallery2.
We want g2 users to be created/updated/deleted synchronous with the Typo3 users. In the available hook in the registration form i have the following code:

require_once(t3lib_extMgm::extPath('gallery2').'lib/class.tx_gallery2_api.php');
include_once('httpsocket.php');
include_once('da_login.php');
$galleryHome = '/home/usgplaza/domains/plaza.usginnotiv.nl/public_html/gallery2/';
include($galleryHome.'embed.php');
include($galleryHome.'config.php');

class tx_srfeuserregister_hooksHandler {
function registrationProcess_afterSaveCreate($recordArray, &$invokingObj) {
<snip>
$ret = GalleryEmbed::init(array(
'g2Uri' => '/Gallery2/',
'embedUri' => '/index.php?id=116',
'activeUserId' => '',
'fullInit' => true
));

$user = Array( //these values are just for testing, the final implementation will have dynamic variables of course
'username' => 'testuser',
'email' => 'testuser@test.com',
'fullname' => 'mrtest',
'language' => 'EN',
'password' => 'testtesttest',
'creationtimestamp' => time()
);
debug('creating gallery user');
$ret = GalleryEmbed::createUser($user['username'], $user);
debug($ret);
<snip>

the last debug statement returns NULL, which should mean the createUser function executed properly, but when looking in the g2_user or g2_externalIdMap tables no entries seem to have been added.

Been puzzling with this for some days now and i'm honestly quite clueless, if anyone could give me a hint it would be greatly appreciated.

Regards

henrik