I want to change the wording on the home page before someone logs in At present it says

Access denied, You are not authorized to access this page.

The resaon for this is that I have set users who are not logged in no access to nodes
(Role for anonymous user, access content turned off).

I have found 3 potential solutions as follows, none of which are good enough I think.

1. Edit the messages in common.inc. bad idea to amend source code like this. It would work though.

2. Set up a new language and change the appropriate message. Would work but a lot of work and would make maintenance, upgrades and issue I think.

3. Set URLs for 403 and 404 errors, in Admnister -> Site Configuration -> Error Reporting

The problem is that the pages mentioned would not be accessible either (as they are just content and we don't want un-logged in users to access any content).

Any ideas? My best shot would be 3, by allowing individual pages to be accessed by anonymous users, while keeping other content private, but is this possible. If not, can anyone suggest something else?

Thanks,
Greg

Comments

marcusthijm’s picture

Are you using CCK for creating content types?

If you do you won't have to restrict access to all content, but only the content types you really want restricted. This makes it possible to set up a page (or more pages) with general information of your website and maybe explain something about the reasoning for securing/hiding content.

As I'm thinking of it, you don't even have to have CCK installed. You can create content types from within Drupal core and restrict access to certain content types.

gregambrose’s picture

Thanks for the reply.

I dont use CCK, but you suggested I might be able to set up a content type. I just tried that but I can't see how I can give anonymous users access to some content types (like my new one) and no access to others (the main site content I wish to keep anonymous users away from). Any ideas?

marcusthijm’s picture

Maybe a better approach would be to use private.module.

With this module you can keep certain nodes private. You're also able to make nodes private by default.

mtsanford’s picture

gregambrose’s picture

Thanks for that. It sounds like a good idea but it hasn't worked. The README details seem to relate to pre versions 6, and when I install it it messes up my whole site.

When I login (as any user) I get Page Not Found

I'll restore and trythe CCK approach suggested earlier. What a pain!

marcusthijm’s picture

You don't need CCK to create different content types. That's also possible in core.