Gossamer Forum
Home : Products : DBMan : Customization :

Login as [Userid] or else...default

Quote Reply
Login as [Userid] or else...default
Hi:
I am triyng to make a site with more than one database (using same auth info). The probelm is that there will be two kinds of users. Anyone will be able to see, and registered users will be able to modify their own records on one of the DBs.

Now, the real problem is that I am making links like this ?db=test&uid=default&view_records=1 (for example) to make sure that all users can access the info withowt loggin in.
I plan to use the cookie mod so registered users only log once but, once they click on one of these links, I guess they will be logged as default (instead of the real Userid they had). Hope this is clear and maybe it has an easy solution, though I dont see it yet....

Thanks



Quote Reply
Re: Login as [Userid] or else...default In reply to
I would recommend visiting some of the DBMAN FAQ sites listed in the Resource Center.

Regards,

Eliot Lee
Quote Reply
Re: Login as [Userid] or else...default In reply to
I had the same problem as you. In order to fix it, I just added some IF statements to my menu. Goes something like this:

|;
if ($db_uid ne ""){
print qq|<a href="$db_script_link_url">logged in link</a>|;
}
else {
print qq|<a href="$db_script_url?db=$db_setup&uid=default">default link</a>|;
}
print qq|


This way, if the person is logged in, the link will be automatically have their username and password included. If the person isn't logged in, they are defaulted.

Hope that helps.



-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: Login as [Userid] or else...default In reply to
Thanks, that's exactly what I needed...
I haven't tried it yet but it seems easy

Thanks again