Home

developers.mit.edu

Sort of helping developers at MIT since 2009

Secondary links

  • Forums
  • Recent Posts
Home Forums Authentication, Authorization, and Identity Services
    • FAQ
    • Contact
    • Community

Display Touchstone on access denied Drupal 5.x pages

Submitted by moses_b@mit.edu on Wed, 01/21/2009 - 13:34
  • Authentication, Authorization, and Identity Services
  • MIT Touchstone

I came up with a method of displaying a link to Touchstone on access denied pages in Drupal 5.x. This would probably work for Drupal 6.x as well. Here is how I set it up:

1.) Create a new page node. Title it "Access Denied" and use this content:

<?php
global $user;
if ($user->uid) { // this user is already logged in print "Access Denied: You do not have access to this page."; } else { print "Access Denied: You do not have access to this page."; $dest = 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo 'You may need to login'; } ?>

Make a note of the node ID.
2.) Under admin => site configuration => error reporting enter 'node/[node id from new page]' under Default 403.

That's it. I think this could probably be improved on, but it's a start. I also think the user could be redirected automatically, but I decided to just create a link.

‹ How do you access moira to use it for application group management and permissions? MIT Touchstone hands-on lab: Tue Jan 20, 01:30-04:00pm, W92-206, seating limited to 18 ›
  • Login to post comments

Login

Log in via Touchstone

Forums

  • All Forums
  • General Questions
  • Drupal Users
  • FileMaker Developers
  • Identity Management
  • Java Developers
  • Linux Users
  • Opportunities
  • PHP Developers
  • Python Users
  • UX Developers
  • Web Masters
  • Suggestions

Tags

accessibility ajax branch Javascript jQuery MIT Touchstone openssl question from an openssl noob release management Shibboleth silverstripe source control speed
more tags
RoopleTheme