﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	difficulty
3703	User is registered even if plugin hook 'register/user' returns false	richardloxley		"File actions/register.php creates a new user, then triggers the plugin hook register/user, and if the hooks return false then it attempts to delete the user and throw an error.

This deletion always fails, and so the user is registered (although they still get an error message).

There are 2 reasons for the failure to delete:

(1) ElggUser::delete calls ElggEntity::delete which calls delete_entity().  delete_entity() calls $entity->canEdit() and does nothing if the logged in user doesn't have permission to edit the entity.  Since we are in user registration code, there is no logged in user, so the user entity is not deleted.

(2) There is a further interaction with the uservalidationbyemail plugin.  This plugin disables the user entity within the 'register/user' plugin hook.  When delete_entity() is called it calls get_entity() to retrieve the user entity.  However get_entity() does not retrieve disabled entities.  Thus even if (1) above is fixed, the user deletion code in actions/register.php will not work if the uservalidationbyemail plugin is enabled."	Defect	new	normal	Near Term Future Release	Core	1.8 Beta	minor		register, user registration	brett@…	
