RE: 0.16.3 upgrade issue...

"Jan Bolmeson" <[email protected]> Sat, 13 Aug 2005 18:46:11 +0200
Newsgroups gmane.comp.php.pear.liveuser
Message-ID <[email protected]>
I think I found the Error!!! =o)

Solution:: CHANGE field in liveuser_table from isactive to is_active



Motivation:
-------------------------------------------------


The problem seems to lie within the isactive-property in the liveuser_users
table. Hence;

1. In my 16.2 version I didn't have to specify an alias for the isactive
field. Hence with the same config I get in 16.3 version the following sql
for fetching the User:

LiveUser\Auth\DB.php:221


SELECT auth_user_id AS auth_user_id,handle AS handle,passwd AS passwd
            FROM   liveuser_users
            WHERE  handle='madwax' AND
passwd='f3bfc29c228b806b6a03513f5c7c149b'
 

When I add to my config the directives for isactive field: 

		'tables' => array(
                        'users' => array(
                            'fields' => array(
                                'isactive' => 'isactive',
                            ),
                        ),
                    ),
                    'fields' => array(
                        'isactive' => 'integer',
                    ),
                    'alias' => array(
                        'isactive' => 'isactive',


I get the following sql:

SELECT auth_user_id AS auth_user_id,handle AS handle,passwd AS
passwd,isactive AS isactive
            FROM   liveuser_users
            WHERE  handle='madwax' AND
passwd='f3bfc29c228b806b6a03513f5c7c149b'


The problem no arises in LiveUser\Auth\Common.php where on line (approx 440)
the system uses the following line:

if (array_key_exists('is_active', $this->propertyValues)//BUG madwax

I.E: The system looks for an key is_active (which I guess got changed
together with all the other keys) which does not exist. If this is_active is
changed to "isactive" the system correctly logs in the user!! :)

Above is not a good solution - it is better to change the name of the field
in the DB!

Regards,
Jan