Just ran an instal of this and noticed

DRScales - October 28, 2008 - 13:34
Project:Webserver authentication
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

user_external_load fails for most existing users due to http://drupal.org/node/13619. Can we patch:

      // try to log into Drupal. if unsuccessful, register the user
  $test_user = user_external_load($account->name);

  // ADD Search user_load instead of user_external_load
  if(!test_user) {
      $test_user = user_load(array("name" => $account->name));
  }
  //ADD ends
      if (!$test_user->uid) {

Would also be good to select the user variable in the UI as I am using squid to present the user on on a unix box from an NT network. (php_auth_user) - think this would be a good addition for intranets as most companies can't get support for mod_ntlm from their vendour

#1

DRScales - October 28, 2008 - 14:19

sorry - that had no $

$test_user = user_external_load($account->name);

  // added
  if(!$test_user->uid) {
      $test_user = user_load(array("name" => $account->name));
  }

#2

DRScales - October 28, 2008 - 14:49

and as for the UI - something akin to

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

  $remote_user = "";
 
   // CookedBreakfast server variable changed to our squid variable 'php_auth_user' this can be changed in the UI
   $uservar = variable_get("webserver_auth_uservar", "");

  if (isset($_SERVER["$uservar"])) {
     $remote_user = $_SERVER["$uservar"];
// ends
  }

with the form addition

function webserver_auth_settings() {
  $form["webserver_auth_domain"] = array(
    '#type' => 'textfield',
    '#title' => t("Email Domain"),
    '#default_value' => variable_get("webserver_auth_domain", ""),
    '#size' => 30,
    '#maxlength' => 55,
    '#description' => t("Append this domain name to each new user in order generate his email address. Currently only used for NTLM authentication."),
    );
$form["webserver_auth_uservar"] = array(
    '#type' => 'textfield',
    '#title' => t("User Variable"),
    '#default_value' => variable_get("webserver_auth_uservar", ""),
    '#size' => 30,
    '#maxlength' => 55,
    '#description' => t("The name of your environment user variable"),
    );
  return system_settings_form($form);
}

 
 

Drupal is a registered trademark of Dries Buytaert.