Would anyone be interested in upgrading the webserver_auth module to Drupal 5.x. I've had a crack at it but it's beyond me. I e-mailed the author but he's a little busy at the moment. So if anyone has the time and ability I'd much appreciate it.

Comments

telex4’s picture

Nobody responded to this, and there's nothing in the issue queue suggesting someone is working on it.

Is this something anyone is interested in? I'd love to get this functionality into Drupal 5.x for an intranet I'm working on for my employer.

tulio’s picture

Adding some more voice to the claim, yeah, it would be great to upgrade this module.
For now, only workarounds...

mau’s picture

You have my vote.

theiviaxx’s picture

I started from // $Id: webserver_auth.module,v 1.13.2.3 2006/03/03 05:08:12 weitzman Exp $ and trimmed some stuff out. It works for us by forcing the login if there is an account for that person. I removed the register feature because we don't use it, but this might get you started on re-implementing that feature. I apologize if its sloppy or not the "right" way to do things.

function webserver_auth_init() {
  global $user, $account;

  if ($user->uid) {
    //do nothing because user is already logged into Drupal
  }
  else {
    if ($name = $_SERVER["REMOTE_USER"]) {
      // user is logged into webserver.
      $account->name = $name;
      //modules get to change the user bits before saving. use a global $account to do so.
      // only loaded modules will see this hook
      module_invoke_all("webserver_auth");
      // if we are in bootstrap, load user.module ourselves
      if (!module_exists('user')) {
       drupal_load('module', 'user');
      }

      // try to log into Drupal. if unsuccessful, use anonymous
      if ($user = user_load($array = $account)) {
      	watchdog("user", "Session opened for $user->name.", WATCHDOG_NOTICE);
      }
      else {
      	$user = drupal_anonymous_user();
      	watchdog("user", "Session opened for Anonymous.", WATCHDOG_NOTICE);
      }
    }
    else {
      // do nothing. user isn't logged into web server
    }
  }
}
gnomeskull’s picture

Anyone willing to update for 5.x or give instructions on how to install this to 5.x and modify it to work? Thank you for your work in advance.

trudolph’s picture

I also would like to see an updated version of this module for Drupal 5.x.

schuyler1d’s picture

http://code.google.com/p/drupal-remoteuser/
if you're still waiting. There are also pending patches, which you can apply on the webserver_auth module