[ticket/346] Use phpBB log class instead of add_log()
B3P-346
This commit is contained in:
@@ -112,6 +112,9 @@ class calendar extends module_base
|
||||
/** @var string Portal root path */
|
||||
protected $portal_root_path;
|
||||
|
||||
/** @var \phpbb\log\log phpBB log */
|
||||
protected $log;
|
||||
|
||||
/**
|
||||
* Construct a calendar object
|
||||
*
|
||||
@@ -123,8 +126,9 @@ class calendar extends module_base
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
* @param \phpbb\path_helper $path_helper phpBB path helper
|
||||
* @param \phpbb\log\log $log phpBB log object
|
||||
*/
|
||||
public function __construct($config, $template, $db, $request, $phpbb_root_path, $phpEx, $user, $path_helper)
|
||||
public function __construct($config, $template, $db, $request, $phpbb_root_path, $phpEx, $user, $path_helper, $log)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->template = $template;
|
||||
@@ -134,6 +138,7 @@ class calendar extends module_base
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->user = $user;
|
||||
$this->path_helper = $path_helper;
|
||||
$this->log = $log;
|
||||
$this->portal_root_path = $this->path_helper->get_web_root_path() . $this->phpbb_root_path . 'ext/board3/portal/';
|
||||
}
|
||||
|
||||
@@ -497,7 +502,7 @@ class calendar extends module_base
|
||||
'url' => htmlspecialchars_decode($event_url),
|
||||
);
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_EVENT_UPDATED', $event_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_EVENT_UPDATED', false, array($event_title));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -512,7 +517,7 @@ class calendar extends module_base
|
||||
'permission' => $event_permission,
|
||||
'url' => $event_url, // optional
|
||||
);
|
||||
add_log('admin', 'LOG_PORTAL_EVENT_ADDED', $event_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_EVENT_ADDED', false, array($event_title));
|
||||
}
|
||||
|
||||
// we sort the $events array by the start time
|
||||
@@ -546,7 +551,7 @@ class calendar extends module_base
|
||||
$board3_events_array = serialize($events);
|
||||
set_portal_config('board3_calendar_events_' . $module_id, $board3_events_array);
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_EVENT_REMOVED', $cur_event_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_EVENT_REMOVED', false, array($cur_event_title));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -68,6 +68,9 @@ class custom extends module_base
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
|
||||
/** @var \phpbb\log\log phpBB log*/
|
||||
protected $log;
|
||||
|
||||
/**
|
||||
* Construct a custom module object
|
||||
*
|
||||
@@ -78,8 +81,9 @@ class custom extends module_base
|
||||
* @param string $phpEx php file extension
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
* @param \phpbb\log\log $log phpBB log
|
||||
*/
|
||||
public function __construct($config, $template, $db, $request, $phpbb_root_path, $phpEx, $user)
|
||||
public function __construct($config, $template, $db, $request, $phpbb_root_path, $phpEx, $user, $log)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->template = $template;
|
||||
@@ -88,6 +92,7 @@ class custom extends module_base
|
||||
$this->php_ext = $phpEx;
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->user = $user;
|
||||
$this->log = $log;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -232,7 +237,7 @@ class custom extends module_base
|
||||
$log_title = $custom_title;
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_CONFIG', $this->user->lang['PORTAL_CUSTOM'] . ': ' . $log_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_CONFIG', false, array($this->user->lang['PORTAL_CUSTOM'] . ': ' . $log_title));
|
||||
|
||||
// set_portal_config will take care of escaping the welcome message
|
||||
set_portal_config('board3_custom_' . $module_id . '_code', $custom_code);
|
||||
|
||||
@@ -74,6 +74,9 @@ class links extends module_base
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
|
||||
/** @var \phpbb\log\log phpBB log */
|
||||
protected $log;
|
||||
|
||||
/**
|
||||
* Construct a links object
|
||||
*
|
||||
@@ -84,8 +87,9 @@ class links extends module_base
|
||||
* @param string $phpEx php file extension
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
* @param \phpbb\log\log phpBB log
|
||||
*/
|
||||
public function __construct($config, $db, $request, $template, $phpbb_root_path, $phpEx, $user)
|
||||
public function __construct($config, $db, $request, $template, $phpbb_root_path, $phpEx, $user, $log)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->db = $db;
|
||||
@@ -94,6 +98,7 @@ class links extends module_base
|
||||
$this->php_ext = $phpEx;
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->user = $user;
|
||||
$this->log = $log;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -297,7 +302,7 @@ class links extends module_base
|
||||
'permission' => $link_permissions,
|
||||
);
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_LINK_UPDATED', $link_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_LINK_UPDATED', false, array($link_title));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -309,7 +314,7 @@ class links extends module_base
|
||||
'type' => $link_type,
|
||||
'permission' => $link_permissions,
|
||||
);
|
||||
add_log('admin', 'LOG_PORTAL_LINK_ADDED', $link_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'],'LOG_PORTAL_LINK_ADDED', false, array($link_title));
|
||||
}
|
||||
|
||||
$board3_links_array = serialize($links);
|
||||
@@ -337,7 +342,7 @@ class links extends module_base
|
||||
$board3_links_array = serialize($links);
|
||||
set_portal_config('board3_links_array_' . $module_id, $board3_links_array);
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_LINK_REMOVED', $cur_link_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_LINK_REMOVED', false, array($cur_link_title));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -75,6 +75,9 @@ class main_menu extends module_base
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
|
||||
/** @var \phpbb\log\log phpBB log */
|
||||
protected $log;
|
||||
|
||||
/**
|
||||
* Construct a main menu object
|
||||
*
|
||||
@@ -85,8 +88,9 @@ class main_menu extends module_base
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
* @param string $phpEx php file extension
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
* @param \phpbb\log\log $log phpBB log
|
||||
*/
|
||||
public function __construct($config, $db, $request, $template, $phpbb_root_path, $phpEx, $user)
|
||||
public function __construct($config, $db, $request, $template, $phpbb_root_path, $phpEx, $user, $log)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->db = $db;
|
||||
@@ -95,6 +99,7 @@ class main_menu extends module_base
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->php_ext = $phpEx;
|
||||
$this->user = $user;
|
||||
$this->log = $log;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -353,7 +358,7 @@ class main_menu extends module_base
|
||||
'permission' => $link_permissions,
|
||||
);
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_LINK_UPDATED', $link_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_LINK_UPDATED', false, array($link_title));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -369,7 +374,7 @@ class main_menu extends module_base
|
||||
'type' => $link_type,
|
||||
'permission' => $link_permissions,
|
||||
);
|
||||
add_log('admin', 'LOG_PORTAL_LINK_ADDED', $link_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_LINK_ADDED', false, array($link_title));
|
||||
}
|
||||
|
||||
$board3_menu_array = serialize($links);
|
||||
@@ -397,7 +402,7 @@ class main_menu extends module_base
|
||||
$board3_menu_array = serialize($links);
|
||||
set_portal_config('board3_menu_array_' . $module_id, $board3_menu_array);
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_LINK_REMOVED', $cur_link_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_LINK_REMOVED', false, array($cur_link_title));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user