I have a situation where my anonymous users can have a different role than the standard anonymous user role (role id 1). In this case the front page by role doesn't work because its hard coded to use the settings for role id 1.

I'm using the Mobile Tools module and that module allows me to create a new role called "anonymous user (Mobile)". When a user visits the site using a mobile device they get this new role, which in my case has a role id of 5. Anonymous mobile users need to have a different front page than standard anonymous users.

CommentFileSizeAuthor
#1 front_page_916372.patch1.42 KBbschilt
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bschilt’s picture

FileSize
1.42 KB

attached is a simple patch that uses the rid of the anonymous role instead of always using the role id 1.

bschilt’s picture

Status: Active » Needs review
pirmin’s picture

The patch solved my issue where anonymous uid==2 although I copied/pasted the lines from the patch.

Before the patch, anonymous users would get a completely blank page.

Anonymous uid == 2 because the mysql backend is a replicating multi-multi db.

front_page.info

; $Id: front_page.info,v 1.13 2008/03/26 05:20:48 augustin Exp $
name = Front Page
description = Allows site admins setup custom front pages for the site.
package = Administration

; Information added by drupal.org packaging script on 2007-01-20
project = "front"

core = 6.x

; Information added by drupal.org packaging script on 2008-04-29
version = "6.x-1.2"
core = "6.x"
project = "front"
datestamp = "1209458407"

pgrond’s picture

Just applied the patch and it works. Had the same issue with mobile tools.

Simon Georges’s picture

Status: Needs review » Closed (won't fix)

Several roles are supported in the 6.x-2.x, please use this version if you want them.