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

Bug in addUser in LiveUser_Admin_Auth_Container_MDB

Details

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

Comments

[2004-02-26 01:15 UTC] simon dot hamilton at ntlworld dot com

Description:
------------
As per my email to the list...

The ['name'] key was missing from the vars used in the INSERT...perhaps due to some copy/paste^h^h^h^h^h^h^h^h^h^hporting from the DB container :).

Here's the diff to fix it:

--- MDB.php.new 2004-02-26 00:08:59.656250000 +0000
+++ MDB.php 2004-02-26 00:08:25.578125000 +0000
@@ -223,17 +223,17 @@
$col = $val = '';

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

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

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

Hope this helps!

Reproduce code:
---------------
n/a

Expected result:
----------------
An Auth user id.

Actual result:
--------------
a SQL error causing arrays to get added to the query.

[2004-02-26 01:17 UTC] simon dot hamilton at ntlworld dot com

lol....I did it again.

Here's the patch the right way around.

--- MDB.php 2004-02-26 00:08:25.578125000 +0000
+++ MDB.php.new 2004-02-26 00:08:59.656250000 +0000
@@ -223,17 +223,17 @@
$col = $val = '';

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

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

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

--
Simon H