log
class log implements log_interface
This class is used to add entries into the log table.
Properties
protected bool | $is_in_admin | If set, administrative user profile links will be returned and messages will not be censored. |
|
protected array | $disabled_types | An array with the disabled log types. Logs of such types will not be added when add() is called. |
|
protected int | $entry_count | Keeps the total log count of the last call to get_logs() |
|
protected int | $last_page_offset | Keeps the offset of the last valid page of the last call to get_logs() |
|
protected string | $log_table | The table we use to store our logs. |
|
protected driver | $db | Database object |
|
protected user | $user | User object |
|
protected auth | $auth | Auth object |
|
protected dispatcher_interface | $dispatcher | Event dispatcher object |
|
protected string | $phpbb_root_path | phpBB root path |
|
protected string | $phpbb_admin_path | Admin root path |
|
protected string | $php_ext | PHP Extension |
Methods
Constructor
Set is_in_admin in order to return administrative user profile links in get_logs()
Returns the is_in_admin option
Set table name
This function returns the state of the log system.
Disable log
Enable log
Adds a log entry to the database
Delete entries in the logs
Grab the logs from the database
Generates a sql condition for the specified keywords
Determine whether the user is allowed to read and/or moderate the forum of the topic
Get the data for all reportee from the database
Get total log count
Get offset of the last valid page
Details
at line 107
__construct(driver_interface $db, user $user, auth $auth, dispatcher_interface $phpbb_dispatcher, string $phpbb_root_path, string $relative_admin_path, string $php_ext, string $log_table)
Constructor
at line 134
null
set_is_admin(bool $is_in_admin)
Set is_in_admin in order to return administrative user profile links in get_logs()
at line 144
bool
get_is_admin()
Returns the is_in_admin option
at line 155
null
set_log_table(string $log_table)
Set table name
at line 163
bool
is_enabled(string $type = '')
This function returns the state of the log system.
at line 175
null
disable(mixed $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.
at line 197
null
enable(mixed $type = '')
Enable log
This function allows re-enabling the log system.
at line 219
int|bool
add(string $mode, int $user_id, string $log_ip, string $log_operation, int|bool $log_time = false, array $additional_data = array())
Adds a log entry to the database
at line 325
delete(string $mode, array $conditions = array())
Delete entries in the logs
at line 418
array
get_logs(string $mode, bool $count_logs = true, int $limit = 0, int $offset = 0, mixed $forum_id = 0, int $topic_id = 0, int $user_id = 0, int $log_time = 0, string $sort_by = 'l.log_time DESC', string $keywords = '')
Grab the logs from the database
at line 827
protected string
generate_sql_keyword(string $keywords, string $table_alias = 'l.', string $statement_operator = 'AND')
Generates a sql condition for the specified keywords
at line 896
protected array
get_topic_auth(array $topic_ids)
Determine whether the user is allowed to read and/or moderate the forum of the topic
at line 967
protected array
get_reportee_data(array $reportee_ids)
Get the data for all reportee from the database
at line 989
int
get_log_count()
Get total log count
at line 997
int
get_valid_offset()
Get offset of the last valid page