Changeset 6074


Ignore:
Timestamp:
05/05/10 00:21:11 (9 years ago)
Author:
plg
Message:

bug 1501 fixed: with apache_authentication, fall back to REDIRECT_REMOTE_USER
if REMOTE_USER is not set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/user.inc.php

    r5196 r6074  
    5151 
    5252// using Apache authentication override the above user search 
    53 if ($conf['apache_authentication'] and isset($_SERVER['REMOTE_USER'])) 
     53if ($conf['apache_authentication']) 
    5454{ 
    55   if (!($user['id'] = get_userid($_SERVER['REMOTE_USER']))) 
     55  $remote_user = null; 
     56  foreach (array('REMOTE_USER', 'REDIRECT_REMOTE_USER') as $server_key) 
    5657  { 
    57     register_user($_SERVER['REMOTE_USER'], '', '', false); 
    58     $user['id'] = get_userid($_SERVER['REMOTE_USER']); 
     58    if (isset($_SERVER[$server_key])) 
     59    { 
     60      $remote_user = $_SERVER[$server_key]; 
     61      echo $server_key; 
     62      break; 
     63    } 
     64  } 
     65 
     66  if (isset($remote_user)) 
     67  { 
     68    if (!($user['id'] = get_userid($remote_user))) 
     69    { 
     70      register_user($remote_user, '', '', false); 
     71      $user['id'] = get_userid($remote_user); 
     72    } 
    5973  } 
    6074} 
Note: See TracChangeset for help on using the changeset viewer.