aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-01-22 16:47:05 +0100
committerJoas Schilling <nickvergessen@gmx.de>2013-01-22 16:47:05 +0100
commitd5d282005c74a4b9539c3b37d3df723ba6e2c456 (patch)
tree6b4f6d1211b89d5031ce18ffbb98494cf26a02c5 /phpBB/includes
parentc2504e9300608feea540ab162e4cc0ac79cda7a0 (diff)
downloadforums-d5d282005c74a4b9539c3b37d3df723ba6e2c456.tar
forums-d5d282005c74a4b9539c3b37d3df723ba6e2c456.tar.gz
forums-d5d282005c74a4b9539c3b37d3df723ba6e2c456.tar.bz2
forums-d5d282005c74a4b9539c3b37d3df723ba6e2c456.tar.xz
forums-d5d282005c74a4b9539c3b37d3df723ba6e2c456.zip
[ticket/10714] Add getter for is_in_admin and use it
PHPBB3-10714
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/log/log.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/phpBB/includes/log/log.php b/phpBB/includes/log/log.php
index 09dff10ae5..8da8b63391 100644
--- a/phpBB/includes/log/log.php
+++ b/phpBB/includes/log/log.php
@@ -23,6 +23,13 @@ if (!defined('IN_PHPBB'))
class phpbb_log implements phpbb_log_interface
{
/**
+ * If set, administrative user profile links will be returned and messages
+ * will not be censored.
+ * @var bool
+ */
+ protected $is_in_admin;
+
+ /**
* An array with the disabled log types. Logs of such types will not be
* added when add_log() is called.
* @var array
@@ -114,7 +121,7 @@ class phpbb_log implements phpbb_log_interface
$this->log_table = $log_table;
/*
- * IN_ADMIN is set after the session was created,
+ * IN_ADMIN is set after the session is created,
* so we need to take ADMIN_START into account as well, otherwise
* it will not work for the phpbb_log object we create in common.php
*/
@@ -135,6 +142,16 @@ class phpbb_log implements phpbb_log_interface
}
/**
+ * Returns the is_in_admin option
+ *
+ * @return bool
+ */
+ public function get_is_admin()
+ {
+ return $this->is_in_admin;
+ }
+
+ /**
* Set table name
*
* @param string $log_table Can overwrite the table to use for the logs
@@ -317,7 +334,7 @@ class phpbb_log implements phpbb_log_interface
$topic_id_list = $reportee_id_list = array();
- $profile_url = ($this->is_in_admin && $this->phpbb_admin_path) ? append_sid("{$this->phpbb_admin_path}index.{$this->php_ext}", 'i=users&amp;mode=overview') : append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=viewprofile');
+ $profile_url = ($this->get_is_admin() && $this->phpbb_admin_path) ? append_sid("{$this->phpbb_admin_path}index.{$this->php_ext}", 'i=users&amp;mode=overview') : append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=viewprofile');
switch ($mode)
{
@@ -509,7 +526,7 @@ class phpbb_log implements phpbb_log_interface
$log[$i]['action'] = vsprintf($log[$i]['action'], $log_data_ary);
// If within the admin panel we do not censor text out
- if ($this->is_in_admin)
+ if ($this->get_is_admin())
{
$log[$i]['action'] = bbcode_nl2br($log[$i]['action']);
}