mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-04 17:18:52 +00:00
[feature/events] Adding ledge user_update_name
Used by phpBB Gallery PHPBB3-9550
This commit is contained in:
parent
eda9bcc65d
commit
77845c1478
1 changed files with 6 additions and 1 deletions
|
@ -112,7 +112,7 @@ function update_last_username()
|
||||||
*/
|
*/
|
||||||
function user_update_name($old_name, $new_name)
|
function user_update_name($old_name, $new_name)
|
||||||
{
|
{
|
||||||
global $config, $db, $cache;
|
global $config, $db, $cache, $phpbb_dispatcher;
|
||||||
|
|
||||||
$update_ary = array(
|
$update_ary = array(
|
||||||
FORUMS_TABLE => array('forum_last_poster_name'),
|
FORUMS_TABLE => array('forum_last_poster_name'),
|
||||||
|
@ -137,6 +137,11 @@ function user_update_name($old_name, $new_name)
|
||||||
set_config('newest_username', $new_name, true);
|
set_config('newest_username', $new_name, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$vars = array('old_name', 'new_name');
|
||||||
|
$event = new phpbb_event_data(compact($vars));
|
||||||
|
$phpbb_dispatcher->dispatch('core.user_update_name', $event);
|
||||||
|
extract($event->get_data_filtered($vars));
|
||||||
|
|
||||||
// Because some tables/caches use username-specific data we need to purge this here.
|
// Because some tables/caches use username-specific data we need to purge this here.
|
||||||
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
|
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue