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 #877

AdminAuthMDB addUser fails with SQL problem

Details

Submitted2004-02-26 13:54 UTC
Fromsimon dot hamilton at ntlworld dot com
Assignedlsmith
StatusClosed
PackageLiveUser
PHP Version4.3.3
OSANY
Roadmaps(Not assigned)

Comments

[2004-02-26 13:54 UTC] simon dot hamilton at ntlworld dot com

Description:
------------
Hi there

I don't know how I got this to work before but now it doesn’t unless the following changes are made:

Since the values passed are defaulted to NULL we should check that they are null before adding the value to the array.

Without doing this we get a SQL query error.

Here's a suggested fix. This may need done in the other containers as per the last fix.

if (isset($this->authTableCols['is_active']) && !is_null($active)) {
$col[] = $this->authTableCols['is_active']['name'];
$val[] = $this->dbc->getValue($this->authTableCols['is_active']['type'], $active);
}

if (isset($this->authTableCols['owner_user_id']) && !is_null($owner_user_id)) {
$col[] = $this->authTableCols['owner_user_id']['name'];
$val[] = $this->dbc->getValue($this->authTableCols['owner_user_id']['name'], $owner_user_id);
}

if (isset($this->authTableCols['owner_group_id']) && !is_null($owner_group_id)) {
$col[] = $this->authTableCols['owner_group_id']['name'];
$val[] = $this->dbc->getValue($this->authTableCols['owner_group_id']['name'], $owner_group_id);
}

Reproduce code:
---------------
N/A

Expected result:
----------------
N/A

Actual result:
--------------
N/A

[2004-02-26 16:18 UTC] simon dot hamilton at ntlworld dot com

Yeah that did the trick.

Thanks Lukas.