summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-04-12 18:32:00 +0000
committerDries Buytaert <dries@buytaert.net>2005-04-12 18:32:00 +0000
commitbbb746b8148be858f52b236c9c2a4053350c7aad (patch)
tree400c12d0af590e53b90c0ac07318f75a057aa2a2
parentb43a782b619bf5f314ca7bc9af4d42d36cfa3228 (diff)
downloadbrdo-bbb746b8148be858f52b236c9c2a4053350c7aad.tar.gz
brdo-bbb746b8148be858f52b236c9c2a4053350c7aad.tar.bz2
- Patch by Gerhard: refinements and bugfixes for the 'access user profiles' patch.
-rw-r--r--modules/user.module8
-rw-r--r--modules/user/user.module8
2 files changed, 8 insertions, 8 deletions
diff --git a/modules/user.module b/modules/user.module
index bcfea31ed..eea831ee0 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -529,7 +529,7 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
return $block;
case 2:
- if (user_access('access content') && user_access('access user profiles')) {
+ if (user_access('access content')) {
$result = db_query_range('SELECT uid, name FROM {users} WHERE status != 0 ORDER BY uid DESC', 0, 5);
while ($account = db_fetch_object($result)) {
$items[] = format_name($account);
@@ -543,7 +543,7 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
return $block;
case 3:
- if (user_access('access content') && user_access('access user profiles')) {
+ if (user_access('access content')) {
// Count users with activity in the past defined period.
$time_period = variable_get('user_block_seconds_online', 2700);
@@ -637,7 +637,7 @@ function user_menu($may_cache) {
$items[] = array('path' => 'user', 'title' => t('user account'),
'callback' => 'user_page', 'access' => TRUE, 'type' => MENU_CALLBACK);
- //registration and login pages.
+ //registration and login pages.
$items[] = array('path' => 'user/login', 'title' => t('log in'),
'type' => MENU_DEFAULT_LOCAL_TASK);
$items[] = array('path' => 'user/register', 'title' => t('register'),
@@ -726,7 +726,7 @@ function user_menu($may_cache) {
'title' => $category['title'],
'type' => $category['name'] == 'account' ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
'weight' => $category['weight'],
- 'access' => $admin_access);
+ 'access' => ($admin_access || $user->uid == arg(1)));
}
}
}
diff --git a/modules/user/user.module b/modules/user/user.module
index bcfea31ed..eea831ee0 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -529,7 +529,7 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
return $block;
case 2:
- if (user_access('access content') && user_access('access user profiles')) {
+ if (user_access('access content')) {
$result = db_query_range('SELECT uid, name FROM {users} WHERE status != 0 ORDER BY uid DESC', 0, 5);
while ($account = db_fetch_object($result)) {
$items[] = format_name($account);
@@ -543,7 +543,7 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
return $block;
case 3:
- if (user_access('access content') && user_access('access user profiles')) {
+ if (user_access('access content')) {
// Count users with activity in the past defined period.
$time_period = variable_get('user_block_seconds_online', 2700);
@@ -637,7 +637,7 @@ function user_menu($may_cache) {
$items[] = array('path' => 'user', 'title' => t('user account'),
'callback' => 'user_page', 'access' => TRUE, 'type' => MENU_CALLBACK);
- //registration and login pages.
+ //registration and login pages.
$items[] = array('path' => 'user/login', 'title' => t('log in'),
'type' => MENU_DEFAULT_LOCAL_TASK);
$items[] = array('path' => 'user/register', 'title' => t('register'),
@@ -726,7 +726,7 @@ function user_menu($may_cache) {
'title' => $category['title'],
'type' => $category['name'] == 'account' ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
'weight' => $category['weight'],
- 'access' => $admin_access);
+ 'access' => ($admin_access || $user->uid == arg(1)));
}
}
}