Created
April 13, 2011 13:59
-
-
Save boombatower/917592 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 1b8d30c54ee3cbdf073accad5841ce988a6cc4bf Mon Sep 17 00:00:00 2001 | |
From: Jimmy Berry <[email protected]> | |
Date: Tue, 22 Mar 2011 16:15:33 -0500 | |
Subject: Change theme_username() to always create a link for current user. | |
--- | |
includes/theme.inc | 3 ++- | |
1 files changed, 2 insertions(+), 1 deletions(-) | |
diff --git includes/theme.inc includes/theme.inc | |
index 806e5ee..0d0096c 100644 | |
--- includes/theme.inc | |
+++ includes/theme.inc | |
@@ -2539,6 +2539,7 @@ function template_preprocess_region(&$variables) { | |
* @see template_process_username() | |
*/ | |
function template_preprocess_username(&$variables) { | |
+ global $user; | |
$account = $variables['account']; | |
$variables['extra'] = ''; | |
@@ -2563,7 +2564,7 @@ function template_preprocess_username(&$variables) { | |
} | |
$variables['name'] = check_plain($name); | |
- $variables['profile_access'] = user_access('access user profiles'); | |
+ $variables['profile_access'] = $user->uid == $account->uid || user_access('access user profiles'); | |
$variables['link_attributes'] = array(); | |
// Populate link path and attributes if appropriate. | |
if ($variables['uid'] && $variables['profile_access']) { | |
-- | |
1.7.4.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment