From 566510769b37f093542bfe18834ce2e4771eaf77 Mon Sep 17 00:00:00 2001 From: MasterShredder Date: Sun, 7 Dec 2014 05:57:07 +0400 Subject: [ticket/13422] Add new event core.session_check_user_session PHPBB3-13422 --- phpBB/phpbb/session.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/session.php') diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 691d0d5bef..ef177ed072 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -215,7 +215,7 @@ class session function session_begin($update_session_page = true) { global $phpEx, $SID, $_SID, $_EXTRA_URL, $db, $config, $phpbb_root_path; - global $request, $phpbb_container; + global $request, $phpbb_container, $phpbb_dispatcher; // Give us some basic information $this->time_now = time(); @@ -372,6 +372,14 @@ class session // Did the session exist in the DB? if (isset($this->data['user_id'])) { + /** + * Event to check user session + * + * @event core.session_check_user_session + * @since 3.1.3-RC1 + */ + $phpbb_dispatcher->dispatch('core.session_check_user_session'); + // Validate IP length according to admin ... enforces an IP // check on bots if admin requires this // $quadcheck = ($config['ip_check_bot'] && $this->data['user_type'] & USER_BOT) ? 4 : $config['ip_check']; -- cgit v1.2.1 From 1896825f39225368e1843a28479818f2bf195da2 Mon Sep 17 00:00:00 2001 From: MasterShredder Date: Sun, 7 Dec 2014 05:59:20 +0400 Subject: [ticket/13422] Add new event core.session_set_custom_ban PHPBB3-13422 --- phpBB/phpbb/session.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/session.php') diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index ef177ed072..35df71b92e 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -1090,7 +1090,7 @@ class session */ function check_ban($user_id = false, $user_ips = false, $user_email = false, $return = false) { - global $config, $db; + global $config, $db, $phpbb_dispatcher; if (defined('IN_CHECK_BAN') || defined('SKIP_CHECK_BAN')) { @@ -1204,6 +1204,20 @@ class session } $db->sql_freeresult($result); + /** + * Event to set custom ban type + * + * @event core.session_set_custom_ban + * @var bool return If $return is false this routine does not return on finding a banned user, it outputs a relevant message and stops execution + * @var bool banned Check if user already banned + * @var array ban_row Ban data + * @var string ban_triggered_by Custom ban type + * @since 3.1.3-RC1 + */ + $ban_row = isset($ban_row) ? $ban_row : false; + $vars = array('return', 'banned', 'ban_row', 'ban_triggered_by'); + extract($phpbb_dispatcher->trigger_event('core.session_set_custom_ban', compact($vars))); + if ($banned && !$return) { global $template, $phpbb_root_path, $phpEx; -- cgit v1.2.1 From fda5d8d637661dba083dc168745058628d38e5fd Mon Sep 17 00:00:00 2001 From: MasterShredder Date: Mon, 8 Dec 2014 08:50:05 +0400 Subject: [ticket/13422] Deleted event core.session_check_user_session --- phpBB/phpbb/session.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'phpBB/phpbb/session.php') diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 35df71b92e..2a948fd885 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -215,7 +215,7 @@ class session function session_begin($update_session_page = true) { global $phpEx, $SID, $_SID, $_EXTRA_URL, $db, $config, $phpbb_root_path; - global $request, $phpbb_container, $phpbb_dispatcher; + global $request, $phpbb_container; // Give us some basic information $this->time_now = time(); @@ -372,14 +372,6 @@ class session // Did the session exist in the DB? if (isset($this->data['user_id'])) { - /** - * Event to check user session - * - * @event core.session_check_user_session - * @since 3.1.3-RC1 - */ - $phpbb_dispatcher->dispatch('core.session_check_user_session'); - // Validate IP length according to admin ... enforces an IP // check on bots if admin requires this // $quadcheck = ($config['ip_check_bot'] && $this->data['user_type'] & USER_BOT) ? 4 : $config['ip_check']; -- cgit v1.2.1 From 3f88be65273a9eeba15f822b24a7940c1e58872f Mon Sep 17 00:00:00 2001 From: MasterShredder Date: Sun, 28 Dec 2014 03:35:21 +0400 Subject: [ticket/13422] Changed variable descriptions PHPBB3-13422 --- phpBB/phpbb/session.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/session.php') diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 2a948fd885..0a6a18ffbe 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -1200,10 +1200,10 @@ class session * Event to set custom ban type * * @event core.session_set_custom_ban - * @var bool return If $return is false this routine does not return on finding a banned user, it outputs a relevant message and stops execution - * @var bool banned Check if user already banned - * @var array ban_row Ban data - * @var string ban_triggered_by Custom ban type + * @var bool return If $return is false this routine does not return on finding a banned user, it outputs a relevant message and stops execution + * @var bool banned Check if user already banned + * @var array|false ban_row Ban data + * @var string ban_triggered_by Method that caused ban, can be your custom method * @since 3.1.3-RC1 */ $ban_row = isset($ban_row) ? $ban_row : false; -- cgit v1.2.1