#1 2013-03-21 20:51:37

MrTall
Guest

Piwigo 2.5 & PHPBB3.x

Hello all,

My Gallery2 integration has died on my forum so I'm looking at alternatives and I really like the look of Piwigo.

I've done a fair but of searching but I can't find any definite solution so I thought I'd ask here.

Is there any type of user bridge or modification that can be made so that Piwigo uses the user database I already have allowing the members of my phpbb site to add albums and images?

I'm eagerly watching this topic and if anyone has a solution please let me know! :D

Thanks

 

#2 2013-03-21 21:00:00

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Piwigo 2.5 & PHPBB3.x

take a look at  the file 'include/config_default.inc.php' (DON'T MODIFY THIS FILE, use local files editor plugin instead)


Code:

// remember_me_name: specifies the name of the cookie used to stay logged
$conf['remember_me_name'] = 'pwg_remember';

// users_table: which table is the reference for users? Can be a different
// table than Piwigo table
//
// ................
$conf['users_table'] = null;

// user_fields : mapping between generic field names and table specific
// field names. For example, in PWG, the mail address is names
// "mail_address" and in punbb, it's called "email".
$conf['user_fields'] = array(
  'id' => 'id',
  'username' => 'username',
  'password' => 'password',
  'email' => 'mail_address'
  );

// password_hash: function hash the clear user password to store it in the
// database. The function takes only one parameter: the clear password.
$conf['password_hash'] = 'pwg_password_hash';

// password_verify: function that checks the password against its hash. The
// function takes 2 mandatory parameter : clear password, hashed password +
// an optional parameter user_id. The user_id is used to update the password
// with the new hash introduced in Piwigo 2.5. See function
// pwg_password_verify in include/functions_user.inc.php
$conf['password_verify'] = 'pwg_password_verify';

// guest_id : id of the anonymous user
$conf['guest_id'] = 2;

// webmaster_id : webmaster'id.
$conf['webmaster_id'] = 1;

Offline

 

#3 2013-03-25 16:38:15

MrTall
Guest

Re: Piwigo 2.5 & PHPBB3.x

Thanks for the reply, certainly guided me in the right direction though I'm hitting obstacles on the way.

The piwigo tables are in the same database as phpbb and my configuration looks like:

Code:

// +-----------------------------------------------------------------------+
// |                            authentication                             |
// +-----------------------------------------------------------------------+

// apache_authentication : use Apache authentication as reference instead of
// users table ?
$conf['apache_authentication'] = false;

// users_table: which table is the reference for users? Can be a different
// table than Piwigo table
//
// If you decide to use another table than the default one, you need to
// prepare your database by deleting some datas :
//
// delete from piwigo_user_access;
// delete from piwigo_user_cache;
// delete from piwigo_user_feed;
// delete from piwigo_user_group;
// delete from piwigo_user_infos;
// delete from piwigo_sessions;
// delete from piwigo_rate;
// update piwigo_images set rating_score = null;
// delete from piwigo_caddie;
// delete from piwigo_favorites;
//
// All informations contained in these tables and column are related to
// piwigo_users table.
$conf['users_table'] = phpbb_users;

// If you decide to use external authentication
// change conf below by $conf['external_authentification'] = true;
$conf['external_authentification'] = false;

// Other tables can be changed, if you define associated constants
// Example:
//   define('USER_INFOS_TABLE', 'pwg_main'.'user_infos');

// user_fields : mapping between generic field names and table specific
// field names. For example, in PWG, the mail address is names
// "mail_address" and in punbb, it's called "email".
$conf['user_fields'] = array(
  'id' => 'user_id',
  'username' => 'username',
  'password' => 'user_password',
  'email' => 'user_email'
  );

// password_hash: function hash the clear user password to store it in the
// database. The function takes only one parameter: the clear password.
$conf['pass_convert'] = create_function('$s', 'return md5($s);');

// password_verify: function that checks the password against its hash. The
// function takes 2 mandatory parameter : clear password, hashed password +
// an optional parameter user_id. The user_id is used to update the password
// with the new hash introduced in Piwigo 2.5. See function
// pwg_password_verify in include/functions_user.inc.php
$conf['password_verify'] = 'pwg_password_verify';

// guest_id : id of the anonymous user
$conf['guest_id'] = 1;

// default_user_id : id of user used for default value
$conf['default_user_id'] = $conf['guest_id'];

// Registering process and guest/generic members get language from the browser
// if language isn't available PHPWG_DEFAULT_LANGUAGE is used as previously
$conf['browser_language'] = true;

// webmaster_id : webmaster'id.
$conf['webmaster_id'] = 2;

// does the guest have access ?
// (not a security feature, set your categories "private" too)
// If false it'll be redirected from index.php to identification.php
$conf['guest_access'] = true;

However when I login in my account it accepts the login but the menu is the same menu a guest would see. If I login like a regular member it generates php/sql errors.

Have I missed something crucial?

The only other question is the following:

Code:

// If you decide to use another table than the default one, you need to
// prepare your database by deleting some datas :
//
// delete from piwigo_user_access;
// delete from piwigo_user_cache;
// delete from piwigo_user_feed;
// delete from piwigo_user_group;
// delete from piwigo_user_infos;
// delete from piwigo_sessions;
// delete from piwigo_rate;
// update piwigo_images set rating_score = null;
// delete from piwigo_caddie;
// delete from piwigo_favorites;

Is this saying to clear any data in these tables (and keep the tables), or to delete the table itself?

Thanks for the help, nearly there!

All the best

Craig

 

#4 2013-03-25 23:34:50

MrTall
Guest

Re: Piwigo 2.5 & PHPBB3.x

Well it's working, however it ignores my guest and webmaster id. Double checked plenty of times and it's right; is there something obvious I'm missing? :)

 

#5 2013-03-25 23:44:48

MrTall
Guest

Re: Piwigo 2.5 & PHPBB3.x

Fixed, if anyone is interested my config is as follows:

Code:

// +-----------------------------------------------------------------------+
// |                            authentication                             |
// +-----------------------------------------------------------------------+

// apache_authentication : use Apache authentication as reference instead of
// users table ?
$conf['apache_authentication'] = false;

// users_table: which table is the reference for users? Can be a different
// table than Piwigo table
//
// If you decide to use another table than the default one, you need to
// prepare your database by deleting some datas :
//
// delete from piwigo_user_access;
// delete from piwigo_user_cache;
// delete from piwigo_user_feed;
// delete from piwigo_user_group;
// delete from piwigo_user_infos;
// delete from piwigo_sessions;
// delete from piwigo_rate;
// update piwigo_images set rating_score = null;
// delete from piwigo_caddie;
// delete from piwigo_favorites;
//
// All informations contained in these tables and column are related to
// piwigo_users table.
$conf['users_table'] = 'phpbb_users';

// If you decide to use external authentication
// change conf below by $conf['external_authentification'] = true;
$conf['external_authentification'] = true;

// Other tables can be changed, if you define associated constants
// Example:
//   define('USER_INFOS_TABLE', 'pwg_main'.'user_infos');

// user_fields : mapping between generic field names and table specific
// field names. For example, in PWG, the mail address is names
// "mail_address" and in punbb, it's called "email".
$conf['user_fields'] = array(
  'id' => 'user_id',
  'username' => 'username',
  'password' => 'user_password',
  'email' => 'user_email'
  );

// password_hash: function hash the clear user password to store it in the
// database. The function takes only one parameter: the clear password.
$conf['pass_convert'] = create_function('$s', 'return md5($s);');

// password_verify: function that checks the password against its hash. The
// function takes 2 mandatory parameter : clear password, hashed password +
// an optional parameter user_id. The user_id is used to update the password
// with the new hash introduced in Piwigo 2.5. See function
// pwg_password_verify in include/functions_user.inc.php
$conf['password_verify'] = 'pwg_password_verify';

// guest_id : id of the anonymous user
$conf['guest_id'] = 1;

// default_user_id : id of user used for default value
$conf['default_user_id'] = $conf['guest_id'];

// Registering process and guest/generic members get language from the browser
// if language isn't available PHPWG_DEFAULT_LANGUAGE is used as previously
$conf['browser_language'] = true;

// webmaster_id : webmaster'id.
$conf['webmaster_id'] = 2;

// does the guest have access ?
// (not a security feature, set your categories "private" too)
// If false it'll be redirected from index.php to identification.php
$conf['guest_access'] = true;
 

#6 2013-03-25 23:53:59

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Piwigo 2.5 & PHPBB3.x

you know what ? there is a plugin for that  [extension by Eric] Register_PhpBB
sorry....

next time I could search ! and you too :D

Offline

 

#7 2013-03-26 00:00:55

MrTall
Guest

Re: Piwigo 2.5 & PHPBB3.x

Yeah I saw that, the problem I thought from the description of the plugin it works by a user registering first on piwigo then they would have access to phpbb. Not the other way round :(

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2025 · Contact