[ticket/13981] Add events to capture avatar deletion or overwriting

An event to capture new avatar moving in place (and maybe overwriting
existing avatar), and another to capture deletion.  Includes better error
processing.  Rename event.

PHPBB3-13981
This commit is contained in:
javiexin 2015-07-24 10:52:00 +02:00
parent e37b3495f0
commit c3d77edd83

View file

@ -168,9 +168,9 @@ class upload extends \phpbb\avatar\driver\driver
}
/**
* Before overwriting an existing avatar with a newly uploaded avatar
* Before moving new file in place (and eventually overwriting the existing avatar with the newly uploaded avatar)
*
* @event core.avatar_driver_upload_overwrite_before
* @event core.avatar_driver_upload_move_file_before
* @var string destination Destination directory where the file is going to be moved
* @var string prefix Prefix for the avatar filename
* @var array row Array with avatar row data
@ -183,7 +183,7 @@ class upload extends \phpbb\avatar\driver\driver
'row',
'error',
);
extract($this->dispatcher->trigger_event('core.avatar_driver_upload_overwrite_before', compact($vars)));
extract($this->dispatcher->trigger_event('core.avatar_driver_upload_move_file_before', compact($vars)));
if (!sizeof($error))
{