Announcement

#1 2005-09-21 19:20:59

Outie
Member
2005-09-19
30

User Database

Hey guys,

Is there a way to tie the user database to phpbb or visa vera... I want it to where when someone registers to phpbb is creates a login for them in phpwebgallery php. So this eliminates two logins... Also would be nice if i could have phpwebgallery assign new registered users to a guest automaticly in which they can only view the thumbnails and not the entire image... Is this possiable? Thanks

Outie

Offline

 

#2 2005-09-21 19:51:11

volcom
Former Piwigo Team
2005-01-24
489

Re: User Database

The new 1.5.0RC1 allows users form phpbb to login on PWG.  Try it :-)

Offline

 

#3 2005-09-21 22:51:32

Outie
Member
2005-09-19
30

Re: User Database

volcom wrote:

The new 1.5.0RC1 allows users form phpbb to login on PWG.  Try it :-)

Awesome two improvements I am looking for!! Should I do a fresh install or upgrade?

Thanks

Outie

Offline

 

#4 2005-09-22 05:21:41

Outie
Member
2005-09-19
30

Re: User Database

Volcom,

Not exactly sure how do tie the two databases together nor put the image for the category icon? Any hints on how to do that?

Outie

Offline

 

#5 2005-09-24 12:18:30

Vassae
Member
2005-01-13
128

Re: User Database

To tie the two databases you must edit the include/config_default.inc.php file. The lines to edit stand at the end of the file just after
// +-----------------------------------------------------------------------+
// |                            authentication                             |
// +-----------------------------------------------------------------------+

You have to edit the pwg table (you'll find the informations in the file).
And after you have to specify in the file, the names of phpbb's field.

I hope that I'm enought clear with my poor english :)

For example, this is a part of my config_default.inc.php file (to tie pwg and phpbb 2.0.17) :

// All informations contained in these tables and column are related to
// phpwebgallery_users table.
$conf['users_table'] = 'phpbb_users';

// 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'
  );

// pass_convert : function to crypt or hash the clear user password to store
// it in the database
$conf['pass_convert'] = create_function('$s', 'return md5($s);');

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

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

Last edited by Vassae (2005-09-24 12:42:49)

Offline

 

#6 2005-09-25 00:45:18

Outie
Member
2005-09-19
30

Re: User Database

Thank you very much for your reply!! Ill work on this right now!!

PS is there a way to create a group and have it to where they can only see the thumbnails and no access to the full images?

Thanks

Outie

Last edited by Outie (2005-09-25 00:46:14)

Offline

 

#7 2005-09-25 00:56:49

Outie
Member
2005-09-19
30

Re: User Database

When editing mine simliar to yours i get the following error:

SELECT user_id AS id
     , username AS username
     , user_password AS password
     , user_email AS email
  FROM phpwebgallery_phpbb_users
  WHERE user_id = '1'
;
[mysql error 1146] Table 'aacovers_PHPgallery.phpwebgallery_phpbb_users' doesn't exist



Thanks for your help

PS. I did run the queries in phpmyadmin agains the PHPWebGallery tables:

delete from phpwebgallery_user_access;
delete from phpwebgallery_user_cache;
delete from phpwebgallery_user_feed;
delete from phpwebgallery_user_group;
delete from phpwebgallery_user_infos;
delete from phpwebgallery_sessions;
delete from phpwebgallery_rate;
update phpwebgallery_images set average_rate = NULL;
delete from phpwebgallery_caddie;
delete from phpwebgallery_favorites;

and got this resultant:

SQL query:
DELETE FROM phpwebgallery_user_access;# MySQL returned an empty result set (i.e. zero rows).
DELETE FROM phpwebgallery_user_cache;# Affected rows:2
DELETE FROM phpwebgallery_user_feed;# MySQL returned an empty result set (i.e. zero rows).
DELETE FROM phpwebgallery_user_group;# MySQL returned an empty result set (i.e. zero rows).
DELETE FROM phpwebgallery_user_infos;# Affected rows:3
DELETE FROM phpwebgallery_sessions;# Affected rows:2
DELETE FROM phpwebgallery_rate;# MySQL returned an empty result set (i.e. zero rows).
UPDATE phpwebgallery_images SET average_rate = NULL ;# MySQL returned an empty result set (i.e. zero rows).
DELETE FROM phpwebgallery_caddie;# Affected rows:13
DELETE FROM phpwebgallery_favorites;# MySQL returned an empty result set (i.e. zero rows).

so seems everything went ok

Last edited by Outie (2005-09-25 01:15:51)

Offline

 

#8 2005-09-25 01:26:48

Outie
Member
2005-09-19
30

Re: User Database

Heres my code for that part:

// All informations contained in these tables and column are related to
// phpwebgallery_users table.
$conf['users_table'] = $PHPforum.'phpbb_users';

// 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'
  );

// pass_convert : function to crypt or hash the clear user password to store
// it in the database
$conf['pass_convert'] = create_function('$s', 'return md5($s);');

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

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

Offline

 

#9 2005-09-25 04:03:27

Outie
Member
2005-09-19
30

Re: User Database

Ok I seemed to of got it to verify by the phpbb user database but for some reason when going from the PWG to PHPBB I have to login again on the PHPBB side. Is there a setting for sessions somewhere so they both use the same one? Thanks

Outie

Offline

 

#10 2005-09-25 09:56:14

Vassae
Member
2005-01-13
128

Re: User Database

$conf['users_table'] = $PHPforum.'phpbb_users';

Is it important for you this var $PHPforum ? Perhaps you can try to write the full name of the phpbb's database. I forgot to say that my pwg and phpbb tables are in the same database. It's just the prefixe which changes.

[EDIT] I haven't enough read your error message. Sorry. The problem comes fron the name who give to your users'table. $PHPforum.'phpbb_users' gives "phpwebgallery_phpbb_users". Or I think the name of your phpbb users' table is just "phpbb_users".
So you just have to write in the config file $conf['users_table'] = 'name of your phpbb users' table'

The session's control is not implemented yet. So it's normal to login twice.

Last edited by Vassae (2005-09-25 10:05:14)

Offline

 

#11 2005-09-26 14:28:32

Outie
Member
2005-09-19
30

Re: User Database

Ok gotcha, I found a script that claims to join the sessions together!! So ill will try to implement that today. Is there a way to combine the groups or only use the groups in phpbb also? Thanks

Outie

Offline

 

#12 2005-09-26 17:01:26

Vassae
Member
2005-01-13
128

Re: User Database

The groups : not yet ;)

And I wonder if it will be a good think. The groups of my forum or my gallery are not the same.

If your script to join the sessions works, I'm interesting :)

Last edited by Vassae (2005-09-26 17:02:58)

Offline

 

#13 2005-09-27 21:31:42

Outie
Member
2005-09-19
30

Re: User Database

Ok ill let you know. Got real busy at work so ill try it out tonight.

Outie

Offline

 

#14 2005-09-29 14:07:34

ToFiC
Member
2005-05-30
2

Re: User Database

I've done this modification but now when i log to PWG whith my admin login i don't have the administration pannel link. It's seems i'm a standard user.

Offline

 

Board footer

Powered by FluxBB

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