[ticket/10714] Enable core.add_log event and remove superseded add_log_case

PHPBB3-10714
This commit is contained in:
Joas Schilling 2012-08-21 12:40:55 +02:00
parent 3170845a50
commit 0fcbb40a0e

View file

@ -134,12 +134,7 @@ class phpbb_log implements phpbb_log_interface
return false;
}
global $db;
/**
* @todo: enable when events are merged
*
global $db, $phpbb_dispatcher;
*/
if ($log_time == false)
{
@ -192,34 +187,37 @@ class phpbb_log implements phpbb_log_interface
'log_data' => (!empty($additional_data)) ? serialize($additional_data) : '',
);
break;
}
default:
/**
* @todo: enable when events are merged
* Allow to modify log data before we add them to the database
*
* NOTE: if sql_ary does not contain a log_type value, the entry will
* not be stored in the database. So ensure to set it, if needed.
*
* @event core.add_log
* @var string mode Mode of the entry we log
* @var int user_id ID of the user who triggered the log
* @var string log_ip IP of the user who triggered the log
* @var string log_operation Language key of the log operation
* @var int log_time Timestamp, when the log was added
* @var array additional_data Array with additional log data
* @var array sql_ary Array with log data we insert into the
* database. If sql_ary[log_type] is not set,
* we won't add the entry to the database.
* @since 3.1-A1
*/
if ($phpbb_dispatcher != null)
{
$vars = array('mode', 'user_id', 'log_ip', 'log_operation', 'log_time', 'additional_data', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.add_log_case', $vars, $vars));
extract($phpbb_dispatcher->trigger_event('core.add_log', $vars, $vars));
}
*/
// We didn't find a log_type, so we don't save it in the database.
if (!isset($sql_ary['log_type']))
{
return false;
}
}
/**
* @todo: enable when events are merged
*
if ($phpbb_dispatcher != null)
{
$vars = array('mode', 'user_id', 'log_ip', 'log_operation', 'log_time', 'additional_data', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.add_log', $vars, $vars));
}
*/
$db->sql_query('INSERT INTO ' . $this->log_table . ' ' . $db->sql_build_array('INSERT', $sql_ary));