phpBB

Code Changes

File: phpbb/log/log.php

  Unmodified   Added   Modified   Removed
Line 27Line 27

/**
* An array with the disabled log types. Logs of such types will not be


/**
* An array with the disabled log types. Logs of such types will not be

	* added when add_log() is called.

	* added when add() is called.

	* @var array
*/
protected $disabled_types;

	* @var array
*/
protected $disabled_types;

Line 223Line 223
			return false;
}


			return false;
}


		if ($log_time == false)

		if ($log_time === false)

		{
$log_time = time();
}

		{
$log_time = time();
}

Line 249Line 249
				unset($additional_data['forum_id']);
$topic_id = isset($additional_data['topic_id']) ? (int) $additional_data['topic_id'] : 0;
unset($additional_data['topic_id']);

				unset($additional_data['forum_id']);
$topic_id = isset($additional_data['topic_id']) ? (int) $additional_data['topic_id'] : 0;
unset($additional_data['topic_id']);

 
				$post_id = isset($additional_data['post_id']) ? (int) $additional_data['post_id'] : 0;
unset($additional_data['post_id']);

				$sql_ary += array(
'log_type' => LOG_MOD,
'forum_id' => $forum_id,
'topic_id' => $topic_id,

				$sql_ary += array(
'log_type' => LOG_MOD,
'forum_id' => $forum_id,
'topic_id' => $topic_id,

 
					'post_id'		=> $post_id,

					'log_data'		=> (!empty($additional_data)) ? serialize($additional_data) : '',
);
break;

					'log_data'		=> (!empty($additional_data)) ? serialize($additional_data) : '',
);
break;

Line 643Line 646
				'time'				=> (int) $row['log_time'],
'forum_id' => (int) $row['forum_id'],
'topic_id' => (int) $row['topic_id'],

				'time'				=> (int) $row['log_time'],
'forum_id' => (int) $row['forum_id'],
'topic_id' => (int) $row['topic_id'],

 
				'post_id'			=> (int) $row['post_id'],


'viewforum' => ($row['forum_id'] && $this->auth->acl_get('f_read', $row['forum_id'])) ? append_sid("{$this->phpbb_root_path}viewforum.{$this->php_ext}", 'f=' . $row['forum_id']) : false,
'action' => (isset($this->user->lang[$row['log_operation']])) ? $row['log_operation'] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',


'viewforum' => ($row['forum_id'] && $this->auth->acl_get('f_read', $row['forum_id'])) ? append_sid("{$this->phpbb_root_path}viewforum.{$this->php_ext}", 'f=' . $row['forum_id']) : false,
'action' => (isset($this->user->lang[$row['log_operation']])) ? $row['log_operation'] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',

Line 743Line 747
			foreach ($log as $key => $row)
{
$log[$key]['viewtopic'] = (isset($topic_auth['f_read'][$row['topic_id']])) ? append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", 'f=' . $topic_auth['f_read'][$row['topic_id']] . '&t=' . $row['topic_id']) : false;

			foreach ($log as $key => $row)
{
$log[$key]['viewtopic'] = (isset($topic_auth['f_read'][$row['topic_id']])) ? append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", 'f=' . $topic_auth['f_read'][$row['topic_id']] . '&t=' . $row['topic_id']) : false;

 
				$log[$key]['viewpost'] = (isset($topic_auth['f_read'][$row['topic_id']]) && $row['post_id']) ? append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", 'f=' . $topic_auth['f_read'][$row['topic_id']] . '&t=' . $row['topic_id'] . '&p=' . $row['post_id']) : false;

				$log[$key]['viewlogs'] = (isset($topic_auth['m_'][$row['topic_id']])) ? append_sid("{$this->phpbb_root_path}mcp.{$this->php_ext}", 'i=logs&mode=topic_logs&t=' . $row['topic_id'], true, $this->user->session_id) : false;
}
}

				$log[$key]['viewlogs'] = (isset($topic_auth['m_'][$row['topic_id']])) ? append_sid("{$this->phpbb_root_path}mcp.{$this->php_ext}", 'i=logs&mode=topic_logs&t=' . $row['topic_id'], true, $this->user->session_id) : false;
}
}

Line 893Line 898
		$forum_auth = array('f_read' => array(), 'm_' => array());
$topic_ids = array_unique($topic_ids);


		$forum_auth = array('f_read' => array(), 'm_' => array());
$topic_ids = array_unique($topic_ids);


		$sql = 'SELECT topic_id, forum_id
FROM ' . TOPICS_TABLE . '
WHERE ' . $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids));





















		$sql_ary = array(
'SELECT' => 'topic_id, forum_id',
'FROM' => array(
TOPICS_TABLE => 't',
),
'WHERE' => $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids)),
);

/**
* Allow modifying SQL query before topic data is retrieved.
*
* @event core.phpbb_log_get_topic_auth_sql_before
* @var array topic_ids Array with unique topic IDs
* @var array sql_ary SQL array
* @since 3.1.11-RC1
*/
$vars = array(
'topic_ids',
'sql_ary',
);
extract($this->dispatcher->trigger_event('core.phpbb_log_get_topic_auth_sql_before', compact($vars)));

$sql = $this->db->sql_build_query('SELECT', $sql_ary);

		$result = $this->db->sql_query($sql);

while ($row = $this->db->sql_fetchrow($result))

		$result = $this->db->sql_query($sql);

while ($row = $this->db->sql_fetchrow($result))