I would suggest that Rimians register the URLs inside Drupal itself (+1), but as an alternative, you can load Drupal βmanuallyβ and check user rights after that directly from other scripts:
// initialize Drupal // TODO: adjust path according to placement of script (might need to change to Drupal directory first) require './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); // check user access rights // TODO: Adjust to the permission you want to restrict to, eg 'access content' or whatever if (!user_access('administer nodes')) { // Insufficient rights, say so drupal_access_denied(); exit(0); } // ... call legacy script
NOTE. Drupal does a little work at boot time, including some manipulations and setting global variables, so be sure to carefully check for interference / collisions with outdated code (will also apply for Rimians).
If you want to restrict access only to authenticated users, you can replace the user_access() user_is_logged_in() . If you want to check the role, you can add global $user; and check the contents of the $user->roles array
source share