Using external user database?

Zim

Joined: 2003-09-13
Posts: 8
Posted: Sun, 2003-09-21 15:04

I have a website that already has userID/password/permissions DB (in mySQL) I'd like to figure out how to unify Gallery with it such that the users can use their same login info for Gallery as with our other existing tools.

I'm new to PHP (years with Perl) and not much of an OO person either :), but a long time code-hack I think I can begin to see where I need to do this, but.....

It would _appear_ that associated with each user are only several pieces of info...

var $username;
var $fullname;
var $password;
var $email;
var $isAdmin;
var $canCreateAlbums;
var $uid;

If I can pass all user/login requests to my DB, I can easily fill in and return info for all of these fields. I would then disable all ways from within Gallery for users to modify their info, and/or or an Admin to add/remove users.. I simply want the login to pull from my DB, for the pic owner to associate the ID for a pic with the fullname from my DB. I can handle all of the "admin" side of things (adding/removing users) from our main DB side of things. Hopefully that makes the rest easier since there should be less to change.

Perhaps I can just intercept all access to userdb.dat? Fill in any reads with a call to my DB, and drop any writes on the floor (although hopefully I will remove any way to cause a write)?

Obviously I'm operating on thin understanding of how Gallery works, and in a new language (to me) and in a new coding style (OO). But hey, that just makes it more of a challenge.

One further idea I had, its not very elegant, but if someone would explain the userdb.dat format to me, I could (brute force) generate the file from my DB on a cron job. Very much down my list of how I'd like to do this, but...

I'd appreciate any advice to get me started in the right direction.

Cheers,
Mike

 
BorgKing
BorgKing's picture

Joined: 2002-09-12
Posts: 313
Posted: Mon, 2003-09-22 13:38

init.php is the file you want to change for your purposes. It's not easy, but I even managed to use a MSSQL database on a different Windows 2000 Server to use as the Gallery user database.

Great tutorial: http://www.txraves.org/code/dox/embedding_gallery.php

 
blacklily8

Joined: 2003-09-28
Posts: 1
Posted: Sun, 2003-09-28 02:39

Hi, folks. I need some help integrating my PHPBB userdatabase into Gallery. Specifically, I'd like to use the same MYSQL database PHPBB uses to keep up with members.

I've been working at this for hours but can't figure out where gallery stores its database config or even where it is storing the user information.

I'm not very comfortable with the technical aspects of databases, etc. What would really help me is if someone could identify the files that I need to change and help me modify it to accept the right database from phpbb's (mysql) user directory.

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Tue, 2003-09-30 23:40

Hi,

i am working on an integration of phpBB2 into gallery or gallery into phpBB2.
It will be in 1.4.1

Regards,

Jens