Re: liveuser admin problem

Lukas Kahwe Smith <[email protected]> Wed, 12 Oct 2005 13:03:54 +0200
Newsgroups gmane.comp.php.pear.liveuser
Message-ID <[email protected]>
Jeroen Houben wrote:
> Hi,
> 
> After upgrading to Liveuser_Admin 0.3.5 the following code no longer works:
> 
> $group = array();
> $group['group_define_name'] = 'test';   
> $group['is_active'] = true;
> $lu_admin->perm->addGroup($group);
> 
> Error:
> 
> Notice: Undefined index: is_active in 
> /usr/local/share/php/pear/LiveUser/Admin/Storage/SQL.php on line 156
> 
> Notice: Undefined index: is_active in 
> /usr/local/share/php/pear/LiveUser/Admin/Storage/SQL.php on line 157
> 
> Couldn't create the query, reason: DB Error: syntax error-INSERT INTO 
> lu_groups
> (group_define_name, , group_id)
> VALUES ('TEST', TRUE, '9') [nativecode=ERROR:  syntax error at or near 
> "," at character 43]
> 
> 
> This is probably related to my earlier post:
> http://marc.theaimsgroup.com/?l=pear-general&m=112800485417870&w=2
> 
> I can just not specify "is_active" and it works, but then the is_active 
> defaults to NULL, which effectively makes the group in_active, right?

damn .. looks like i forgot to add this to the changelog:
- removed is_active, owner_group_id, owner_user_id from groups table
(need to be added in the config just like for users now)

essentially we have brought the group field inline with the user fields.
if you want is_active handling you need to explicitly enable it by
adding the fields to the group table definition. the same goes for
owner_user_id etc ..

See example4 for an example of how this is done on the auth side. Its
more or less the same for the perm side of things.

regards,
Lukas