Forums / Developer / Trying to delete an user
Antoine W.
Thursday 04 August 2005 7:16:43 am
Hi ! I'm coding a custom login handler and I need to delete an user when this user dont more exist in a distant database.I have tried with the following code :
$existUser =& $this->fetchByName( $login ); if( $existUser ) { $userId =& $existUser->id(); eZUser::removeUser( $userId ); }
With this code, user that should be deleted already exists in the user list, but all its attributes are empty (login, password, email...). Do you know which function must be called to remove node assignment of this object ? Must I call other functions to be sure to delete every related informations about this user ?Thanks !
Friday 12 August 2005 3:41:12 am
After searching a few days, I cant find a code working to delete properly an user.Any help would be greatly appreciated =)
K259
Tuesday 16 August 2005 6:27:59 am
I wonder how it's possible to delete a user with sql on the command line in eZ publish...and howto list all users which belongs to a specific group with sql.
Michael D.
Wednesday 10 May 2006 4:44:14 am
Antoine: Try adding this code under eZUser::removeUser
eZContentObjectTreeNode::removeSubtrees( array($existUser->attribute("node_id")), false );
The second parameter tells ez to delete the user (if false) instead of just moving it into the trash (if true).
I hope this helps.