aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_modules.php18
-rw-r--r--phpBB/includes/functions.php15
-rw-r--r--phpBB/includes/functions_admin.php6
-rwxr-xr-xphpBB/includes/mcp/mcp_logs.php2
-rw-r--r--phpBB/includes/mcp/mcp_main.php2
-rw-r--r--phpBB/includes/mcp/mcp_queue.php2
-rwxr-xr-xphpBB/includes/mcp/mcp_reports.php2
7 files changed, 35 insertions, 12 deletions
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index 8b54589707..dd67cdda87 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -106,12 +106,26 @@ class acp_modules
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
}
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
+ AND module_id = $module_id";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if (!$row)
+ {
+ trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
+ }
+
$sql = 'UPDATE ' . MODULES_TABLE . '
SET module_enabled = ' . (($action == 'enable') ? 1 : 0) . "
- WHERE module_id = $module_id";
+ WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
+ AND module_id = $module_id";
$db->sql_query($sql);
- add_log('admin', 'LOG_MODULE_' . strtoupper($action));
+ add_log('admin', 'LOG_MODULE_' . strtoupper($action), $this->lang_name($row['module_langname']));
$this->remove_cache_file();
break;
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index aae147af4f..78a9983b0f 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3355,7 +3355,7 @@ function truncate_string($string, $max_length = 60, $allow_reply = true, $append
*/
function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false)
{
- global $phpbb_root_path, $phpEx, $user;
+ global $phpbb_root_path, $phpEx, $user, $auth;
$profile_url = '';
$username_colour = ($username_colour) ? '#' . $username_colour : '';
@@ -3372,8 +3372,17 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
// Only show the link if not anonymous
if ($user_id && $user_id != ANONYMOUS)
{
- $profile_url = ($custom_profile_url !== false) ? $custom_profile_url : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile');
- $profile_url .= '&u=' . (int) $user_id;
+ // Do not show the link if the user is already logged in but do not have u_viewprofile permissions (relevant for bots mostly).
+ // For all others the link leads to a login page or the profile.
+ if ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile'))
+ {
+ $profile_url = '';
+ }
+ else
+ {
+ $profile_url = ($custom_profile_url !== false) ? $custom_profile_url : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile');
+ $profile_url .= '&u=' . (int) $user_id;
+ }
}
else
{
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 51a45166ba..18853eb013 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -1490,18 +1490,18 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
{
if (sizeof($forum_ids) == 1)
{
- $sql = 'SELECT SUM(topic_replies + 1) AS forum_posts
+ $sql = 'SELECT SUM(t.topic_replies + 1) AS forum_posts
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
AND t.topic_approved = 1';
}
else
{
- $sql = 'SELECT p.forum_id, SUM(topic_replies + 1) AS forum_posts
+ $sql = 'SELECT t.forum_id, SUM(t.topic_replies + 1) AS forum_posts
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
AND t.topic_approved = 1
- GROUP BY p.forum_id';
+ GROUP BY t.forum_id';
}
$result = $db->sql_query($sql);
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index a7a9e48c8f..cec097cd8a 100755
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -18,7 +18,7 @@ class mcp_logs
var $u_action;
var $p_master;
- function mcp_main(&$p_master)
+ function mcp_logs(&$p_master)
{
$this->p_master = &$p_master;
}
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index ced9f83ce9..7d16664a77 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -598,7 +598,7 @@ function mcp_move_topic($topic_ids)
$db->sql_transaction('begin');
- $sql = 'SELECT SUM(topic_replies + 1) as topic_posts
+ $sql = 'SELECT SUM(t.topic_replies + 1) as topic_posts
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.topic_id', $topic_ids);
$result = $db->sql_query($sql);
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 2fc97d423a..03347101e0 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -18,7 +18,7 @@ class mcp_queue
var $p_master;
var $u_action;
- function mcp_main(&$p_master)
+ function mcp_queue(&$p_master)
{
$this->p_master = &$p_master;
}
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 06d5ffd03d..9080dcdc76 100755
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -18,7 +18,7 @@ class mcp_reports
var $p_master;
var $u_action;
- function mcp_main(&$p_master)
+ function mcp_reports(&$p_master)
{
$this->p_master = &$p_master;
}