What file do I get into to change 'You are not authorized to access this page.'?? I wanted it to say something like "You must be logged in to view this page."

Thanks!

Comments

oscargh’s picture

You can create a page named Not Authorized and put that node in Admin>settings in the field Predifined 403 (Not Authorized) page.

krwester’s picture

I have a site that I want to be accessible to only family and friends. I followed the instructions listed above, but I still get the default "you are not authorized to access this page"

Now, I am guessing that is because I haven't given anonymous users access to content. But I don't want them to access content, just this page. Is there any way to do this?

Thanks, as always.

simon rawson’s picture

If you really want to do something about it then you will need to hack the core. The function you need is drupal_access_denied and it is in common.inc.

See docs: http://drupaldocs.org/api/head/function/drupal_access_denied

jgreep’s picture

Dublin Drupaller’s picture

Hi Krwester,

A lightly different, but, IMO better way of changing that text is to follow these steps:

  1. enable the locale.module under ADMINISTER -> MODULES
  2. click on ADMINISTER -> LOCALISATION
  3. Click on ADD LANGUAGE
  4. give your new language a name, such as Custom English and click on SAVE CONFIGURATION
  5. Disable the default Drupal language, enable your CUSTOM ENGLISH and make it the site default
  6. Click on Manage Strings.
  7. Search for "authorized"
  8. Edit that string to your hearts content

What's going on?
the above is a simple way of customising the language used on the site without hacking any modules. you are essentially making a copy of the default Drupal English language, renaming it to call your own and making that the default language on the site.

highly recommended and you will thank me when you have to upgrade your site and you can't remember which modules you had hacked to make something appear the way it does.

Of course, you can search for mostly any string, in any module and customise the english used to suit your needs.

(just tried the above with Drupal 4.6 and it works but it wouldn't for Drupal 4.7.beta - there must be one or two bugs in the 4.7beta that needs sorting.)

hope that helps.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

simon rawson’s picture

I think you're way is better too... I decided against posting it for fear of complicating things. But it is better.

sepeck’s picture

Rather than post, you can link to the handbook
http://drupal.org/node/24593

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide