PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Authentication » LiveUser » Bug #2443

AddUser error when using DB-container

Details

Submitted2004-10-04 15:30 UTC
Fromjan at ivtaco dot se
Assigneddufuz
StatusClosed
PackageLiveUser
PHP VersionIrrelevant
OSAll
Roadmaps(Not assigned)

Comments

[2004-10-04 15:30 UTC] jan at ivtaco dot se

Description:
------------
I had problems with having the admin class (latest version) to add user with custom and optional fields. Maybe I have misunderstood it, but I find it something strange when I call the Admin->addUser() with the options specified and then the Admin->addUser wants to send it to Admin::Auth:DB addUser and the parameters don't match at all.

Admin.php code: (line 372)
$authId = $this->auth->addUser($handle, $password, $active, $owner_user_id, $owner_group_id, $id, $customFields);

whereas in the DB (Admin/Auth/Container/DB.php) to where the call goes has:
DB.php (line: 156)
function addUser($handle, $password = '', optionalFields = array(), $customFields = array(), $authId = null)

This sent out a couple of errors as well as it sends notices on the defintion of (Admin.php line 170)
$col = $val = array();

because of the error above if they are not set then you get a sql parse error since you get a query:
INSERT INTO ... , Array() ) VALUES (.... Array())

I fixed all these errors my self (on my own distribution) by changing:
--------------------------------------------------
$col = $val = array();

to

$col = $val = "" //doesn't matter that they are inited to null
--------------------------------------------------

Changed the function header from:

function addUser($handle, $password = '', optionalFields = array(), $customFields = array(), $authId = null)

to

function addUser($handle, $password = '', $active, $owner_user_id,$owner_group_id, $authId, $customFields)

----------------------------------------------------

Then changed within the AddUser function to make use of the new inparams.

I just thought I would notice this and get your feedback on this, maybe it is something I misunderstood or you missed... =/

Thanks for a great pacakage otherwise,
//Jan Bolmeson