Re: Bug with removing a user

Arnaud Limbourg <arnaud-GdXxm9JVFPlWk0Htik3J/[email protected]> Tue, 15 Nov 2005 07:45:35 +0100
Newsgroups gmane.comp.php.pear.liveuser
Message-ID <[email protected]>
Dan Rossi wrote:
> Ive discovered a bug removing a user with the cvs version i was told to
> get, if i do
> 
> $lu->admin->removeUser(array('perm_user_id'=>1));
> 
> Here is the error i get
> 
> Pear Errors with the system
> Info: MDB2 Error: syntax error
>  [Last query: UPDATE liveuser_groups SET
>  = NULL]
> 
> In the complex method removeUser
> 
>  $data = array('owner_user_id' => null);
>         $filter = array('owner_user_id' => $filters['perm_user_id']);
>         $result = $this->updateGroup($data, $filter);
>         if ($result === false) {
>             return false;
>         }
> 
> Why is it trying to update the groups ? There is no updateGroup method
> in complex anyway.
> 
> Also how do i make removeUser also remove the area and user rights ??

Every method is called is cascade, Complex extends Medium extends
Simple. The three methods are called one after the other, the user is
removed from the group in medium and has his rights revoked in Simple.

The update group is called to make sure the group's data is updated
properly if the user is the owner.

I don't know why you have an error though, you could try to see chat
happens in the createUpdate method of Storage/SQL.php

Arnaud.