PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Authentication » LiveUser » Bug #1554

file:LiveUser/Admin/Auth/Container/MDB2.php line 250

Details

Submitted2004-06-03 15:52 UTC
Fromwaxdipped at yahoo dot co dot uk
Assignedlsmith
StatusClosed
PackageLiveUser
PHP Version4.3.3
OSLinux (SuSE 9.0)
Roadmaps(Not assigned)

Comments

[2004-06-03 15:52 UTC] waxdipped at yahoo dot co dot uk

Description:
------------
When using MDB2 for database abstraction, calling addUser with custom fields results in custom field value of 'Array' in MySQL databse.

file:LiveUser/Admin/Auth/Container/MDB2.php
function: addUser
line number: 250

$val[] = $this->dbc->quote($v, $customFields[$k]['type']);

change to

$val[] = $this->dbc->quote($v['value'], $customFields[$k]['type']);

or

$val[] = $this->dbc->quote($customFields[$k]['value'], $customFields[$k]['type']);

Reproduce code:
---------------
from bundled example 'admin_example_mdb2.php'

$admin = new LiveUser_Admin($conf, 'FR');
$custom = array(
array('name' => 'name', 'value' => 'asdfMDB22', 'type' => 'text'),
array('name' => 'email', 'value' => 'fleh@example.comMDB23', 'type' => 'text')
);
$user_id = $admin->addUser('johndoe', 'dummypass', true, null, null, null, $custom);

Expected result:
----------------
Table liveuser_users:
+--------------+---------+----------------------------------+-----------+---------------+----------------+-----------+------------------------------+------------------+
| auth_user_id | handle | passwd | lastlogin | owner_user_id | owner_group_id | is_active | email | name |
+--------------+---------+----------------------------------+-----------+---------------+----------------+-----------+------------------------------+------------------+
| 1 | johndoe | 4518bda19425be276817a3b3eeee82b8 | NULL | NULL | NULL | Y | fleh@example.comMDBUpdated22 | asdfMDBUpdated22 |
+--------------+---------+----------------------------------+-----------+---------------+----------------+-----------+------------------------------+------------------+

Actual result:
--------------
Table liveuser_users:
+--------------+---------+----------------------------------+-----------+---------------+----------------+---
-----+------------------------+----------------+
| auth_user_id | handle | passwd | lastlogin | owner_user_id | owner_group_id | is
tive | email | name |
+--------------+---------+----------------------------------+-----------+---------------+----------------+---
-----+------------------------+----------------+
| 1 | johndoe | 4518bda19425be276817a3b3eeee82b8 | NULL | NULL | NULL | Y
| Array | Array |

[2004-06-03 16:33 UTC] smith at backendmedia dot com

Could you try the CVS version? Since we have made changes that seem to have fixed this issue.

[2004-06-03 19:41 UTC] waxdipped at yahoo dot co dot uk

Hello,
I checked out the current CVS version. This problem is indeed fixed, but I found a new problem:

In the CVS version of LiveUser/Admin/Auth/Container/MDB2.php ($Id: MDB2.php,v 1.17 2004/05/13 09:23:12 lsmith Exp $) the function "getUsers" is broken. The same function in LiveUser version 0.11.1 ($Id: MDB2.php,v 1.15 2004/04/25 15:55:09 lsmith Exp $) works fine. Looks broken in Admin/Auth/Container/MDB.php and Admin/Auth/Container/DB.php also. The array keys for customFields and filters are missing in the latest version.

[2004-06-13 14:53 UTC] smith at backendmedia dot com

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.