From bbbf122d05ef77a2b03f2e092f6a0ebc2ca58ee1 Mon Sep 17 00:00:00 2001 From: Stanislav Atanasov Date: Sun, 31 May 2015 15:05:13 +0300 Subject: [PATCH] [ticket/13817] Add session_kill and session_gc Ticket was changed to add few more session related events core.session_kill - send user_id and session_id core.session_gc - just triger event PHPBB3-13817 --- phpBB/phpbb/session.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index f611b0900c..dab75666ac 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -913,6 +913,19 @@ class session AND session_user_id = " . (int) $this->data['user_id']; $db->sql_query($sql); + /** + * Event to send session kill information to extension + * + * @event core.session_kill + * @var int user_id user_id of the session user. + * @var string session_id current user's session_id + * @since 3.1.5-RC1 + */ + $user_id = (int) $this->data['user_id']; + $session_id = $this->session_id; + $vars = array('user_id', 'session_id'); + extract($phpbb_dispatcher->trigger_event('core.session_kill', compact($vars))); + // Allow connecting logout with external auth method logout $provider_collection = $phpbb_container->get('auth.provider_collection'); $provider = $provider_collection->get_provider(); @@ -1048,6 +1061,15 @@ class session $db->sql_query($sql); } + /** + * Event to trigger extension on session_gc + * + * @event core.session_gc + * @since 3.1.5-RC1 + */ + $vars = array(); + extract($phpbb_dispatcher->trigger_event('core.session_gc', compact($vars))); + return; } @@ -1550,11 +1572,11 @@ class session $db->sql_query($sql); /** - * Event to send session information to extension + * Event to send update 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 + * @var string session_id current user's session_id * @since 3.1.5-RC1 */ $vars = array('session_data', 'session_id');