DataObject and Username
| From: | Alex Goddard | Date: | Wed, 18 Aug 2004 17:56:59 +0000 |
| Subject: | DataObject and Username | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14163@lists.php.net to get a copy of this message | ||
Hi,
I'm looking for a way to, if a configuration option is set, connect to a
database using my own username and password instead of the ones given in
the 'database' option of DB_DataObject. That is, I want to use the info
given by a user at login to connect to the database instead of the one
given in the 'database' option.
I've currently got code that seems to do this some of the time
(immediately after login) by overriding the _connect() method and changing
the DSN if the option is set. However, the changed DSN doesn't seem to
survive after that one use, it gets reset to whatever is in the config
file.
The idea is to get it so that 'Updated By' will list the correct username
as opposed to the default one given in the DataObject config file.
Any suggestions as to how this could be done?
Thanks,
--
Alex Goddard
agoddard@cerias.purdue.edu