Gossamer Forum
Home : Products : DBMan : Installation :

One Login for multiple databases using the same key

Quote Reply
One Login for multiple databases using the same key
Greetings to all,
I just downloaded and installed the PERL code and am now in the process of test driving it.

My first question is as follows:
Is it possible to give a user one login prompt that will take him/her to a page that links to all the databases that contain his/her unique key? It seems un-intuitive for a user to login seperately to modify data on each table. For example, I want the following page to appear after a user logs in instead of vice versa:

http://www.palestinehotels.com/testing/dbman.htm

Second question:
Once logged in, is it possible to set a timeout that will expire for all of his/her databases (i.e. after a 1/2 hour)?

I hope my questions are clear. Thank you,

Ibrahim Dawud
Arab Hotel Association - Jerusalem
http://www.palestinehotels.com
Quote Reply
Re: One Login for multiple databases using the same key In reply to
Ibrahim,

The answer to question 1 is a yes anyway, you just need to use the same password file and auth directory for your databases. As to having them taken to a page that links to all the databases with their key, you'll have to do soem work in html.pl to achieve it, but I don't see any major problems.

Question 2, when you say expire their databases, do you mean their records? I guess this would be possible, but you would either have to run that subroutine from a click through the script or via cron. JPDeni has answered something like this before, but try searching for "expire" or "expires" on the BB search engine, you might find some appropriate information.

Cheers,
adam
Quote Reply
Re: One Login for multiple databases using the same key In reply to
Maybe I should've phrased that better. When I said I don't see any major problems, I didn't want to make it sound easy. It's be bloody hard to achieve. Possible, but hard.

adam
Quote Reply
Re: One Login for multiple databases using the same key In reply to
Well, it's not really that hard to connect between databases, especially if one is using the same password file and auth directory for all the databases. You do have to have the links to the databases within DBMan, though.

What I did was to create an extra database -- default -- and use that one to login. Then on the home page I included a table to the other links:

Code:
print qq|<table><tr valign=top><td>Database 1<P>
print qq! <A HREF="$db_script_url&db=database1&uid=$db_uid">Database 1 Home</A><BR>!;
print qq!| <A HREF="$db_script_url&db=database1&uid=$db_uid&add_form=1">Add to Database 1</A><BR> !
if ($per_add);
print qq!| <A HREF="$db_script_url&db=database1&uid=$db_uid&view_search=1">Search Database 1</A> !<BR>
if ($per_view);
print qq!| <A HREF="$db_script_url&db=database1&uid=$db_uid&delete_search=1">Delete Database 1</A><BR> !
if ($per_del);
print qq!| <A HREF="$db_script_url&db=database1&uid=$db_uid&modify_search=1">Modify Database 1</A><BR> !
if ($per_mod);
print qq|</td><td>Database 2<P>|;
print qq! <A HREF="$db_script_url&db=database2&uid=$db_uid">Database 2 Home</A><BR>!;
print qq!| <A HREF="$db_script_url&db=database2&uid=$db_uid&add_form=1">Add to Database 2</A><BR> !
if ($per_add);
print qq!| <A HREF="$db_script_url&db=database2&uid=$db_uid&view_search=1">Search Database 2</A> !<BR>
if ($per_view);
print qq!| <A HREF="$db_script_url&db=database2&uid=$db_uid&delete_search=1">Delete Database 2</A><BR> !
if ($per_del);
print qq!| <A HREF="$db_script_url&db=database2&uid=$db_uid&modify_search=1">Modify Database 2</A><BR> !
if ($per_mod);
print qq|</td></tr></table>|;
print qq!| <A HREF="$db_script_link_url&admin_display=1">Admin</A> ! if ($per_admin);
print qq!| <A HREF="$db_script_link_url&logoff=1">Log Off</A> !;
print qq!|</font></p>!;

Note a couple of things. I've removed the "List All" from the links. Since the $db_key variable is likely to be different in the databases, it won't work as it originally is set up. You would need to specifically defined the $db_key that applies to each database.

Also, the "Admin" and "Logoff" links don't change.

In addition to the links in sub html_footer for each of the databases, I added:

Code:
print qq! <A HREF="$db_script_url&db=default&uid=$db_uid">Database Manager</A><BR>!;

Does this make any sense?

Regarding your expiration after a half hour, if you want people to just have a half hour to be connected to the database, set

$auth_time = 1800;

in your .cfg files.
------------------
JPD







[This message has been edited by JPDeni (edited June 01, 1999).]
Quote Reply
Re: [JPDeni] One Login for multiple databases using the same key In reply to
Everywhere JPDeni has

..........$db_script_url&db=database1&uid=$db_uid............


it should be

........$db_script_url?db=database.....


In other words, the &db shoulc be ?db

This is an old post but I found it usefull still and went around for a while figuring out what was wrong so I thought I'd post for the next person's use!

HTH

Lynette
Lynette
Hollister, Ca
Quote Reply
Re: [ltillner] One Login for multiple databases using the same key In reply to
Hi all,

I am trying to use the same thing as described in this thread. 2 db with the same db key and when the user logs in the the option to enter into any of the db. My problem is that I getting a message that DBMan encountered an internal error. Please enable debugging to view. I have enabled debuggin in the cfg files for the both the db but the 2nd db still shows me the same error message. This problem persists even if I try to access the db directly (not by going in after signing into the first db). The first db is working fine and I have compared all the files with the working db and they seem to be fine. I am at a total loss as to what the problem could be.

Any help will be greatly appreciated. Thanks in advance

FHN
Quote Reply
Re: [fhnaqvi] One Login for multiple databases using the same key In reply to
Hi All,

I got the solution to my problem. I had created the config and html.pl files using JPDeni's configrator and for some reason it has inserted 2 extra curly braces in the html.pl code in sub html_record. I never thought of checking that so I was stuck. Otherwise this solution works excellent.

FHN