| 1 |
<?php |
<?php |
| 2 |
// $Id: webserver_auth.module,v 1.15 2006/03/25 05:53:56 weitzman Exp $ |
// $Id: webserver_auth.module,v 1.16 2006/03/25 06:01:54 weitzman Exp $ |
| 3 |
|
|
| 4 |
function webserver_auth_init() { |
function webserver_auth_init() { |
| 5 |
global $user, $account; |
global $user, $account; |
| 45 |
function webserver_auth_webserver_auth() { |
function webserver_auth_webserver_auth() { |
| 46 |
global $account; |
global $account; |
| 47 |
|
|
| 48 |
|
$account->name = trim($account->name); |
| 49 |
// pretties up the username for NTLM authentication (i.e. Windows) |
// pretties up the username for NTLM authentication (i.e. Windows) |
| 50 |
if ($_SERVER["AUTH_TYPE"] == "NTLM" || $_SERVER["AUTH_TYPE"] == 'Negotiate') { |
if ($_SERVER["AUTH_TYPE"] == "NTLM" || $_SERVER["AUTH_TYPE"] == 'Negotiate') { |
| 51 |
$account->name = substr(trim($account->name), strrpos(trim($account->name), "\\")+1); |
if (!(strpos($account->name, "\\") === false)) { |
| 52 |
|
$account->name = substr($account->name, strrpos($account->name, "\\")+1); |
| 53 |
|
} |
| 54 |
|
if (!(strpos($account->name, "@") === false)) { |
| 55 |
|
$account->name = substr($account->name, 0, strrpos($account->name, "@")); |
| 56 |
|
} |
| 57 |
} |
} |
| 58 |
|
|
| 59 |
if ($domain = variable_get("webserver_auth_domain", "")) { |
if ($domain = variable_get("webserver_auth_domain", "")) { |