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

Bug #1554 file:LiveUser/Admin/Auth/Container/MDB2.php line 250
Submitted: 2004-06-03 15:52 UTC
From: waxdipped at yahoo dot co dot uk Assigned: lsmith
Status: Closed Package: LiveUser
PHP Version: 4.3.3 OS: Linux (SuSE 9.0)
Roadmaps: (Not assigned)    
Subscription  


 [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 |

Comments

 [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-08 20:37 UTC] arnaud
The CVS version implements custom fields in the configuration array now, you can check LiveUser.php, the inline doc is up-to-date. We are conscious it is a BC break but this will give developers of the package and users a lot more flexibility.
 [2004-06-09 09:24 UTC] arnaud
Latest CVS version implements a new handling for custom fields. Basically you define the fields names and types in the configuration array 'required' => array( 'auth_user_id' => array('name' => 'auth_user_id', 'type' => 'int'), 'handle' => array('name' => 'handle', 'type' => 'text'), 'passwd' => array('name' => 'passwd', 'type' => ''), ), 'optional' => array( 'lastlogin' => array('name' => 'lastlogin', 'type' => ''), 'is_active' => array('name' => 'is_active', 'type' => '') ); 'optional' => array( 'alias' => array('name' => '', 'value' => 'value') ) The customFields array passed to addUser() should now container array('alias' => 'value') e;g. array('lastlogin' => time()) That should be satisfying for everybody
 [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.