diff options
author | Stanislav Atanasov <lucifer@anavaro.com> | 2015-05-31 19:20:45 +0300 |
---|---|---|
committer | Stanislav Atanasov <lucifer@anavaro.com> | 2015-06-20 23:46:36 +0300 |
commit | 76f7175fc485f75eda89e8f2cc01a7c5da2b52bf (patch) | |
tree | 2a6405f4aed7d093a9013f75a7c68502ef739357 | |
parent | bbbf122d05ef77a2b03f2e092f6a0ebc2ca58ee1 (diff) | |
download | forums-76f7175fc485f75eda89e8f2cc01a7c5da2b52bf.tar forums-76f7175fc485f75eda89e8f2cc01a7c5da2b52bf.tar.gz forums-76f7175fc485f75eda89e8f2cc01a7c5da2b52bf.tar.bz2 forums-76f7175fc485f75eda89e8f2cc01a7c5da2b52bf.tar.xz forums-76f7175fc485f75eda89e8f2cc01a7c5da2b52bf.zip |
[ticket/13817] Fix missing phpbb_dispatcher
Fix missing phpbb_dispatcher and add event to session_create
PHPBB3-13817
-rw-r--r-- | phpBB/phpbb/session.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index dab75666ac..93070dae09 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -519,7 +519,7 @@ class session */ function session_create($user_id = false, $set_admin = false, $persist_login = false, $viewonline = true) { - global $SID, $_SID, $db, $config, $cache, $phpbb_root_path, $phpEx, $phpbb_container; + global $SID, $_SID, $db, $config, $cache, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; $this->data = array(); @@ -851,6 +851,18 @@ class session $_SID = $this->session_id; $this->data = array_merge($this->data, $sql_ary); + /** + * Event to send new session data to extension + * + * @event core.session_create + * @var array session_data Associative array of session keys to be updated + * @since 3.1.5-RC1 + */ + $session_data = $this->data; + $vars = array('session_data'); + extract($phpbb_dispatcher->trigger_event('core.session_create', compact($vars))); + unset($session_data); + if (!$bot) { $cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000); @@ -906,7 +918,7 @@ class session */ function session_kill($new_session = true) { - global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx, $phpbb_container; + global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; $sql = 'DELETE FROM ' . SESSIONS_TABLE . " WHERE session_id = '" . $db->sql_escape($this->session_id) . "' @@ -925,6 +937,8 @@ class session $session_id = $this->session_id; $vars = array('user_id', 'session_id'); extract($phpbb_dispatcher->trigger_event('core.session_kill', compact($vars))); + unset($user_id); + unset($session_id); // Allow connecting logout with external auth method logout $provider_collection = $phpbb_container->get('auth.provider_collection'); @@ -993,7 +1007,7 @@ class session */ function session_gc() { - global $db, $config, $phpbb_root_path, $phpEx, $phpbb_container; + global $db, $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; $batch_size = 10; |