phpBB API Documentation
Class

phpbb\log\log

class log implements log_interface

This class is used to add entries into the log table.

Methods

__construct($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, $relative_admin_path, $php_ext, $log_table)

Constructor

set_is_admin($is_in_admin)

Set isinadmin in order to return administrative user profile links in get_logs()

get_is_admin()

Returns the isinadmin option

set_log_table($log_table)

Set table name

is_enabled($type = '')

This function returns the state of the log system.

disable($type = '')

Disable log

enable($type = '')

Enable log

add($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array())

Adds a log entry to the database

delete(string $mode, array $conditions = array())

Delete entries in the logs

get_logs($mode, $count_logs = true, $limit, $offset, $forum_id, $topic_id, $user_id, $log_time, $sort_by = 'l.log_time DESC', $keywords = '')

Grab the logs from the database

get_log_count()

Get total log count

get_valid_offset()

Get offset of the last valid page

Details

at line 107
public __construct($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, $relative_admin_path, $php_ext, $log_table)

Constructor

Parameters

$db
$user
$auth
$phpbb_dispatcher
$phpbb_root_path
$relative_admin_path
$php_ext
$log_table

at line 134
public set_is_admin($is_in_admin)

Set isinadmin in order to return administrative user profile links in get_logs()

Parameters

$is_in_admin

at line 144
public get_is_admin()

Returns the isinadmin option

at line 155
public set_log_table($log_table)

Set table name

Parameters

$log_table

at line 163
public is_enabled($type = '')

This function returns the state of the log system.

Parameters

$type

at line 175
public disable($type = '')

Disable log

This function allows disabling the log system or parts of it, for this page call. When add() is called and the type is disabled, the log will not be added to the database.

Parameters

$type

at line 197
public enable($type = '')

Enable log

This function allows re-enabling the log system.

Parameters

$type

at line 219
public add($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array())

Adds a log entry to the database

Parameters

$mode
$user_id
$log_ip
$log_operation
$log_time
$additional_data

at line 325
public delete(string $mode, array $conditions = array())

Delete entries in the logs

Parameters

string $mode The mode defines which log_type is used and from which log the entries are deleted
array $conditions An array of conditions, 3 different forms are accepted 1) => transformed into 'AND = ' (value should be an integer) 2) => array(, ) transformed into 'AND ' (values can't be an array) 3) => array('IN' => array()) transformed into 'AND IN ' A special field, keywords, can also be defined. In this case only the log entries that have the keywords in logoperation or logdata will be deleted.

at line 418
public get_logs($mode, $count_logs = true, $limit, $offset, $forum_id, $topic_id, $user_id, $log_time, $sort_by = 'l.log_time DESC', $keywords = '')

Grab the logs from the database

Parameters

$mode
$count_logs
$limit
$offset
$forum_id
$topic_id
$user_id
$log_time
$sort_by
$keywords

at line 989
public get_log_count()

Get total log count

at line 997
public get_valid_offset()

Get offset of the last valid page