I'm not sure of the Drupal version as I don't yet have access to the site in question.

I'm not sure of the best way to implement what I want to do, so I will describe the problem I am trying to solve and maybe someone can send me in the right direction. I'm very new to Drupal. I am a quick learner but on an extremely tight deadline. The whole project needs to be completed by the end of April.

I have written a custom application for my client in PHP. Now, he would like to allow one of his subscribers to link to his restricted area from within their membership area so that the subscriber's members may access my client's restricted area without having to to have their own account and without having to know the subscriber's login credentials.

I was planning to write a simple script that would use cURL to post the login credentials to my client's site and retrieve a temporary key. This key could then be used in the query string with a location redirect to transfer the user to the client's site. This key would identify them as a valid user.

The problem comes because I need to ensure that only users that are logged into the subscriber's site are able to access this simple script. I've learned that the subscriber's site is managed with Drupal. The developers of the subscriber's site are capable of installing Drupal, but not writing new code.

I'm not sure whether I should write a Drupal module or whether I should write a separate script that interacts with Drupal in some way. I've read through "Integrating third party applications" at http://drupal.org/node/32178 and I've read through some information about creating a module.

I'm sure I could figure it out if I had the time to peruse through all the documentation, but I'm overwhelmed and feeling the time crunch.

I imagine it would be useful to also have some kind of admin function to edit the login credentials and login url, but for now I imagine hard coding those.

Is a module the best way to go? How can I ensure the module is only accessed by users that are logged in?