Posted by mmoreira on July 3, 2008 at 8:12am
3 followers
Jump to:
| Project: | Activity Stream |
| Version: | 5.x-1.0 |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | akalsey |
| Status: | closed (fixed) |
Issue Summary
Hello,
There's a strange procedure with the username. When anonymous visitors don't have access to profiles, Drupal don't link to profiles. But this module links the username to the profile page of that user, returning a DON'T HAVE ACCESS default Drupal page.
The default is, when a role doesn't have permission to see the profile page of others users, don't link the usernames.
Thanks...
Comments
#1
You should give some access to your anonymous guest.
Go to Administer >> User management >> user module >> access user profiles and check the anonymous user box!
#2
Yeah, but I don't want the anonymous users have access to profiles.
So, Activity Stream is linking to profiles even when I configure to don't give access to anonymous.
NOTE: The Activity Stream is on a block on front page of the site, to all users (anonymous and registered) see that block of information. So, I think the module is linking the usernames overriding the user access configuration.
#3
I see... you can try to replace the function "theme_activitystream_username" located into activitystream.module with this:
function theme_activitystream_username($user) {if ($user->uid) {
$arrNames = split(' ',$user->name);
return l($arrNames[0],'user/' . $user->uid);
} else {
$arrNames = split(' ',$user->name);
return t("$arrNames[0]");
}
}
Make a backup and try this code!
#4
I've fixed this in development. In the meantime, you can theme the username function yourself. In template.php in your theme, add the following function....
<?phpfunction yourthemename_activitystream_username($user) {
$arrNames = split(' ',$user->name);
if (user_access('access user profiles')) {
return l($arrNames[0],'user/' . $user->uid);
} else {
return $arrNames[0];
}
}
?>
Replace yourthemename with the name of your theme.
#5
This is now fixed in the default theme in both 5.x and 6.x