Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.6.4

Bug #2497 'db_fields' parameter has no effect
Submitted: 2004-10-11 09:49 UTC
From: denis dot gerasimov at vekos dot ru Assigned:
Status: Bogus Package: Auth
PHP Version: 5.0.1 OS: Microsoft Windows 2000 SP4
Roadmaps: (Not assigned)    
Comments Add Comment Add patch

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 30 + 43 = ?

 [2004-10-11 09:49 UTC] denis dot gerasimov at vekos dot ru
Description: ------------ 'db_fields' parameter has no effect, only username/password are fetched from the database. I have to run fetch command manually like this: $objAuth->storage->fetchData($objAuth->username, $objAuth->password); Reproduce code: --------------- ... private static $arrAuthOptions = array( 'dsn' => 'mysql://user:pass@localhost/db', 'table' => 'editors', 'usernamecol' => 'login', 'passwordcol' => 'password', 'cryptType' => 'none', // FIX 'db_fields' => '*' // fetch all table fields ); ... $objAuth = new Auth_HTTP("DB", self::$arrAuthOptions); ... if($objAuth->getAuth()) { // FIX $objAuth->storage->fetchData($objAuth->username, $objAuth->password); if ($objAuth->getAuthData('id') != 0) { ... Expected result: ---------------- That should not be done manually I suppose.


 [2004-10-11 10:09 UTC] yavo
Please indicate which version of Auth and Auth_HTTP you have installed. Also please check first with Auth to see if this is an Auth or Auth_HTTP problem The following script works fine on latest auth (1.3-beta) <?php include_once('DB.php'); include_once('Auth.php'); $db = DB::connect('mysql://user:pass@localhost/db'); $params = array('dsn'=>&$db,'db_fields'=>'*', 'table'=>'users','usernamecol'=>'username', 'passwordcol'=>'userpassword'); $myauth = new Auth('DB', $params); $myauth->start(); if ($_GET['action'] == "logout" && $myauth->checkAuth()) { $myauth->logout(); $myauth->start(); } if($myauth->getAuth()) { print "<br/>User Email: ".$myauth->getAuthData('useremail').''; print "<br/>User Name: ".$myauth->getAuthData('userfname').'<br/>'; print '<a href="?action=logout">Logout</a>'; } print '  <a href="?">Home</a>'; ?>
 [2004-10-18 09:34 UTC] denis dot gerasimov at vekos dot ru
I have tested your script, thanks. The problem is that I cannot reproduce this bug (after upgrading to PHP 5.0.2; that may be the reason but I am really not sure). Your code and my script work fine now. Possibly, that was my mistake, but... it really didn't work. Well, I suggest to mark this bug Closed. If somebody see this strange behaviuor once more time the status will have to be changed back to Open again.
 [2006-12-27 04:41 UTC] cellog (Greg Beaver)