PHP Class phpbb\log\log

Inheritance: implements phpbb\log\log_interface
Mostrar archivo Open project: phpbb/phpbb Class Usage Examples

Protected Properties

Property Type Description
$auth phpbb\auth\auth Auth object
$db phpbb\db\driver\driver Database object
$disabled_types array An array with the disabled log types. Logs of such types will not be added when add() is called.
$dispatcher phpbb\event\dispatcher_interface Event dispatcher object
$entry_count integer Keeps the total log count of the last call to get_logs()
$is_in_admin boolean If set, administrative user profile links will be returned and messages will not be censored.
$last_page_offset integer Keeps the offset of the last valid page of the last call to get_logs()
$log_table string The table we use to store our logs.
$php_ext string PHP Extension
$phpbb_admin_path string Admin root path
$phpbb_root_path string phpBB root path
$user phpbb\user User object

Public Methods

Method Description
__construct ( phpbb\db\driver\driver_interface $db, phpbb\user $user, phpbb\auth\auth $auth, phpbb\event\dispatcher_interface $phpbb_dispatcher, string $phpbb_root_path, string $relative_admin_path, string $php_ext, string $log_table ) Constructor
add ( $mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = [] ) {@inheritDoc}
delete ( $mode, $conditions = [] ) {@inheritDoc}
disable ( $type = '' ) {@inheritDoc}
enable ( $type = '' ) {@inheritDoc}
get_is_admin ( ) : boolean Returns the is_in_admin option
get_log_count ( ) {@inheritDoc}
get_logs ( $mode, $count_logs = true, $limit, $offset, $forum_id, $topic_id, $user_id, $log_time, $sort_by = 'l.log_time DESC', $keywords = '' ) {@inheritDoc}
get_valid_offset ( ) {@inheritDoc}
is_enabled ( $type = '' ) {@inheritDoc}
set_is_admin ( boolean $is_in_admin ) : null Set is_in_admin in order to return administrative user profile links in get_logs()
set_log_table ( string $log_table ) : null Set table name

Protected Methods

Method Description
generate_sql_keyword ( string $keywords, string $table_alias = 'l.', string $statement_operator = 'AND' ) : string Generates a sql condition for the specified keywords
get_reportee_data ( array $reportee_ids ) : array Get the data for all reportee from the database
get_topic_auth ( array $topic_ids ) : array Determine whether the user is allowed to read and/or moderate the forum of the topic

Method Details

__construct() public method

Constructor
public __construct ( phpbb\db\driver\driver_interface $db, phpbb\user $user, phpbb\auth\auth $auth, phpbb\event\dispatcher_interface $phpbb_dispatcher, string $phpbb_root_path, string $relative_admin_path, string $php_ext, string $log_table )
$db phpbb\db\driver\driver_interface Database object
$user phpbb\user User object
$auth phpbb\auth\auth Auth object
$phpbb_dispatcher phpbb\event\dispatcher_interface Event dispatcher
$phpbb_root_path string Root path
$relative_admin_path string Relative admin root path
$php_ext string PHP Extension
$log_table string Name of the table we use to store our logs

add() public method

{@inheritDoc}
public add ( $mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = [] )

delete() public method

{@inheritDoc}
public delete ( $mode, $conditions = [] )

disable() public method

{@inheritDoc}
public disable ( $type = '' )

enable() public method

{@inheritDoc}
public enable ( $type = '' )

generate_sql_keyword() protected method

Generates a sql condition for the specified keywords
protected generate_sql_keyword ( string $keywords, string $table_alias = 'l.', string $statement_operator = 'AND' ) : string
$keywords string The keywords the user specified to search for
$table_alias string The alias of the logs' table ('l.' by default)
$statement_operator string The operator used to prefix the statement ('AND' by default)
return string Returns the SQL condition searching for the keywords

get_is_admin() public method

Returns the is_in_admin option
public get_is_admin ( ) : boolean
return boolean

get_log_count() public method

{@inheritDoc}
public get_log_count ( )

get_logs() public method

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

get_reportee_data() protected method

Get the data for all reportee from the database
protected get_reportee_data ( array $reportee_ids ) : array
$reportee_ids array Array with the user ids of the reportees
return array Returns an array with the reportee data

get_topic_auth() protected method

Determine whether the user is allowed to read and/or moderate the forum of the topic
protected get_topic_auth ( array $topic_ids ) : array
$topic_ids array Array with the topic ids
return array Returns an array with two keys 'm_' and 'read_f' which are also an array of topic_id => forum_id sets when the permissions are given. Sample: array( 'permission' => array( topic_id => forum_id ), ),

get_valid_offset() public method

{@inheritDoc}
public get_valid_offset ( )

is_enabled() public method

{@inheritDoc}
public is_enabled ( $type = '' )

set_is_admin() public method

Set is_in_admin in order to return administrative user profile links in get_logs()
public set_is_admin ( boolean $is_in_admin ) : null
$is_in_admin boolean Are we called from within the acp?
return null

set_log_table() public method

Set table name
public set_log_table ( string $log_table ) : null
$log_table string Can overwrite the table to use for the logs
return null

Property Details

$auth protected_oe property

Auth object
protected auth,phpbb\auth $auth
return phpbb\auth\auth

$db protected_oe property

Database object
protected driver,phpbb\db\driver $db
return phpbb\db\driver\driver

$disabled_types protected_oe property

An array with the disabled log types. Logs of such types will not be added when add() is called.
protected array $disabled_types
return array

$dispatcher protected_oe property

Event dispatcher object
protected dispatcher_interface,phpbb\event $dispatcher
return phpbb\event\dispatcher_interface

$entry_count protected_oe property

Keeps the total log count of the last call to get_logs()
protected int $entry_count
return integer

$is_in_admin protected_oe property

If set, administrative user profile links will be returned and messages will not be censored.
protected bool $is_in_admin
return boolean

$last_page_offset protected_oe property

Keeps the offset of the last valid page of the last call to get_logs()
protected int $last_page_offset
return integer

$log_table protected_oe property

The table we use to store our logs.
protected string $log_table
return string

$php_ext protected_oe property

PHP Extension
protected string $php_ext
return string

$phpbb_admin_path protected_oe property

Admin root path
protected string $phpbb_admin_path
return string

$phpbb_root_path protected_oe property

phpBB root path
protected string $phpbb_root_path
return string

$user protected_oe property

User object
protected user,phpbb $user
return phpbb\user