phpBB

Code Changes

File: phpbb/session.php

  Unmodified   Added   Modified   Removed
Line 1077Line 1077
	*/
function set_cookie($name, $cookiedata, $cookietime, $httponly = true)
{

	*/
function set_cookie($name, $cookiedata, $cookietime, $httponly = true)
{

		global $config;

		global $config, $phpbb_dispatcher;


// If headers are already set, we just return
if (headers_sent())


// If headers are already set, we just return
if (headers_sent())

 
		{
return;
}

$disable_cookie = false;
/**
* Event to modify or disable setting cookies
*
* @event core.set_cookie
* @var bool disable_cookie Set to true to disable setting this cookie
* @var string name Name of the cookie
* @var string cookiedata The data to hold within the cookie
* @var int cookietime The expiration time as UNIX timestamp
* @var bool httponly Use HttpOnly?
* @since 3.2.9-RC1
*/
$vars = array(
'disable_cookie',
'name',
'cookiedata',
'cookietime',
'httponly',
);
extract($phpbb_dispatcher->trigger_event('core.set_cookie', compact($vars)));

if ($disable_cookie)

		{
return;
}

		{
return;
}

Line 1299Line 1325
			trigger_error($message);
}


			trigger_error($message);
}


		return ($banned && $ban_row['ban_give_reason']) ? $ban_row['ban_give_reason'] : $banned;






		if (!empty($ban_row))
{
$ban_row['ban_triggered_by'] = $ban_triggered_by;
}

return ($banned && $ban_row) ? $ban_row : $banned;

	}

/**

	}

/**

Line 1613Line 1644
		{
return;
}

		{
return;
}

 

// Do not update the session page for ajax requests, so the view online still works as intended
$page_changed = $this->update_session_page && $this->data['session_page'] != $this->page['page'] && !$request->is_ajax();


// Only update session DB a minute or so after last update or if page changes


// Only update session DB a minute or so after last update or if page changes

		if ($this->time_now - ((isset($this->data['session_time'])) ? $this->data['session_time'] : 0) > 60 || ($this->update_session_page && $this->data['session_page'] != $this->page['page']))

		if ($this->time_now - (isset($this->data['session_time']) ? $this->data['session_time'] : 0) > 60 || $page_changed)

		{
$sql_ary = array('session_time' => $this->time_now);


		{
$sql_ary = array('session_time' => $this->time_now);


			// Do not update the session page for ajax requests, so the view online still works as intended
if ($this->update_session_page && !$request->is_ajax())

			if ($page_changed)


			{
$sql_ary['session_page'] = substr($this->page['page'], 0, 199);
$sql_ary['session_forum_id'] = $this->page['forum'];

			{
$sql_ary['session_page'] = substr($this->page['page'], 0, 199);
$sql_ary['session_forum_id'] = $this->page['forum'];