By Nick Wilson on
HI all,
I'd like a particular content type (or all the content if really need be) to be restricted to just authenticated users. IE you have to sign up to be able to consume the content.
The big problem for me is the Access Denied! You are not authorized to view this page!" message that shows on nodes (like on index pages and when you try to view the node). It's horrible, and really pretty off putting.
Is there a way to configure Drupal so that instead of this harsh message, users could get a nice, polite message askign them to sign up in order to view content?
Any ideas most appreciated, thanks!
Comments
Hi Nick
just go to admin->site configuration->error reporting....
you can change the page that is displayed for 403(access denied) and 404(page not found) errors, so just create a seperate page saying "login or register to access this area" and specify the link to that page.
Best Regards,
Dasith.
http://www.mytechdaily.com
Not working as expected..
You'd certainly think that would work wouldn't you?
I have configured the site so only authenticated users can view content, and have set the default 403 to a custom page but these things still happen:
Any more thoughts Dasith?
thanks for the help
Module "Front Page" works for me
Note: the following approach is global to the site and as far as I know cannot be restricted to some content types.
Not sure this applies 100% to your case, but this works for me (all the steps done as admin user):
Themed
Should not be applicable, but I left the default "node"
Redirect
Set the page that should be visible to authenticated users, eg: "node"
Now, an anonymous user sees: "This site is accessible to authenticated users only. Please login first", and an authenticated user sees the standard node page.
Tested under Drupal 5.7
Forgot to mention: the solution I just suggested was tested under Drupal 5.7 (there is a Drupal 6 version of the module Front Page, but I didn't test it)
I didnt test that out but....
Hi I didnt checkout the frontpage module but i tested out whether the error reporting actually worked.... what I did was created a page and then set it as the default error page for both 403 and 404 errors..... then via site admin I denied permission for guests to access content.... have a look....
http://www.mytechdaily.com... it blocks everything...no sweat:)
btw im not sure about how this works in D6... this is for D5.7....
http://www.mytechdaily.com
Drupal 6
Yeh, I'm using D6 guys..
Front Page looks very cool. But if a user had a link to an internal page it wouldnt block them right? In D6, having the error page as /403 is not working at all..
Sheesh, I may have to downgrad to 5.7.......
thanks again
create a new seperate page
Nick you need to create a new page that will display the message via create content->page
then get the link which leads to that page..... then in the error reporting section link that page for cases of 403 errors
say you create a page which has a link say http://drupal.org/node/xxx.... you have to go to the error reporting section and add node/xxx in the box to completely specify the alternate page that should be displayed for 403 errors....
/403 doesnt work because you dont have such a page created....
http://www.mytechdaily.com
Ah but it does :) Because
Ah but it does :)
Because that's the url alias i gave it! hehe..