summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--buddylist.module9
1 files changed, 4 insertions, 5 deletions
diff --git a/buddylist.module b/buddylist.module
index 27f72bf..a897d7b 100644
--- a/buddylist.module
+++ b/buddylist.module
@@ -99,7 +99,7 @@ function buddylist_menu($may_cache) {
'title' => t('My @buddylist', buddylist_translation()),
'access' => (user_access('maintain buddy list') && $id),
'callback' => 'buddylist_buddylisting_page',
- 'callback arguments' => array($user->uid,'buddies'),
+ 'callback arguments' => array($user->uid, 'buddies'),
);
}
else {
@@ -128,7 +128,7 @@ function buddylist_menu($may_cache) {
);
// 'view only' tabs
- $viewAccess = (($id == $user->uid) || user_access('view buddy lists'));
+ $viewAccess = (($id == $user->uid && user_access('maintain buddy list')) || user_access('view buddy lists'));
$items[] = array(
'path' => 'buddylist/'. $id .'/buddies',
'title' => t('@Buddies', buddylist_translation()),
@@ -454,7 +454,7 @@ function buddylist_user($type, &$edit, &$thisuser, $category = NULL) {
else if ($type == 'load') {
$thisuser->buddies = buddylist_get_buddies($thisuser->uid);
}
- else if ($type == 'form' && $category == 'account' && variable_get('buddylist_user_mail', FALSE)) {
+ else if ($type == 'form' && $category == 'account' && variable_get('buddylist_user_mail', FALSE) && user_access('maintain buddy list', $thisuser)) {
// when user tries to edit his own data
$form['buddylist_settings'] = array(
'#type' => 'fieldset',
@@ -549,7 +549,7 @@ function buddylist_block($op = 'list', $delta = 0) {
}
return $block;
}
- else if ($op == 'view' && user_access('access content') && $user->uid > 0) {
+ else if ($op == 'view' && user_access('access content') && user_access('maintain buddy list') && $user->uid > 0) {
switch ($delta) {
case 0 : // Shows buddylist block
if ($buddies = buddylist_get_buddies()) {
@@ -562,7 +562,6 @@ function buddylist_block($op = 'list', $delta = 0) {
}
}
-
$block['content'] = theme('user_list', $users);
$block['subject'] = variable_get('buddylist_list_block_title', t('My @buddy list', buddylist_translation()));