PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Authentication » Auth » Bug #10000

Undefined index: final_table, if a MDB2 Object is given

Details

Submitted2007-02-01 08:37 UTC
Fromberdir at php dot net
Assignedaashley
StatusClosed
PackageAuth
PHP Version5.1.6
OSLinux
Roadmaps(Not assigned)

Comments

[2007-02-01 08:37 UTC] berdir at php dot net

Description:
------------
If $this->options['dsn'] is a MDB2 object, $this->db is directly set in the constructor of Auth_Container_MDB2.

In this case, $this->_connect() is never called and $this->options['final_xy'] will never be set.

When removing the 4 lines in the constructor, everything works as expected.

Test script:
---------------
$options = array('dsn' => $mdb2Object,
'table' => 'auth',
'usernamecol' => 'username',
'passwordcol' => 'password',
'db_fields' => '*');

$auth = new Auth('MDB2', $options);

$auth->start();

Expected result:
----------------
Successful login

Actual result:
--------------
PHP Error: Undefined index: final_table in /usr/share/php/Auth/Container/MDB2.php at line 317

PHP Error: Undefined index: final_usernamecol in /usr/share/php/Auth/Container/MDB2.php at line 318

MDB2 Error: syntax error _doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT * FROM WHERE = '<Username>']

[2007-02-02 00:49 UTC] aashley at php dot net

This bug has been fixed in CVS.

If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.

Yeah i screwed that one up good.