diff options
Diffstat (limited to 'phpBB/phpbb')
| -rw-r--r-- | phpBB/phpbb/avatar/driver/upload.php | 7 | ||||
| -rw-r--r-- | phpBB/phpbb/notification/method/messenger_base.php | 2 | ||||
| -rw-r--r-- | phpBB/phpbb/session.php | 58 | ||||
| -rw-r--r-- | phpBB/phpbb/template/twig/node/includecss.php | 2 | 
4 files changed, 63 insertions, 6 deletions
| diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index ee36243844..73147a85a0 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -161,6 +161,13 @@ class upload extends \phpbb\avatar\driver\driver  			return false;  		} +		// Delete current avatar if not overwritten +		$ext = substr(strrchr($row['avatar'], '.'), 1); +		if ($ext && $ext !== $file->get('extension')) +		{ +			$this->delete($row); +		} +  		return array(  			'avatar' => $row['id'] . '_' . time() . '.' . $file->get('extension'),  			'avatar_width' => $file->get('width'), diff --git a/phpBB/phpbb/notification/method/messenger_base.php b/phpBB/phpbb/notification/method/messenger_base.php index bde4573117..c3aee088f9 100644 --- a/phpBB/phpbb/notification/method/messenger_base.php +++ b/phpBB/phpbb/notification/method/messenger_base.php @@ -69,7 +69,7 @@ abstract class messenger_base extends \phpbb\notification\method\base  			$user = $this->user_loader->get_user($notification->user_id); -			if ($user['user_type'] == USER_IGNORE || in_array($notification->user_id, $banned_users)) +			if ($user['user_type'] == USER_IGNORE || ($user['user_type'] == USER_INACTIVE && $user['user_inactive_reason'] == INACTIVE_MANUAL) || in_array($notification->user_id, $banned_users))  			{  				continue;  			} diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index bedd581725..a5c8f264e0 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(); @@ -893,6 +893,19 @@ class session  			$_SID = '';  		} +		$session_data = $sql_ary; +		/** +		* Event to send new session data to extension +		* Read-only event +		* +		* @event core.session_create_after +		* @var	array		session_data				Associative array of session keys to be updated +		* @since 3.1.6-RC1 +		*/ +		$vars = array('session_data'); +		extract($phpbb_dispatcher->trigger_event('core.session_create_after', compact($vars))); +		unset($session_data); +  		return true;  	} @@ -906,13 +919,30 @@ 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) . "'  				AND session_user_id = " . (int) $this->data['user_id'];  		$db->sql_query($sql); +		$user_id = (int) $this->data['user_id']; +		$session_id = $this->session_id; +		/** +		* Event to send session kill information to extension +		* Read-only event +		* +		* @event core.session_kill_after +		* @var	int		user_id				user_id of the session user. +		* @var	string		session_id				current user's session_id +		* @var	bool	new_session 	should we create new session for user +		* @since 3.1.6-RC1 +		*/ +		$vars = array('user_id', 'session_id', 'new_session'); +		extract($phpbb_dispatcher->trigger_event('core.session_kill_after', compact($vars))); +		unset($user_id); +		unset($session_id); +  		// Allow connecting logout with external auth method logout  		$provider_collection = $phpbb_container->get('auth.provider_collection');  		$provider = $provider_collection->get_provider(); @@ -980,7 +1010,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; @@ -1048,6 +1078,14 @@ class session  			$db->sql_query($sql);  		} +		/** +		* Event to trigger extension on session_gc +		* +		* @event core.session_gc_after +		* @since 3.1.6-RC1 +		*/ +		$phpbb_dispatcher->dispatch('core.session_gc_after'); +  		return;  	} @@ -1541,12 +1579,24 @@ 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 update session information to extension +		* Read-only event +		* +		* @event core.update_session_after +		* @var	array		session_data				Associative array of session keys to be updated +		* @var	string		session_id				current user's session_id +		* @since 3.1.6-RC1 +		*/ +		$vars = array('session_data', 'session_id'); +		extract($phpbb_dispatcher->trigger_event('core.update_session_after', compact($vars)));  	}  } diff --git a/phpBB/phpbb/template/twig/node/includecss.php b/phpBB/phpbb/template/twig/node/includecss.php index 2ce63402aa..2dac154036 100644 --- a/phpBB/phpbb/template/twig/node/includecss.php +++ b/phpBB/phpbb/template/twig/node/includecss.php @@ -31,7 +31,7 @@ class includecss extends \phpbb\template\twig\node\includeasset  		$compiler  			->raw("<link href=\"' . ")  			->raw("\$asset_file . '\"") -			->raw(' rel="stylesheet" type="text/css" media="screen, projection" />') +			->raw(' rel="stylesheet" type="text/css" media="screen" />')  		;  	}  } | 
