Great module, but I have a question. How to overwrite the default message shown to roles with no access/permission?

I would like to override the message:

Access denied
You are not authorized to access this page.

I'd like to add a Login/Register link there as it makes sense under some circumstances.

Comments

ptamas’s picture

open private.module in a text editor and search for the text....

it is in a section that looks like this

***snip
function private_form_alter($form_id, &$form) {
if ($form['#id'] == 'node-form') {
if (user_access('mark content as private')) {
$form['private'] = array(
'#type' => 'checkbox',
'#title' => t('Assignment'),
'#return_value' => 1,
'#description' => t('Check here if this post should only be read by Peter.'),
***snip

I've changed the checkbox text from Private -> Assignment
and changed the description text
so long as you stay inside the single 'quotation' marks everything is good.

-peter

BioALIEN’s picture

Thanks ptamas. I think your code reveals how to change what users see when editing nodes with the Private.module enabled.

My original question is related to the error message displayed to nodes that are set to "Private". So if a guest views a node you've set as Private they see the error message displayed in my original post. This is the message I wanted to override.

I don't think your code is answering the same question. Correct me if I'm wrong?

ptamas’s picture

you are right...I should read a bit better before pretending that I Have The Answer...
digging.
-p

adamps’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Tidying up ancient D5 support request.