aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-05-11 18:11:44 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-05-11 18:11:44 +0200
commit8cdc6632ee30d58f40a873b42bd263899169f6a4 (patch)
tree241d37633d728cf7345158245f90e58edb59e108 /phpBB/phpbb
parente28b1a838942b05d79451428f4d2e8fef74cc324 (diff)
parent9a295e4845c012c2b10ea6c9cd7b3fb97930b120 (diff)
downloadforums-8cdc6632ee30d58f40a873b42bd263899169f6a4.tar
forums-8cdc6632ee30d58f40a873b42bd263899169f6a4.tar.gz
forums-8cdc6632ee30d58f40a873b42bd263899169f6a4.tar.bz2
forums-8cdc6632ee30d58f40a873b42bd263899169f6a4.tar.xz
forums-8cdc6632ee30d58f40a873b42bd263899169f6a4.zip
Merge pull request #2438 from marc1706/ticket/12517
[ticket/12517] Correctly call $log->add in prune shadow topics * marc1706/ticket/12517: [ticket/12517] Correctly call $log->add in prune shadow topics
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/cron/task/core/prune_shadow_topics.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
index b30e665a87..aa600e9abe 100644
--- a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
+++ b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
@@ -25,6 +25,7 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
protected $config;
protected $db;
protected $log;
+ protected $user;
/**
* If $forum_data is given, it is assumed to contain necessary information
@@ -44,14 +45,16 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
* @param \phpbb\config\config $config The config
* @param \phpbb\db\driver\driver $db The db connection
* @param \phpbb\log\log $log The phpBB log system
+ * @param \phpbb\user $user The phpBB user object
*/
- public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver $db, \phpbb\log\log $log)
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver $db, \phpbb\log\log $log, \phpbb\user $user)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->config = $config;
$this->db = $db;
$this->log = $log;
+ $this->user = $user;
}
/**
@@ -183,7 +186,10 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
WHERE forum_id = $forum_id";
$this->db->sql_query($sql);
- $this->log->add('admin', 'LOG_PRUNE_SHADOW', $row['forum_name']);
+ $user_id = (empty($this->user->data)) ? ANONYMOUS : $this->user->data['user_id'];
+ $user_ip = (empty($this->user->ip)) ? '' : $this->user->ip;
+
+ $this->log->add('admin', $user_id, $user_ip, 'LOG_PRUNE_SHADOW', false, array($row['forum_name']));
}
return;