Auth: Bug in getAuthData() ?
| From: | Michael Fischer | Date: | Tue, 18 Feb 2003 14:21:09 +0000 |
| Subject: | Auth: Bug in getAuthData() ? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-3816@lists.php.net to get a copy of this message | ||
I tried the following with Auth.php (Revision 1.49):
<?php
require_once('Auth/Auth.php');
$a = new Auth("DB","mysql://user:pass@example.com/test");
$a = new myAuth(TRUE);
$a->start();
$test1 = array('customer' => 'A578');
$a->setAuthData($test1);
echo "Test1: <pre>"; print_r($_SESSION['auth']); echo
"</pre>";
$test2 = $a->getAuthData('customer');
echo "Test2: <pre>"; print_r($test2); echo "</pre>";
?>
and got this:
Test1:
Array
(
[data] => Array
(
[customer] => A578
)
)
Test2:
In my opinion (according the manual) the second part should be:
Test2:
A578
I looked at the source of Auth.php and found the following:
function setAuthData($data)
{
...
$session['auth']['data'] = $data;
...
}
function getAuthData($data)
{
...
return $session['auth'][$data];
...
}
If getAuthData() would return $session['auth']['data'][$data] the result
should be as expected.
Thanks,
Michael