/[drupal]/contributions/modules/webserver_auth/webserver_auth.module
ViewVC logotype

Diff of /contributions/modules/webserver_auth/webserver_auth.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.16, Sat Mar 25 06:01:54 2006 UTC revision 1.17, Tue Apr 24 01:09:26 2007 UTC
# Line 1  Line 1 
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;
# Line 45  function webserver_auth_init() { Line 45  function webserver_auth_init() {
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", "")) {

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.2