From 4a1f617473c982af4c25fe23a42ea544d5e95c78 Mon Sep 17 00:00:00 2001 From: Stanislav Atanasov Date: Tue, 5 May 2015 01:50:10 +0300 Subject: [ticket/13817] Add core.update_session event Add core.update_session event in \phpbb\session.php PHPBB3-13817 --- phpBB/phpbb/session.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/session.php') diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index bedd581725..1a15e171c4 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -1541,12 +1541,23 @@ class session */ public function update_session($session_data, $session_id = null) { - global $db; + global $db, $phpbb_dispatcher; $session_id = ($session_id) ? $session_id : $this->session_id; $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $session_data) . " WHERE session_id = '" . $db->sql_escape($session_id) . "'"; $db->sql_query($sql); + + /** + * Event to send session information to extension + * + * @event core.update_session + * @var array session_data Associative array of session keys to be updated + * @var array session_id current user's session_id + * @since 3.1.4 + */ + $vars = array('session_data', 'session_id'); + extract($phpbb_dispatcher->trigger_event('core.update_session', compact($vars))); } } -- cgit v1.2.1