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

Bug #6808 can't add user with DB container
Submitted: 2006-02-17 10:56 UTC
From: farell Assigned: aashley
Status: Closed Package: Auth (version 1.3.0r4)
PHP Version: 5.1.2 OS: Windows 2000
Roadmaps: (Not assigned)    

 [2006-02-17 10:56 UTC] farell
Description: ------------ i've tried to add new user with password through test script below, and i get a fatal error. Reason is db connection is not yet available (db = null). i suggest to add as it was done in listUsers() function a check like this after line 344 ($Id: DB.php,v 1.52 2005/10/18 07:05:32 quipo Exp $) $err = $this->_prepare(); if ($err !== true) { return PEAR::raiseError($err->getMessage(), $err->getCode()); } Laurent Laville Test script: --------------- <?php require_once "Auth.php"; $dsn = "mysql://user:password@localhost/database"; $a = new Auth("DB", $dsn); $a->start(); $res = $a->addUser('user1', 'pass1'); if (PEAR::isError($res)) { die($res->getMessage()); } else { echo 'user created! '; } ?> Expected result: ---------------- user created! Actual result: -------------- Fatal error: Call to a member function quoteString() on a non-object in [...]\Auth\Container\DB.php on line 370


 [2006-02-21 01:00 UTC] aashley at php dot net
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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.