aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorRuslan Uzdenov <rxu@mail.ru>2009-06-18 11:43:16 +0000
committerRuslan Uzdenov <rxu@mail.ru>2009-06-18 11:43:16 +0000
commita4e817e32286125ccc3d85a11b0c8e990ab8697a (patch)
tree90c2b200a9a6d7a19dd10812ac47891156c7747c /phpBB
parent7bee180a785a698818a3078f1791e3409bbed8d8 (diff)
downloadforums-a4e817e32286125ccc3d85a11b0c8e990ab8697a.tar
forums-a4e817e32286125ccc3d85a11b0c8e990ab8697a.tar.gz
forums-a4e817e32286125ccc3d85a11b0c8e990ab8697a.tar.bz2
forums-a4e817e32286125ccc3d85a11b0c8e990ab8697a.tar.xz
forums-a4e817e32286125ccc3d85a11b0c8e990ab8697a.zip
Fix bug #10519 - "View user notes" and "Warn user" links shown even if modules disabled
Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9617 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/docs/CHANGELOG.html1
-rw-r--r--phpBB/memberlist.php26
-rw-r--r--phpBB/styles/prosilver/template/memberlist_view.html2
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_view.html2
4 files changed, 18 insertions, 13 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index e42d5b6d0c..afa25c6548 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -116,6 +116,7 @@
<li>[Fix] Do not display birthdays of banned users (Bug #20625 - Patch by nickvergessen)</li>
<li>[Fix] Fix function to recalculate Nested Sets (Bug #41555 - Patch by EXreaction)</li>
<li>[Fix] Display and highlight already used rank images while assigning new rank (Bug #22665 - Patch by nickvergessen)</li>
+ <li>[Fix] Do not display &quot;View user notes&quot; and &quot;Warn user&quot; links in user profile if corresponding MCP modules are disabled. (Bug #10519 - Patch by rxu)</li>
<li>[Fix] Empty error message in UCP folder management when creating folder without name (Bug #39875 - Patch by nickvergessen)</li>
<li>[Fix] Wrong description in UCP group managment implicates missing feature (Bug #19945 - Patch by nickvergessen)</li>
<li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li>
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 298164be9e..d8e6d99471 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -512,20 +512,22 @@ switch ($mode)
$profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields[$user_id]) : array();
}
- // We need to check if the module 'zebra' is accessible
- $zebra_enabled = false;
+ // We need to check if the modules 'zebra', 'notes' ('user_notes' mode) and 'warn' ('warn_user' mode) are accessible to decide if we can display appropriate links
+ $zebra_enabled = $user_notes_enabled = $warn_user_enabled = false;
- if ($user->data['user_id'] != $user_id && $user->data['is_registered'])
+ if (!class_exists('p_master'))
{
- include_once($phpbb_root_path . 'includes/functions_module.' . $phpEx);
- $module = new p_master();
- $module->list_modules('ucp');
- $module->set_active('zebra');
-
- $zebra_enabled = ($module->active_module === false) ? false : true;
-
- unset($module);
+ include($phpbb_root_path . 'includes/functions_module.' . $phpEx);
}
+ $module = new p_master();
+
+ $module->list_modules('ucp');
+ $module->list_modules('mcp');
+ $user_notes_enabled = ($module->loaded('notes', 'user_notes')) ? true : false;
+ $warn_user_enabled = ($module->loaded('warn', 'warn_user')) ? true : false;
+ $zebra_enabled = ($module->loaded('zebra')) ? true : false;
+
+ unset($module);
// If the user has m_approve permission or a_user permission, then list then display unapproved posts
if ($auth->acl_getf_global('m_approve') || $auth->acl_get('a_user'))
@@ -575,6 +577,8 @@ switch ($mode)
'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_id}") : '',
+ 'S_USER_NOTES' => ($user_notes_enabled) ? true : false,
+ 'S_WARN_USER' => ($warn_user_enabled) ? true : false,
'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false,
'U_ADD_FRIEND' => (!$friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
'U_ADD_FOE' => (!$foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;mode=foes&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html
index 8f2e1734a4..8352583d2a 100644
--- a/phpBB/styles/prosilver/template/memberlist_view.html
+++ b/phpBB/styles/prosilver/template/memberlist_view.html
@@ -80,7 +80,7 @@
<dt>{L_VISITED}:</dt> <dd>{VISITED}</dd>
<!-- IF U_NOTES or U_WARN -->
<dt>{L_WARNINGS}: </dt>
- <dd><strong>{WARNINGS}</strong> [ <a href="{U_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_WARN --> | <a href="{U_WARN}">{L_WARN_USER}</a> <!-- ENDIF -->]</dd>
+ <dd><strong>{WARNINGS}</strong><!-- IF S_USER_NOTES or S_WARN_USER --> [ <!-- IF S_USER_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN and S_WARN_USER --><!-- IF S_USER_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]<!-- ENDIF --><!-- ENDIF --></dd>
<!-- ENDIF -->
<dt>{L_TOTAL_POSTS}:</dt>
<dd>{POSTS} | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></strong>
diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html
index 15d43e60c1..8cfe4d9276 100644
--- a/phpBB/styles/subsilver2/template/memberlist_view.html
+++ b/phpBB/styles/subsilver2/template/memberlist_view.html
@@ -69,7 +69,7 @@
<!-- IF U_NOTES or U_WARN -->
<tr>
<td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}: </td>
- <td width="100%"><b class="gen">{WARNINGS}</b><br /><span class="genmed">[ <a href="{U_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_WARN --> | <a href="{U_WARN}">{L_WARN_USER}</a> <!-- ENDIF -->]</span></td>
+ <td width="100%"><b class="gen">{WARNINGS}</b><br /><span class="genmed"><!-- IF S_USER_NOTES or S_WARN_USER --> [ <!-- IF S_USER_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN and S_WARN_USER --><!-- IF S_USER_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]<!-- ENDIF --></span></td>
</tr>
<!-- ENDIF -->
<tr>